Skip to contentSkip to conversation

regulator: core: Use the power efficient workqueue for delayed powerdown

PATCH In review Mark Brown 2 participants 3 messages Jul 18, 2013 Voltage and current regulator framework

lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/1 regulator: core: Use the power efficient workqueue for delayed powerdown

From: Mark Brown <[email protected]>

There is no need to use a normal per-CPU workqueue for delayed power downs as they're not timing or performance critical and waking up a core for them would defeat some of the point.

---
 drivers/regulator/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/regulator/core.c +3 -2
index b6efead..6ef476f 100644
@@ -1891,8 +1891,9 @@ int regulator_disable_deferred(struct regulator *regulator, int ms)
 	rdev->deferred_disables++;
 	mutex_unlock(&rdev->mutex);
 
-	ret = schedule_delayed_work(&rdev->disable_work,
-				    msecs_to_jiffies(ms));
+	ret = queue_delayed_work(system_power_efficient_wq,
+				 &rdev->disable_work,
+				 msecs_to_jiffies(ms));
 	if (ret < 0)
 		return ret;
 	else
Signature · 1 line
1.8.3.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Mark Brown

From: Mark Brown <[email protected]>

There is no need to use a normal per-CPU workqueue for delayed power downs as they're not timing or performance critical and waking up a core for them would defeat some of the point.

---
 drivers/regulator/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/regulator/core.c +0 -0
index b6efead..6ef476f 100644
@@ -1891,8 +1891,9 @@ int regulator_disable_deferred(struct regulator *regulator, int ms)
        rdev->deferred_disables++;

drivers/regulator/core.c int regulator_disable_deferred(struct regulator *regulator, int ms) · line 1899

Quoted 10 lines
drivers/regulator/core.c +3 -2
        mutex_unlock(&rdev->mutex);
 
-       ret = schedule_delayed_work(&rdev->disable_work,
-                                   msecs_to_jiffies(ms));
+       ret = queue_delayed_work(system_power_efficient_wq,
+                                &rdev->disable_work,
+                                msecs_to_jiffies(ms));
        if (ret < 0)
                return ret;
        else

Cool!! People have started to use this interface now :)

author maintainer
#2 lore raw
Quoted 1 line · Viresh Kumar

Cool!! People have started to use this interface now :)

It could do with a bit more publicity - the only reason I heard of it is that I queried what a version of it was doing in the middle of big.LITTLE patches for the LSK and why it wasn't upstream.