linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Propagate errors from platform_get_irq() in the USB drivers
@ 2021-12-14 20:42 Sergey Shtylyov
  2021-12-14 20:42 ` [PATCH 1/4] usb: gadget: udc: bcm63xx: propagate errors from platform_get_irq() Sergey Shtylyov
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Sergey Shtylyov @ 2021-12-14 20:42 UTC (permalink / raw)
  To: linux-usb, Greg Kroah-Hartman, Felipe Balbi, Alan Stern

Here are 4 patches against the 'usb-next' branch of Greg KH's 'usb.git' repo.
The affected host/gadget drivers call platform_get_irq() but override its
result in case of error. Switch them to propagating the error codes upstream.
The patche #3 depends on the previously posted patch:

https://marc.info/?l=linux-kernel&m=163623041902285

Sergey Shtylyov (4):
  usb: gadget: udc: bcm63xx: propagate errors from platform_get_irq()
  usb: gadget: udc: pxa25x: propagate errors from platform_get_irq()
  usb: host: ehci-sh: propagate errors from platform_get_irq()
  usb: host: ohci-omap: propagate errors from platform_get_irq()

 drivers/usb/gadget/udc/bcm63xx_udc.c | 8 ++++++--
 drivers/usb/gadget/udc/pxa25x_udc.c  | 2 +-
 drivers/usb/host/ehci-sh.c           | 4 ++--
 drivers/usb/host/ohci-omap.c         | 2 +-
 4 files changed, 10 insertions(+), 6 deletions(-)

-- 
2.26.3


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

* [PATCH 1/4] usb: gadget: udc: bcm63xx: propagate errors from platform_get_irq()
  2021-12-14 20:42 [PATCH 0/4] Propagate errors from platform_get_irq() in the USB drivers Sergey Shtylyov
@ 2021-12-14 20:42 ` Sergey Shtylyov
  2021-12-16  3:48   ` Florian Fainelli
  2021-12-14 20:42 ` [PATCH 2/4] usb: gadget: udc: pxa25x: " Sergey Shtylyov
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Sergey Shtylyov @ 2021-12-14 20:42 UTC (permalink / raw)
  To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
  Cc: Kevin Cernekee, Florian Fainelli, bcm-kernel-feedback-list,
	linux-arm-kernel

The driver overrides the error codes returned by platform_get_irq() to
-ENXIO for some strange reason.  Switch to propagating the error codes
upstream.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/usb/gadget/udc/bcm63xx_udc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c
index a9f07c59fc37..2cdb07905bde 100644
--- a/drivers/usb/gadget/udc/bcm63xx_udc.c
+++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
@@ -2321,8 +2321,10 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
 
 	/* IRQ resource #0: control interrupt (VBUS, speed, etc.) */
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0)
+	if (irq < 0) {
+		rc = irq;
 		goto out_uninit;
+	}
 	if (devm_request_irq(dev, irq, &bcm63xx_udc_ctrl_isr, 0,
 			     dev_name(dev), udc) < 0)
 		goto report_request_failure;
@@ -2330,8 +2332,10 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
 	/* IRQ resources #1-6: data interrupts for IUDMA channels 0-5 */
 	for (i = 0; i < BCM63XX_NUM_IUDMA; i++) {
 		irq = platform_get_irq(pdev, i + 1);
-		if (irq < 0)
+		if (irq < 0) {
+			rc = irq;
 			goto out_uninit;
+		}
 		if (devm_request_irq(dev, irq, &bcm63xx_udc_data_isr, 0,
 				     dev_name(dev), &udc->iudma[i]) < 0)
 			goto report_request_failure;
-- 
2.26.3


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

* [PATCH 2/4] usb: gadget: udc: pxa25x: propagate errors from platform_get_irq()
  2021-12-14 20:42 [PATCH 0/4] Propagate errors from platform_get_irq() in the USB drivers Sergey Shtylyov
  2021-12-14 20:42 ` [PATCH 1/4] usb: gadget: udc: bcm63xx: propagate errors from platform_get_irq() Sergey Shtylyov
@ 2021-12-14 20:42 ` Sergey Shtylyov
  2021-12-17 10:32   ` Daniel Mack
  2021-12-14 20:42 ` [PATCH 3/4] usb: host: ehci-sh: " Sergey Shtylyov
  2021-12-14 20:42 ` [PATCH 4/4] usb: host: ohci-omap: " Sergey Shtylyov
  3 siblings, 1 reply; 10+ messages in thread
From: Sergey Shtylyov @ 2021-12-14 20:42 UTC (permalink / raw)
  To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
  Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, linux-arm-kernel

The driver overrides the error codes returned by platform_get_irq() to
-ENODEV for some strange reason.  Switch to propagating the error codes
upstream.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/usb/gadget/udc/pxa25x_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
index 52cdfd8212d6..b38747fd3bb0 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -2364,7 +2364,7 @@ static int pxa25x_udc_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
-		return -ENODEV;
+		return irq;
 
 	dev->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(dev->regs))
-- 
2.26.3


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

* [PATCH 3/4] usb: host: ehci-sh: propagate errors from platform_get_irq()
  2021-12-14 20:42 [PATCH 0/4] Propagate errors from platform_get_irq() in the USB drivers Sergey Shtylyov
  2021-12-14 20:42 ` [PATCH 1/4] usb: gadget: udc: bcm63xx: propagate errors from platform_get_irq() Sergey Shtylyov
  2021-12-14 20:42 ` [PATCH 2/4] usb: gadget: udc: pxa25x: " Sergey Shtylyov
@ 2021-12-14 20:42 ` Sergey Shtylyov
  2021-12-14 21:04   ` Alan Stern
  2021-12-14 20:42 ` [PATCH 4/4] usb: host: ohci-omap: " Sergey Shtylyov
  3 siblings, 1 reply; 10+ messages in thread
From: Sergey Shtylyov @ 2021-12-14 20:42 UTC (permalink / raw)
  To: linux-usb, Greg Kroah-Hartman, Alan Stern

The driver overrides the error codes and IRQ0 returned by platform_get_irq()
to -ENODEV.  Switch to propagating the error codes upstream.  IRQ0 is no
longer returned by platform_get_irq(), so we now can safely ignore it...

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/usb/host/ehci-sh.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c
index c25c51d26f26..882231b5c382 100644
--- a/drivers/usb/host/ehci-sh.c
+++ b/drivers/usb/host/ehci-sh.c
@@ -82,8 +82,8 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		ret = -ENODEV;
+	if (irq < 0) {
+		ret = irq;
 		goto fail_create_hcd;
 	}
 
-- 
2.26.3


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

* [PATCH 4/4] usb: host: ohci-omap: propagate errors from platform_get_irq()
  2021-12-14 20:42 [PATCH 0/4] Propagate errors from platform_get_irq() in the USB drivers Sergey Shtylyov
                   ` (2 preceding siblings ...)
  2021-12-14 20:42 ` [PATCH 3/4] usb: host: ehci-sh: " Sergey Shtylyov
@ 2021-12-14 20:42 ` Sergey Shtylyov
  2021-12-14 21:04   ` Alan Stern
  3 siblings, 1 reply; 10+ messages in thread
From: Sergey Shtylyov @ 2021-12-14 20:42 UTC (permalink / raw)
  To: linux-usb, Greg Kroah-Hartman, Alan Stern; +Cc: linux-omap

The driver overrides the error codes returned by platform_get_irq() to
-ENXIO for some strange reason.  Switch to propagating the error codes
upstream.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/usb/host/ohci-omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index ded9738392e4..45dcf8292072 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -306,7 +306,7 @@ static int ohci_hcd_omap_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		retval = -ENXIO;
+		retval = irq;
 		goto err3;
 	}
 	retval = usb_add_hcd(hcd, irq, 0);
-- 
2.26.3


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

* Re: [PATCH 3/4] usb: host: ehci-sh: propagate errors from platform_get_irq()
  2021-12-14 20:42 ` [PATCH 3/4] usb: host: ehci-sh: " Sergey Shtylyov
@ 2021-12-14 21:04   ` Alan Stern
  0 siblings, 0 replies; 10+ messages in thread
From: Alan Stern @ 2021-12-14 21:04 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: linux-usb, Greg Kroah-Hartman

On Tue, Dec 14, 2021 at 11:42:46PM +0300, Sergey Shtylyov wrote:
> The driver overrides the error codes and IRQ0 returned by platform_get_irq()
> to -ENODEV.  Switch to propagating the error codes upstream.  IRQ0 is no
> longer returned by platform_get_irq(), so we now can safely ignore it...
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> ---

Acked-by: Alan Stern <stern@rowland.harvard.edu>

>  drivers/usb/host/ehci-sh.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c
> index c25c51d26f26..882231b5c382 100644
> --- a/drivers/usb/host/ehci-sh.c
> +++ b/drivers/usb/host/ehci-sh.c
> @@ -82,8 +82,8 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
>  		return -ENODEV;
>  
>  	irq = platform_get_irq(pdev, 0);
> -	if (irq <= 0) {
> -		ret = -ENODEV;
> +	if (irq < 0) {
> +		ret = irq;
>  		goto fail_create_hcd;
>  	}
>  
> -- 
> 2.26.3
> 

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

* Re: [PATCH 4/4] usb: host: ohci-omap: propagate errors from platform_get_irq()
  2021-12-14 20:42 ` [PATCH 4/4] usb: host: ohci-omap: " Sergey Shtylyov
@ 2021-12-14 21:04   ` Alan Stern
  0 siblings, 0 replies; 10+ messages in thread
From: Alan Stern @ 2021-12-14 21:04 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: linux-usb, Greg Kroah-Hartman, linux-omap

On Tue, Dec 14, 2021 at 11:42:47PM +0300, Sergey Shtylyov wrote:
> The driver overrides the error codes returned by platform_get_irq() to
> -ENXIO for some strange reason.  Switch to propagating the error codes
> upstream.
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> ---

Acked-by: Alan Stern <stern@rowland.harvard.edu>

>  drivers/usb/host/ohci-omap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
> index ded9738392e4..45dcf8292072 100644
> --- a/drivers/usb/host/ohci-omap.c
> +++ b/drivers/usb/host/ohci-omap.c
> @@ -306,7 +306,7 @@ static int ohci_hcd_omap_probe(struct platform_device *pdev)
>  
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0) {
> -		retval = -ENXIO;
> +		retval = irq;
>  		goto err3;
>  	}
>  	retval = usb_add_hcd(hcd, irq, 0);
> -- 
> 2.26.3
> 

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

* Re: [PATCH 1/4] usb: gadget: udc: bcm63xx: propagate errors from platform_get_irq()
  2021-12-14 20:42 ` [PATCH 1/4] usb: gadget: udc: bcm63xx: propagate errors from platform_get_irq() Sergey Shtylyov
@ 2021-12-16  3:48   ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2021-12-16  3:48 UTC (permalink / raw)
  To: Sergey Shtylyov, linux-usb, Greg Kroah-Hartman, Felipe Balbi
  Cc: Kevin Cernekee, Florian Fainelli, bcm-kernel-feedback-list,
	linux-arm-kernel



On 12/14/2021 12:42 PM, Sergey Shtylyov wrote:
> The driver overrides the error codes returned by platform_get_irq() to
> -ENXIO for some strange reason.  Switch to propagating the error codes
> upstream.
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH 2/4] usb: gadget: udc: pxa25x: propagate errors from platform_get_irq()
  2021-12-14 20:42 ` [PATCH 2/4] usb: gadget: udc: pxa25x: " Sergey Shtylyov
@ 2021-12-17 10:32   ` Daniel Mack
  2021-12-17 11:11     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Mack @ 2021-12-17 10:32 UTC (permalink / raw)
  To: Sergey Shtylyov, linux-usb, Greg Kroah-Hartman, Felipe Balbi
  Cc: Haojian Zhuang, Robert Jarzmik, linux-arm-kernel

On 12/14/21 21:42, Sergey Shtylyov wrote:
> The driver overrides the error codes returned by platform_get_irq() to
> -ENODEV for some strange reason.  Switch to propagating the error codes
> upstream.
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Acked-by: Daniel Mack <daniel@zonque.org>

Greg, could you take this through your tree?


Best,
Daniel



> ---
>  drivers/usb/gadget/udc/pxa25x_udc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
> index 52cdfd8212d6..b38747fd3bb0 100644
> --- a/drivers/usb/gadget/udc/pxa25x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa25x_udc.c
> @@ -2364,7 +2364,7 @@ static int pxa25x_udc_probe(struct platform_device *pdev)
>  
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0)
> -		return -ENODEV;
> +		return irq;
>  
>  	dev->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(dev->regs))
> 


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

* Re: [PATCH 2/4] usb: gadget: udc: pxa25x: propagate errors from platform_get_irq()
  2021-12-17 10:32   ` Daniel Mack
@ 2021-12-17 11:11     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2021-12-17 11:11 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Sergey Shtylyov, linux-usb, Felipe Balbi, Haojian Zhuang,
	Robert Jarzmik, linux-arm-kernel

On Fri, Dec 17, 2021 at 11:32:58AM +0100, Daniel Mack wrote:
> On 12/14/21 21:42, Sergey Shtylyov wrote:
> > The driver overrides the error codes returned by platform_get_irq() to
> > -ENODEV for some strange reason.  Switch to propagating the error codes
> > upstream.
> > 
> > Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> 
> Acked-by: Daniel Mack <daniel@zonque.org>
> 
> Greg, could you take this through your tree?

Will do, thanks!

greg k-h

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

end of thread, other threads:[~2021-12-17 11:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 20:42 [PATCH 0/4] Propagate errors from platform_get_irq() in the USB drivers Sergey Shtylyov
2021-12-14 20:42 ` [PATCH 1/4] usb: gadget: udc: bcm63xx: propagate errors from platform_get_irq() Sergey Shtylyov
2021-12-16  3:48   ` Florian Fainelli
2021-12-14 20:42 ` [PATCH 2/4] usb: gadget: udc: pxa25x: " Sergey Shtylyov
2021-12-17 10:32   ` Daniel Mack
2021-12-17 11:11     ` Greg Kroah-Hartman
2021-12-14 20:42 ` [PATCH 3/4] usb: host: ehci-sh: " Sergey Shtylyov
2021-12-14 21:04   ` Alan Stern
2021-12-14 20:42 ` [PATCH 4/4] usb: host: ohci-omap: " Sergey Shtylyov
2021-12-14 21:04   ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).