Krzysztof Kozlowski
31f7dc7969
ACPI / battery: Fix doubly added battery on system suspend
Commit 297d716f62 ("power_supply: Change ownership from driver to
core") inverted the logic in battery_notify(). As an effect already
present battery was re-added on each system suspend or hibernation.
WARNING: CPU: 0 PID: 303 at ../fs/sysfs/dir.c:31 sysfs_warn_dup+0x68/0x80()
sysfs: cannot create duplicate filename '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/PNP0C0A:00/power_supply/BAT0'
CPU: 0 PID: 303 Comm: rtcwake Not tainted 4.0.0-ARCH-02621-g07e6253af953 #48
Call Trace:
sysfs_create_dir_ns+0x8d/0xa0
kobject_add_internal+0xb6/0x370
kobject_add+0x6f/0xd0
device_add+0x120/0x6c0
__power_supply_register+0x145/0x290
power_supply_register_no_ws+0x10/0x20
sysfs_add_battery+0x84/0xc5 [battery]
battery_notify+0x45/0x6b [battery]
notifier_call_chain+0x4f/0x80
__blocking_notifier_call_chain+0x4b/0x70
blocking_notifier_call_chain+0x16/0x20
pm_notifier_call_chain+0x1a/0x40
pm_suspend+0x3ed/0x4e0
Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-14 09:03:33 -07:00
..
2015-02-12 18:54:13 -08:00
2015-01-15 11:30:57 +01:00
2015-01-29 21:02:11 +08:00
2015-03-13 23:15:51 +01:00
2015-02-06 15:42:16 +01:00
2014-09-08 15:38:41 +02:00
2014-08-06 20:34:19 -07:00
2013-09-30 19:46:13 +02:00
2015-01-29 21:02:10 +08:00
2015-03-10 00:28:43 +01:00
2015-01-26 16:09:56 +01:00
2015-04-03 08:44:34 +02:00
2015-02-05 15:09:25 +01:00
2014-10-09 16:07:43 -04:00
2015-01-05 23:34:26 +01:00
2015-04-14 09:03:33 -07:00
2014-03-19 01:57:46 +01:00
2013-08-22 08:34:39 -07:00
2014-12-04 04:03:55 -08:00
2014-09-15 13:15:34 -06:00
2014-07-23 00:59:04 +02:00
2014-05-06 01:52:09 +02:00
2014-09-21 02:58:18 +02:00
2013-12-07 01:03:14 +01:00
2013-12-07 01:03:14 +01:00
2015-02-08 23:45:58 +01:00
2014-04-07 14:11:35 +02:00
2014-01-06 00:13:22 +01:00
2015-02-17 18:27:59 +01:00
2015-01-18 01:03:45 -05:00
2014-12-11 00:29:02 +01:00
2014-02-11 00:35:46 +01:00
2013-12-07 01:03:14 +01:00
2015-01-06 08:17:14 +08:00
2015-02-10 16:05:16 +01:00
2015-02-05 15:09:26 +01:00
2015-02-05 15:09:26 +01:00
2015-02-19 11:28:36 -08:00
2015-02-06 01:34:47 +01:00
2014-05-27 18:13:08 +02:00
2014-11-11 23:49:09 +01:00
2015-03-20 14:56:19 +01:00
2014-03-19 02:01:57 +01:00
2015-04-09 14:20:11 -05:00
2014-01-06 00:13:22 +01:00
2014-03-19 02:01:57 +01:00
2014-02-05 01:06:21 +01:00
2015-02-05 15:09:26 +01:00
2014-08-06 22:22:03 +02:00
2015-04-13 11:08:28 -07:00
2014-07-21 13:50:58 +02:00
2014-02-21 00:27:47 +01:00
2013-12-07 01:38:45 +01:00
2014-02-27 00:21:05 +01:00
2014-11-05 20:48:06 +01:00
2015-03-04 14:09:50 +01:00
2015-03-13 23:15:51 +01:00
2013-12-07 01:03:14 +01:00
2015-02-06 15:42:16 +01:00
2015-01-23 22:10:16 +01:00
2014-10-21 00:39:40 +02:00
2014-11-27 02:07:41 +01:00
2014-10-10 13:57:15 +08:00
2014-12-18 18:42:56 +01:00
2014-09-24 23:09:41 +02:00
2015-03-04 15:10:36 +01:00
2013-12-07 01:03:14 +01:00