From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 12 May 2015 21:30:38 +0200 Subject: [U-Boot] [PATCH] usb: kbd: Fix key repeat not always using In-Reply-To: <1431449903-22483-1-git-send-email-hdegoede@redhat.com> References: <1431449903-22483-1-git-send-email-hdegoede@redhat.com> Message-ID: <201505122130.38205.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday, May 12, 2015 at 06:58:23 PM, Hans de Goede wrote: > The usb-kbd key repeat code assumes that reports get repeated every 40 ms, > this is never true when using CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP, and > does not always works for CONFIG_SYS_USB_EVENT_POLL and > CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE since not all usb keyboards honor > the usb_set_idle() command. > > For CONFIG_SYS_USB_EVENT_POLL we must use usb_set_idle() since we do a > blocking wait for the hid report, so if we do not tell the keyboard to send > a hid report every 40ms even if nothing changes then we will block u-boot > for 1s (the default u-boot usb interrupt packet timeout). Note that in this > case on keyboards which do not support usb_set_idle() we loose and we > actually get 1s latencies on other u-boot activities. > > For the other poll-methods this commit stops using usb_set_idle() and > instead repeats the last received hid-report every 40 ms as long as no new > hid-report is received. This fixes key-repeat not working at all with > CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP and fixes it not working with > keyboards which do not implement usb_set_idle() when using > CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE. > > Signed-off-by: Hans de Goede Looks reasonable, I don't really care about the ifdef indent, but the data type for get_timer() should be fixed. Otherwise, Reviewed-by: Marek Vasut Would this finally be a patch to pick through the USB tree ? :b Best regards, Marek Vasut