From patchwork Thu Jun 30 11:00:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 71230 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp328157qgy; Thu, 30 Jun 2016 04:00:56 -0700 (PDT) X-Received: by 10.66.43.240 with SMTP id z16mr20438469pal.114.1467284452560; Thu, 30 Jun 2016 04:00:52 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 90si4065703pfr.48.2016.06.30.04.00.52; Thu, 30 Jun 2016 04:00:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751885AbcF3LAu (ORCPT + 5 others); Thu, 30 Jun 2016 07:00:50 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:34892 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840AbcF3LAu (ORCPT ); Thu, 30 Jun 2016 07:00:50 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u5UAxZPg025232; Thu, 30 Jun 2016 05:59:35 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5UB0kcu028730; Thu, 30 Jun 2016 06:00:46 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Thu, 30 Jun 2016 06:00:46 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5UB0iZC003914; Thu, 30 Jun 2016 06:00:44 -0500 Subject: Re: [GIT PULL] usb patches for v4.8 To: Felipe Balbi , Greg Kroah-Hartman , Bin Liu References: <87lh1ogmws.fsf@linux.intel.com> <20160629165256.GA28330@kroah.com> <878txngfhh.fsf@linux.intel.com> <5774F440.6050606@ti.com> <87vb0rezlm.fsf@linux.intel.com> <5774F83A.8060407@ti.com> CC: , Tony Lindgren From: Roger Quadros Message-ID: <5774FBD8.1010509@ti.com> Date: Thu, 30 Jun 2016 14:00:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <5774F83A.8060407@ti.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Greg, Felipe, On 30/06/16 13:45, Roger Quadros wrote: > On 30/06/16 13:32, Felipe Balbi wrote: >> >> Hi, >> >> Roger Quadros 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. 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) {