regulator: arizona-micsupp: freeze charge-pump state work
Subsystems (3)
PATCH 1/1 regulator: arizona-micsupp: freeze charge-pump state work
The charge-pump state worker accesses the device through regmap and then updates DAPM state. It is currently queued on system_wq, so it can run after the backing bus has suspended.
Queue the worker on system_freezable_wq so hardware access is deferred until devices have resumed.
--- drivers/regulator/arizona-micsupp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/arizona-micsupp.c +3 -3
@@ -78,7 +78,7 @@ static int arizona_micsupp_enable(struct regulator_dev *rdev) ret =regulator_enable_regmap (rdev);if (ret ==0 ) -schedule_work (&micsupp->check_cp_work); +queue_work (system_freezable_wq, &micsupp->check_cp_work);return ret; }
@@ -90,7 +90,7 @@ static int arizona_micsupp_disable(struct regulator_dev *rdev) ret =regulator_disable_regmap (rdev);if (ret ==0 ) -schedule_work (&micsupp->check_cp_work); +queue_work (system_freezable_wq, &micsupp->check_cp_work);return ret; }
@@ -102,7 +102,7 @@ static int arizona_micsupp_set_bypass(struct regulator_dev *rdev, bool ena) ret =regulator_set_bypass_regmap (rdev, ena);if (ret ==0 ) -schedule_work (&micsupp->check_cp_work); +queue_work (system_freezable_wq, &micsupp->check_cp_work);return ret; }
Signature · 1 line
2.34.1
Quoted 19 lines · Jiale Yao
The charge-pump state worker accesses the device through regmap and then updates DAPM state. It is currently queued on
system_wq, so it can run after the backing bus has suspended.Queue the worker on
system_freezable_wqso hardware access is deferred until devices have resumed.Fixes e6ed90581bfa ("regulator: arizona-micsupp: Enable SYSCLK for charge pump")Signed-off-by Jiale Yao <[email protected]>--- drivers/regulator/arizona-micsupp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/regulator/arizona-micsupp.c +0
-0
drivers/regulator/arizona-micsupp.c static int arizona_micsupp_enable(struct regulator_dev *rdev) · line 81
Quoted 5 lines
drivers/regulator/arizona-micsupp.c +1
-1@@ -78,7 +78,7 @@ static int arizona_micsupp_enable(struct regulator_dev *rdev) ret =regulator_enable_regmap (rdev);if (ret ==0 ) -schedule_work (&micsupp->check_cp_work); +queue_work (system_freezable_wq, &micsupp->check_cp_work);
The Sashiko concerns here seem fairly plausible, I suspect the fix might not be quite this simple. This is a fairly old driver at this point and I suspect this might become quite an involved fix, are you actually observing a problem or is this based on static analysis? I am inclined to say if we arn't seeing a problem IRL perhaps its better to leave this one for now.
Thanks,
Charles
Quoted 23 lines
drivers/regulator/arizona-micsupp.c +2
-2return ret; }@@ -90,7 +90,7 @@ static int arizona_micsupp_disable(struct regulator_dev *rdev) ret =regulator_disable_regmap (rdev);if (ret ==0 ) -schedule_work (&micsupp->check_cp_work); +queue_work (system_freezable_wq, &micsupp->check_cp_work);return ret; }@@ -102,7 +102,7 @@ static int arizona_micsupp_set_bypass(struct regulator_dev *rdev, bool ena) ret =regulator_set_bypass_regmap (rdev, ena);if (ret ==0 ) -schedule_work (&micsupp->check_cp_work); +queue_work (system_freezable_wq, &micsupp->check_cp_work);return ret; }Signature · 1 line
2.34.1