From patchwork Tue Aug 6 17:07:37 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: 1142982 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 4631Ln5yqHz9sBF for ; Wed, 7 Aug 2019 03:08:47 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 152A5C21E75; Tue, 6 Aug 2019 17:08:27 +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 CD28FC21E49; Tue, 6 Aug 2019 17:08:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0DA32C21EBF; Tue, 6 Aug 2019 17:07:43 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 086F3C21EDE for ; Tue, 6 Aug 2019 17:07:43 +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 C7B52AF90; Tue, 6 Aug 2019 17:07:42 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Tue, 6 Aug 2019 19:07:37 +0200 Message-Id: <1fe27eaf6b67927382b460db78dcce9fa68e7451.1565111235.git.msuchanek@suse.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <17d39ca0f79959c6ff84d9d3b8ddf1a6668cbbe5.1565111235.git.msuchanek@suse.de> References: <17d39ca0f79959c6ff84d9d3b8ddf1a6668cbbe5.1565111235.git.msuchanek@suse.de> MIME-Version: 1.0 Cc: Marek Vasut , Andre Przywara , Sven Schwermer , York Sun , Michal Suchanek , Chris Packham Subject: [U-Boot] [PATCH v4 5/5] 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; } }