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 D769DC636D3 for ; Wed, 8 Feb 2023 18:45:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5566C85EE4; Wed, 8 Feb 2023 19:45:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="cNM9xiqc"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="9Fhi5F3F"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0AC2685DF8; Wed, 8 Feb 2023 19:45:41 +0100 (CET) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (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 1835D85DF8 for ; Wed, 8 Feb 2023 19:45:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=msuchanek@suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id D306722695; Wed, 8 Feb 2023 18:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675881937; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j5QyzhIh64KIyLlNy+H5IrMxs9umca29rUBNIGvtGC0=; b=cNM9xiqc3YhsrTkqAXjqHiZpA1rLdVLUKSbEe5Z1sLskCoqvN4/SzKE8qyLbl0VsZt4V5e 3Qqb2MMDkdDyQru71lyGOitMJmQys/mOSUN5aIJ9MZXt5NtflD2uefgCC90Rks3tG/W4BT RPqoDqu5zgvKaXPXUpD/MxVIHpS/SEQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675881937; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j5QyzhIh64KIyLlNy+H5IrMxs9umca29rUBNIGvtGC0=; b=9Fhi5F3FDBzqrAuyyyAqP8uMcpL7UhaEU34ECvFn1Q3Lbqye39SkUv5wzNf0Db/C0MrMaO oMPUirx5E3IXERDg== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 9BEDE2C141; Wed, 8 Feb 2023 18:45:37 +0000 (UTC) Date: Wed, 8 Feb 2023 19:45:36 +0100 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Filip =?utf-8?Q?=C5=BDaludek?= Cc: sjg@chromium.org, u-boot@lists.denx.de, twatson52@icloud.com, marex@denx.de Subject: Re: [PATCH v3] console: usb: kbd: Limit poll frequency to improve performance Message-ID: <20230208184536.GU19419@kitsune.suse.cz> References: <6434bd15-88e5-c5af-6267-77d504d7cf49@oracle.com> <20230117184611.GK16547@kitsune.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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 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. Thanks Michal