From: Alan Cox If a card reports 0xFFFF check if the devid is also all 0xFFFFFFFF and if so assume the card was pulled rather than showing parity errors. This avoids us spewing errors when a card is yanked and hotplug hasn't caught up with it. Also default PCI scan to off as it has a performance impact and is relevant to a minority of users only. Users can enable it when they need it. Signed-off-by: Andrew Morton --- drivers/edac/edac_mc.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletion(-) diff -puN drivers/edac/edac_mc.c~edac-change-default-also-handle-pulled-hardware drivers/edac/edac_mc.c --- devel/drivers/edac/edac_mc.c~edac-change-default-also-handle-pulled-hardware 2006-01-10 01:50:05.000000000 -0800 +++ devel-akpm/drivers/edac/edac_mc.c 2006-01-10 01:50:05.000000000 -0800 @@ -51,7 +51,7 @@ static int log_ce = 1; static int panic_on_ue = 1; static int poll_msec = 1000; -static int check_pci_parity = 1; /* default YES check PCI parity */ +static int check_pci_parity = 0; /* default YES check PCI parity */ static int panic_on_pci_parity; /* default no panic on PCI Parity */ static atomic_t pci_parity_count = ATOMIC_INIT(0); @@ -1753,6 +1753,17 @@ static u16 get_pci_parity_status(struct where = secondary ? PCI_SEC_STATUS : PCI_STATUS; pci_read_config_word(dev, where, &status); + + /* If we get back 0xFFFF then we must suspect that the card has been pulled but + the Linux PCI layer has not yet finished cleaning up. We don't want to report + on such devices */ + + if (status == 0xFFFF) { + u32 sanity; + pci_read_config_dword(dev, 0, &sanity); + if (sanity == 0xFFFFFFFF) + return 0; + } status &= PCI_STATUS_DETECTED_PARITY | PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_PARITY; _