usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
Subsystems (3)
PATCH 1/1 usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
IRQ_NOAUTOEN can't be used with shared IRQs and Kernel now will triggers warning if it happns, since commit 04c848d39879 ("genirq: Warn when IRQ_NOAUTOEN is used with shared interrupts"). And this is the case for OMAP DWC 3 driver.
Hence, remove IRQ_NOAUTOEN flag and instead call disable_irq() before disabling PM runtime in probe error path handling.
--- drivers/usb/dwc3/dwc3-omap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/dwc3/dwc3-omap.c +1 -2
@@ -512,7 +512,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)/* check the DMA Status */ reg =dwc3_omap_readl (omap->base,USBOTGSS_SYSCONFIG ); -irq_set_status_flags (omap->irq,IRQ_NOAUTOEN ); ret =devm_request_threaded_irq (dev, omap->irq, dwc3_omap_interrupt, dwc3_omap_interrupt_thread,IRQF_SHARED ,"dwc3-omap" , omap);
@@ -533,10 +532,10 @@ static int dwc3_omap_probe(struct platform_device *pdev) }dwc3_omap_enable_irqs (omap); -enable_irq (omap->irq);return 0 ; err1: +disable_irq (omap->irq);pm_runtime_put_sync (dev);pm_runtime_disable (dev);
Signature · 6 lines
2.10.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Grygorii
IRQ_NOAUTOENcan't be used with shared IRQs and Kernel now will triggers warning if it happns, since commit04c848d39879("genirq: Warn whenIRQ_NOAUTOENis used with shared interrupts"). And this is the case for OMAP DWC 3 driver.Hence, remove
IRQ_NOAUTOENflag and instead calldisable_irq()before disabling PM runtime in probe error path handling.
Or, how about requesting the irq at the end of probe after extcon registration?
Quoted 32 lines
Fixes 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")Signed-off-by Grygorii Strashko <[email protected]>--- drivers/usb/dwc3/dwc3-omap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/usb/dwc3/dwc3-omap.c +1
-2@@ -512,7 +512,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)/* check the DMA Status */ reg =dwc3_omap_readl (omap->base,USBOTGSS_SYSCONFIG ); -irq_set_status_flags (omap->irq,IRQ_NOAUTOEN ); ret =devm_request_threaded_irq (dev, omap->irq, dwc3_omap_interrupt, dwc3_omap_interrupt_thread,IRQF_SHARED ,"dwc3-omap" , omap);@@ -533,10 +532,10 @@ static int dwc3_omap_probe(struct platform_device *pdev) }dwc3_omap_enable_irqs (omap); -enable_irq (omap->irq);return 0 ; err1: +disable_irq (omap->irq);pm_runtime_put_sync (dev);pm_runtime_disable (dev);
Signature · 6 lines
Regards Vignesh -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Vignesh R
Quoted 5 lines · Grygorii
IRQ_NOAUTOENcan't be used with shared IRQs and Kernel now will triggers warning if it happns, since commit04c848d39879("genirq: Warn whenIRQ_NOAUTOENis used with shared interrupts"). And this is the case for OMAP DWC 3 driver.
Quoted 5 lines
Quoted 2 lines
Hence, remove
IRQ_NOAUTOENflag and instead calldisable_irq()before disabling PM runtime in probe error path handling.Or, how about requesting the irq at the end of probe after extcon registration?
Hmm yeah, what prevents the issue that we tried to fix with commit 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with irq handler in probe")?
Regards,
Tony
Quoted 35 lines
Quoted 31 lines
Fixes 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")Signed-off-by Grygorii Strashko <[email protected]>--- drivers/usb/dwc3/dwc3-omap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/usb/dwc3/dwc3-omap.c +1
-2@@ -512,7 +512,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)/* check the DMA Status */ reg =dwc3_omap_readl (omap->base,USBOTGSS_SYSCONFIG ); -irq_set_status_flags (omap->irq,IRQ_NOAUTOEN ); ret =devm_request_threaded_irq (dev, omap->irq, dwc3_omap_interrupt, dwc3_omap_interrupt_thread,IRQF_SHARED ,"dwc3-omap" , omap);@@ -533,10 +532,10 @@ static int dwc3_omap_probe(struct platform_device *pdev) }dwc3_omap_enable_irqs (omap); -enable_irq (omap->irq);return 0 ; err1: +disable_irq (omap->irq);pm_runtime_put_sync (dev);pm_runtime_disable (dev);Signature · 2 lines
Regards Vignesh
Quoted 12 lines · Tony Lindgren
Quoted 11 lines · Vignesh R
Quoted 7 lines · Grygorii
IRQ_NOAUTOENcan't be used with shared IRQs and Kernel now will triggers warning if it happns, since commit04c848d39879("genirq: Warn whenIRQ_NOAUTOENis used with shared interrupts"). And this is the case for OMAP DWC 3 driver.Hence, remove
IRQ_NOAUTOENflag and instead calldisable_irq()before disabling PM runtime in probe error path handling.
Quoted 6 lines
Quoted 2 lines
Or, how about requesting the irq at the end of probe after extcon registration?
Hmm yeah, what prevents the issue that we tried to fix with commit
12a7f17fac5b("usb: dwc3: omap: fix race of pm runtime with irq handler in probe")?
No, I think. There should be the disable_irq() call any way before pm_runtime_put_sync(dev);| pm_runtime_disable(dev); - once IRQ is requested driver can't know if IRQ handler is running now or not unless it will call disable_irq()/free_irq().
But, I've also thought about moving request_irq() down (seems it can be moved even after of_platform_populate()). looks like it can be separate patch.
Quoted 30 lines
Quoted 30 lines
Quoted 30 lines
Fixes 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")Signed-off-by Grygorii Strashko <[email protected]>--- drivers/usb/dwc3/dwc3-omap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/usb/dwc3/dwc3-omap.c +1
-2@@ -512,7 +512,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)/* check the DMA Status */ reg =dwc3_omap_readl (omap->base,USBOTGSS_SYSCONFIG ); -irq_set_status_flags (omap->irq,IRQ_NOAUTOEN ); ret =devm_request_threaded_irq (dev, omap->irq, dwc3_omap_interrupt, dwc3_omap_interrupt_thread,IRQF_SHARED ,"dwc3-omap" , omap);@@ -533,10 +532,10 @@ static int dwc3_omap_probe(struct platform_device *pdev) }dwc3_omap_enable_irqs (omap); -enable_irq (omap->irq);return 0 ; err1: +disable_irq (omap->irq);pm_runtime_put_sync (dev);pm_runtime_disable (dev);
Signature · 2 lines
regards, -grygorii
Hi,
Quoted 22 lines · Grygorii
Quoted 12 lines · Tony Lindgren
Quoted 11 lines · Vignesh R
Quoted 7 lines · Grygorii
IRQ_NOAUTOENcan't be used with shared IRQs and Kernel now will triggers warning if it happns, since commit04c848d39879("genirq: Warn whenIRQ_NOAUTOENis used with shared interrupts"). And this is the case for OMAP DWC 3 driver.Hence, remove
IRQ_NOAUTOENflag and instead calldisable_irq()before disabling PM runtime in probe error path handling.Quoted 6 lines
Quoted 2 lines
Or, how about requesting the irq at the end of probe after extcon registration?
Hmm yeah, what prevents the issue that we tried to fix with commit
12a7f17fac5b("usb: dwc3: omap: fix race of pm runtime with irq handler in probe")?
Quoted 9 lines
No, I think. There should be the
disable_irq()call any way before pm_runtime_put_sync(dev);|pm_runtime_disable(dev); - once IRQ is requested driver can't know if IRQ handler is running now or not unless it will call disable_irq()/free_irq().But, I've also thought about moving
request_irq()down (seems it can be moved even afterof_platform_populate()). looks like it can be separate patch.
commit 12a7f17fac5b says PM runtime can race with IRQ handler when deferred probing happening due to extcon, therefore IRQ_NOAUTOEN was set and disable_irq() call was added. If IRQ handler registration is moved to a place after of_platform_populate(), then we can be sure that extcon is registered and there wont be any deferred probe or race with irq handler and PM runtime. Would disable_irq() still be needed then?
Quoted 32 lines
Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
Fixes 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")Signed-off-by Grygorii Strashko <[email protected]>--- drivers/usb/dwc3/dwc3-omap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/usb/dwc3/dwc3-omap.c +1
-2@@ -512,7 +512,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)/* check the DMA Status */ reg =dwc3_omap_readl (omap->base,USBOTGSS_SYSCONFIG ); -irq_set_status_flags (omap->irq,IRQ_NOAUTOEN ); ret =devm_request_threaded_irq (dev, omap->irq, dwc3_omap_interrupt, dwc3_omap_interrupt_thread,IRQF_SHARED ,"dwc3-omap" , omap);@@ -533,10 +532,10 @@ static int dwc3_omap_probe(struct platform_device *pdev) }dwc3_omap_enable_irqs (omap); -enable_irq (omap->irq);return 0 ; err1: +disable_irq (omap->irq);pm_runtime_put_sync (dev);pm_runtime_disable (dev);
Signature · 2 lines
Regards Vignesh
Quoted 35 lines · Vignesh R
Hi,
Quoted 22 lines · Grygorii
Quoted 12 lines · Tony Lindgren
Quoted 11 lines · Vignesh R
Quoted 7 lines · Grygorii
IRQ_NOAUTOENcan't be used with shared IRQs and Kernel now will triggers warning if it happns, since commit04c848d39879("genirq: Warn whenIRQ_NOAUTOENis used with shared interrupts"). And this is the case for OMAP DWC 3 driver.Hence, remove
IRQ_NOAUTOENflag and instead calldisable_irq()before disabling PM runtime in probe error path handling.Quoted 6 lines
Quoted 2 lines
Or, how about requesting the irq at the end of probe after extcon registration?
Hmm yeah, what prevents the issue that we tried to fix with commit
12a7f17fac5b("usb: dwc3: omap: fix race of pm runtime with irq handler in probe")?Quoted 9 lines
No, I think. There should be the
disable_irq()call any way before pm_runtime_put_sync(dev);|pm_runtime_disable(dev); - once IRQ is requested driver can't know if IRQ handler is running now or not unless it will call disable_irq()/free_irq().But, I've also thought about moving
request_irq()down (seems it can be moved even afterof_platform_populate()). looks like it can be separate patch.
Quoted 7 lines
commit
12a7f17fac5bsays PM runtime can race with IRQ handler when deferred probing happening due to extcon, thereforeIRQ_NOAUTOENwas set anddisable_irq()call was added. If IRQ handler registration is moved to a place afterof_platform_populate(), then we can be sure that extcon is registered and there wont be any deferred probe or race with irq handler and PM runtime. Woulddisable_irq()still be needed then?
You might be correct, so feel free to send a patch.
Signature · 6 lines
regards, -grygorii -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
Quoted 49 lines · Grygorii Strashko
Quoted 38 lines · Vignesh R
Hi,
Quoted 30 lines · Grygorii
Quoted 14 lines · Tony Lindgren
Quoted 13 lines · Vignesh R
Quoted 9 lines · Grygorii
IRQ_NOAUTOENcan't be used with shared IRQs and Kernel now will triggers
warning if it happns, since commit04c848d39879("genirq: Warn whenIRQ_NOAUTOENis used with shared interrupts"). And this is the case for
OMAP DWC 3 driver.Hence, remove
IRQ_NOAUTOENflag and instead calldisable_irq()before disabling PM runtime in probe error path handling.Quoted 6 lines
Quoted 2 lines
Or, how about requesting the irq at the end of probe after extcon registration?
Hmm yeah, what prevents the issue that we tried to fix with commit
12a7f17fac5b("usb: dwc3: omap: fix race of pm runtime with irq handler in probe")?No, I think. There should be the
disable_irq()call any way before pm_runtime_put_sync(dev);|pm_runtime_disable(dev); - once IRQ is requested driver can't know if IRQ handler is running now or not
unless it will call disable_irq()/free_irq().Quoted 4 lines
But, I've also thought about moving
request_irq()down (seems it can be moved even afterof_platform_populate()). looks like it can be separate patch.Quoted 7 lines
commit
12a7f17fac5bsays PM runtime can race with IRQ handler when deferred probing happening due to extcon, thereforeIRQ_NOAUTOENwas set anddisable_irq()call was added. If IRQ handler registration is moved to a place afterof_platform_populate(), then we can be sure that extcon is registered and there wont be any deferred probe or race with irq handler and PM runtime. Woulddisable_irq()still be needed then?
Quoted 1 line
You might be correct, so feel free to send a patch.
Ok, will send a patch moving irq registration after of_platform_populate().