* [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
@ 2017-06-28 23:31 ` Grygorii Strashko
0 siblings, 0 replies; 14+ messages in thread
From: Grygorii Strashko @ 2017-06-28 23:31 UTC (permalink / raw)
To: GregKroah-Hartmangregkh, Tony Lindgren, Felipe Balbi
Cc: linux-omap, linux-usb, linux-kernel, Sekhar Nori, Vignesh R,
Grygorii Strashko
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.
Fixes: 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
drivers/usb/dwc3/dwc3-omap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 9892650..cd9bef5 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -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);
--
2.10.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
@ 2017-06-28 23:31 ` Grygorii Strashko
0 siblings, 0 replies; 14+ messages in thread
From: Grygorii Strashko @ 2017-06-28 23:31 UTC (permalink / raw)
To: GregKroah-Hartmangregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
Tony Lindgren, Felipe Balbi
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Sekhar Nori, Vignesh R,
Grygorii Strashko
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.
Fixes: 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")
Signed-off-by: Grygorii Strashko <grygorii.strashko-l0cyMroinI0@public.gmane.org>
---
drivers/usb/dwc3/dwc3-omap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 9892650..cd9bef5 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -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);
--
2.10.1
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
@ 2017-06-29 4:21 ` Vignesh R
0 siblings, 0 replies; 14+ messages in thread
From: Vignesh R @ 2017-06-29 4:21 UTC (permalink / raw)
To: Strashko, Grygorii, GregKroah-Hartmangregkh, Tony Lindgren, Felipe Balbi
Cc: linux-omap, linux-usb, linux-kernel, Nori, Sekhar
On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
> 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.
Or, how about requesting the irq at the end of probe after extcon
registration?
>
> Fixes: 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
> drivers/usb/dwc3/dwc3-omap.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> index 9892650..cd9bef5 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -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);
>
>
--
Regards
Vignesh
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
@ 2017-06-29 4:21 ` Vignesh R
0 siblings, 0 replies; 14+ messages in thread
From: Vignesh R @ 2017-06-29 4:21 UTC (permalink / raw)
To: Strashko, Grygorii,
GregKroah-Hartmangregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
Tony Lindgren, Felipe Balbi
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Nori, Sekhar
On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
> 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.
Or, how about requesting the irq at the end of probe after extcon
registration?
>
> Fixes: 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")
> Signed-off-by: Grygorii Strashko <grygorii.strashko-l0cyMroinI0@public.gmane.org>
> ---
> drivers/usb/dwc3/dwc3-omap.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> index 9892650..cd9bef5 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -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);
>
>
--
Regards
Vignesh
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
2017-06-29 4:21 ` Vignesh R
@ 2017-06-29 6:03 ` Tony Lindgren
-1 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2017-06-29 6:03 UTC (permalink / raw)
To: Vignesh R
Cc: Strashko, Grygorii, GregKroah-Hartmangregkh, Felipe Balbi,
linux-omap, linux-usb, linux-kernel, Nori, Sekhar
* Vignesh R <vigneshr@ti.com> [170628 21:21]:
>
>
> On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
> > 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.
>
> 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
> > Fixes: 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")
> > Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> > ---
> > drivers/usb/dwc3/dwc3-omap.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> > index 9892650..cd9bef5 100644
> > --- a/drivers/usb/dwc3/dwc3-omap.c
> > +++ b/drivers/usb/dwc3/dwc3-omap.c
> > @@ -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);
> >
> >
>
> --
> Regards
> Vignesh
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
@ 2017-06-29 6:03 ` Tony Lindgren
0 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2017-06-29 6:03 UTC (permalink / raw)
To: Vignesh R
Cc: Strashko, Grygorii, GregKroah-Hartmangregkh, Felipe Balbi,
linux-omap, linux-usb, linux-kernel, Nori, Sekhar
* Vignesh R <vigneshr@ti.com> [170628 21:21]:
>
>
> On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
> > 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.
>
> 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
> > Fixes: 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")
> > Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> > ---
> > drivers/usb/dwc3/dwc3-omap.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> > index 9892650..cd9bef5 100644
> > --- a/drivers/usb/dwc3/dwc3-omap.c
> > +++ b/drivers/usb/dwc3/dwc3-omap.c
> > @@ -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);
> >
> >
>
> --
> Regards
> Vignesh
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
2017-06-29 6:03 ` Tony Lindgren
@ 2017-06-30 19:34 ` Grygorii Strashko
-1 siblings, 0 replies; 14+ messages in thread
From: Grygorii Strashko @ 2017-06-30 19:34 UTC (permalink / raw)
To: Tony Lindgren, Vignesh R
Cc: GregKroah-Hartmangregkh, Felipe Balbi, linux-omap, linux-usb,
linux-kernel, Nori, Sekhar
On 06/29/2017 01:03 AM, Tony Lindgren wrote:
> * Vignesh R <vigneshr@ti.com> [170628 21:21]:
>>
>>
>> On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
>>> 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.
>>
>> 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.
>>> Fixes: 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")
>>> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
>>> ---
>>> drivers/usb/dwc3/dwc3-omap.c | 3 +--
>>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
>>> index 9892650..cd9bef5 100644
>>> --- a/drivers/usb/dwc3/dwc3-omap.c
>>> +++ b/drivers/usb/dwc3/dwc3-omap.c
>>> @@ -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);
>>>
--
regards,
-grygorii
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
@ 2017-06-30 19:34 ` Grygorii Strashko
0 siblings, 0 replies; 14+ messages in thread
From: Grygorii Strashko @ 2017-06-30 19:34 UTC (permalink / raw)
To: Tony Lindgren, Vignesh R
Cc: GregKroah-Hartmangregkh, Felipe Balbi, linux-omap, linux-usb,
linux-kernel, Nori, Sekhar
On 06/29/2017 01:03 AM, Tony Lindgren wrote:
> * Vignesh R <vigneshr@ti.com> [170628 21:21]:
>>
>>
>> On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
>>> 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.
>>
>> 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.
>>> Fixes: 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")
>>> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
>>> ---
>>> drivers/usb/dwc3/dwc3-omap.c | 3 +--
>>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
>>> index 9892650..cd9bef5 100644
>>> --- a/drivers/usb/dwc3/dwc3-omap.c
>>> +++ b/drivers/usb/dwc3/dwc3-omap.c
>>> @@ -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);
>>>
--
regards,
-grygorii
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
2017-06-30 19:34 ` Grygorii Strashko
@ 2017-07-03 4:27 ` Vignesh R
-1 siblings, 0 replies; 14+ messages in thread
From: Vignesh R @ 2017-07-03 4:27 UTC (permalink / raw)
To: Strashko, Grygorii, Tony Lindgren
Cc: GregKroah-Hartmangregkh, Felipe Balbi, linux-omap, linux-usb,
linux-kernel, Nori, Sekhar
Hi,
On Saturday 01 July 2017 01:04 AM, Strashko, Grygorii wrote:
>
>
> On 06/29/2017 01:03 AM, Tony Lindgren wrote:
>> * Vignesh R <vigneshr@ti.com> [170628 21:21]:
>>>
>>>
>>> On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
>>>> 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.
>>>
>>> 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.
>
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?
>
>>>> Fixes: 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")
>>>> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
>>>> ---
>>>> drivers/usb/dwc3/dwc3-omap.c | 3 +--
>>>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
>>>> index 9892650..cd9bef5 100644
>>>> --- a/drivers/usb/dwc3/dwc3-omap.c
>>>> +++ b/drivers/usb/dwc3/dwc3-omap.c
>>>> @@ -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);
>>>>
>
--
Regards
Vignesh
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
@ 2017-07-03 4:27 ` Vignesh R
0 siblings, 0 replies; 14+ messages in thread
From: Vignesh R @ 2017-07-03 4:27 UTC (permalink / raw)
To: Strashko, Grygorii, Tony Lindgren
Cc: GregKroah-Hartmangregkh, Felipe Balbi, linux-omap, linux-usb,
linux-kernel, Nori, Sekhar
Hi,
On Saturday 01 July 2017 01:04 AM, Strashko, Grygorii wrote:
>
>
> On 06/29/2017 01:03 AM, Tony Lindgren wrote:
>> * Vignesh R <vigneshr@ti.com> [170628 21:21]:
>>>
>>>
>>> On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
>>>> 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.
>>>
>>> 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.
>
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?
>
>>>> Fixes: 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with...")
>>>> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
>>>> ---
>>>> drivers/usb/dwc3/dwc3-omap.c | 3 +--
>>>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
>>>> index 9892650..cd9bef5 100644
>>>> --- a/drivers/usb/dwc3/dwc3-omap.c
>>>> +++ b/drivers/usb/dwc3/dwc3-omap.c
>>>> @@ -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);
>>>>
>
--
Regards
Vignesh
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
@ 2017-07-03 18:28 ` Grygorii Strashko
0 siblings, 0 replies; 14+ messages in thread
From: Grygorii Strashko @ 2017-07-03 18:28 UTC (permalink / raw)
To: Vignesh R, Tony Lindgren
Cc: GregKroah-Hartmangregkh, Felipe Balbi, linux-omap, linux-usb,
linux-kernel, Nori, Sekhar
On 07/02/2017 11:27 PM, Vignesh R wrote:
> Hi,
>
> On Saturday 01 July 2017 01:04 AM, Strashko, Grygorii wrote:
>>
>>
>> On 06/29/2017 01:03 AM, Tony Lindgren wrote:
>>> * Vignesh R <vigneshr@ti.com> [170628 21:21]:
>>>>
>>>>
>>>> On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
>>>>> 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.
>>>>
>>>> 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.
>>
>
> 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?
>
You might be correct, so feel free to send a patch.
--
regards,
-grygorii
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
@ 2017-07-03 18:28 ` Grygorii Strashko
0 siblings, 0 replies; 14+ messages in thread
From: Grygorii Strashko @ 2017-07-03 18:28 UTC (permalink / raw)
To: Vignesh R, Tony Lindgren
Cc: GregKroah-Hartmangregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
Felipe Balbi, linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Nori, Sekhar
On 07/02/2017 11:27 PM, Vignesh R wrote:
> Hi,
>
> On Saturday 01 July 2017 01:04 AM, Strashko, Grygorii wrote:
>>
>>
>> On 06/29/2017 01:03 AM, Tony Lindgren wrote:
>>> * Vignesh R <vigneshr-l0cyMroinI0@public.gmane.org> [170628 21:21]:
>>>>
>>>>
>>>> On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
>>>>> 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.
>>>>
>>>> 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.
>>
>
> 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?
>
You might be correct, so feel free to send a patch.
--
regards,
-grygorii
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
2017-07-03 18:28 ` Grygorii Strashko
@ 2017-07-04 12:50 ` Vignesh R
-1 siblings, 0 replies; 14+ messages in thread
From: Vignesh R @ 2017-07-04 12:50 UTC (permalink / raw)
To: Grygorii Strashko, Tony Lindgren
Cc: GregKroah-Hartmangregkh, Felipe Balbi, linux-omap, linux-usb,
linux-kernel, Nori, Sekhar
Hi,
On 7/3/2017 11:58 PM, Grygorii Strashko wrote:
>
>
> On 07/02/2017 11:27 PM, Vignesh R wrote:
>> Hi,
>>
>> On Saturday 01 July 2017 01:04 AM, Strashko, Grygorii wrote:
>>>
>>>
>>> On 06/29/2017 01:03 AM, Tony Lindgren wrote:
>>>> * Vignesh R <vigneshr@ti.com> [170628 21:21]:
>>>>>
>>>>>
>>>>> On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
>>>>>> 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.
>>>>>
>>>>> 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.
>>>
>>
>> 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?
>>
>
> You might be correct, so feel free to send a patch.
Ok, will send a patch moving irq registration after of_platform_populate().
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
@ 2017-07-04 12:50 ` Vignesh R
0 siblings, 0 replies; 14+ messages in thread
From: Vignesh R @ 2017-07-04 12:50 UTC (permalink / raw)
To: Grygorii Strashko, Tony Lindgren
Cc: GregKroah-Hartmangregkh, Felipe Balbi, linux-omap, linux-usb,
linux-kernel, Nori, Sekhar
Hi,
On 7/3/2017 11:58 PM, Grygorii Strashko wrote:
>
>
> On 07/02/2017 11:27 PM, Vignesh R wrote:
>> Hi,
>>
>> On Saturday 01 July 2017 01:04 AM, Strashko, Grygorii wrote:
>>>
>>>
>>> On 06/29/2017 01:03 AM, Tony Lindgren wrote:
>>>> * Vignesh R <vigneshr@ti.com> [170628 21:21]:
>>>>>
>>>>>
>>>>> On Thursday 29 June 2017 05:01 AM, Strashko, Grygorii wrote:
>>>>>> 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.
>>>>>
>>>>> 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.
>>>
>>
>> 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?
>>
>
> You might be correct, so feel free to send a patch.
Ok, will send a patch moving irq registration after of_platform_populate().
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2017-07-04 12:50 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-28 23:31 [linux-next][PATCH] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq Grygorii Strashko
2017-06-28 23:31 ` Grygorii Strashko
2017-06-29 4:21 ` Vignesh R
2017-06-29 4:21 ` Vignesh R
2017-06-29 6:03 ` Tony Lindgren
2017-06-29 6:03 ` Tony Lindgren
2017-06-30 19:34 ` Grygorii Strashko
2017-06-30 19:34 ` Grygorii Strashko
2017-07-03 4:27 ` Vignesh R
2017-07-03 4:27 ` Vignesh R
2017-07-03 18:28 ` Grygorii Strashko
2017-07-03 18:28 ` Grygorii Strashko
2017-07-04 12:50 ` Vignesh R
2017-07-04 12:50 ` Vignesh R
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.