From owner-svn-src-all@FreeBSD.ORG Mon Aug 3 07:23:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEF8D106566B; Mon, 3 Aug 2009 07:23:15 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.freebsd.org (Postfix) with ESMTP id 8AAF38FC0A; Mon, 3 Aug 2009 07:23:14 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=Ng6CjssoZK4A:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=6I5d2MoRAAAA:8 a=tvxVFqbIViT3gDeE9WcA:9 a=2d7sk_lQ3xpT-xgUtR8A:7 a=cetWsfPpLUD0WGh-NiOkqoOadlQA:4 a=Rk7U24iObsvedVEAsQEA:9 a=gnrMiKeQK1jmmxtyE0cA:7 a=AN3LayuI9UxRzUdBw6P6GySq-W0A:4 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 234667817; Mon, 03 Aug 2009 09:23:13 +0200 To: "Robert N. M. Watson" Content-Disposition: inline From: Hans Petter Selasky Date: Mon, 3 Aug 2009 09:23:10 +0200 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_gBpdKXvHCK5Yo+y" Message-Id: <200908030923.12867.hselasky@c2i.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, Navdeep Parhar Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input (regression patch) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2009 07:23:16 -0000 --Boundary-00=_gBpdKXvHCK5Yo+y Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Here is a patch to address the problem. Please test and report back. Works fine over here. http://perforce.freebsd.org/chv.cgi?CH=166957 MD5 (ukbd.c.diff) = 1e3c143942593b0ed4617d306a9d2ee2 cd /usr/src/sys/dev/usb/input/ cat ukbd.c.diff | patch --HPS --Boundary-00=_gBpdKXvHCK5Yo+y Content-Type: text/x-patch; charset="iso-8859-1"; name="ukbd.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ukbd.c.diff" --- ukbd.c 2009-08-02 16:28:40.000000000 +0200 +++ ukbd.c 2009-08-03 09:12:42.000000000 +0200 @@ -170,6 +170,7 @@ int32_t sc_state; /* shift/lock key state */ int32_t sc_accents; /* accent key index (> 0) */ + uint16_t sc_microtime; /* used when polling */ uint16_t sc_inputs; uint16_t sc_inputhead; uint16_t sc_inputtail; @@ -302,18 +303,32 @@ static void ukbd_do_poll(struct ukbd_softc *sc, uint8_t wait) { + struct timeval tv; + uint16_t temp; + DPRINTFN(2, "polling\n"); while (sc->sc_inputs == 0) { usbd_transfer_poll(sc->sc_xfer, UKBD_N_TRANSFER); - DELAY(1000); /* delay 1 ms */ + microtime(&tv); - sc->sc_time_ms++; + temp = tv.tv_usec / 25000; /* support repetition of keys: */ + if (sc->sc_microtime != temp) { + + /* wait for next delta */ + + sc->sc_microtime = temp; + + /* 25 milliseconds have passed */ + + sc->sc_time_ms += 25; + } + ukbd_interrupt(sc); if (!wait) --Boundary-00=_gBpdKXvHCK5Yo+y--