mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: arizona-micsupp: freeze charge-pump state work
@ 2026-10-28  4:50 Jiale Yao
  2026-10-28 14:38 ` Charles Keepax
  0 siblings, 1 reply; 2+ messages in thread
From: Jiale Yao @ 2026-10-28  4:50 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, patches, linux-kernel; +Cc: stable

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.

Fixes: e6ed90581bfa ("regulator: arizona-micsupp: Enable SYSCLK for charge pump")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
 drivers/regulator/arizona-micsupp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/arizona-micsupp.c b/drivers/regulator/arizona-micsupp.c
index be7208bc7409..ae99173b8236 100644
--- a/drivers/regulator/arizona-micsupp.c
+++ b/drivers/regulator/arizona-micsupp.c
@@ -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;
 }
-- 
2.34.1


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

* Re: [PATCH] regulator: arizona-micsupp: freeze charge-pump state work
  2026-10-28  4:50 [PATCH] regulator: arizona-micsupp: freeze charge-pump state work Jiale Yao
@ 2026-10-28 14:38 ` Charles Keepax
  0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2026-10-28 14:38 UTC (permalink / raw)
  To: Jiale Yao; +Cc: Liam Girdwood, Mark Brown, patches, linux-kernel, stable

On Wed, Oct 28, 2026 at 12:50:01PM +0800, Jiale Yao wrote:
> 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.
> 
> Fixes: e6ed90581bfa ("regulator: arizona-micsupp: Enable SYSCLK for charge pump")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jiale Yao <yaojiale02@163.com>
> ---
>  drivers/regulator/arizona-micsupp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/regulator/arizona-micsupp.c b/drivers/regulator/arizona-micsupp.c
> index be7208bc7409..ae99173b8236 100644
> --- a/drivers/regulator/arizona-micsupp.c
> +++ b/drivers/regulator/arizona-micsupp.c
> @@ -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

>  	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;
>  }
> -- 
> 2.34.1
> 

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

end of thread, other threads:[~2026-10-28 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-28  4:50 [PATCH] regulator: arizona-micsupp: freeze charge-pump state work Jiale Yao
2026-10-28 14:38 ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®