[GIT,PULL] usb patches for v4.8

Message ID 5774FBD8.1010509@ti.com
State New
Headers show

Commit Message

Roger Quadros June 30, 2016, 11 a.m.
Greg, Felipe,

On 30/06/16 13:45, Roger Quadros wrote:
> On 30/06/16 13:32, Felipe Balbi wrote:

>>

>> Hi,

>>

>> Roger Quadros <rogerq@ti.com> writes:

>>>>>> here's the big pull request for gadget API and related UDC drivers.

>>>>>>

>>>>>> Nothing really scary lately. Patches have been in linux-next for a while

>>>>>> without outstanding reports.

>>>>>>

>>>>>> Let me know if you want any changes, but things seem to be calming

>>>>>> down. I have, however, a few patches pending in my linux-usb inbox but I

>>>>>> won't have time to really work on them in time for current merge window,

>>>>>> so I decided to cut my tree short and send you a pull request.

>>>>>>

>>>>>> Anyway, here's the good stuff

>>>>>>

>>>>>> The following changes since commit 33688abb2802ff3a230bd2441f765477b94cc89e:

>>>>>>

>>>>>>   Linux 4.7-rc4 (2016-06-19 21:30:02 -0700)

>>>>>>

>>>>>> are available in the git repository at:

>>>>>>

>>>>>>   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git tags/usb-for-v4.8

>>>>>

>>>>> I got a merge issue in drivers/usb/dwc3/host.c that I had to fix up by

>>>>> hand.  Can you verify I got the merge correct?  It builds for me here :)

>>>>

>>>> looks okay and still passes my tests. Then again, Intel's SoCs don't use

>>>> dwc3/host.c, Roger or Bin, can you test AM437x with greg/usb-next to

>>>> make sure it still works for you guys?

>>>>

>>> Unfortunately USB host is broken for TI platforms on greg/usb-next.

>>> Works fine on balbi/next though.

>>

>> got some logs to aid debugging there? Tracepoints? dmesg? Anything which

>> could hint at the problem?

>>

> xhci driver hasn't been loaded so

> 

>> lsusb

> unable to initialize libusb: -99

> 

> cheers,

> -roger

> 


The following patch fixes it for me. Looks like we lost all changes related
to commit 9522def40065 ("usb: dwc3: core: cleanup IRQ resources") in host.c
during the merge.

Patch

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index 67f90d7..f6533c6 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -23,7 +23,48 @@  int dwc3_host_init(struct dwc3 *dwc)
 {
 	struct property_entry	props[2];
 	struct platform_device	*xhci;
-	int			ret;
+	int			ret, irq;
+	struct resource		*res;
+	struct platform_device	*dwc3_pdev = to_platform_device(dwc->dev);
+
+	irq = platform_get_irq_byname(dwc3_pdev, "host");
+	if (irq == -EPROBE_DEFER)
+		return irq;
+
+	if (irq <= 0) {
+		irq = platform_get_irq_byname(dwc3_pdev, "dwc_usb3");
+		if (irq == -EPROBE_DEFER)
+			return irq;
+
+		if (irq <= 0) {
+			irq = platform_get_irq(dwc3_pdev, 0);
+			if (irq <= 0) {
+				if (irq != -EPROBE_DEFER) {
+					dev_err(dwc->dev,
+						"missing host IRQ\n");
+				}
+				if (!irq)
+					irq = -EINVAL;
+				return irq;
+			} else {
+				res = platform_get_resource(dwc3_pdev,
+							    IORESOURCE_IRQ, 0);
+			}
+		} else {
+			res = platform_get_resource_byname(dwc3_pdev,
+							   IORESOURCE_IRQ,
+							   "dwc_usb3");
+		}
+
+	} else {
+		res = platform_get_resource_byname(dwc3_pdev, IORESOURCE_IRQ,
+						   "host");
+	}
+
+	dwc->xhci_resources[1].start = irq;
+	dwc->xhci_resources[1].end = irq;
+	dwc->xhci_resources[1].flags = res->flags;
+	dwc->xhci_resources[1].name = res->name;
 
 	xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO);
 	if (!xhci) {