[coreboot] [PATCH] chipset_enable: Fix open /dev/cpu

Myles Watson mylesgw at gmail.com
Wed May 6 00:19:20 CEST 2009



> -----Original Message-----
> From: coreboot-bounces at coreboot.org [mailto:coreboot-bounces at coreboot.org]
> On Behalf Of Carl-Daniel Hailfinger
> Sent: Tuesday, May 05, 2009 4:12 PM
> To: Beber
> Cc: coreboot at coreboot.org
> Subject: Re: [coreboot] [PATCH] chipset_enable: Fix open /dev/cpu
> 
> Hi Bertrand,
> 
> On 05.05.2009 22:22, Beber wrote:
> > Here is a fix for chipset_enable.c when there is not /dev/cpu. Open
> > fail no there is not reason to lseek in. Actually this is a trivial fix
> > for not well handled return from open.
> >
> 
> Although the fix seems trivial, it breaks the code a few lines down.
> With the old code, you got a meaningful error message about having to
> run "modprobe msr". This error message does not trigger anymore with the
> new code.
> Please fix. Thanks.

Is this what you're asking for?

Index: util/flashrom/chipset_enable.c
===================================================================
--- util/flashrom/chipset_enable.c	(revision 462)
+++ util/flashrom/chipset_enable.c	(working copy)
@@ -512,7 +512,8 @@
 
 	fd_msr = open("/dev/cpu/0/msr", O_RDWR);
 	if (fd_msr == -1) {
-		perror("open msr");
+		perror("open /dev/cpu/0/msr");
+		printf("Cannot open MSR. Did you run 'modprobe msr'?\n");
 		return -1;
 	}

Thanks,
Myles





More information about the coreboot mailing list