From patchwork Tue Jul 2 17:55:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michal_Such=C3=A1nek?= X-Patchwork-Id: 1126444 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45dX9C3hfxz9s00 for ; Wed, 3 Jul 2019 04:01:03 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 386AFC21C50; Tue, 2 Jul 2019 17:59:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C10F3C21E13; Tue, 2 Jul 2019 17:58:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 30CFDC21E1A; Tue, 2 Jul 2019 17:57:23 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 9038AC21E18 for ; Tue, 2 Jul 2019 17:57:19 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 544C2AF70; Tue, 2 Jul 2019 17:57:19 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Tue, 2 Jul 2019 19:55:34 +0200 Message-Id: <7059dcc94dcd0d0b9d8428afd09651327c332e6f.1562090082.git.msuchanek@suse.de> X-Mailer: git-send-email 2.21.0 In-Reply-To: <493871942d344ca3076301a182292b08da213d29.1562090082.git.msuchanek@suse.de> References: <493871942d344ca3076301a182292b08da213d29.1562090082.git.msuchanek@suse.de> MIME-Version: 1.0 Cc: Marek Vasut , Andre Przywara , Michal Simek , Oleksandr Tymoshenko , Sven Schwermer , York Sun , Michal Suchanek , Chris Packham Subject: [U-Boot] [PATCH v2 9/9] dwc2: use the nonblock argument in submit_int_msg X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" An USB 1.1 keyboard connected to dwc2 through a high-speed hub does not report status until it changes. With this patch you can enable keyboard by pressing a key while USB devices are probed. Without a keypress no state is reported and the probe times out. We don't want to wait for a keypress or timeout while polling for keypresses so implement an int_msg nonblock variant that exits early on error. Signed-off-by: Michal Suchanek --- v2: move superfluous hunk to earlier patch --- drivers/usb/host/dwc2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index b4121a49b805..78829d56199c 100644 --- a/drivers/usb/host/dwc2.c +++ b/drivers/usb/host/dwc2.c @@ -1123,7 +1123,7 @@ int _submit_int_msg(struct dwc2_priv *priv, struct usb_device *dev, return -ETIMEDOUT; } ret = _submit_bulk_msg(priv, dev, pipe, buffer, len); - if (ret != -EAGAIN) + if ((ret != -EAGAIN) || nonblock) return ret; } }