All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.
@ 2022-07-02 21:03 Darren Stevens
  2022-07-05 15:40   ` Christian Zigotzky
  2022-07-05 16:29   ` Rob Herring
  0 siblings, 2 replies; 7+ messages in thread
From: Darren Stevens @ 2022-07-02 21:03 UTC (permalink / raw)
  To: linuxppc-dev, oss, chzigotzky, robh, stern, linux-usb
  Cc: shawnguo, leoyang.li

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;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.
  2022-07-02 21:03 [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode Darren Stevens
@ 2022-07-05 15:40   ` Christian Zigotzky
  2022-07-05 16:29   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Christian Zigotzky @ 2022-07-05 15:40 UTC (permalink / raw)
  To: Darren Stevens, linuxppc-dev, oss, robh, stern, linux-usb
  Cc: Christian Zigotzky, shawnguo, mad skateman, R.T.Dickinson, leoyang.li

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.
@ 2022-07-05 15:40   ` Christian Zigotzky
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Zigotzky @ 2022-07-05 15:40 UTC (permalink / raw)
  To: Darren Stevens, linuxppc-dev, oss, robh, stern, linux-usb
  Cc: shawnguo, leoyang.li, R.T.Dickinson, mad skateman, Christian Zigotzky

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.
  2022-07-02 21:03 [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode Darren Stevens
@ 2022-07-05 16:29   ` Rob Herring
  2022-07-05 16:29   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2022-07-05 16:29 UTC (permalink / raw)
  To: Darren Stevens
  Cc: linuxppc-dev, Scott Wood, Christian Zigotzky, Alan Stern,
	Linux USB List, Shawn Guo, Yang-Leo Li

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>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.
@ 2022-07-05 16:29   ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2022-07-05 16:29 UTC (permalink / raw)
  To: Darren Stevens
  Cc: Shawn Guo, Linux USB List, Yang-Leo Li, Scott Wood, Alan Stern,
	Christian Zigotzky, linuxppc-dev

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>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.
  2022-07-05 16:29   ` Rob Herring
@ 2022-07-05 18:54     ` Alan Stern
  -1 siblings, 0 replies; 7+ messages in thread
From: Alan Stern @ 2022-07-05 18:54 UTC (permalink / raw)
  To: Greg KH, Rob Herring
  Cc: Darren Stevens, linuxppc-dev, Scott Wood, Christian Zigotzky,
	Linux USB List, Shawn Guo, Yang-Leo Li

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>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.
@ 2022-07-05 18:54     ` Alan Stern
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Stern @ 2022-07-05 18:54 UTC (permalink / raw)
  To: Greg KH, Rob Herring
  Cc: Darren Stevens, linuxppc-dev, Linux USB List, Yang-Leo Li,
	Scott Wood, Christian Zigotzky, Shawn Guo

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>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-05 19:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-02 21:03 [PATCH v3] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode Darren Stevens
2022-07-05 15:40 ` Christian Zigotzky
2022-07-05 15:40   ` Christian Zigotzky
2022-07-05 16:29 ` Rob Herring
2022-07-05 16:29   ` Rob Herring
2022-07-05 18:54   ` Alan Stern
2022-07-05 18:54     ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.