Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 407FCC636D3 for ; Wed, 8 Feb 2023 19:01:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 341D885F01; Wed, 8 Feb 2023 20:01:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xs4all.nl Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=xs4all.nl header.i=@xs4all.nl header.b="sOhw2T+b"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CBC6885EFA; Wed, 8 Feb 2023 20:01:14 +0100 (CET) Received: from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl [195.121.94.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CDEFF85F01 for ; Wed, 8 Feb 2023 20:01:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xs4all.nl Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mark.kettenis@xs4all.nl X-KPN-MessageId: f2b58e75-a7e2-11ed-a286-005056ab378f Received: from smtp.kpnmail.nl (unknown [10.31.155.39]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id f2b58e75-a7e2-11ed-a286-005056ab378f; Wed, 08 Feb 2023 20:01:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=xs4all01; h=content-type:mime-version:subject:to:from:message-id:date; bh=9eu54ntpVDVqXUrJq+xzocmJagpZylOTj3I5jj2uSME=; b=sOhw2T+byxYU1/Sawnk/RRjy0GobDXFHbTxVlwqeZfPFBBoOnQmAXu6dzOc940NWoSly1oulb2+ON 1TH8Cyyc/XoUFBvdsHLgkDEICFF27U6/R6Sd0Wj3UQagKCvvbJOEg8Y4rjgxZqOEtodK6/zutSYU2+ n3wH80cdEeJdsgmje3USrSjQ2t1SJbErlprL+kcifgFGzk3kQetQ18zM69OTCdM+TbEqAgoJB+q0ML 5cQJs/BuAwwOkb1j4M+rKIgQ93jrFUu7fm2mf4CoVoLpN2qIH1ZV5lV9AvNl6a6TS2CV+pZ2+8UlAa Pl6JNXxiueNWpwkACpYyNH70lwJ+8tA== X-KPN-MID: 33|Z1L0TlADDCbys6C5MrLmm7OELtFh6JoWJO76a0aTxjUxQLRK79GQVaY5eHI0X5/ gqpnrPqp2r7CwAvQSxnp/LLCFIpdF8fGetmNC34sYqHc= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|BRAtCjJS7/zMenx+gaJqYr4IgjzlcbLLBu4L/Td4/v8MMekYnlNRGWzbgjGOHUe G/u7svCc+L+9smfDlT1xmkg== X-Originating-IP: 80.61.163.207 Received: from bloch.sibelius.xs4all.nl (80-61-163-207.fixed.kpn.net [80.61.163.207]) by smtp.xs4all.nl (Halon) with ESMTPSA id f2b42d0c-a7e2-11ed-ab4c-005056ab7447; Wed, 08 Feb 2023 20:01:10 +0100 (CET) Date: Wed, 08 Feb 2023 20:01:09 +0100 Message-Id: <875yccvv62.fsf@bloch.sibelius.xs4all.nl> From: Mark Kettenis To: Michal =?utf-8?Q?Such=C3=A1nek?= Cc: filip.zaludek@oracle.com, sjg@chromium.org, u-boot@lists.denx.de, twatson52@icloud.com, marex@denx.de In-Reply-To: <20230208184536.GU19419@kitsune.suse.cz> (message from Michal =?utf-8?Q?Such=C3=A1nek?= on Wed, 8 Feb 2023 19:45:36 +0100) Subject: Re: [PATCH v3] console: usb: kbd: Limit poll frequency to improve performance References: <6434bd15-88e5-c5af-6267-77d504d7cf49@oracle.com> <20230117184611.GK16547@kitsune.suse.cz> <20230208184536.GU19419@kitsune.suse.cz> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean > Date: Wed, 8 Feb 2023 19:45:36 +0100 > From: Michal Suchánek > > Hello, > > On Wed, Jan 18, 2023 at 05:01:12PM +0100, Filip Žaludek wrote: > > > > > > Hi Michal, > > > > thanks for testing! Do you consider keyboard as working once it is detected without > > 'usb_kbd usb_kbd: Timeout poll on interrupt endpoint', or judging from subsequent > > typing? Note that issue is reproducible only in about 20% of reboots. > > I rely on keyboard input to boot so if it was 20% broken I would notice. > I don't use the rPi all that much so if it was broken only a few > % of the time there is a chance I would miss it. > > However, for me not typing on the keyboard during usb detection it is > 100% not detected, typing on it during usb detection it is 100% > detected. > > The timeout is limitation of the dwc2 controller handling of usb hubs. > > There might be a possibility to improve the driver so that it handles > the condition but it might be that the Linux driver relies on a separate > thread handling the controller which is not acceptable for u-boot. > > I am not usb expert and definitely not dwc2 expert so I cannot do more > than workaround the current driver limitation. > > > For me I can always enter 'U-Boot>' shell, but then keyboard usually does not work. > > And yes, resetting the usb controller with pressing a key afterwards will > > finally break the keyboard. ('usb reset' typed from keyboard) > > If you are Prague located I am ready to demonstrate what I am talking about. > > > > Simon's keyboard detection is somewhat interfered by 'SanDisk USB Extreme Pro' detection, > > printed complaints but keyboard still works.. > > 'usb_kbd usb_kbd: Timeout poll on interrupt endpoint' and 'Failed to get keyboard state from device 0c40:8000' > > Btw. why from 0c40:8000 (ELMCU 2.4GHz receiver) when wired keyboard is 046d:c31c (Logitech Keyboard K120)? > > > > What is supposed scenario for RPi3/u-boot/grub usb keyboard equipped users wanting to boot non-default? > > Enter 'U-Boot>' shell to detect keyboard; type boot; select desired grub entry..? > > > > Reverting either from the two makes it non issue for me: > > 'dwc2: use the nonblock argument in submit_int_msg' > > commit 9dcab2c4d2cb50ab1864c818b82a72393c160236 > > Without this booting from USB is not feasible because reading every > block from the USB drive waits for the keyboard to time out. > > > 'console: usb: kbd: Limit poll frequency to improve performance' > > commit 96991e652f541323a03c5b7e075d54a117091618 > > No idea about this one, for me it doea not give any substantial > difference in behavior. Reverting that commit leads to a significant slowdown loading a kernel from disk with a usb keyboard connected. The slowdown is somewhat hardware dependent but on some systems loading the OpenBSD/arm64 kernel would take minutes instead of seconds.