Message ID | 20220702220355.63b36fb8@Cyrus.lan (mailing list archive) |
---|---|
State | Handled Elsewhere, archived |
Headers | show |
Series | [v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode. | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/github-powerpc_sparse | success | Successfully ran 4 jobs. |
snowpatch_ozlabs/github-powerpc_kernel_qemu | success | Successfully ran 23 jobs. |
snowpatch_ozlabs/github-powerpc_clang | success | Successfully ran 7 jobs. |
On 02 July 2022 at 11:03 pm, Darren Stevens wrote: > In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT > core) we stopped platform_get_resource() from returning the IRQ, as all > drivers were supposed to have switched to platform_get_irq() > Unfortunately the Freescale EHCI driver in host mode got missed. Fix > it. > > Fixes: a1a2b7125e10 (Drop static setup of IRQ resource from DT core) > Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de> > Suggested-by: Rob Herring <robh@kernel.org> > Signed-off-by: Darren Stevens <darren@stevens-zone.net> > --- > v3 - Corrected resource allocation in fsl-mph-dr-of.c > > v2 - Fixed coding style, removed a couple of unneeded initializations, > cc'd Layerscape maintainers. > > Tested on AmigaOne X5000/20 and X5000/40 Contains code by Rob Herring > (in fsl-mph-dr-of.c) > > diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c > index 385be30..896c0d1 100644 > --- a/drivers/usb/host/ehci-fsl.c > +++ b/drivers/usb/host/ehci-fsl.c > @@ -76,14 +76,9 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev) > return -ENODEV; > } > > - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); > - if (!res) { > - dev_err(&pdev->dev, > - "Found HC with no IRQ. Check %s setup!\n", > - dev_name(&pdev->dev)); > - return -ENODEV; > - } > - irq = res->start; > + irq = platform_get_irq(pdev, 0); > + if (irq < 0) > + return irq; > > hcd = __usb_create_hcd(&fsl_ehci_hc_driver, pdev->dev.parent, > &pdev->dev, dev_name(&pdev->dev), NULL); > diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c > index 44a7e58..e5df175 100644 > --- a/drivers/usb/host/fsl-mph-dr-of.c > +++ b/drivers/usb/host/fsl-mph-dr-of.c > @@ -112,6 +112,9 @@ static struct platform_device *fsl_usb2_device_register( > goto error; > } > > + pdev->dev.of_node = ofdev->dev.of_node; > + pdev->dev.of_node_reused = true; > + > retval = platform_device_add(pdev); > if (retval) > goto error; Hello, I patched the RC5 of kernel 5.19 with this patch and I can confirm, that my keyboard and mouse work without any problems. Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> Please accept this patch. Thanks, Christian
On Sat, Jul 2, 2022 at 3:04 PM Darren Stevens <darren@stevens-zone.net> wrote: > > In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT > core) we stopped platform_get_resource() from returning the IRQ, as all > drivers were supposed to have switched to platform_get_irq() > Unfortunately the Freescale EHCI driver in host mode got missed. Fix > it. > > Fixes: a1a2b7125e10 (Drop static setup of IRQ resource from DT core) > Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de> > Suggested-by: Rob Herring <robh@kernel.org> > Signed-off-by: Darren Stevens <darren@stevens-zone.net> > --- > v3 - Corrected resource allocation in fsl-mph-dr-of.c > > v2 - Fixed coding style, removed a couple of unneeded initializations, > cc'd Layerscape maintainers. > > Tested on AmigaOne X5000/20 and X5000/40 Contains code by Rob Herring > (in fsl-mph-dr-of.c) Thanks for fixing. Acked-by: Rob Herring <robh@kernel.org>
On Tue, Jul 05, 2022 at 10:29:53AM -0600, Rob Herring wrote: > On Sat, Jul 2, 2022 at 3:04 PM Darren Stevens <darren@stevens-zone.net> wrote: > > > > In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT > > core) we stopped platform_get_resource() from returning the IRQ, as all > > drivers were supposed to have switched to platform_get_irq() > > Unfortunately the Freescale EHCI driver in host mode got missed. Fix > > it. > > > > Fixes: a1a2b7125e10 (Drop static setup of IRQ resource from DT core) > > Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de> > > Suggested-by: Rob Herring <robh@kernel.org> > > Signed-off-by: Darren Stevens <darren@stevens-zone.net> > > --- > > v3 - Corrected resource allocation in fsl-mph-dr-of.c > > > > v2 - Fixed coding style, removed a couple of unneeded initializations, > > cc'd Layerscape maintainers. > > > > Tested on AmigaOne X5000/20 and X5000/40 Contains code by Rob Herring > > (in fsl-mph-dr-of.c) > > Thanks for fixing. > > Acked-by: Rob Herring <robh@kernel.org> Okay for me too. Acked-by: Alan Stern <stern@rowland.harvard.edu>
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 385be30..896c0d1 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -76,14 +76,9 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev) return -ENODEV; } - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!res) { - dev_err(&pdev->dev, - "Found HC with no IRQ. Check %s setup!\n", - dev_name(&pdev->dev)); - return -ENODEV; - } - irq = res->start; + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; hcd = __usb_create_hcd(&fsl_ehci_hc_driver, pdev->dev.parent, &pdev->dev, dev_name(&pdev->dev), NULL); diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index 44a7e58..e5df175 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -112,6 +112,9 @@ static struct platform_device *fsl_usb2_device_register( goto error; } + pdev->dev.of_node = ofdev->dev.of_node; + pdev->dev.of_node_reused = true; + retval = platform_device_add(pdev); if (retval) goto error;
In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT core) we stopped platform_get_resource() from returning the IRQ, as all drivers were supposed to have switched to platform_get_irq() Unfortunately the Freescale EHCI driver in host mode got missed. Fix it. Fixes: a1a2b7125e10 (Drop static setup of IRQ resource from DT core) Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de> Suggested-by: Rob Herring <robh@kernel.org> Signed-off-by: Darren Stevens <darren@stevens-zone.net> --- v3 - Corrected resource allocation in fsl-mph-dr-of.c v2 - Fixed coding style, removed a couple of unneeded initializations, cc'd Layerscape maintainers. Tested on AmigaOne X5000/20 and X5000/40 Contains code by Rob Herring (in fsl-mph-dr-of.c)