linux_dsm_epyc7002/drivers/base/power
Tony Lindgren 4990d4fe32 PM / Wakeirq: Add automated device wake IRQ handling
Turns out we can automate the handling for the device_may_wakeup()
quite a bit by using the kernel wakeup source list as suggested
by Rafael J. Wysocki <rjw@rjwysocki.net>.

And as some hardware has separate dedicated wake-up interrupt
in addition to the IO interrupt, we can automate the handling by
adding a generic threaded interrupt handler that just calls the
device PM runtime to wake up the device.

This allows dropping code from device drivers as we currently
are doing it in multiple ways, and often wrong.

For most drivers, we should be able to drop the following
boilerplate code from runtime_suspend and runtime_resume
functions:

	...
	device_init_wakeup(dev, true);
	...
	if (device_may_wakeup(dev))
		enable_irq_wake(irq);
	...
	if (device_may_wakeup(dev))
		disable_irq_wake(irq);
	...
	device_init_wakeup(dev, false);
	...

We can replace it with just the following init and exit
time code:

	...
	device_init_wakeup(dev, true);
	dev_pm_set_wake_irq(dev, irq);
	...
	dev_pm_clear_wake_irq(dev);
	device_init_wakeup(dev, false);
	...

And for hardware with dedicated wake-up interrupts:

	...
	device_init_wakeup(dev, true);
	dev_pm_set_dedicated_wake_irq(dev, irq);
	...
	dev_pm_clear_wake_irq(dev);
	device_init_wakeup(dev, false);
	...

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-05-20 01:56:31 +02:00
..
clock_ops.c PM / OPP / clk: Remove unnecessary OOM message 2015-02-12 02:00:52 +01:00
common.c PM: Convert dev_pm_put_subsys_data() into a void function 2015-02-03 22:59:25 +01:00
domain_governor.c PM: Drop CONFIG_PM_RUNTIME from the driver core 2014-12-04 00:46:58 +01:00
domain.c PM / domains: avoid potential oops in pm_genpd_remove_device() 2015-03-23 23:20:28 +01:00
generic_ops.c PM / Runtime: Spelling s/competing/completing/ 2014-03-26 16:33:53 +01:00
main.c PM / Wakeirq: Add automated device wake IRQ handling 2015-05-20 01:56:31 +02:00
Makefile PM / Wakeirq: Add automated device wake IRQ handling 2015-05-20 01:56:31 +02:00
opp.c PM / OPP / clk: Remove unnecessary OOM message 2015-02-12 02:00:52 +01:00
power.h PM / Wakeirq: Add automated device wake IRQ handling 2015-05-20 01:56:31 +02:00
qos.c PM / QoS: Use lockdep asserts to find missing hold of power.lock 2015-01-23 22:31:08 +01:00
runtime.c PM / Wakeirq: Add automated device wake IRQ handling 2015-05-20 01:56:31 +02:00
sysfs.c PM: Drop CONFIG_PM_RUNTIME from the driver core 2014-12-04 00:46:58 +01:00
trace.c PM / sleep: add pm-trace support for suspending phase 2015-03-18 15:54:27 +01:00
wakeirq.c PM / Wakeirq: Add automated device wake IRQ handling 2015-05-20 01:56:31 +02:00
wakeup.c PM / Wakeirq: Add automated device wake IRQ handling 2015-05-20 01:56:31 +02:00