linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: remove 'pm_runtime_set_active' in resume callback
       [not found] <CGME20210315074223epcas2p11ddf190ec730f8629c1310117135f813@epcas2p1.samsung.com>
@ 2021-03-15  7:43 ` taehyun cho
  2021-03-15 14:13   ` Alan Stern
  0 siblings, 1 reply; 6+ messages in thread
From: taehyun cho @ 2021-03-15  7:43 UTC (permalink / raw)
  To: balbi; +Cc: taehyun.cho, Greg Kroah-Hartman, linux-usb, linux-kernel

'pm_runtime_set_active' sets a flag to describe rumtime status.
This flag is automatically set in pm_runtime_get_sync/put_sync API.
'pm_runtime_set_active' checks the runtime status of parent device.
As a result, the below error message is printed.
dwc3 11110000.dwc3: runtime PM trying to activate child device
11110000.dwc3 but parent (11110000.usb) is not active.

Signed-off-by: taehyun cho <taehyun.cho@samsung.com>
---
 drivers/usb/dwc3/core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 94fdbe502ce9..e7c0e390f885 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1553,7 +1553,6 @@ static int dwc3_probe(struct platform_device *pdev)
 
 	spin_lock_init(&dwc->lock);
 
-	pm_runtime_set_active(dev);
 	pm_runtime_use_autosuspend(dev);
 	pm_runtime_set_autosuspend_delay(dev, DWC3_DEFAULT_AUTOSUSPEND_DELAY);
 	pm_runtime_enable(dev);
@@ -1920,7 +1919,6 @@ static int dwc3_resume(struct device *dev)
 		return ret;
 
 	pm_runtime_disable(dev);
-	pm_runtime_set_active(dev);
 	pm_runtime_enable(dev);
 
 	return 0;
-- 
2.26.0


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

* Re: [PATCH] usb: dwc3: remove 'pm_runtime_set_active' in resume callback
  2021-03-15  7:43 ` [PATCH] usb: dwc3: remove 'pm_runtime_set_active' in resume callback taehyun cho
@ 2021-03-15 14:13   ` Alan Stern
  2021-03-16 12:16     ` taehyun cho
  2021-03-17  8:25     ` taehyun cho
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Stern @ 2021-03-15 14:13 UTC (permalink / raw)
  To: taehyun cho; +Cc: balbi, Greg Kroah-Hartman, linux-usb, linux-kernel

On Mon, Mar 15, 2021 at 04:43:17PM +0900, taehyun cho wrote:
> 'pm_runtime_set_active' sets a flag to describe rumtime status.
> This flag is automatically set in pm_runtime_get_sync/put_sync API.
> 'pm_runtime_set_active' checks the runtime status of parent device.
> As a result, the below error message is printed.
> dwc3 11110000.dwc3: runtime PM trying to activate child device
> 11110000.dwc3 but parent (11110000.usb) is not active.

This is very suspicious.  That error message indicates a real error is 
present; removing these pm_runtime_set_active calls won't fix the error.

You need to determine why the parent platform device 11110000.usb isn't 
active when the dwc3 probe and resume routines are called.  It seems 
likely that there is a bug in the platform device's driver.

Alan Stern

> Signed-off-by: taehyun cho <taehyun.cho@samsung.com>
> ---
>  drivers/usb/dwc3/core.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 94fdbe502ce9..e7c0e390f885 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1553,7 +1553,6 @@ static int dwc3_probe(struct platform_device *pdev)
>  
>  	spin_lock_init(&dwc->lock);
>  
> -	pm_runtime_set_active(dev);
>  	pm_runtime_use_autosuspend(dev);
>  	pm_runtime_set_autosuspend_delay(dev, DWC3_DEFAULT_AUTOSUSPEND_DELAY);
>  	pm_runtime_enable(dev);
> @@ -1920,7 +1919,6 @@ static int dwc3_resume(struct device *dev)
>  		return ret;
>  
>  	pm_runtime_disable(dev);
> -	pm_runtime_set_active(dev);
>  	pm_runtime_enable(dev);
>  
>  	return 0;
> -- 
> 2.26.0

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

* Re: [PATCH] usb: dwc3: remove 'pm_runtime_set_active' in resume callback
  2021-03-15 14:13   ` Alan Stern
@ 2021-03-16 12:16     ` taehyun cho
  2021-03-17  8:25     ` taehyun cho
  1 sibling, 0 replies; 6+ messages in thread
From: taehyun cho @ 2021-03-16 12:16 UTC (permalink / raw)
  To: Alan Stern; +Cc: balbi, Greg Kroah-Hartman, linux-usb, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1933 bytes --]

On Mon, Mar 15, 2021 at 10:13:35AM -0400, Alan Stern wrote:
> On Mon, Mar 15, 2021 at 04:43:17PM +0900, taehyun cho wrote:
> > 'pm_runtime_set_active' sets a flag to describe rumtime status.
> > This flag is automatically set in pm_runtime_get_sync/put_sync API.
> > 'pm_runtime_set_active' checks the runtime status of parent device.
> > As a result, the below error message is printed.
> > dwc3 11110000.dwc3: runtime PM trying to activate child device
> > 11110000.dwc3 but parent (11110000.usb) is not active.
> 
> This is very suspicious.  That error message indicates a real error is 
> present; removing these pm_runtime_set_active calls won't fix the error.
> 
> You need to determine why the parent platform device 11110000.usb isn't 
> active when the dwc3 probe and resume routines are called.  It seems 
> likely that there is a bug in the platform device's driver.
> 
> Alan Stern
>

I thought the issue happened because 'pm_runtime_set_active' set a flag again.
I will check again if there is a problem in our platform device driver and
get back.

Taehyun Cho

> > Signed-off-by: taehyun cho <taehyun.cho@samsung.com>
> > ---
> >  drivers/usb/dwc3/core.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> > index 94fdbe502ce9..e7c0e390f885 100644
> > --- a/drivers/usb/dwc3/core.c
> > +++ b/drivers/usb/dwc3/core.c
> > @@ -1553,7 +1553,6 @@ static int dwc3_probe(struct platform_device *pdev)
> >  
> >  	spin_lock_init(&dwc->lock);
> >  
> > -	pm_runtime_set_active(dev);
> >  	pm_runtime_use_autosuspend(dev);
> >  	pm_runtime_set_autosuspend_delay(dev, DWC3_DEFAULT_AUTOSUSPEND_DELAY);
> >  	pm_runtime_enable(dev);
> > @@ -1920,7 +1919,6 @@ static int dwc3_resume(struct device *dev)
> >  		return ret;
> >  
> >  	pm_runtime_disable(dev);
> > -	pm_runtime_set_active(dev);
> >  	pm_runtime_enable(dev);
> >  
> >  	return 0;
> > -- 
> > 2.26.0
> 

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] usb: dwc3: remove 'pm_runtime_set_active' in resume callback
  2021-03-15 14:13   ` Alan Stern
  2021-03-16 12:16     ` taehyun cho
@ 2021-03-17  8:25     ` taehyun cho
  2021-03-17 15:11       ` Alan Stern
  1 sibling, 1 reply; 6+ messages in thread
From: taehyun cho @ 2021-03-17  8:25 UTC (permalink / raw)
  To: Alan Stern
  Cc: balbi, Greg Kroah-Hartman, linux-usb, linux-kernel, taehyun.cho

[-- Attachment #1: Type: text/plain, Size: 2000 bytes --]

On Mon, Mar 15, 2021 at 10:13:35AM -0400, Alan Stern wrote:
> On Mon, Mar 15, 2021 at 04:43:17PM +0900, taehyun cho wrote:
> > 'pm_runtime_set_active' sets a flag to describe rumtime status.
> > This flag is automatically set in pm_runtime_get_sync/put_sync API.
> > 'pm_runtime_set_active' checks the runtime status of parent device.
> > As a result, the below error message is printed.
> > dwc3 11110000.dwc3: runtime PM trying to activate child device
> > 11110000.dwc3 but parent (11110000.usb) is not active.
> 
> This is very suspicious.  That error message indicates a real error is 
> present; removing these pm_runtime_set_active calls won't fix the error.
> 
> You need to determine why the parent platform device 11110000.usb isn't 
> active when the dwc3 probe and resume routines are called.  It seems 
> likely that there is a bug in the platform device's driver.
> 
> Alan Stern
>

Alan,

Thanks to your comments, I checked our platform device driver and found
the problem. Our parent platform device didn't set active in resume
callback. This made a problem. Thank you for the help and sorry for
disturbing you.

Taehyun Cho

> > Signed-off-by: taehyun cho <taehyun.cho@samsung.com>
> > ---
> >  drivers/usb/dwc3/core.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> > index 94fdbe502ce9..e7c0e390f885 100644
> > --- a/drivers/usb/dwc3/core.c
> > +++ b/drivers/usb/dwc3/core.c
> > @@ -1553,7 +1553,6 @@ static int dwc3_probe(struct platform_device *pdev)
> >  
> >  	spin_lock_init(&dwc->lock);
> >  
> > -	pm_runtime_set_active(dev);
> >  	pm_runtime_use_autosuspend(dev);
> >  	pm_runtime_set_autosuspend_delay(dev, DWC3_DEFAULT_AUTOSUSPEND_DELAY);
> >  	pm_runtime_enable(dev);
> > @@ -1920,7 +1919,6 @@ static int dwc3_resume(struct device *dev)
> >  		return ret;
> >  
> >  	pm_runtime_disable(dev);
> > -	pm_runtime_set_active(dev);
> >  	pm_runtime_enable(dev);
> >  
> >  	return 0;
> > -- 
> > 2.26.0
> 

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] usb: dwc3: remove 'pm_runtime_set_active' in resume callback
  2021-03-17  8:25     ` taehyun cho
@ 2021-03-17 15:11       ` Alan Stern
  2021-03-18 12:42         ` taehyun cho
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Stern @ 2021-03-17 15:11 UTC (permalink / raw)
  To: taehyun cho; +Cc: balbi, Greg Kroah-Hartman, linux-usb, linux-kernel

On Wed, Mar 17, 2021 at 05:25:20PM +0900, taehyun cho wrote:
> On Mon, Mar 15, 2021 at 10:13:35AM -0400, Alan Stern wrote:
> > On Mon, Mar 15, 2021 at 04:43:17PM +0900, taehyun cho wrote:
> > > 'pm_runtime_set_active' sets a flag to describe rumtime status.
> > > This flag is automatically set in pm_runtime_get_sync/put_sync API.
> > > 'pm_runtime_set_active' checks the runtime status of parent device.
> > > As a result, the below error message is printed.
> > > dwc3 11110000.dwc3: runtime PM trying to activate child device
> > > 11110000.dwc3 but parent (11110000.usb) is not active.
> > 
> > This is very suspicious.  That error message indicates a real error is 
> > present; removing these pm_runtime_set_active calls won't fix the error.
> > 
> > You need to determine why the parent platform device 11110000.usb isn't 
> > active when the dwc3 probe and resume routines are called.  It seems 
> > likely that there is a bug in the platform device's driver.
> > 
> > Alan Stern
> >
> 
> Alan,
> 
> Thanks to your comments, I checked our platform device driver and found
> the problem. Our parent platform device didn't set active in resume
> callback. This made a problem.

Ah, good.  Does the platform driver set the active flag in its probe 
routine?

>  Thank you for the help and sorry for
> disturbing you.

No problem at all.

Alan Stern

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

* Re: [PATCH] usb: dwc3: remove 'pm_runtime_set_active' in resume callback
  2021-03-17 15:11       ` Alan Stern
@ 2021-03-18 12:42         ` taehyun cho
  0 siblings, 0 replies; 6+ messages in thread
From: taehyun cho @ 2021-03-18 12:42 UTC (permalink / raw)
  To: Alan Stern; +Cc: balbi, Greg Kroah-Hartman, linux-usb, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1775 bytes --]

On Wed, Mar 17, 2021 at 11:11:59AM -0400, Alan Stern wrote:
> On Wed, Mar 17, 2021 at 05:25:20PM +0900, taehyun cho wrote:
> > On Mon, Mar 15, 2021 at 10:13:35AM -0400, Alan Stern wrote:
> > > On Mon, Mar 15, 2021 at 04:43:17PM +0900, taehyun cho wrote:
> > > > 'pm_runtime_set_active' sets a flag to describe rumtime status.
> > > > This flag is automatically set in pm_runtime_get_sync/put_sync API.
> > > > 'pm_runtime_set_active' checks the runtime status of parent device.
> > > > As a result, the below error message is printed.
> > > > dwc3 11110000.dwc3: runtime PM trying to activate child device
> > > > 11110000.dwc3 but parent (11110000.usb) is not active.
> > > 
> > > This is very suspicious.  That error message indicates a real error is 
> > > present; removing these pm_runtime_set_active calls won't fix the error.
> > > 
> > > You need to determine why the parent platform device 11110000.usb isn't 
> > > active when the dwc3 probe and resume routines are called.  It seems 
> > > likely that there is a bug in the platform device's driver.
> > > 
> > > Alan Stern
> > >
> > 
> > Alan,
> > 
> > Thanks to your comments, I checked our platform device driver and found
> > the problem. Our parent platform device didn't set active in resume
> > callback. This made a problem.
> 
> Ah, good.  Does the platform driver set the active flag in its probe 
> routine?
>

PM resume callback function in our platform driver had a bug.
Resume callback function doesn't set active flag in 'pm_runtime_suspended' state.
This is a obvious bug. We are rebuilding our platform device driver. This bug
looks inserted while rebuilding a driver.

Thanks.

Taehyun Cho

> >  Thank you for the help and sorry for
> > disturbing you.
> 
> No problem at all.
> 
> Alan Stern
> 

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2021-03-18 12:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210315074223epcas2p11ddf190ec730f8629c1310117135f813@epcas2p1.samsung.com>
2021-03-15  7:43 ` [PATCH] usb: dwc3: remove 'pm_runtime_set_active' in resume callback taehyun cho
2021-03-15 14:13   ` Alan Stern
2021-03-16 12:16     ` taehyun cho
2021-03-17  8:25     ` taehyun cho
2021-03-17 15:11       ` Alan Stern
2021-03-18 12:42         ` taehyun cho

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).