* [PATCH v2] usb: gadget: udc: renesas_usb3: Fix RZ/V2M {modprobe,bind} error
@ 2023-05-30 16:17 Biju Das
2023-05-31 7:22 ` Geert Uytterhoeven
0 siblings, 1 reply; 2+ messages in thread
From: Biju Das @ 2023-05-30 16:17 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Biju Das, Zheng Wang, Yoshihiro Shimoda, Krzysztof Kozlowski,
Wolfram Sang, linux-usb, Laurent Pinchart, Marc Zyngier,
Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc
Currently {modprobe, bind} after {rmmod, unbind} results in probe failure.
genirq: Flags mismatch irq 22. 00000004 (85070400.usb3drd) vs. 00000004 (85070400.usb3drd)
renesas_usb3: probe of 85070000.usb3peri failed with error -16
The reason is, it is trying to register an interrupt handler for the same
IRQ twice. The devm_request_irq() was called with the parent device.
So the interrupt handler won't be unregistered when the usb3-peri device
is unbound.
Fix this issue by replacing "parent dev"->"dev" as the irq resource
is managed by this driver.
Fixes: 9cad72dfc556 ("usb: gadget: Add support for RZ/V2M USB3DRD driver")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
* Added missing ')' at the end of the line for fixes tag.
* Updated commit description.
* Replaced "ddata->dev"->"&pdev->dev" for the devname parameter.
---
drivers/usb/gadget/udc/renesas_usb3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index aac8bc185afa..eb008e873361 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -2877,9 +2877,9 @@ static int renesas_usb3_probe(struct platform_device *pdev)
struct rzv2m_usb3drd *ddata = dev_get_drvdata(pdev->dev.parent);
usb3->drd_reg = ddata->reg;
- ret = devm_request_irq(ddata->dev, ddata->drd_irq,
+ ret = devm_request_irq(&pdev->dev, ddata->drd_irq,
renesas_usb3_otg_irq, 0,
- dev_name(ddata->dev), usb3);
+ dev_name(&pdev->dev), usb3);
if (ret < 0)
return ret;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] usb: gadget: udc: renesas_usb3: Fix RZ/V2M {modprobe,bind} error
2023-05-30 16:17 [PATCH v2] usb: gadget: udc: renesas_usb3: Fix RZ/V2M {modprobe,bind} error Biju Das
@ 2023-05-31 7:22 ` Geert Uytterhoeven
0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2023-05-31 7:22 UTC (permalink / raw)
To: Biju Das
Cc: Greg Kroah-Hartman, Zheng Wang, Yoshihiro Shimoda,
Krzysztof Kozlowski, Wolfram Sang, linux-usb, Laurent Pinchart,
Marc Zyngier, Prabhakar Mahadev Lad, linux-renesas-soc
On Tue, May 30, 2023 at 6:17 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Currently {modprobe, bind} after {rmmod, unbind} results in probe failure.
>
> genirq: Flags mismatch irq 22. 00000004 (85070400.usb3drd) vs. 00000004 (85070400.usb3drd)
> renesas_usb3: probe of 85070000.usb3peri failed with error -16
>
> The reason is, it is trying to register an interrupt handler for the same
> IRQ twice. The devm_request_irq() was called with the parent device.
> So the interrupt handler won't be unregistered when the usb3-peri device
> is unbound.
>
> Fix this issue by replacing "parent dev"->"dev" as the irq resource
> is managed by this driver.
>
> Fixes: 9cad72dfc556 ("usb: gadget: Add support for RZ/V2M USB3DRD driver")
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
> * Added missing ')' at the end of the line for fixes tag.
> * Updated commit description.
> * Replaced "ddata->dev"->"&pdev->dev" for the devname parameter.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-31 7:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 16:17 [PATCH v2] usb: gadget: udc: renesas_usb3: Fix RZ/V2M {modprobe,bind} error Biju Das
2023-05-31 7:22 ` Geert Uytterhoeven
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).