Re: [PATCH 2/2] usb: dwc3: core: allow device to runtime_suspend several times

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 3 Aug 2016, Felipe Balbi wrote:

> >> --- a/drivers/usb/dwc3/core.c
> >> +++ b/drivers/usb/dwc3/core.c
> >> @@ -1192,6 +1192,7 @@ static int dwc3_runtime_resume(struct device *dev)
> >>  	}
> >>  
> >>  	pm_runtime_mark_last_busy(dev);
> >> +	pm_runtime_put(dev);
> >>  
> >>  	return 0;
> >>  }
> >
> > This may be correct, but it certainly looks odd.  For example, it 
> > wouldn't work right if you ever called pm_runtime_resume() instead of 
> > pm_runtime_get().
> 
> well, we don't. But is there an alternative for this?

What are you trying to accomplish?  Is the problem that wakeup signals
only cause the platform device to be runtime-resumed, but you also need
the HCD to wake up?  And conversely, whenever the HCD gets
runtime-suspended you also want the platform device to go into runtime
suspend?

If that's so, the proper solution is for the platform device's
runtime_resume routine to call pm_runtime_resume() for the HCD, and
never to do pm_runtime_get_* or pm_runtime_put_* on the platform
device.  The HCD's callback routines would then be responsible for
doing runtime-PM gets and puts on the HCD as required.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux