mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: <balbi@kernel.org>, <mathias.nyman@intel.com>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<rogerq@ti.com>
Subject: [PATCH 3/3] usb: dwc3: host: pass quirk-broken-port-ped property for known broken revisions
Date: Thu, 17 Nov 2016 17:01:21 +0200	[thread overview]
Message-ID: <1479394881-13863-4-git-send-email-rogerq@ti.com> (raw)
In-Reply-To: <1479394881-13863-1-git-send-email-rogerq@ti.com>

From: Felipe Balbi <balbi@ti.com>

dwc3 revisions <=3.00a have a limitation where Port Disable command
doesn't work. Set the quirk-broken-port-ped property for such
controllers so XHCI core can do the necessary workaround.

[rogerq@ti.com] Updated code from platform data to device property.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/dwc3/host.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index f6533c6..626d87d 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -21,11 +21,12 @@
 
 int dwc3_host_init(struct dwc3 *dwc)
 {
-	struct property_entry	props[2];
+	struct property_entry	props[3];
 	struct platform_device	*xhci;
 	int			ret, irq;
 	struct resource		*res;
 	struct platform_device	*dwc3_pdev = to_platform_device(dwc->dev);
+	int			prop_idx = 0;
 
 	irq = platform_get_irq_byname(dwc3_pdev, "host");
 	if (irq == -EPROBE_DEFER)
@@ -89,8 +90,22 @@ int dwc3_host_init(struct dwc3 *dwc)
 
 	memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
 
-	if (dwc->usb3_lpm_capable) {
-		props[0].name = "usb3-lpm-capable";
+	if (dwc->usb3_lpm_capable)
+		props[prop_idx++].name = "usb3-lpm-capable";
+
+	/**
+	 * WORKAROUND: dwc3 revisions <=3.00a have a limitation
+	 * where Port Disable command doesn't work.
+	 *
+	 * The suggested workaround is that we avoid Port Disable
+	 * completely.
+	 *
+	 * This following flag tells XHCI to do just that.
+	 */
+	if (dwc->revision <= DWC3_REVISION_300A)
+		props[prop_idx++].name = "quirk-broken-port-ped";
+
+	if (prop_idx) {
 		ret = platform_device_add_properties(xhci, props);
 		if (ret) {
 			dev_err(dwc->dev, "failed to add properties to xHCI\n");
-- 
2.7.4

  parent reply	other threads:[~2016-11-17 18:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 15:01 [PATCH 0/3] usb: xhci: Add broken port disable quirk Roger Quadros
2016-11-17 15:01 ` [PATCH 1/3] usb: xhci: add quirk flag for broken PED bits Roger Quadros
2016-11-18 10:49   ` Sergei Shtylyov
2016-11-21 11:51     ` Roger Quadros
2016-11-21 11:51   ` [PATCH v2 " Roger Quadros
2016-11-21 11:56     ` Felipe Balbi
2016-11-21 13:05       ` Roger Quadros
2016-11-21 13:09     ` [PATCH v3 " Roger Quadros
2016-11-17 15:01 ` [PATCH 2/3] usb: host: xhci-plat: enable BROKEN_PED quirk if platform requested Roger Quadros
2016-11-17 15:01 ` Roger Quadros [this message]
2017-01-03 12:37 ` [PATCH 0/3] usb: xhci: Add broken port disable quirk Roger Quadros
2017-01-03 12:53   ` Felipe Balbi
2017-01-03 16:32     ` Mathias Nyman
2017-01-24 14:59     ` Roger Quadros
2017-01-26  9:19       ` Felipe Balbi

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=1479394881-13863-4-git-send-email-rogerq@ti.com \
    --to=rogerq@ti.com \
    --cc=balbi@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.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

all inboxes | Powered by JetHome®