RE: Problems with EDAC coexisting with BIOS

Gross, Mark
2006-04-25T23:26:17Z

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

>-----Original Message-----
>From: Corey Minyard [mailto:minyard@acm.org]
>Sent: Tuesday, April 25, 2006 3:40 PM
>To: Gross, Mark
>Cc: Alan Cox; bluesmoke-devel@lists.sourceforge.net; LKML; Carbonari,
>Steven; Ong, Soo Keong; Wang, Zhenyu Z
>Subject: Re: Problems with EDAC coexisting with BIOS
>
>Gross, Mark wrote:
>
>>>
>>>
>>>
>>
>>Done.
>>Signed-off-by: Mark Gross
>>
>>
>>--mgross
>>
>>
>Yes, this is what I was talking about. I believe the mode of
>module_param should be 444, since modifying this after the module is
>loaded won't do anything. Also, it might be nice to print something
>different in the "force" case.

How about printing nothing like it used too?

See attached.

Signed-off-by: Mark Gross

--mgross

[-- Attachment #2: e752x_edac.patch --]
[-- Type: application/octet-stream, Size: 1739 bytes --]

diff -urN -X linux-2.6.16/Documentation/dontdiff linux-2.6.16/drivers/edac/e752x_edac.c linux-2.6.16_edac/drivers/edac/e752x_edac.c
--- linux-2.6.16/drivers/edac/e752x_edac.c 2006-03-19 21:53:29.000000000 -0800
+++ linux-2.6.16_edac/drivers/edac/e752x_edac.c 2006-04-25 16:19:25.000000000 -0700
@@ -29,6 +29,7 @@

#include "edac_mc.h"

+static int force_function_unhide = 0;

#ifndef PCI_DEVICE_ID_INTEL_7520_0
#define PCI_DEVICE_ID_INTEL_7520_0 0x3590
@@ -755,10 +756,18 @@
debugf0("MC: " __FILE__ ": %s(): mci\n", __func__);
debugf0("Starting Probe1\n");

- /* enable device 0 function 1 */
+ /* check to see if device 0 function 1 is enbaled if it isn't we
+ * assume the BIOS has reserved it for a reason and is expecting
+ * exclusive access, we take care to not violate that assumption and
+ * fail the probe. */
pci_read_config_byte(pdev, E752X_DEVPRES1, &stat8);
- stat8 |= (1 << 5);
- pci_write_config_byte(pdev, E752X_DEVPRES1, stat8);
+ if (!force_function_unhide && !(stat8 & (1 << 5))) {
+ printk(KERN_INFO "contact your bios vendor to see if the "
+ "E752x error registers can be safely un-hidden\n");
+ goto fail;
+ }
+ stat8 |= (1 << 5);
+ pci_write_config_byte(pdev, E752X_DEVPRES1, stat8);

/* need to find out the number of channels */
pci_read_config_dword(pdev, E752X_DRC, &drc);
@@ -1069,3 +1078,8 @@
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Linux Networx (http://lnxi.com) Tom Zimmerman\n");
MODULE_DESCRIPTION("MC support for Intel e752x memory controllers");
+
+module_param(force_function_unhide, int, 0444);
+MODULE_PARM_DESC(force_function_unhide, "if BIOS sets Dev0:Fun1 up as hidden:"
+" 1=force unhide and hope BIOS doesn't fight driver for Dev0:Fun1 access");
+