From patchwork Tue Jul 2 17:55:26 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: 1126436 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 45dX4z5gZ1z9sLt for ; Wed, 3 Jul 2019 03:57:23 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 8318FC21C6A; Tue, 2 Jul 2019 17:57:18 +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 696BAC21C4A; Tue, 2 Jul 2019 17:57:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 450B2C21C2C; Tue, 2 Jul 2019 17:57:14 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 00C7EC21BE5 for ; Tue, 2 Jul 2019 17:57:14 +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 855A4AF50; Tue, 2 Jul 2019 17:57:13 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Tue, 2 Jul 2019 19:55:26 +0200 Message-Id: <493871942d344ca3076301a182292b08da213d29.1562090082.git.msuchanek@suse.de> X-Mailer: git-send-email 2.21.0 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 1/9] usb: r8a66597: return -ENOTSUPP from unimplemented 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" Signed-off-by: Michal Suchanek --- drivers/usb/host/r8a66597-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index 3c263e51c160..7b699d3f4788 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c @@ -826,7 +826,7 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, { /* no implement */ R8A66597_DPRINT("%s\n", __func__); - return 0; + return -ENOTSUPP; } int usb_lowlevel_init(int index, enum usb_init_type init, void **controller) From patchwork Tue Jul 2 17:55:27 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: 1126437 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 45dX650kRTz9s00 for ; Wed, 3 Jul 2019 03:58:21 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B676DC21DCA; Tue, 2 Jul 2019 17:57:31 +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 EF0A3C21BE5; Tue, 2 Jul 2019 17:57:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BF399C21C2C; Tue, 2 Jul 2019 17:57:14 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 8372EC21BE5 for ; Tue, 2 Jul 2019 17:57:14 +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 40754AF55; Tue, 2 Jul 2019 17:57:14 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Tue, 2 Jul 2019 19:55:27 +0200 Message-Id: <8a34decf3c233d5c1c99f691527544c6aea262e2.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 2/9] usb: sl811-hcd: return -ENOTSUPP from unimplemented 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" Signed-off-by: Michal Suchanek --- drivers/usb/host/sl811-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index daba0dcd1aee..4fd2ad464312 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -388,7 +388,7 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, { PDEBUG(0, "dev = %p pipe = %#lx buf = %p size = %d int = %d\n", dev, pipe, buffer, len, interval); - return -1; + return -ENOTSUPP; } /* From patchwork Tue Jul 2 17:55:28 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: 1126439 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 45dX7C54qHz9s00 for ; Wed, 3 Jul 2019 03:59:19 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 52D37C21C6A; Tue, 2 Jul 2019 17:57:46 +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 87D37C21E0D; Tue, 2 Jul 2019 17:57:17 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9F964C21C2C; Tue, 2 Jul 2019 17:57:15 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 47EC7C21BE5 for ; Tue, 2 Jul 2019 17:57:15 +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 10EE1AF57; Tue, 2 Jul 2019 17:57:15 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Tue, 2 Jul 2019 19:55:28 +0200 Message-Id: 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 3/9] usb_kdb: only process events succesfully received 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" On error the data buffer does not contain valid data so do not submit it for processing. Usually it will contain the last data recieved so the last pressed key will be repeated indefinitely on device failure. Signed-off-by: Michal Suchanek --- v2: fix indentation --- common/usb_kbd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 020f0d4117f7..74206d2de74f 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -317,10 +317,9 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev) struct usb_kbd_pdata *data = dev->privptr; /* Submit a interrupt transfer request */ - usb_submit_int_msg(dev, data->intpipe, &data->new[0], data->intpktsize, - data->intinterval); - - usb_kbd_irq_worker(dev); + if (!usb_submit_int_msg(dev, data->intpipe, &data->new[0], + data->intpktsize, data->intinterval)) + usb_kbd_irq_worker(dev); #elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) || \ defined(CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE) #if defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) From patchwork Tue Jul 2 17:55:29 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: 1126442 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 45dX7j0BSrz9sLt for ; Wed, 3 Jul 2019 03:59:45 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id BFB1AC21E18; Tue, 2 Jul 2019 17:57:59 +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 9DEA3C21E13; Tue, 2 Jul 2019 17:57:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 44512C21C2C; Tue, 2 Jul 2019 17:57:16 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 0A840C21BE5 for ; Tue, 2 Jul 2019 17:57:16 +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 C5DBDAF5B; Tue, 2 Jul 2019 17:57:15 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Tue, 2 Jul 2019 19:55:29 +0200 Message-Id: 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 4/9] usb: usb_submit_int_msg -> usb_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" This aligns naming with usb_bulk_msg and usb_control_msg. Signed-off-by: Michal Suchanek --- v2: new patch --- common/usb.c | 2 +- common/usb_kbd.c | 6 +++--- include/usb.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/usb.c b/common/usb.c index b70f614d244f..704937dec8a8 100644 --- a/common/usb.c +++ b/common/usb.c @@ -194,7 +194,7 @@ int usb_disable_asynch(int disable) /* * submits an Interrupt Message */ -int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe, +int usb_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, int interval) { return submit_int_msg(dev, pipe, buffer, transfer_len, interval); diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 74206d2de74f..71da890b762a 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -317,7 +317,7 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev) struct usb_kbd_pdata *data = dev->privptr; /* Submit a interrupt transfer request */ - if (!usb_submit_int_msg(dev, data->intpipe, &data->new[0], + if (!usb_int_msg(dev, data->intpipe, &data->new[0], data->intpktsize, data->intinterval)) usb_kbd_irq_worker(dev); #elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) || \ @@ -481,8 +481,8 @@ static int usb_kbd_probe_dev(struct usb_device *dev, unsigned int ifnum) if (usb_get_report(dev, iface->desc.bInterfaceNumber, 1, 0, data->new, USB_KBD_BOOT_REPORT_SIZE) < 0) { #else - if (usb_submit_int_msg(dev, data->intpipe, data->new, data->intpktsize, - data->intinterval) < 0) { + if (usb_int_msg(dev, data->intpipe, data->new, data->intpktsize, + data->intinterval) < 0) { #endif printf("Failed to get keyboard state from device %04x:%04x\n", dev->descriptor.idVendor, dev->descriptor.idProduct); diff --git a/include/usb.h b/include/usb.h index 420a30e49fa1..8cd73863b876 100644 --- a/include/usb.h +++ b/include/usb.h @@ -261,7 +261,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, void *data, unsigned short size, int timeout); int usb_bulk_msg(struct usb_device *dev, unsigned int pipe, void *data, int len, int *actual_length, int timeout); -int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe, +int usb_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, int interval); int usb_disable_asynch(int disable); int usb_maxpacket(struct usb_device *dev, unsigned long pipe); From patchwork Tue Jul 2 17:55:30 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: 1126443 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 45dX970TLHz9s00 for ; Wed, 3 Jul 2019 04:00:59 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id BDE04C21E3B; Tue, 2 Jul 2019 17:58:58 +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 C4C38C21E02; Tue, 2 Jul 2019 17:57:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2DC77C21DD3; Tue, 2 Jul 2019 17:57:20 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id C08BDC21DB6 for ; Tue, 2 Jul 2019 17:57:16 +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 8202CAF5D; Tue, 2 Jul 2019 17:57:16 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Tue, 2 Jul 2019 19:55:30 +0200 Message-Id: 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 5/9] usb: storage: submit_int_msg -> usb_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" Use the wrapper because the unwrapped function prototype will be changed in the following patch. Signed-off-by: Michal Suchanek --- v2: usb_submit_int_msg -> usb_int_msg --- common/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/usb_storage.c b/common/usb_storage.c index 8c889bb1a648..7be965964f09 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -650,7 +650,7 @@ static int usb_stor_CBI_get_status(struct scsi_cmd *srb, struct us_data *us) int timeout; us->ip_wanted = 1; - submit_int_msg(us->pusb_dev, us->irqpipe, + usb_int_msg(us->pusb_dev, us->irqpipe, (void *) &us->ip_data, us->irqmaxp, us->irqinterval); timeout = 1000; while (timeout--) { From patchwork Tue Jul 2 17:55:31 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: 1126440 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 45dX7b6m7Tz9s00 for ; Wed, 3 Jul 2019 03:59:39 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id AE032C21C4A; Tue, 2 Jul 2019 17:58:38 +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 0C96CC21E2C; Tue, 2 Jul 2019 17:57:35 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 39280C21DD4; Tue, 2 Jul 2019 17:57:21 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 70531C21E08 for ; Tue, 2 Jul 2019 17:57:17 +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 3720CAF60; Tue, 2 Jul 2019 17:57:17 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Tue, 2 Jul 2019 19:55:31 +0200 Message-Id: <3a48e151d344809ff8faf56f7380ce2d49ceed6e.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 6/9] usb: Add nonblock argument to 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" This will be used to implement non-blocking keyboard polling in case of errors. Signed-off-by: Michal Suchanek --- v2: ad missing hunk from last patch --- common/usb.c | 2 +- drivers/usb/host/dwc2.c | 12 +++++++----- drivers/usb/host/ehci-hcd.c | 13 ++++++++----- drivers/usb/host/ohci-hcd.c | 4 ++-- drivers/usb/host/r8a66597-hcd.c | 2 +- drivers/usb/host/sl811-hcd.c | 2 +- drivers/usb/host/usb-uclass.c | 4 ++-- drivers/usb/host/xhci.c | 13 ++++++++----- drivers/usb/musb-new/musb_uboot.c | 12 +++++++----- include/usb.h | 4 ++-- 10 files changed, 39 insertions(+), 29 deletions(-) diff --git a/common/usb.c b/common/usb.c index 704937dec8a8..f57c0e8cdf57 100644 --- a/common/usb.c +++ b/common/usb.c @@ -197,7 +197,7 @@ int usb_disable_asynch(int disable) int usb_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, int interval) { - return submit_int_msg(dev, pipe, buffer, transfer_len, interval); + return submit_int_msg(dev, pipe, buffer, transfer_len, interval, false); } /* diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index a62a2f8a951d..b4121a49b805 100644 --- a/drivers/usb/host/dwc2.c +++ b/drivers/usb/host/dwc2.c @@ -1108,7 +1108,8 @@ static int _submit_control_msg(struct dwc2_priv *priv, struct usb_device *dev, } int _submit_int_msg(struct dwc2_priv *priv, struct usb_device *dev, - unsigned long pipe, void *buffer, int len, int interval) + unsigned long pipe, void *buffer, int len, int interval, + bool nonblock) { unsigned long timeout; int ret; @@ -1236,9 +1237,10 @@ int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer, } int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, - int len, int interval) + int len, int interval, bool nonblock) { - return _submit_int_msg(&local, dev, pipe, buffer, len, interval); + return _submit_int_msg(&local, dev, pipe, buffer, len, interval, + nonblock); } /* U-Boot USB control interface */ @@ -1292,13 +1294,13 @@ static int dwc2_submit_bulk_msg(struct udevice *dev, struct usb_device *udev, static int dwc2_submit_int_msg(struct udevice *dev, struct usb_device *udev, unsigned long pipe, void *buffer, int length, - int interval) + int interval, bool nonblock) { struct dwc2_priv *priv = dev_get_priv(dev); debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); - return _submit_int_msg(priv, udev, pipe, buffer, length, interval); + return _submit_int_msg(priv, udev, pipe, buffer, length, interval, nonblock); } static int dwc2_usb_ofdata_to_platdata(struct udevice *dev) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 4b28db70a566..61a61abb2112 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -1482,7 +1482,8 @@ out: } static int _ehci_submit_int_msg(struct usb_device *dev, unsigned long pipe, - void *buffer, int length, int interval) + void *buffer, int length, int interval, + bool nonblock) { void *backbuffer; struct int_queue *queue; @@ -1532,9 +1533,10 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, } int submit_int_msg(struct usb_device *dev, unsigned long pipe, - void *buffer, int length, int interval) + void *buffer, int length, int interval, bool nonblock) { - return _ehci_submit_int_msg(dev, pipe, buffer, length, interval); + return _ehci_submit_int_msg(dev, pipe, buffer, length, interval, + nonblock); } struct int_queue *create_int_queue(struct usb_device *dev, @@ -1576,10 +1578,11 @@ static int ehci_submit_bulk_msg(struct udevice *dev, struct usb_device *udev, static int ehci_submit_int_msg(struct udevice *dev, struct usb_device *udev, unsigned long pipe, void *buffer, int length, - int interval) + int interval, bool nonblock) { debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); - return _ehci_submit_int_msg(udev, pipe, buffer, length, interval); + return _ehci_submit_int_msg(udev, pipe, buffer, length, interval, + nonblock); } static struct int_queue *ehci_create_int_queue(struct udevice *dev, diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 3b6f889f7b7a..2645b64b0eba 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1702,7 +1702,7 @@ int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer, } int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, - int transfer_len, int interval) + int transfer_len, int interval, bool nonblock) { info("submit_int_msg"); return submit_common_msg(&gohci, dev, pipe, buffer, transfer_len, NULL, @@ -2151,7 +2151,7 @@ static int ohci_submit_bulk_msg(struct udevice *dev, struct usb_device *udev, static int ohci_submit_int_msg(struct udevice *dev, struct usb_device *udev, unsigned long pipe, void *buffer, int length, - int interval) + int interval, bool nonblock) { ohci_t *ohci = dev_get_priv(usb_get_bus(dev)); diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index 7b699d3f4788..fe23a88733be 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c @@ -822,7 +822,7 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, } int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, - int transfer_len, int interval) + int transfer_len, int interval, bool nonblock) { /* no implement */ R8A66597_DPRINT("%s\n", __func__); diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 4fd2ad464312..21872285feeb 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -384,7 +384,7 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, } int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, - int len, int interval) + int len, int interval, bool nonblock) { PDEBUG(0, "dev = %p pipe = %#lx buf = %p size = %d int = %d\n", dev, pipe, buffer, len, interval); diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c index 611ea97a7249..72ce2a2fca75 100644 --- a/drivers/usb/host/usb-uclass.c +++ b/drivers/usb/host/usb-uclass.c @@ -31,7 +31,7 @@ int usb_disable_asynch(int disable) } int submit_int_msg(struct usb_device *udev, unsigned long pipe, void *buffer, - int length, int interval) + int length, int interval, bool nonblock) { struct udevice *bus = udev->controller_dev; struct dm_usb_ops *ops = usb_get_ops(bus); @@ -39,7 +39,7 @@ int submit_int_msg(struct usb_device *udev, unsigned long pipe, void *buffer, if (!ops->interrupt) return -ENOSYS; - return ops->interrupt(bus, udev, pipe, buffer, length, interval); + return ops->interrupt(bus, udev, pipe, buffer, length, interval, nonblock); } int submit_control_msg(struct usb_device *udev, unsigned long pipe, diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 44c5f2d264c1..b3e4dcd66fa1 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1109,7 +1109,8 @@ unknown: * @return 0 */ static int _xhci_submit_int_msg(struct usb_device *udev, unsigned long pipe, - void *buffer, int length, int interval) + void *buffer, int length, int interval, + bool nonblock) { if (usb_pipetype(pipe) != PIPE_INTERRUPT) { printf("non-interrupt pipe (type=%lu)", usb_pipetype(pipe)); @@ -1277,9 +1278,10 @@ int submit_bulk_msg(struct usb_device *udev, unsigned long pipe, void *buffer, } int submit_int_msg(struct usb_device *udev, unsigned long pipe, void *buffer, - int length, int interval) + int length, int interval, bool nonblock) { - return _xhci_submit_int_msg(udev, pipe, buffer, length, interval); + return _xhci_submit_int_msg(udev, pipe, buffer, length, interval, + nonblock); } /** @@ -1386,10 +1388,11 @@ static int xhci_submit_bulk_msg(struct udevice *dev, struct usb_device *udev, static int xhci_submit_int_msg(struct udevice *dev, struct usb_device *udev, unsigned long pipe, void *buffer, int length, - int interval) + int interval, bool nonblock) { debug("%s: dev='%s', udev=%p\n", __func__, dev->name, udev); - return _xhci_submit_int_msg(udev, pipe, buffer, length, interval); + return _xhci_submit_int_msg(udev, pipe, buffer, length, interval, + nonblock); } static int xhci_alloc_device(struct udevice *dev, struct usb_device *udev) diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c index 9c8cc6e58443..9eb593402ea0 100644 --- a/drivers/usb/musb-new/musb_uboot.c +++ b/drivers/usb/musb-new/musb_uboot.c @@ -110,7 +110,7 @@ static int _musb_submit_bulk_msg(struct musb_host_data *host, static int _musb_submit_int_msg(struct musb_host_data *host, struct usb_device *dev, unsigned long pipe, - void *buffer, int len, int interval) + void *buffer, int len, int interval, bool nonblock) { construct_urb(&host->urb, &host->hep, dev, USB_ENDPOINT_XFER_INT, pipe, buffer, len, NULL, interval); @@ -268,9 +268,10 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, } int submit_int_msg(struct usb_device *dev, unsigned long pipe, - void *buffer, int length, int interval) + void *buffer, int length, int interval, bool nonblock) { - return _musb_submit_int_msg(&musb_host, dev, pipe, buffer, length, interval); + return _musb_submit_int_msg(&musb_host, dev, pipe, buffer, length, + interval, nonblock); } struct int_queue *create_int_queue(struct usb_device *dev, @@ -320,10 +321,11 @@ static int musb_submit_bulk_msg(struct udevice *dev, struct usb_device *udev, static int musb_submit_int_msg(struct udevice *dev, struct usb_device *udev, unsigned long pipe, void *buffer, int length, - int interval) + int interval, bool nonblock) { struct musb_host_data *host = dev_get_priv(dev); - return _musb_submit_int_msg(host, udev, pipe, buffer, length, interval); + return _musb_submit_int_msg(host, udev, pipe, buffer, length, interval, + nonblock); } static struct int_queue *musb_create_int_queue(struct udevice *dev, diff --git a/include/usb.h b/include/usb.h index 8cd73863b876..6ca2eb30d08a 100644 --- a/include/usb.h +++ b/include/usb.h @@ -184,7 +184,7 @@ int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, struct devrequest *setup); int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, - int transfer_len, int interval); + int transfer_len, int interval, bool nonblock); #if defined CONFIG_USB_EHCI_HCD || defined CONFIG_USB_MUSB_HOST \ || CONFIG_IS_ENABLED(DM_USB) @@ -708,7 +708,7 @@ struct dm_usb_ops { */ int (*interrupt)(struct udevice *bus, struct usb_device *udev, unsigned long pipe, void *buffer, int length, - int interval); + int interval, bool nonblock); /** * create_int_queue() - Create and queue interrupt packets From patchwork Tue Jul 2 17:55:32 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: 1126445 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 45dX9S0Nqmz9s00 for ; Wed, 3 Jul 2019 04:01:15 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id BC78BC21BE5; Tue, 2 Jul 2019 17:58:24 +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 3A301C21D9A; Tue, 2 Jul 2019 17:57:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BECAAC21DD7; Tue, 2 Jul 2019 17:57:22 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 24B11C21E12 for ; Tue, 2 Jul 2019 17:57:18 +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 DD515AF68; Tue, 2 Jul 2019 17:57:17 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Tue, 2 Jul 2019 19:55:32 +0200 Message-Id: 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 7/9] usb: add usb_int_msg_nonblock 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" Variant of the int_msg wrapper that does not introduce excessive retry delay on error. Signed-off-by: Michal Suchanek --- v2: usb_submit_int_msg -> usb_int_msg --- common/usb.c | 9 +++++++++ include/usb.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/common/usb.c b/common/usb.c index f57c0e8cdf57..1bd60b24a555 100644 --- a/common/usb.c +++ b/common/usb.c @@ -200,6 +200,15 @@ int usb_int_msg(struct usb_device *dev, unsigned long pipe, return submit_int_msg(dev, pipe, buffer, transfer_len, interval, false); } +/* + * submits an Interrupt Message without retry + */ +int usb_int_msg_nonblock(struct usb_device *dev, unsigned long pipe, + void *buffer, int transfer_len, int interval) +{ + return submit_int_msg(dev, pipe, buffer, transfer_len, interval, true); +} + /* * submits a control message and waits for comletion (at least timeout * 1ms) * If timeout is 0, we don't wait for completion (used as example to set and diff --git a/include/usb.h b/include/usb.h index 6ca2eb30d08a..b0a079766652 100644 --- a/include/usb.h +++ b/include/usb.h @@ -263,6 +263,8 @@ int usb_bulk_msg(struct usb_device *dev, unsigned int pipe, void *data, int len, int *actual_length, int timeout); int usb_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, int interval); +int usb_int_msg_nonblock(struct usb_device *dev, unsigned long pipe, + void *buffer, int transfer_len, int interval); int usb_disable_asynch(int disable); int usb_maxpacket(struct usb_device *dev, unsigned long pipe); int usb_get_configuration_no(struct usb_device *dev, int cfgno, From patchwork Tue Jul 2 17:55:33 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: 1126441 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 45dX7g1gLMz9sLt for ; Wed, 3 Jul 2019 03:59:43 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E6F40C21E2C; Tue, 2 Jul 2019 17:58:12 +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 5FB49C21C4A; Tue, 2 Jul 2019 17:57:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AF5BAC21E18; Tue, 2 Jul 2019 17:57:22 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id D916BC21E2C for ; Tue, 2 Jul 2019 17:57:18 +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 9895DAF7C; Tue, 2 Jul 2019 17:57:18 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Date: Tue, 2 Jul 2019 19:55:33 +0200 Message-Id: <3640553af38bb0266bcfde58412677d26c8c1422.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 8/9] usb: kbd: use usb_int_msg_nonblock for polling 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" With the following patch it avoids excessive delays with USB 1.1 keyboard connected to high-speed USB hub conncted to dwc2. Signed-off-by: Michal Suchanek --- v2: usb_submit_int_msg -> usb_int_msg --- common/usb_kbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 71da890b762a..c7be125f1811 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -317,7 +317,7 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev) struct usb_kbd_pdata *data = dev->privptr; /* Submit a interrupt transfer request */ - if (!usb_int_msg(dev, data->intpipe, &data->new[0], + if (!usb_int_msg_nonblock(dev, data->intpipe, &data->new[0], data->intpktsize, data->intinterval)) usb_kbd_irq_worker(dev); #elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) || \ 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; } }