[PATCH v3] console: usb: kbd: Limit poll frequency to improve performance

Filip Žaludek filip.zaludek at oracle.com
Tue Jan 3 18:36:59 CET 2023



Hi Simon,
  hmm this is strange. I am hitting this usually before 10 repetitions,
for sure within 30 repetitions. 'gpu_freq' is missing, thus default.
I can see this also from stock JeOS/RPi3 from OpenSUSE.
Do you have enabled debug as it works as workaround? [usb_hub.c]


  Dissected more, thoughts into record:
** not reproduced on underclocked RPi4
** not reproduced with hardcoded poll_delay=0 [common/usb_kbd.c]
** reproduced with hardcoded poll_delay=1 [common/usb_kbd.c]
** not reproduced when '#define LOG_DEBUG' enabled in common/usb_hub.c
** workaround is to output character in non 'UCLASS_USB_HUB' branch,
  even mdelay(500) instead of printing character would not help.


  Seems to be synchronization problem, please advise if you have any
ideas/suggestions how to troubleshoot.



%< -------------------------------------------------------------
diff --git a/common/usb_hub.c b/common/usb_hub.c
index 95f1449..817e15e 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -73,8 +73,10 @@ static inline bool usb_hub_is_superspeed(struct usb_device *hdev)
  #if CONFIG_IS_ENABLED(DM_USB)
  bool usb_hub_is_root_hub(struct udevice *hub)
  {
-       if (device_get_uclass_id(hub->parent) != UCLASS_USB_HUB)
+       if (device_get_uclass_id(hub->parent) != UCLASS_USB_HUB) {
+               puts(".");
                 return true;
+       }

         return false;
  }

%< -------------------------------------------------------------





Happy new year!
Regards,
Filip





On 1/3/23 18:02, Simon Glass wrote:
> Hi Filip,
> 
> On Mon, 19 Dec 2022 at 14:25, Filip Žaludek <filip.zaludek at oracle.com> wrote:
>>
>>
>>
>> Hi Simon,
>>
>>
>> On 12/19/22 20:20, Simon Glass wrote:
>>> Hi Filip,
>>>
>>> On Mon, 19 Dec 2022 at 02:29, Filip Žaludek <filip.zaludek at oracle.com> wrote:
>>>>
>>>>
>>>>
>>>> Hi Simon,
>>>>
>>>>     is your testing framework connected to HDMI? Only notable discrepancy
>>>> from generic config is enabled 'efidebug' command.
>>>>
>>>>
>>>> Tested more (cycled 'U-Boot>' and 'reset'), both RPi3B and RPi3B+..
>>>> USB Keyboard failure rates:
>>>> connected console            02/10
>>>> connected hdmi               06/10
>>>> connected console + hdmi     07/10
>>>> ** USB Keyboard always detected by 'usb info', just does not respond.
>>>>
>>>> USB Keyboard failure rates, reverted 96991e652f541323a03c5b7e075d54a117091618:
>>>> connected console + hdmi     00/10
>>>
>>> Yes this one does have HDMI. Are you wanting me to run multiple runs?
>>> With or without the display?
>>
>>
>>    Yes please! With HDMI as there is better chance you will hit issue I am experiencing,
>> to confirm 96991e652f541323a03c5b7e075d54a117091618 is inferior for RPi3.
>> You should see usb_kbd detected, but no input possible.
> 
> I am not seeing this problem, but the HDMI is not actually working. It
> could be because of a setting in the silly config.txt file, e.g.
> gpu_freq=250
> 
> The display comes to life and then says no signal.
> 
> But I tried it 10 times on us/next and the USB keyboard worked each time.
> 
> Regards,
> Simon


More information about the U-Boot mailing list