mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] usb: hub: fix state change check for not powercycled ports
Date: Mon, 18 Jan 2021 20:09:23 +0100	[thread overview]
Message-ID: <20210118190923.531-1-m.grzeschik@pengutronix.de> (raw)

Since we don't power cycle the ports on start since patch "19bb0b2a usb:
hub: Do not power-cycle usb devices on init" it is possible that the
device on this port is already active from a previous enumeration. This
way barebox will never get any change in USB_PORT_STAT_C_CONNECTION bit
change.

Although the device will probably still work fine after the following
port reset, the current code will always miss reenumerating these still
plugged devices. This patch fixes this by ignoring the check for
STAT_C_CONNECTION bit and only go for USB_PORT_STAT_CONNECTION which
should be enough.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/usb/core/hub.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 01653d8c20..d1112248ee 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -336,8 +336,7 @@ static void usb_scan_port(struct usb_device_scan *usb_scan)
 	dev_dbg(&dev->dev, "port%d: Status 0x%04x Change 0x%04x\n",
 			port + 1, portstatus, portchange);
 
-	if (!(portchange & USB_PORT_STAT_C_CONNECTION) ||
-	    !(portstatus & USB_PORT_STAT_CONNECTION)) {
+	if (!(portstatus & USB_PORT_STAT_CONNECTION)) {
 		if (get_time_ns() >= hub->connect_timeout) {
 			dev_dbg(&dev->dev, "port%d: timeout\n", port + 1);
 			/* Remove this device from scanning list */
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2021-01-18 19:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 19:09 Michael Grzeschik [this message]
2021-01-25  9:53 ` Sascha Hauer
2021-02-11 12:03 ` Ahmad Fatoum
2021-02-16  8:20   ` Michael Grzeschik
2021-02-16  9:33     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210118190923.531-1-m.grzeschik@pengutronix.de \
    --to=m.grzeschik@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox