[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CABawtvNrQ2wT49dns5gD-m_i4au5BiqQvpovSBEfD=1nbckC0g@mail.gmail.com>
Date: Fri, 16 Nov 2012 09:22:57 +0800
From: Ethan Zhao <ethan.kernel@...il.com>
To: DL-MPTFusionLinux@....com
Cc: yinghai@...nel.org, LKML <linux-kernel@...r.kernel.org>,
ethan.zhao@...cle.com
Subject: [patch]mpt2sas/mpt2sas_base.c temporarily mask the corrected AER bit
while driver initializing to suppress AER
Hi, Lsi guys,
On our servers (Sun fire X3-2/2L/2B, Sun fire X4-2/2L/2B ),
while loading mpt2sas driver, the _diag_reset action always triggers
correct AER,
So mask CRER bit before the reset action and restore it after
successful resetting.
Please help to check the attached patch, I have tested with
upstream kernel 3.7RC4.
Before applying the patch:
mpt2sas0: 64 BIT PCI BUS DMA ADDRESSING SUPPORTED, total mem (32836676 kB)
mpt2sas 0000:50:00.0: irq 106 for MSI/MSI-X
mpt2sas0-msix0: PCI-MSI-X enabled: IRQ 106
mpt2sas0: iomem(0x00000000c7cc0000), mapped(0xffffc900144d8000), size(16384)
mpt2sas0: ioport(0x0000000000005000), size(256)
mpt2sas0: sending diag reset !!
pcieport 0000:00:03.2: AER: Corrected error received: id=001a
pcieport 0000:00:03.2: PCIe Bus Error: severity=Corrected, type=Physical
Layer, id=001a(Receiver ID)
pcieport 0000:00:03.2: device [8086:3c0a] error
status/mask=00000001/00000000
pcieport 0000:00:03.2: [ 0] Receiver Error
mpt2sas0: diag reset: SUCCESS
mpt2sas0: Allocated physical memory: size(2998 kB)
mpt2sas0: Current Controller Queue Depth(1331), Max Controller Queue
Depth(1408)
mpt2sas0: Scatter Gather Elements per IO(128)
mpt2sas0: LSISAS2008: FWVersion(11.05.02.00), ChipRevision(0x03),
BiosVersion(07.21.03.00)
Applied the patch:
mpt2sas0: 64 BIT PCI BUS DMA ADDRESSING SUPPORTED, total mem (32836676 kB)
mpt2sas 0000:50:00.0: irq 106 for MSI/MSI-X
mpt2sas0-msix0: PCI-MSI-X enabled: IRQ 106
mpt2sas0: iomem(0x00000000c7cc0000), mapped(0xffffc900144d8000), size(16384)
mpt2sas0: ioport(0x0000000000005000), size(256)
mpt2sas0: sending diag reset !!
mpt2sas0: diag reset: SUCCESS
mpt2sas0: Allocated physical memory: size(2998 kB)
mpt2sas0: Current Controller Queue Depth(1331), Max Controller Queue
Depth(1408)
mpt2sas0: Scatter Gather Elements per IO(128)
mpt2sas0: LSISAS2008: FWVersion(11.05.02.00), ChipRevision(0x03),
BiosVersion(07.21.03.00)
Thanks,
Ethan
-------------------------------------------------------------------
>From 88f1ac6124678bbe45112ce070b62e709e7d72f7 Mon Sep 17 00:00:00 2001
From: ethan.zhao <ethan.kernel@...il.com>
Date: Fri, 16 Nov 2012 04:14:48 -0800
Subject: [PATCH 643/643] On some system, reset action during
initializing will trigger multiple corrected AER,
So mask corrected error before issue the reset and restore it after reset.
Tested working with
LSI Logic / Symbios Logic SAS2008 PCI-Expre ss Fusion-MPT SAS-2 [Falcon]
and Sun X3-2/2L/2B Servers(SUN FIRE X4170/X4270 M3), Sun X4-2/2L/2B servers
Signed-off-by: ethan.zhao <ethan.kernel@...il.com>
---
drivers/scsi/mpt2sas/mpt2sas_base.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c
b/drivers/scsi/mpt2sas/mpt2sas_base.c
index ffd85c5..ee54bb9 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -3873,6 +3873,17 @@ _base_diag_reset(struct MPT2SAS_ADAPTER *ioc,
int sleep_flag)
u32 ioc_state;
u32 count;
u32 hcb_size;
+ struct pci_dev *us_dev = ioc->pdev->bus->self;
+ int pos = pci_pcie_cap(us_dev);
+ u16 devctl;
+
+ /* On some system, reset action will trigger corrected AER,
+ * So mask corrected error before issue the reset and enable it
+ * after reset
+ */
+ pci_read_config_word(us_dev, pos + PCI_EXP_DEVCTL, &devctl);
+ pci_write_config_word(us_dev, pos + PCI_EXP_DEVCTL,
+ (devctl & ~PCI_EXP_DEVCTL_CERE));
printk(MPT2SAS_INFO_FMT "sending diag reset !!\n", ioc->name);
drsprintk(ioc, printk(MPT2SAS_INFO_FMT "clear interrupts\n",
@@ -3971,6 +3982,7 @@ _base_diag_reset(struct MPT2SAS_ADAPTER *ioc,
int sleep_flag)
}
printk(MPT2SAS_INFO_FMT "diag reset: SUCCESS\n", ioc->name);
+ pci_write_config_word(us_dev, pos + PCI_EXP_DEVCTL, devctl);
return 0;
out:
--
1.7.1
Download attachment "0643-On-some-system-reset-action-during-initializing-will.patch" of type "application/octet-stream" (1794 bytes)
Powered by blists - more mailing lists