diff options
author | Hans de Goede <hdegoede@redhat.com> | 2022-11-28 10:28:49 +0100 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2022-12-03 03:06:51 +0100 |
commit | 7e6fb67808ab5ceba73a6f45d0942e1e25ac56a7 (patch) | |
tree | 20302da7c800ebf1f12dd49d83453fc43a882caa /tools/perf/tests/code-reading.c | |
parent | a7aaa80098d5b7608b2dc1e883e3c3f929415243 (diff) | |
download | linux-7e6fb67808ab5ceba73a6f45d0942e1e25ac56a7.tar.gz linux-7e6fb67808ab5ceba73a6f45d0942e1e25ac56a7.tar.bz2 linux-7e6fb67808ab5ceba73a6f45d0942e1e25ac56a7.zip |
power: supply: bq25890: Fix usb-notifier probe and remove races
There are 2 races surrounding the usb-notifier:
1. The notifier, and thus usb_work, may run before the bq->charger
power_supply class device is registered. But usb_work may call
power_supply_changed() which relies on the psy device being registered.
2. usb_work may be pending/running at remove() time, so it needs to be
cancelled on remove after unregistering the usb-notifier.
Fix 1. by moving usb-notifier registration to after the power_supply
registration.
Fix 2. by adding a cancel_work_sync() call directly after the usb-notifier
unregistration.
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'tools/perf/tests/code-reading.c')
0 files changed, 0 insertions, 0 deletions