All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 1/2 Improve Error reporting
@ 2005-11-10 22:52 Langsdorf, Mark
  0 siblings, 0 replies; 3+ messages in thread
From: Langsdorf, Mark @ 2005-11-10 22:52 UTC (permalink / raw)
  To: cpufreq; +Cc: shin, jacob

[-- Attachment #1: Type: text/plain, Size: 212 bytes --]

This patch cleans up some error messages in the 
powernow-k8 driver and makes them more understandable.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>
Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>

[-- Attachment #2: pn-cleanup.patch --]
[-- Type: application/octet-stream, Size: 2900 bytes --]

--- powernow-k8.c.orig	2005-11-10 13:23:44.000000000 -0600
+++ powernow-k8.c	2005-11-10 13:39:03.000000000 -0600
@@ -44,7 +44,7 @@
 
 #define PFX "powernow-k8: "
 #define BFX PFX "BIOS error: "
-#define VERSION "version 1.50.4"
+#define VERSION "version 1.50.5"
 #include "powernow-k8.h"
 
 /* serialize freq changes  */
@@ -464,7 +464,7 @@ static int check_supported_cpu(unsigned 
 	schedule();
 
 	if (smp_processor_id() != cpu) {
-		printk(KERN_ERR "limiting to cpu %u failed\n", cpu);
+		printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu);
 		goto out;
 	}
 
@@ -519,22 +519,28 @@ static int check_pst_table(struct powern
 			printk(KERN_ERR BFX "maxvid exceeded with pstate %d\n", j);
 			return -ENODEV;
 		}
-		if ((pst[j].fid > MAX_FID)
-		    || (pst[j].fid & 1)
-		    || (j && (pst[j].fid < HI_FID_TABLE_BOTTOM))) {
+		if (pst[j].fid > MAX_FID) {
+			printk(KERN_ERR BFX "maxfid exceeded with pstate %d\n", j);
+			return -ENODEV;
+		}
+		if (pst[j].fid & 1) {
+			printk(KERN_ERR BFX "fid invalid - %d : 0x%x\n", j, pst[j].fid);
+			return -EINVAL;
+		}
+		if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) {
 			/* Only first fid is allowed to be in "low" range */
-			printk(KERN_ERR PFX "two low fids - %d : 0x%x\n", j, pst[j].fid);
+			printk(KERN_ERR BFX "two low fids - %d : 0x%x\n", j, pst[j].fid);
 			return -EINVAL;
 		}
 		if (pst[j].fid < lastfid)
 			lastfid = pst[j].fid;
 	}
 	if (lastfid & 1) {
-		printk(KERN_ERR PFX "lastfid invalid\n");
+		printk(KERN_ERR BFX "lastfid invalid\n");
 		return -EINVAL;
 	}
 	if (lastfid > LO_FID_TABLE_TOP)
-		printk(KERN_INFO PFX  "first fid not from lo freq table\n");
+		printk(KERN_INFO BFX  "first fid not from lo freq table\n");
 
 	return 0;
 }
@@ -915,7 +921,7 @@ static int powernowk8_target(struct cpuf
 	schedule();
 
 	if (smp_processor_id() != pol->cpu) {
-		printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu);
+		printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
 		goto err_out;
 	}
 
@@ -987,6 +993,9 @@ static int __init powernowk8_cpu_init(st
 	cpumask_t oldmask = CPU_MASK_ALL;
 	int rc, i;
 
+	if (!cpu_online(pol->cpu))
+		return -ENODEV;
+
 	if (!check_supported_cpu(pol->cpu))
 		return -ENODEV;
 
@@ -1028,7 +1037,7 @@ static int __init powernowk8_cpu_init(st
 	schedule();
 
 	if (smp_processor_id() != pol->cpu) {
-		printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu);
+		printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
 		goto err_out;
 	}
 
@@ -1174,7 +1183,7 @@ static void __exit powernowk8_exit(void)
 	cpufreq_unregister_driver(&cpufreq_amd64_driver);
 }
 
-MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark Langsdorf <mark.langsdorf@amd.com.");
+MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark Langsdorf <mark.langsdorf@amd.com>");
 MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver.");
 MODULE_LICENSE("GPL");
 

[-- Attachment #3: Type: text/plain, Size: 147 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq

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

* RE: [PATCH] 1/2 Improve Error reporting
@ 2005-11-21 18:02 shin, jacob
  2005-11-21 18:22 ` Dave Jones
  0 siblings, 1 reply; 3+ messages in thread
From: shin, jacob @ 2005-11-21 18:02 UTC (permalink / raw)
  To: Dave Jones, cpufreq

On Monday, November 21, 2005 9:36 AM Dave Jones wrote:
> (Also: Please make your patches so that they apply with -p1

here is the cleanup patch again, to be applied w/ -p1 flag.

---

Improve Error reporting in powernow-k8.

This patch also gets rid of "limiting to cpu failed" printk's when
compiled with CONFIG_CPU_HOTPLUG.

Jacob Shin <jacob.shin@amd.com>

--- linux/arch/i386/kernel/cpu/cpufreq/powernow-k8.c.orig
2005-11-19 19:25:03.000000000 -0800
+++ linux/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2005-11-21
09:27:05.192971592 -0800
@@ -45,7 +45,7 @@
 
 #define PFX "powernow-k8: "
 #define BFX PFX "BIOS error: "
-#define VERSION "version 1.50.4"
+#define VERSION "version 1.50.5"
 #include "powernow-k8.h"
 
 /* serialize freq changes  */
@@ -464,7 +464,7 @@ static int check_supported_cpu(unsigned 
 	set_cpus_allowed(current, cpumask_of_cpu(cpu));
 
 	if (smp_processor_id() != cpu) {
-		printk(KERN_ERR "limiting to cpu %u failed\n", cpu);
+		printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu);
 		goto out;
 	}
 
@@ -517,22 +517,28 @@ static int check_pst_table(struct powern
 			printk(KERN_ERR BFX "maxvid exceeded with pstate
%d\n", j);
 			return -ENODEV;
 		}
-		if ((pst[j].fid > MAX_FID)
-		    || (pst[j].fid & 1)
-		    || (j && (pst[j].fid < HI_FID_TABLE_BOTTOM))) {
+		if (pst[j].fid > MAX_FID) {
+			printk(KERN_ERR BFX "maxfid exceeded with pstate
%d\n", j);
+			return -ENODEV;
+		}
+		if (pst[j].fid & 1) {
+			printk(KERN_ERR BFX "fid invalid - %d : 0x%x\n",
j, pst[j].fid);
+			return -EINVAL;
+		}
+		if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) {
 			/* Only first fid is allowed to be in "low"
range */
-			printk(KERN_ERR PFX "two low fids - %d :
0x%x\n", j, pst[j].fid);
+			printk(KERN_ERR BFX "two low fids - %d :
0x%x\n", j, pst[j].fid);
 			return -EINVAL;
 		}
 		if (pst[j].fid < lastfid)
 			lastfid = pst[j].fid;
 	}
 	if (lastfid & 1) {
-		printk(KERN_ERR PFX "lastfid invalid\n");
+		printk(KERN_ERR BFX "lastfid invalid\n");
 		return -EINVAL;
 	}
 	if (lastfid > LO_FID_TABLE_TOP)
-		printk(KERN_INFO PFX  "first fid not from lo freq
table\n");
+		printk(KERN_INFO BFX  "lastfid not from lo freq
table\n");
 
 	return 0;
 }
@@ -912,7 +918,7 @@ static int powernowk8_target(struct cpuf
 	set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
 
 	if (smp_processor_id() != pol->cpu) {
-		printk(KERN_ERR "limiting to cpu %u failed\n",
pol->cpu);
+		printk(KERN_ERR PFX "limiting to cpu %u failed\n",
pol->cpu);
 		goto err_out;
 	}
 
@@ -982,6 +988,9 @@ static int __init powernowk8_cpu_init(st
 	cpumask_t oldmask = CPU_MASK_ALL;
 	int rc, i;
 
+	if (!cpu_online(pol->cpu))
+		return -ENODEV;
+
 	if (!check_supported_cpu(pol->cpu))
 		return -ENODEV;
 
@@ -1021,7 +1030,7 @@ static int __init powernowk8_cpu_init(st
 	set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
 
 	if (smp_processor_id() != pol->cpu) {
-		printk(KERN_ERR "limiting to cpu %u failed\n",
pol->cpu);
+		printk(KERN_ERR PFX "limiting to cpu %u failed\n",
pol->cpu);
 		goto err_out;
 	}
 
@@ -1162,7 +1171,7 @@ static void __exit powernowk8_exit(void)
 	cpufreq_unregister_driver(&cpufreq_amd64_driver);
 }
 
-MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark
Langsdorf <mark.langsdorf@amd.com.");
+MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark
Langsdorf <mark.langsdorf@amd.com>");
 MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency
driver.");
 MODULE_LICENSE("GPL");

On Thursday, November 10, 2005 4:52 PM Langsdorf, Mark wrote:
> This patch cleans up some error messages in the
> powernow-k8 driver and makes them more understandable.
> 
> Signed-off-by: Jacob Shin <jacob.shin@amd.com>
> Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>

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

* Re: [PATCH] 1/2 Improve Error reporting
  2005-11-21 18:02 [PATCH] 1/2 Improve Error reporting shin, jacob
@ 2005-11-21 18:22 ` Dave Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Jones @ 2005-11-21 18:22 UTC (permalink / raw)
  To: shin, jacob; +Cc: cpufreq

On Mon, Nov 21, 2005 at 12:02:29PM -0600, shin, jacob wrote:
 > On Monday, November 21, 2005 9:36 AM Dave Jones wrote:
 > > (Also: Please make your patches so that they apply with -p1
 > 
 > here is the cleanup patch again, to be applied w/ -p1 flag.

Thanks, I already fixed this one up by hand, it's in
the cpufreq.git tree which should get pulled into the next
2.6-mm

		Dave

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

end of thread, other threads:[~2005-11-21 18:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-21 18:02 [PATCH] 1/2 Improve Error reporting shin, jacob
2005-11-21 18:22 ` Dave Jones
  -- strict thread matches above, loose matches on Subject: below --
2005-11-10 22:52 Langsdorf, Mark

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.