Skip to contentSkip to conversation

cpufreq: Print driver name if cpufreq_suspend() fails

PATCH In review Florian Fainelli 3 participants 4 messages Aug 21, 2019 – Aug 26, 2019 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: Print driver name if cpufreq_suspend() fails

Instead of printing the policy, which is incidentally a kernel pointer, so with limited interest, print the cpufreq driver name that failed to be suspend, which is more useful for debugging.

Fixes 2f0aea936360 ("cpufreq: suspend governors on system suspend/hibernate")
---
 drivers/cpufreq/cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/cpufreq.c +2 -2
index c28ebf2810f1..330d789f81fc 100644
@@ -1807,8 +1807,8 @@ void cpufreq_suspend(void)
 		}
 
 		if (cpufreq_driver->suspend && cpufreq_driver->suspend(policy))
-			pr_err("%s: Failed to suspend driver: %p\n", __func__,
-				policy);
+			pr_err("%s: Failed to suspend driver: %s\n", __func__,
+				cpufreq_driver->name);
 	}
 
 suspend:
Signature · 1 line
2.17.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Florian Fainelli

Instead of printing the policy, which is incidentally a kernel pointer, so with limited interest, print the cpufreq driver name that failed to be suspend, which is more useful for debugging.

Fixes 2f0aea936360 ("cpufreq: suspend governors on system suspend/hibernate")

I will drop this tag as this isn't a bug really.

Quoted 10 lines
---
 drivers/cpufreq/cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/cpufreq.c +0 -0
index c28ebf2810f1..330d789f81fc 100644

drivers/cpufreq/cpufreq.c void cpufreq_suspend(void) · line 1814

Quoted 10 lines
drivers/cpufreq/cpufreq.c +2 -2
@@ -1807,8 +1807,8 @@ void cpufreq_suspend(void)
 		}
 
 		if (cpufreq_driver->suspend && cpufreq_driver->suspend(policy))
-			pr_err("%s: Failed to suspend driver: %p\n", __func__,
-				policy);
+			pr_err("%s: Failed to suspend driver: %s\n", __func__,
+				cpufreq_driver->name);
 	}
 
 suspend:
Signature · 1 line
viresh
#2 lore raw
Quoted 8 lines · Viresh Kumar
Quoted 5 lines · Florian Fainelli

Instead of printing the policy, which is incidentally a kernel pointer, so with limited interest, print the cpufreq driver name that failed to be suspend, which is more useful for debugging.

Fixes 2f0aea936360 ("cpufreq: suspend governors on system suspend/hibernate")

I will drop this tag as this isn't a bug really.

Indeed, that was a bit too trigger happy on my side. Thanks!

Quoted 24 lines
Quoted 11 lines
---
 drivers/cpufreq/cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/cpufreq.c +0 -0
index c28ebf2810f1..330d789f81fc 100644

drivers/cpufreq/cpufreq.c void cpufreq_suspend(void) · line 1814

Quoted 10 lines
drivers/cpufreq/cpufreq.c +2 -2
@@ -1807,8 +1807,8 @@ void cpufreq_suspend(void)
 		}
 
 		if (cpufreq_driver->suspend && cpufreq_driver->suspend(policy))
-			pr_err("%s: Failed to suspend driver: %p\n", __func__,
-				policy);
+			pr_err("%s: Failed to suspend driver: %s\n", __func__,
+				cpufreq_driver->name);
 	}
 
 suspend:
Signature · 1 line
Florian
#3 lore raw
Quoted 11 lines · CEST Florian Fainelli
Quoted 8 lines · Viresh Kumar
Quoted 5 lines · Florian Fainelli

Instead of printing the policy, which is incidentally a kernel pointer, so with limited interest, print the cpufreq driver name that failed to be suspend, which is more useful for debugging.

Fixes 2f0aea936360 ("cpufreq: suspend governors on system suspend/hibernate")

I will drop this tag as this isn't a bug really.

Indeed, that was a bit too trigger happy on my side. Thanks!

Applied without the Fixes tag, thanks!

Quoted 27 lines
Quoted 24 lines
Quoted 11 lines
---
 drivers/cpufreq/cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/cpufreq.c +0 -0
index c28ebf2810f1..330d789f81fc 100644

drivers/cpufreq/cpufreq.c void cpufreq_suspend(void) · line 1814

Quoted 10 lines
drivers/cpufreq/cpufreq.c +2 -2
@@ -1807,8 +1807,8 @@ void cpufreq_suspend(void)
 		}
 
 		if (cpufreq_driver->suspend && cpufreq_driver->suspend(policy))
-			pr_err("%s: Failed to suspend driver: %p\n", __func__,
-				policy);
+			pr_err("%s: Failed to suspend driver: %s\n", __func__,
+				cpufreq_driver->name);
 	}
 
 suspend: