lkml.org 
[lkml]   [2023]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] usb: dwc3: qcom: Allow runtime PM
On Tue, Mar 28, 2023 at 06:27:05PM +0530, Manivannan Sadhasivam wrote:
> On Tue, Mar 28, 2023 at 02:18:16PM +0200, Johan Hovold wrote:

> > > > > @@ -948,6 +948,8 @@ static int dwc3_qcom_remove(struct platform_device *pdev)
> > > > > struct device *dev = &pdev->dev;
> > > > > int i;
> > > > >
> > > > > + pm_runtime_get_sync(dev);
> > > >
> > > > This call needs to be balanced. But this is a fix for a bug in the
> > > > current implementation that should go in a separate patch.
> > >
> > > Ok. For balancing I could add pm_runtime_put_noidle() before pm_runtime_disable.
> >
> > You should do it after disabling runtime pm.
>
> May I know why?

The usage counter should be balanced after disabling runtime PM so that
there is no window where you could get a racing suspend request.

> > > > > +
> > > > > device_remove_software_node(&qcom->dwc3->dev);
> > > > > of_platform_depopulate(dev);
> > > > >
> > > > > @@ -960,7 +962,6 @@ static int dwc3_qcom_remove(struct platform_device *pdev)
> > > > > dwc3_qcom_interconnect_exit(qcom);
> > > > > reset_control_assert(qcom->resets);
> > > > >
> > > > > - pm_runtime_allow(dev);
> > > > > pm_runtime_disable(dev);
> > > > >
> > > > > return 0;

Johan

\
 
 \ /
  Last update: 2023-03-28 15:38    [W:0.147 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site