Re: [RFC PATCH 4/5] usb: add runtime pm support for usb port device

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

 



On 2012/11/10 0:07, Alan Stern wrote:
On Fri, 9 Nov 2012, Lan Tianyu wrote:

When pm qos flags is changing, the pm core will keep device not
in RPM_SUSPEND via pm_runtime_get_sync/put(dev). When the flags are
changed, this will affect usb device status. If NO_POWER_OFF flag was
set when the device was power off, it would need to be resumed and
suspended again without power off. If NO_POWER_OFF flag was cleared
when the device was suspended without power off, it would need to be
resumed and suspended again with power off inorder to save more power.

This patch is to add runtime pm callback for usb port device. In the callback,
usb device attached to the port will be resumed and suspended.

No, this is completely the wrong way around.  The device's resume
routine should force the port to resume, not the reverse.  Think of the
port device as a parent of the USB device (even though it's not
represented that way in the device hierarchy) and you'll see why.
Hi Alan:
	Great thanks for your review and good suggestions.
I think the main problem is that when the port device resumed(you said turn on/off power in the port's runtime callback ) and device powered on again, If we did't resume the device and suspend again, the device would be at uninitalized state(I guess it should be unattached state actually) until resume it, right? This will consume more power than suspend it agian. So from my opinion, the device should be resumed when port resumes. After autosuspend delay timeout, the device will suspend again. If I remember correctly, pcie port and sata port do the same thing that port will resume its children when it resumes.


Also, all this port stuff is making hub.c a real mess.  Before going
any farther, can you split it all out into a separate source file?

Ok. I will do this.

Alan Stern



--
Best Regards
Tianyu Lan
linux kernel enabling team
--
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