Re: [PATCH] PM / Sleep: Add pm_generic functions to re-use runtime PM callbacks

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

 



On Fri, 22 Nov 2013, Ulf Hansson wrote:

> To put devices into low power state during sleep, it sometimes makes
> sense at subsystem-level to re-use device's runtime PM callbacks.
> 
> The PM core will at device_suspend_late disable runtime PM, after that
> we can safely operate on these callbacks. At suspend_late the device
> will be put into low power state by invoking the device's
> runtime_suspend callback, unless the runtime status is already
> suspended. At resume_early the state is restored by invoking the
> device's runtime_resume callback. Soon after the PM core will re-enable
> runtime PM before returning from device_resume_early.
> 
> These are new pm_generic functions, which are supposed to be used in
> pairs:
> - pm_generic_suspend_late_runtime / pm_generic_resume_early_runtime
> - pm_generic_freeze_late_runtime / pm_generic_thaw_early_runtime
> - pm_generic_poweroff_late_runtime / pm_generic_restore_early_runtime

The last four aren't needed.  They do exactly the same things as the 
first two.  If you insist on having those names available for drivers,
just do:

#define pm_generic_freeze_late_runtime	pm_generic_suspend_late_runtime
... etc.

Aside from that, this looks okay.

Alan Stern

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




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux