linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hardik Gajjar <hgajjar@de.adit-jv.com>
To: <gregkh@linuxfoundation.org>, <stern@rowland.harvard.edu>,
	<thinhn@synopsys.com>, <Kento.A.Kobayashi@sony.com>,
	<atmgnd@outlook.com>
Cc: <andrew_gabbasov@mentor.com>, <erosca@de.adit-jv.com>,
	<linux-renesas-soc@vger.kernel.org>
Subject: [PATCH] USB: hub: Fix the broken detection of USB3 device in SMSC hub
Date: Fri, 24 Jan 2020 15:36:13 +0100	[thread overview]
Message-ID: <1579876573-13741-1-git-send-email-hgajjar@de.adit-jv.com> (raw)

This patch disables the auto-suspend feature for SMSC USB hub.
Renesas-RCAR3-H3-KF board was not able to detect the USB3.0 devices.
The XHCI driver was going to sleep and not wake up again on connection
of the USB3.0 device. According to Renesas, This is because of some
hardware issue.

Renesas-RCAR3-H3-KF has USB5534B 4-port SuperSpeed/Hi-Speed, low-power,
configurable hub controller.

Signed-off-by: Hardik Gajjar <hgajjar@de.adit-jv.com>
---
 drivers/usb/core/hub.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 939dd73a..ffc7abf 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -36,7 +36,9 @@
 #include "otg_whitelist.h"
 
 #define USB_VENDOR_GENESYS_LOGIC		0x05e3
+#define USB_VENDOR_SMSC    			0x0424
 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND	0x01
+#define HUB_QUIRK_DISABLE_AUTOSUSPEND		0x02
 
 #define USB_VENDOR_UNWIRED			0x2996
 #define USB_VENDOR_DELPHI			0x2C48
@@ -1822,6 +1824,9 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	if (id->driver_info & HUB_QUIRK_NO_LOGICAL_DISCONNECT)
 		hub->quirk_no_logical_disconnect = 1;
 
+	if (id->driver_info & HUB_QUIRK_DISABLE_AUTOSUSPEND)
+		pm_runtime_set_autosuspend_delay(&hdev->dev, -1);
+
 	if (hub_configure(hub, &desc->endpoint[0].desc) >= 0)
 		return 0;
 
@@ -5313,6 +5318,10 @@ static void hub_event(struct work_struct *work)
 }
 
 static const struct usb_device_id hub_id_table[] = {
+    { .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_CLASS,
+      .idVendor = USB_VENDOR_SMSC,
+      .bInterfaceClass = USB_CLASS_HUB,
+      .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
     { .match_flags = USB_DEVICE_ID_MATCH_VENDOR
 			| USB_DEVICE_ID_MATCH_INT_CLASS,
       .idVendor = USB_VENDOR_GENESYS_LOGIC,
-- 
2.7.4


             reply	other threads:[~2020-01-24 14:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 14:36 Hardik Gajjar [this message]
2020-01-24 15:07 ` [PATCH] USB: hub: Fix the broken detection of USB3 device in SMSC hub Alan Stern
2020-01-27 15:46   ` Gajjar, Hardik (TCP GmbH; ADITG/ESM1)

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=1579876573-13741-1-git-send-email-hgajjar@de.adit-jv.com \
    --to=hgajjar@de.adit-jv.com \
    --cc=Kento.A.Kobayashi@sony.com \
    --cc=andrew_gabbasov@mentor.com \
    --cc=atmgnd@outlook.com \
    --cc=erosca@de.adit-jv.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=thinhn@synopsys.com \
    /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;
as well as URLs for NNTP newsgroup(s).