* [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers
@ 2021-08-08 20:30 Sergey Shtylyov
2021-08-08 20:37 ` Sergey Shtylyov
` (4 more replies)
0 siblings, 5 replies; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 20:30 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Here are 9 patches against the 'usb-linus' branch of GregKH's 'usb.git' repo.
The affected drivers call platform_get_irq() but largely ignore its result --
they blithely pass the negative error codes to request_irq() (and its ilk)
which expects *unsinged* IRQ #s. Stop doing that by checking what exactly
platform_get_irq() returns.
[1/9] usb: dwc3: meson-g12a: add IRQ check
[2/9] usb: dwc3: qcom: add IRQ check
[3/61] usb: gadget: udc: at91: add IRQ check
[4/9] usb: gadget: udc: s3c2410: add IRQ check
[5/9] usb: host: ohci-tmio: add IRQ check
[6/9] usb: misc: brcmstb-usb-pinmap: add IRQ check
[7/9] usb: phy: fsl-usb: add IRQ check
[8/9] usb: phy: tahvo: add IRQ check
[9/9] usb: phy: twl6030: add IRQ checks
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check
2021-08-08 20:30 [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers Sergey Shtylyov
2021-08-08 20:37 ` Sergey Shtylyov
@ 2021-08-08 20:37 ` Sergey Shtylyov
2021-08-08 20:45 ` Sergey Shtylyov
` (2 subsequent siblings)
4 siblings, 0 replies; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 20:37 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-arm-kernel, linux-amlogic
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_threaded_irq()
(which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
an original error code. Stop calling devm_request_threaded_irq() with the
invalid IRQ #s.
Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
drivers/usb/dwc3/dwc3-meson-g12a.c | 2 ++
1 file changed, 2 insertions(+)
Index: usb/drivers/usb/dwc3/dwc3-meson-g12a.c
===================================================================
--- usb.orig/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ usb/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -598,6 +598,8 @@ static int dwc3_meson_g12a_otg_init(stru
USB_R5_ID_DIG_IRQ, 0);
irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
dwc3_meson_g12a_irq_thread,
IRQF_ONESHOT, pdev->name, priv);
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check
@ 2021-08-08 20:37 ` Sergey Shtylyov
0 siblings, 0 replies; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 20:37 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-arm-kernel, linux-amlogic
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_threaded_irq()
(which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
an original error code. Stop calling devm_request_threaded_irq() with the
invalid IRQ #s.
Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
drivers/usb/dwc3/dwc3-meson-g12a.c | 2 ++
1 file changed, 2 insertions(+)
Index: usb/drivers/usb/dwc3/dwc3-meson-g12a.c
===================================================================
--- usb.orig/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ usb/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -598,6 +598,8 @@ static int dwc3_meson_g12a_otg_init(stru
USB_R5_ID_DIG_IRQ, 0);
irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
dwc3_meson_g12a_irq_thread,
IRQF_ONESHOT, pdev->name, priv);
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check
@ 2021-08-08 20:37 ` Sergey Shtylyov
0 siblings, 0 replies; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 20:37 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-arm-kernel, linux-amlogic
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_threaded_irq()
(which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
an original error code. Stop calling devm_request_threaded_irq() with the
invalid IRQ #s.
Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
drivers/usb/dwc3/dwc3-meson-g12a.c | 2 ++
1 file changed, 2 insertions(+)
Index: usb/drivers/usb/dwc3/dwc3-meson-g12a.c
===================================================================
--- usb.orig/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ usb/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -598,6 +598,8 @@ static int dwc3_meson_g12a_otg_init(stru
USB_R5_ID_DIG_IRQ, 0);
irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
dwc3_meson_g12a_irq_thread,
IRQF_ONESHOT, pdev->name, priv);
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 2/9] usb: dwc3: qcom: add IRQ check
2021-08-08 20:30 [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers Sergey Shtylyov
2021-08-08 20:37 ` Sergey Shtylyov
@ 2021-08-08 20:41 ` Sergey Shtylyov
2021-08-09 10:07 ` Felipe Balbi
2021-08-08 20:45 ` Sergey Shtylyov
` (2 subsequent siblings)
4 siblings, 1 reply; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 20:41 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Cc: Andy Gross, Bjorn Andersson, linux-arm-msm
In dwc3_qcom_acpi_register_core(), the driver neglects to check the result
of platform_get_irq()'s call and blithely assigns the negative error codes
to the allocated child device's IRQ resource and then passing this resource
to platform_device_add_resources() and later causing dwc3_otg_get_irq() to
fail anyway. Stop calling platform_device_add_resources() with the invalid
IRQ #s, so that there's less complexity in the IRQ error checking.
Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
drivers/usb/dwc3/dwc3-qcom.c | 4 ++++
1 file changed, 4 insertions(+)
Index: usb/drivers/usb/dwc3/dwc3-qcom.c
===================================================================
--- usb.orig/drivers/usb/dwc3/dwc3-qcom.c
+++ usb/drivers/usb/dwc3/dwc3-qcom.c
@@ -614,6 +614,10 @@ static int dwc3_qcom_acpi_register_core(
qcom->acpi_pdata->dwc3_core_base_size;
irq = platform_get_irq(pdev_irq, 0);
+ if (irq < 0) {
+ ret = irq;
+ goto out;
+ }
child_res[1].flags = IORESOURCE_IRQ;
child_res[1].start = child_res[1].end = irq;
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 3/9] usb: gadget: udc: at91: add IRQ check
2021-08-08 20:30 [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers Sergey Shtylyov
@ 2021-08-08 20:45 ` Sergey Shtylyov
2021-08-08 20:41 ` [PATCH 2/9] usb: dwc3: qcom: " Sergey Shtylyov
` (3 subsequent siblings)
4 siblings, 0 replies; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 20:45 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Cc: Nicolas Ferre, Alexandre Belloni, Ludovic Desroches, linux-arm-kernel
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
error code. Stop calling devm_request_irq() with the invalid IRQ #s.
Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
drivers/usb/gadget/udc/at91_udc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: usb/drivers/usb/gadget/udc/at91_udc.c
===================================================================
--- usb.orig/drivers/usb/gadget/udc/at91_udc.c
+++ usb/drivers/usb/gadget/udc/at91_udc.c
@@ -1876,7 +1876,9 @@ static int at91udc_probe(struct platform
clk_disable(udc->iclk);
/* request UDC and maybe VBUS irqs */
- udc->udp_irq = platform_get_irq(pdev, 0);
+ udc->udp_irq = retval = platform_get_irq(pdev, 0);
+ if (retval < 0)
+ goto err_unprepare_iclk;
retval = devm_request_irq(dev, udc->udp_irq, at91_udc_irq, 0,
driver_name, udc);
if (retval) {
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 3/9] usb: gadget: udc: at91: add IRQ check
@ 2021-08-08 20:45 ` Sergey Shtylyov
0 siblings, 0 replies; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 20:45 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Cc: Alexandre Belloni, Ludovic Desroches, linux-arm-kernel
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
error code. Stop calling devm_request_irq() with the invalid IRQ #s.
Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
drivers/usb/gadget/udc/at91_udc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: usb/drivers/usb/gadget/udc/at91_udc.c
===================================================================
--- usb.orig/drivers/usb/gadget/udc/at91_udc.c
+++ usb/drivers/usb/gadget/udc/at91_udc.c
@@ -1876,7 +1876,9 @@ static int at91udc_probe(struct platform
clk_disable(udc->iclk);
/* request UDC and maybe VBUS irqs */
- udc->udp_irq = platform_get_irq(pdev, 0);
+ udc->udp_irq = retval = platform_get_irq(pdev, 0);
+ if (retval < 0)
+ goto err_unprepare_iclk;
retval = devm_request_irq(dev, udc->udp_irq, at91_udc_irq, 0,
driver_name, udc);
if (retval) {
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check
2021-08-08 20:37 ` Sergey Shtylyov
(?)
@ 2021-08-08 20:50 ` Martin Blumenstingl
-1 siblings, 0 replies; 24+ messages in thread
From: Martin Blumenstingl @ 2021-08-08 20:50 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-usb, Greg Kroah-Hartman, Felipe Balbi, Neil Armstrong,
Kevin Hilman, Jerome Brunet, linux-arm-kernel, linux-amlogic
Hi Sergey,
On Sun, Aug 8, 2021 at 10:37 PM Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
>
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to devm_request_threaded_irq()
> (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
> an original error code. Stop calling devm_request_threaded_irq() with the
> invalid IRQ #s.
>
> Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Thanks for spotting and fixing this issue!
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check
@ 2021-08-08 20:50 ` Martin Blumenstingl
0 siblings, 0 replies; 24+ messages in thread
From: Martin Blumenstingl @ 2021-08-08 20:50 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-usb, Greg Kroah-Hartman, Felipe Balbi, Neil Armstrong,
Kevin Hilman, Jerome Brunet, linux-arm-kernel, linux-amlogic
Hi Sergey,
On Sun, Aug 8, 2021 at 10:37 PM Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
>
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to devm_request_threaded_irq()
> (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
> an original error code. Stop calling devm_request_threaded_irq() with the
> invalid IRQ #s.
>
> Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Thanks for spotting and fixing this issue!
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check
@ 2021-08-08 20:50 ` Martin Blumenstingl
0 siblings, 0 replies; 24+ messages in thread
From: Martin Blumenstingl @ 2021-08-08 20:50 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-usb, Greg Kroah-Hartman, Felipe Balbi, Neil Armstrong,
Kevin Hilman, Jerome Brunet, linux-arm-kernel, linux-amlogic
Hi Sergey,
On Sun, Aug 8, 2021 at 10:37 PM Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
>
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to devm_request_threaded_irq()
> (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
> an original error code. Stop calling devm_request_threaded_irq() with the
> invalid IRQ #s.
>
> Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Thanks for spotting and fixing this issue!
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 4/9] usb: gadget: udc: s3c2410: add IRQ check
2021-08-08 20:30 [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers Sergey Shtylyov
@ 2021-08-08 20:57 ` Sergey Shtylyov
2021-08-08 20:41 ` [PATCH 2/9] usb: dwc3: qcom: " Sergey Shtylyov
` (3 subsequent siblings)
4 siblings, 0 replies; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 20:57 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Cc: Krzysztof Kozlowski, linux-arm-kernel, linux-samsung-soc
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
error code. Stop calling devm_request_irq() with the invalid IRQ #s.
Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
drivers/usb/gadget/udc/at91_udc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: usb/drivers/usb/gadget/udc/at91_udc.c
===================================================================
--- usb.orig/drivers/usb/gadget/udc/at91_udc.c
+++ usb/drivers/usb/gadget/udc/at91_udc.c
@@ -1876,7 +1876,9 @@ static int at91udc_probe(struct platform
clk_disable(udc->iclk);
/* request UDC and maybe VBUS irqs */
- udc->udp_irq = platform_get_irq(pdev, 0);
+ udc->udp_irq = retval = platform_get_irq(pdev, 0);
+ if (retval < 0)
+ goto err_unprepare_iclk;
retval = devm_request_irq(dev, udc->udp_irq, at91_udc_irq, 0,
driver_name, udc);
if (retval) {
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 4/9] usb: gadget: udc: s3c2410: add IRQ check
@ 2021-08-08 20:57 ` Sergey Shtylyov
0 siblings, 0 replies; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 20:57 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Cc: Krzysztof Kozlowski, linux-arm-kernel, linux-samsung-soc
The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
error code. Stop calling devm_request_irq() with the invalid IRQ #s.
Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
drivers/usb/gadget/udc/at91_udc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: usb/drivers/usb/gadget/udc/at91_udc.c
===================================================================
--- usb.orig/drivers/usb/gadget/udc/at91_udc.c
+++ usb/drivers/usb/gadget/udc/at91_udc.c
@@ -1876,7 +1876,9 @@ static int at91udc_probe(struct platform
clk_disable(udc->iclk);
/* request UDC and maybe VBUS irqs */
- udc->udp_irq = platform_get_irq(pdev, 0);
+ udc->udp_irq = retval = platform_get_irq(pdev, 0);
+ if (retval < 0)
+ goto err_unprepare_iclk;
retval = devm_request_irq(dev, udc->udp_irq, at91_udc_irq, 0,
driver_name, udc);
if (retval) {
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 4/9] usb: gadget: udc: s3c2410: add IRQ check
2021-08-08 20:57 ` Sergey Shtylyov
@ 2021-08-08 21:01 ` Sergey Shtylyov
-1 siblings, 0 replies; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 21:01 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Cc: Krzysztof Kozlowski, linux-arm-kernel, linux-samsung-soc
Oops, duplicate patch. Scratch the series, I'm going to restart posting tomorrow... :-)
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 4/9] usb: gadget: udc: s3c2410: add IRQ check
@ 2021-08-08 21:01 ` Sergey Shtylyov
0 siblings, 0 replies; 24+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 21:01 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
Cc: Krzysztof Kozlowski, linux-arm-kernel, linux-samsung-soc
Oops, duplicate patch. Scratch the series, I'm going to restart posting tomorrow... :-)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 2/9] usb: dwc3: qcom: add IRQ check
2021-08-08 20:41 ` [PATCH 2/9] usb: dwc3: qcom: " Sergey Shtylyov
@ 2021-08-09 10:07 ` Felipe Balbi
0 siblings, 0 replies; 24+ messages in thread
From: Felipe Balbi @ 2021-08-09 10:07 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-usb, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
linux-arm-msm
Sergey Shtylyov <s.shtylyov@omp.ru> writes:
> In dwc3_qcom_acpi_register_core(), the driver neglects to check the result
> of platform_get_irq()'s call and blithely assigns the negative error codes
> to the allocated child device's IRQ resource and then passing this resource
> to platform_device_add_resources() and later causing dwc3_otg_get_irq() to
> fail anyway. Stop calling platform_device_add_resources() with the invalid
> IRQ #s, so that there's less complexity in the IRQ error checking.
>
> Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 3/9] usb: gadget: udc: at91: add IRQ check
2021-08-08 20:45 ` Sergey Shtylyov
@ 2021-08-09 10:07 ` Felipe Balbi
-1 siblings, 0 replies; 24+ messages in thread
From: Felipe Balbi @ 2021-08-09 10:07 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-usb, Greg Kroah-Hartman, Nicolas Ferre, Alexandre Belloni,
Ludovic Desroches, linux-arm-kernel
Sergey Shtylyov <s.shtylyov@omp.ru> writes:
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to devm_request_irq() (which takes
> *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
> error code. Stop calling devm_request_irq() with the invalid IRQ #s.
>
> Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
>
> ---
> drivers/usb/gadget/udc/at91_udc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> Index: usb/drivers/usb/gadget/udc/at91_udc.c
> ===================================================================
> --- usb.orig/drivers/usb/gadget/udc/at91_udc.c
> +++ usb/drivers/usb/gadget/udc/at91_udc.c
> @@ -1876,7 +1876,9 @@ static int at91udc_probe(struct platform
> clk_disable(udc->iclk);
>
> /* request UDC and maybe VBUS irqs */
> - udc->udp_irq = platform_get_irq(pdev, 0);
> + udc->udp_irq = retval = platform_get_irq(pdev, 0);
> + if (retval < 0)
> + goto err_unprepare_iclk;
let's avoid multiple assignments in one line. How about:
if (udc->udp_irq < 0) {
retval = udc->udp_irq;
goto err_unprepare_iclk;
}
--
balbi
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 3/9] usb: gadget: udc: at91: add IRQ check
@ 2021-08-09 10:07 ` Felipe Balbi
0 siblings, 0 replies; 24+ messages in thread
From: Felipe Balbi @ 2021-08-09 10:07 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: Alexandre Belloni, Greg Kroah-Hartman, linux-usb,
Ludovic Desroches, linux-arm-kernel
Sergey Shtylyov <s.shtylyov@omp.ru> writes:
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to devm_request_irq() (which takes
> *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
> error code. Stop calling devm_request_irq() with the invalid IRQ #s.
>
> Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
>
> ---
> drivers/usb/gadget/udc/at91_udc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> Index: usb/drivers/usb/gadget/udc/at91_udc.c
> ===================================================================
> --- usb.orig/drivers/usb/gadget/udc/at91_udc.c
> +++ usb/drivers/usb/gadget/udc/at91_udc.c
> @@ -1876,7 +1876,9 @@ static int at91udc_probe(struct platform
> clk_disable(udc->iclk);
>
> /* request UDC and maybe VBUS irqs */
> - udc->udp_irq = platform_get_irq(pdev, 0);
> + udc->udp_irq = retval = platform_get_irq(pdev, 0);
> + if (retval < 0)
> + goto err_unprepare_iclk;
let's avoid multiple assignments in one line. How about:
if (udc->udp_irq < 0) {
retval = udc->udp_irq;
goto err_unprepare_iclk;
}
--
balbi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check
2021-08-08 20:37 ` Sergey Shtylyov
(?)
@ 2021-08-09 10:08 ` Felipe Balbi
-1 siblings, 0 replies; 24+ messages in thread
From: Felipe Balbi @ 2021-08-09 10:08 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-usb, Greg Kroah-Hartman, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, linux-arm-kernel,
linux-amlogic
Sergey Shtylyov <s.shtylyov@omp.ru> writes:
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to devm_request_threaded_irq()
> (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
> an original error code. Stop calling devm_request_threaded_irq() with the
> invalid IRQ #s.
>
> Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check
@ 2021-08-09 10:08 ` Felipe Balbi
0 siblings, 0 replies; 24+ messages in thread
From: Felipe Balbi @ 2021-08-09 10:08 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-usb, Greg Kroah-Hartman, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, linux-arm-kernel,
linux-amlogic
Sergey Shtylyov <s.shtylyov@omp.ru> writes:
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to devm_request_threaded_irq()
> (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
> an original error code. Stop calling devm_request_threaded_irq() with the
> invalid IRQ #s.
>
> Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check
@ 2021-08-09 10:08 ` Felipe Balbi
0 siblings, 0 replies; 24+ messages in thread
From: Felipe Balbi @ 2021-08-09 10:08 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-usb, Greg Kroah-Hartman, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, linux-arm-kernel,
linux-amlogic
Sergey Shtylyov <s.shtylyov@omp.ru> writes:
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to devm_request_threaded_irq()
> (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
> an original error code. Stop calling devm_request_threaded_irq() with the
> invalid IRQ #s.
>
> Fixes: f90db10779ad ("usb: dwc3: meson-g12a: Add support for IRQ based OTG switching")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 4/9] usb: gadget: udc: s3c2410: add IRQ check
2021-08-08 20:57 ` Sergey Shtylyov
@ 2021-08-09 10:09 ` Felipe Balbi
-1 siblings, 0 replies; 24+ messages in thread
From: Felipe Balbi @ 2021-08-09 10:09 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-usb, Greg Kroah-Hartman, Krzysztof Kozlowski,
linux-arm-kernel, linux-samsung-soc
Sergey Shtylyov <s.shtylyov@omp.ru> writes:
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to devm_request_irq() (which takes
> *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
> error code. Stop calling devm_request_irq() with the invalid IRQ #s.
>
> Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 4/9] usb: gadget: udc: s3c2410: add IRQ check
@ 2021-08-09 10:09 ` Felipe Balbi
0 siblings, 0 replies; 24+ messages in thread
From: Felipe Balbi @ 2021-08-09 10:09 UTC (permalink / raw)
To: Sergey Shtylyov
Cc: linux-usb, Greg Kroah-Hartman, Krzysztof Kozlowski,
linux-arm-kernel, linux-samsung-soc
Sergey Shtylyov <s.shtylyov@omp.ru> writes:
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to devm_request_irq() (which takes
> *unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
> error code. Stop calling devm_request_irq() with the invalid IRQ #s.
>
> Fixes: 8b2e76687b39 ("USB: AT91 UDC updates, mostly power management")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers
2021-08-08 20:30 [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers Sergey Shtylyov
` (3 preceding siblings ...)
2021-08-08 20:57 ` Sergey Shtylyov
@ 2021-08-13 6:58 ` Greg Kroah-Hartman
2021-08-13 7:01 ` Greg Kroah-Hartman
4 siblings, 1 reply; 24+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-13 6:58 UTC (permalink / raw)
To: Sergey Shtylyov; +Cc: linux-usb, Felipe Balbi
On Sun, Aug 08, 2021 at 11:30:57PM +0300, Sergey Shtylyov wrote:
> Here are 9 patches against the 'usb-linus' branch of GregKH's 'usb.git' repo.
> The affected drivers call platform_get_irq() but largely ignore its result --
> they blithely pass the negative error codes to request_irq() (and its ilk)
> which expects *unsinged* IRQ #s. Stop doing that by checking what exactly
> platform_get_irq() returns.
>
> [1/9] usb: dwc3: meson-g12a: add IRQ check
> [2/9] usb: dwc3: qcom: add IRQ check
> [3/61] usb: gadget: udc: at91: add IRQ check
61?
> [4/9] usb: gadget: udc: s3c2410: add IRQ check
> [5/9] usb: host: ohci-tmio: add IRQ check
> [6/9] usb: misc: brcmstb-usb-pinmap: add IRQ check
> [7/9] usb: phy: fsl-usb: add IRQ check
> [8/9] usb: phy: tahvo: add IRQ check
> [9/9] usb: phy: twl6030: add IRQ checks
I only see 4 patches in this series, and the 4th, did not apply to my
tree :(
Can you please fix this up and resend it correctly?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers
2021-08-13 6:58 ` [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers Greg Kroah-Hartman
@ 2021-08-13 7:01 ` Greg Kroah-Hartman
0 siblings, 0 replies; 24+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-13 7:01 UTC (permalink / raw)
To: Sergey Shtylyov; +Cc: linux-usb, Felipe Balbi
On Fri, Aug 13, 2021 at 08:58:58AM +0200, Greg Kroah-Hartman wrote:
> On Sun, Aug 08, 2021 at 11:30:57PM +0300, Sergey Shtylyov wrote:
> > Here are 9 patches against the 'usb-linus' branch of GregKH's 'usb.git' repo.
> > The affected drivers call platform_get_irq() but largely ignore its result --
> > they blithely pass the negative error codes to request_irq() (and its ilk)
> > which expects *unsinged* IRQ #s. Stop doing that by checking what exactly
> > platform_get_irq() returns.
> >
> > [1/9] usb: dwc3: meson-g12a: add IRQ check
> > [2/9] usb: dwc3: qcom: add IRQ check
> > [3/61] usb: gadget: udc: at91: add IRQ check
>
> 61?
>
> > [4/9] usb: gadget: udc: s3c2410: add IRQ check
> > [5/9] usb: host: ohci-tmio: add IRQ check
> > [6/9] usb: misc: brcmstb-usb-pinmap: add IRQ check
> > [7/9] usb: phy: fsl-usb: add IRQ check
> > [8/9] usb: phy: tahvo: add IRQ check
> > [9/9] usb: phy: twl6030: add IRQ checks
>
>
> I only see 4 patches in this series, and the 4th, did not apply to my
> tree :(
>
> Can you please fix this up and resend it correctly?
Ah, see your v2 now...
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2021-08-13 7:01 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-08 20:30 [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers Sergey Shtylyov
2021-08-08 20:37 ` [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check Sergey Shtylyov
2021-08-08 20:37 ` Sergey Shtylyov
2021-08-08 20:37 ` Sergey Shtylyov
2021-08-08 20:50 ` Martin Blumenstingl
2021-08-08 20:50 ` Martin Blumenstingl
2021-08-08 20:50 ` Martin Blumenstingl
2021-08-09 10:08 ` Felipe Balbi
2021-08-09 10:08 ` Felipe Balbi
2021-08-09 10:08 ` Felipe Balbi
2021-08-08 20:41 ` [PATCH 2/9] usb: dwc3: qcom: " Sergey Shtylyov
2021-08-09 10:07 ` Felipe Balbi
2021-08-08 20:45 ` [PATCH 3/9] usb: gadget: udc: at91: " Sergey Shtylyov
2021-08-08 20:45 ` Sergey Shtylyov
2021-08-09 10:07 ` Felipe Balbi
2021-08-09 10:07 ` Felipe Balbi
2021-08-08 20:57 ` [PATCH 4/9] usb: gadget: udc: s3c2410: " Sergey Shtylyov
2021-08-08 20:57 ` Sergey Shtylyov
2021-08-08 21:01 ` Sergey Shtylyov
2021-08-08 21:01 ` Sergey Shtylyov
2021-08-09 10:09 ` Felipe Balbi
2021-08-09 10:09 ` Felipe Balbi
2021-08-13 6:58 ` [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers Greg Kroah-Hartman
2021-08-13 7:01 ` Greg Kroah-Hartman
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.