Re: [RFC PATCH 2/5] usb: add usb port auto power off mechanism

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

 



On Sun, 11 Nov 2012, Lan Tianyu wrote:

> > What you should do, if all the conditions are met, is call
> > pm_runtime_put(&port_dev->dev).  Then the port's runtime suspend
> > routine should be responsible for turning off the power.
> 
> You mean just send set/clear PORT_POWER request in the port's runtime pm 
> callback? Yeah, this has been suggested Rafael.

Yes, that's what I mean.

> But my previous opinion, usb_port_suspend/resume() has done a lot port's 
> suspend/resume work.(e,g remote wakeup and link power management). If we 
> added port's runtime pm callback, I thought we should move the content 
> of usb_port_suspend/resume() to the callback. But 

No, that won't work.  The work you're talking about has to be done when 
the device is suspended/resumed, not when the port is powered off/on.

> usb_port_suspend/resume() are also used by system pm. So this maybe be 
> difficult to move the code. From your response, this doesn't matter. But 
> I think we also should do a check of runtime pm or system pm before 
> calling pm_runtime_get_sync/put() in the usb_port_suspend/resume(). 
> Since it's not reasonable to call runtime function during system pm, Right?

In fact it won't matter, because the PM core will increment the port's 
usage counter at the start of a system suspend.  So this test isn't 
needed.

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