]> git.itanic.dy.fi Git - linux-stable/commit
power: supply: bq27xxx: Fix I2C IRQ race on remove
authorHans de Goede <hdegoede@redhat.com>
Sat, 15 Apr 2023 18:23:33 +0000 (20:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:44:10 +0000 (12:44 +0100)
commitdafe9136be7b7fc30f1f3ca410c15b7cc65bee44
tree23b1399ac587d162e0560f3502ea317fb4ad5ecd
parent7b3b11964979f41889f44e9f287d90abe92e58a2
power: supply: bq27xxx: Fix I2C IRQ race on remove

commit 444ff00734f3878cd54ddd1ed5e2e6dbea9326d5 upstream.

devm_request_threaded_irq() requested IRQs are only free-ed after
the driver's remove function has ran. So the IRQ could trigger and
call bq27xxx_battery_update() after bq27xxx_battery_teardown() has
already run.

Switch to explicitly free-ing the IRQ in bq27xxx_battery_i2c_remove()
to fix this.

Fixes: 8807feb91b76 ("power: bq27xxx_battery: Add interrupt handling support")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/supply/bq27xxx_battery_i2c.c