]> git.baikalelectronics.ru Git - kernel.git/commit
PM / QoS: Remove device PM QoS sysfs attributes at the right place
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 4 Mar 2013 13:22:57 +0000 (14:22 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 4 Mar 2013 13:23:12 +0000 (14:23 +0100)
commit718068fa435ac1b9581a4702e2fe6ee8d7d77215
tree43a1e1e8f2189b200cf7a6df1bd22e1321c31a91
parenta0143608e94a98609ce762ccdc2a1f28da7f9032
PM / QoS: Remove device PM QoS sysfs attributes at the right place

Device PM QoS sysfs attributes, if present during device removal,
are removed from within device_pm_remove(), which is too late,
since dpm_sysfs_remove() has already removed the whole attribute
group they belonged to.  However, moving the removal of those
attributes to dpm_sysfs_remove() alone is not sufficient, because
in theory they still can be re-added right after being removed by it
(the device's driver is still bound to it at that point).

For this reason, move the entire desctruction of device PM QoS
constraints to dpm_sysfs_remove() and make it prevent any new
constraints from being added after it has run.  Also, move the
initialization of the power.qos field in struct device to
device_pm_init_common() and drop the no longer needed
dev_pm_qos_constraints_init().

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/main.c
drivers/base/power/power.h
drivers/base/power/qos.c
drivers/base/power/sysfs.c