stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] power: supply: bq27xxx_battery: Fix polling interval after re-bind
@ 2020-05-25 11:32 Krzysztof Kozlowski
  2020-05-26  0:23 ` Sasha Levin
  2020-05-27  1:16 ` Andrew F. Davis
  0 siblings, 2 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2020-05-25 11:32 UTC (permalink / raw)
  To: Pali Rohár, Andrew F. Davis, Sebastian Reichel,
	Anton Vorontsov, linux-pm, linux-kernel
  Cc: Krzysztof Kozlowski, stable

This reverts commit 8cfaaa811894a3ae2d7360a15a6cfccff3ebc7db.

If device was unbound and bound, the polling interval would be set to 0.
This is both unexpected and messes up with other bq27xxx devices (if
more than one battery device is used).

This reset of polling interval was added in commit 8cfaaa811894
("bq27x00_battery: Fix OOPS caused by unregistring bq27x00 driver")
stating that power_supply_unregister() calls get_property().  However in
Linux kernel v3.1 and newer, such call trace does not exist.
Unregistering power supply does not call get_property() on unregistered
power supply.

Fixes: 8cfaaa811894 ("bq27x00_battery: Fix OOPS caused by unregistring bq27x00 driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---

I really could not identify the issue being fixed in offending commit
8cfaaa811894 ("bq27x00_battery: Fix OOPS caused by unregistring bq27x00
driver"), therefore maybe I missed here something important.

Please share your thoughts on this.
---
 drivers/power/supply/bq27xxx_battery.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
index 942c92127b6d..4c94ee72de95 100644
--- a/drivers/power/supply/bq27xxx_battery.c
+++ b/drivers/power/supply/bq27xxx_battery.c
@@ -1905,14 +1905,6 @@ EXPORT_SYMBOL_GPL(bq27xxx_battery_setup);
 
 void bq27xxx_battery_teardown(struct bq27xxx_device_info *di)
 {
-	/*
-	 * power_supply_unregister call bq27xxx_battery_get_property which
-	 * call bq27xxx_battery_poll.
-	 * Make sure that bq27xxx_battery_poll will not call
-	 * schedule_delayed_work again after unregister (which cause OOPS).
-	 */
-	poll_interval = 0;
-
 	cancel_delayed_work_sync(&di->work);
 
 	power_supply_unregister(di->bat);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-22 12:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 11:32 [RFC] power: supply: bq27xxx_battery: Fix polling interval after re-bind Krzysztof Kozlowski
2020-05-26  0:23 ` Sasha Levin
2020-05-27  1:16 ` Andrew F. Davis
2020-05-27  7:42   ` Pali Rohár
2020-06-19 17:55     ` Sebastian Reichel
2020-06-19 18:58       ` Pali Rohár
2020-06-22  8:09         ` Krzysztof Kozlowski
2020-06-22  8:22       ` Krzysztof Kozlowski
2020-06-22 12:47         ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).