public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] x86: microcode: Cosmetic changes
@ 2008-06-10 11:15 Ben Castricum
  2008-06-11 17:09 ` Dave Jones
  2008-07-03  9:41 ` Ingo Molnar
  0 siblings, 2 replies; 5+ messages in thread
From: Ben Castricum @ 2008-06-10 11:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: trivial


First announce ourself, then start working. Currently this module reports 
itself when all is completed which is not most modules do. Plus some 
cosmetic/whitespace cleanups.

Signed-off-by: Ben Castricum <lk0806@bencastricum.nl>
---

diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c
index 69729e3..8ce70ac 100644
--- a/arch/x86/kernel/microcode.c
+++ b/arch/x86/kernel/microcode.c
@@ -5,13 +5,14 @@
  *		      2006	Shaohua Li <shaohua.li@intel.com>
  *
  *	This driver allows to upgrade microcode on Intel processors
- *	belonging to IA-32 family - PentiumPro, Pentium II, 
+ *	belonging to IA-32 family - PentiumPro, Pentium II,
  *	Pentium III, Xeon, Pentium 4, etc.
  *
- *	Reference: Section 8.10 of Volume III, Intel Pentium 4 Manual, 
- *	Order Number 245472 or free download from:
- *		
- *	http://developer.intel.com/design/pentium4/manuals/245472.htm
+ *	Reference: Section 8.11 of Volume 3a, IA-32 Intel? Architecture
+ *	Software Developer's Manual
+ *	Order Number 253668 or free download from:
+ *
+ *	http://developer.intel.com/design/pentium4/manuals/253668.htm
  *
  *	For more information, go to http://www.urbanmyth.org/microcode
  *
@@ -58,12 +59,12 @@
  *		nature of implementation.
  *	1.11	22 Mar 2002 Tigran Aivazian <tigran@veritas.com>
  *		Fix the panic when writing zero-length microcode chunk.
- *	1.12	29 Sep 2003 Nitin Kamble <nitin.a.kamble@intel.com>, 
+ *	1.12	29 Sep 2003 Nitin Kamble <nitin.a.kamble@intel.com>,
  *		Jun Nakajima <jun.nakajima@intel.com>
  *		Support for the microcode updates in the new format.
  *	1.13	10 Oct 2003 Tigran Aivazian <tigran@veritas.com>
  *		Removed ->read() method and obsoleted MICROCODE_IOCFREE ioctl
- *		because we no longer hold a copy of applied microcode 
+ *		because we no longer hold a copy of applied microcode
  *		in kernel memory.
  *	1.14	25 Jun 2004 Tigran Aivazian <tigran@veritas.com>
  *		Fix sigmatch() macro to handle old CPUs with pf == 0.
@@ -320,11 +321,11 @@ static void apply_microcode(int cpu)
 		return;
 
 	/* serialize access to the physical write to MSR 0x79 */
-	spin_lock_irqsave(&microcode_update_lock, flags);          
+	spin_lock_irqsave(&microcode_update_lock, flags);
 
 	/* write microcode via MSR 0x79 */
 	wrmsr(MSR_IA32_UCODE_WRITE,
-		(unsigned long) uci->mc->bits, 
+		(unsigned long) uci->mc->bits,
 		(unsigned long) uci->mc->bits >> 16 >> 16);
 	wrmsr(MSR_IA32_UCODE_REV, 0, 0);
 
@@ -341,7 +342,7 @@ static void apply_microcode(int cpu)
 		return;
 	}
 	printk(KERN_INFO "microcode: CPU%d updated from revision "
-	       "0x%x to 0x%x, date = %08x \n", 
+	       "0x%x to 0x%x, date = %08x \n",
 	       cpu_num, uci->rev, val[1], uci->mc->hdr.date);
 	uci->rev = val[1];
 }
@@ -534,7 +535,7 @@ static int cpu_request_microcode(int cpu
 		c->x86, c->x86_model, c->x86_mask);
 	error = request_firmware(&firmware, name, &microcode_pdev->dev);
 	if (error) {
-		pr_debug("microcode: ucode data file %s load failed\n", name);
+		pr_debug("microcode: data file %s load failed\n", name);
 		return error;
 	}
 	buf = firmware->data;
@@ -805,6 +806,9 @@ static int __init microcode_init (void)
 {
 	int error;
 
+	printk(KERN_INFO
+		"IA-32 Microcode Update Driver: v" MICROCODE_VERSION " <tigran@aivazian.fsnet.co.uk>\n");
+
 	error = microcode_dev_init();
 	if (error)
 		return error;
@@ -825,9 +829,6 @@ static int __init microcode_init (void)
 	}
 
 	register_hotcpu_notifier(&mc_cpu_notifier);
-
-	printk(KERN_INFO 
-		"IA-32 Microcode Update Driver: v" MICROCODE_VERSION " <tigran@aivazian.fsnet.co.uk>\n");
 	return 0;
 }
 

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

* Re: [patch] x86: microcode: Cosmetic changes
  2008-06-10 11:15 [patch] x86: microcode: Cosmetic changes Ben Castricum
@ 2008-06-11 17:09 ` Dave Jones
  2008-06-12  5:52   ` Giacomo Catenazzi
  2008-07-03  9:41 ` Ingo Molnar
  1 sibling, 1 reply; 5+ messages in thread
From: Dave Jones @ 2008-06-11 17:09 UTC (permalink / raw)
  To: Ben Castricum; +Cc: linux-kernel, trivial

On Tue, Jun 10, 2008 at 01:15:12PM +0200, Ben Castricum wrote:
 > @@ -805,6 +806,9 @@ static int __init microcode_init (void)
 >  {
 >  	int error;
 >  
 > +	printk(KERN_INFO
 > +		"IA-32 Microcode Update Driver: v" MICROCODE_VERSION " <tigran@aivazian.fsnet.co.uk>\n");
 > +
 >  	error = microcode_dev_init();
 >  	if (error)
 >  		return error;
 > @@ -825,9 +829,6 @@ static int __init microcode_init (void)
 >  	}
 >  
 >  	register_hotcpu_notifier(&mc_cpu_notifier);
 > -
 > -	printk(KERN_INFO 
 > -		"IA-32 Microcode Update Driver: v" MICROCODE_VERSION " <tigran@aivazian.fsnet.co.uk>\n");
 >  	return 0;

By doing this before the registration of the sysdev, we'll
now be printing this on machines that don't have the microcode
update facility.   Pointless spew, for no obvious gain imo.

[Why we go through so many hoops before we check if the CPU is
 capable is a mystery to me. It would make more sense to have
 that be the first thing that gets checked when this inits]

	Dave

-- 
http://www.codemonkey.org.uk

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

* Re: [patch] x86: microcode: Cosmetic changes
  2008-06-11 17:09 ` Dave Jones
@ 2008-06-12  5:52   ` Giacomo Catenazzi
  2008-06-12  7:48     ` Tigran Aivazian
  0 siblings, 1 reply; 5+ messages in thread
From: Giacomo Catenazzi @ 2008-06-12  5:52 UTC (permalink / raw)
  To: Dave Jones, Ben Castricum, linux-kernel, trivial, Tigran Aivazian

Dave Jones wrote:
> On Tue, Jun 10, 2008 at 01:15:12PM +0200, Ben Castricum wrote:
>  > @@ -805,6 +806,9 @@ static int __init microcode_init (void)
>  >  {
>  >  	int error;
>  >  
>  > +	printk(KERN_INFO
>  > +		"IA-32 Microcode Update Driver: v" MICROCODE_VERSION " <tigran@aivazian.fsnet.co.uk>\n");
>  > +
>  >  	error = microcode_dev_init();
>  >  	if (error)
>  >  		return error;
>  > @@ -825,9 +829,6 @@ static int __init microcode_init (void)
>  >  	}
>  >  
>  >  	register_hotcpu_notifier(&mc_cpu_notifier);
>  > -
>  > -	printk(KERN_INFO 
>  > -		"IA-32 Microcode Update Driver: v" MICROCODE_VERSION " <tigran@aivazian.fsnet.co.uk>\n");
>  >  	return 0;
> 
> By doing this before the registration of the sysdev, we'll
> now be printing this on machines that don't have the microcode
> update facility.   Pointless spew, for no obvious gain imo.
> 
> [Why we go through so many hoops before we check if the CPU is
>  capable is a mystery to me. It would make more sense to have
>  that be the first thing that gets checked when this inits]

I would remove the printk:
- it is the only email on my dmesg, along two other copyright
  notices (Ingo and Intel). So it seems that the dmesg clean-up
  is going on.
- the code of driver is stable, and now it is updated only in
  kernel trees, so IMO it is better to use kernel version on
  bug report. BTW I don't think people will update the version
  number of driver.
- IMO it is enough to printk the microcode loads, not the
  driver load.

ciao
	cate

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

* Re: [patch] x86: microcode: Cosmetic changes
  2008-06-12  5:52   ` Giacomo Catenazzi
@ 2008-06-12  7:48     ` Tigran Aivazian
  0 siblings, 0 replies; 5+ messages in thread
From: Tigran Aivazian @ 2008-06-12  7:48 UTC (permalink / raw)
  To: Giacomo Catenazzi; +Cc: Dave Jones, Ben Castricum, linux-kernel, trivial

On Thu, 12 Jun 2008, Giacomo Catenazzi wrote:
> Dave Jones wrote:
>> On Tue, Jun 10, 2008 at 01:15:12PM +0200, Ben Castricum wrote:
>> > @@ -805,6 +806,9 @@ static int __init microcode_init (void)
>> >  {
>> >  	int error;
>> >
>> > +	printk(KERN_INFO
>> > +		"IA-32 Microcode Update Driver: v" MICROCODE_VERSION " <tigran@aivazian.fsnet.co.uk>\n");
>> > +
>> >  	error = microcode_dev_init();
>> >  	if (error)
>> >  		return error;
>> > @@ -825,9 +829,6 @@ static int __init microcode_init (void)
>> >  	}
>> >
>> >  	register_hotcpu_notifier(&mc_cpu_notifier);
>> > -
>> > -	printk(KERN_INFO
>> > -		"IA-32 Microcode Update Driver: v" MICROCODE_VERSION " <tigran@aivazian.fsnet.co.uk>\n");
>> >  	return 0;
>>
>> By doing this before the registration of the sysdev, we'll
>> now be printing this on machines that don't have the microcode
>> update facility.   Pointless spew, for no obvious gain imo.
>>
>> [Why we go through so many hoops before we check if the CPU is
>>  capable is a mystery to me. It would make more sense to have
>>  that be the first thing that gets checked when this inits]
>
> I would remove the printk:
> - it is the only email on my dmesg, along two other copyright
>  notices (Ingo and Intel). So it seems that the dmesg clean-up
>  is going on.
> - the code of driver is stable, and now it is updated only in
>  kernel trees, so IMO it is better to use kernel version on
>  bug report. BTW I don't think people will update the version
>  number of driver.
> - IMO it is enough to printk the microcode loads, not the
>  driver load.

I would prefer Dave's suggestion, i.e. doing the printk after the 
initialization.

Btw, it is not the only email, you forgot the "root@<localmachine>" in the 
kernel utsname printout :)

$ dmesg | grep @
Linux version 2.6.24.4 (root@elpis) (gcc version 4.1.1 20061011 (Red Hat 4.1.1-30)) #1 SMP Thu Mar 27 17:24:19 GMT 2008

If you want so much to remove something you may remove my email address 
from the printk, but please leave the basic message about driver loading. 
This way we know that the driver initialized itself and loaded 
successfully.

Kind regards
Tigran

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

* Re: [patch] x86: microcode: Cosmetic changes
  2008-06-10 11:15 [patch] x86: microcode: Cosmetic changes Ben Castricum
  2008-06-11 17:09 ` Dave Jones
@ 2008-07-03  9:41 ` Ingo Molnar
  1 sibling, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2008-07-03  9:41 UTC (permalink / raw)
  To: Ben Castricum; +Cc: linux-kernel, trivial, the arch/x86 maintainers


* Ben Castricum <lk0806@bencastricum.nl> wrote:

> First announce ourself, then start working. Currently this module 
> reports itself when all is completed which is not most modules do. 
> Plus some cosmetic/whitespace cleanups.
> 
> Signed-off-by: Ben Castricum <lk0806@bencastricum.nl>

applied to tip/x86/cleanups - thanks Ben,

	Ingo

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

end of thread, other threads:[~2008-07-03 12:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-10 11:15 [patch] x86: microcode: Cosmetic changes Ben Castricum
2008-06-11 17:09 ` Dave Jones
2008-06-12  5:52   ` Giacomo Catenazzi
2008-06-12  7:48     ` Tigran Aivazian
2008-07-03  9:41 ` Ingo Molnar

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