Skip to contentSkip to conversation

cpufreq: intel_pstate: Allow repeated intel_pstate disable

PATCH Applied Fabio M. De Francesco 3 participants 3 messages Feb 19 – Mar 6

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: intel_pstate: Allow repeated intel_pstate disable

Repeated intel_pstate disables currently return an error, adding unnecessary complexity to userspace scripts which must first read the current state and conditionally write 'off'.

Make repeated intel_pstate disables a no-op.

---
 drivers/cpufreq/intel_pstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/intel_pstate.c +1 -1
index 1625ec2d0d06..d639cc150092 100644
@@ -3470,7 +3470,7 @@ static int intel_pstate_update_status(const char *buf, size_t size)
 {
 	if (size == 3 && !strncmp(buf, "off", size)) {
 		if (!intel_pstate_driver)
-			return -EINVAL;
+			return 0;
 
 		if (hwp_active)
 			return -EBUSY;
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Fabio M. De Francesco

Repeated intel_pstate disables currently return an error, adding unnecessary
complexity to userspace scripts which must first read the current state and
conditionally write 'off'.

Make repeated intel_pstate disables a no-op.

Cc: Artem Bityutskiy <[email protected]>
Signed-off-by: Fabio M. De Francesco
<[email protected]>

Quoted 19 lines

---
 drivers/cpufreq/intel_pstate.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/intel_pstate.c +1 -1
index 1625ec2d0d06..d639cc150092 100644
@@ -3470,7 +3470,7 @@ static int intel_pstate_update_status(const
 char *buf, size_t size)
  {
  	if (size == 3 && !strncmp(buf, "off", size)) {
  		if (!intel_pstate_driver)
-			return -EINVAL;
+			return 0;


  if (hwp_active)
  return -EBUSY;

maintainer Applied
#2 lore raw
Quoted 33 lines · srinivas pandruvada
Quoted 11 lines · Fabio M. De Francesco

Repeated intel_pstate disables currently return an error, adding unnecessary
complexity to userspace scripts which must first read the current state and
conditionally write 'off'.

Make repeated intel_pstate disables a no-op.

Cc: Artem Bityutskiy <[email protected]>
Signed-off-by: Fabio M. De Francesco
<[email protected]>

Quoted 17 lines
---
 drivers/cpufreq/intel_pstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/intel_pstate.c +1 -1
index 1625ec2d0d06..d639cc150092 100644
@@ -3470,7 +3470,7 @@ static int intel_pstate_update_status(const
 char *buf, size_t size)
 {
      if (size == 3 && !strncmp(buf, "off", size)) {
              if (!intel_pstate_driver)
-                     return -EINVAL;
+                     return 0;
 
Quoted 2 lines
Quoted 2 lines
drivers/cpufreq/intel_pstate.c +0 -0
              if (hwp_active)
                      return -EBUSY;

Applied as 7.1 material, thanks!