summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaowei Bao <xiaowei.bao@nxp.com>2019-09-25 22:55:17 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2020-03-30 12:58:07 +0100
commitf447359b6c3303745c44e087608e542031e79f42 (patch)
tree6386d3be32c8cc97f207683dc079a1b884bbfb22
parentab028c1d99520e4e8ce744a29a92ff9359b172b7 (diff)
PCI: mobiveil: ls_pcie_g4: fix SError when accessing config space
While the Mellanox driver is binding, the following kernel panic occurred: SError Interrupt on CPU1, code 0xbf000002 -- SError CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.3.0+ #392 Hardware name: SolidRun LX2160A COM express type 7 module (DT) pstate: 60400085 (nZCv daIf +PAN -UAO) pc : pci_generic_config_read+0xb0/0xc0 lr : pci_generic_config_read+0x1c/0xc0 sp : ffffff8010f9baf0 x29: ffffff8010f9baf0 x28: ffffff8010d620a0 x27: ffffff8010d79000 x26: ffffff8010d62000 x25: ffffff8010cb06d4 x24: 0000000000000000 x23: ffffff8010e499b8 x22: ffffff8010f9bbaf x21: 0000000000000000 x20: ffffffe2eda11800 x19: ffffff8010f62158 x18: ffffff8010bdede0 x17: ffffff8010bdede8 x16: ffffff8010b96970 x15: ffffffffffffffff x14: ffffffffff000000 x13: ffffffffffffffff x12: 0000000000000030 x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f x9 : 2dff716475687163 x8 : ffffffffffffffff x7 : fefefefefefefefe x6 : 0000000000000000 x5 : 0000000000000000 x4 : ffffff8010f9bb6c x3 : 0000000000000001 x2 : 0000000000000003 x1 : 0000000000000000 x0 : 0000000000000000 Kernel panic - not syncing: Asynchronous SError Interrupt CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.3.0+ #392 Hardware name: SolidRun LX2160A COM express type 7 module (DT) Call trace: dump_backtrace+0x0/0x120 show_stack+0x14/0x1c dump_stack+0x9c/0xc0 panic+0x148/0x34c print_tainted+0x0/0xa8 arm64_serror_panic+0x74/0x80 do_serror+0x8c/0x13c el1_error+0xbc/0x160 pci_generic_config_read+0xb0/0xc0 pci_bus_read_config_byte+0x64/0x90 pci_read_config_byte+0x40/0x48 pci_assign_irq+0x34/0xc8 pci_device_probe+0x28/0x148 really_probe+0x1c4/0x2d0 driver_probe_device+0x58/0xfc device_driver_attach+0x68/0x70 __driver_attach+0x94/0xdc bus_for_each_dev+0x50/0xa0 driver_attach+0x20/0x28 bus_add_driver+0x14c/0x200 driver_register+0x6c/0x124 __pci_register_driver+0x48/0x50 mlx4_init+0x154/0x180 do_one_initcall+0x30/0x250 kernel_init_freeable+0x23c/0x32c kernel_init+0x10/0xfc ret_from_fork+0x10/0x18 SMP: stopping secondary CPUs Kernel Offset: disabled CPU features: 0x0002,21006008 Memory Limit: none which appears to be due to: pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); in pci_assign_irq(). Avoiding that access just moves the SError later (e.g. while accessing the command register in pci_enable_device() instead.) This patch resolves the SError problem by preventing configuration accesses triggering a SError interrupt. Reported-by: Russell King <rmk+kernel@armlinux.org.uk> Tested-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com> [description modified -- rmk] Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
index 2bdce0fbe442..652edfd89946 100644
--- a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
+++ b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
@@ -243,13 +243,13 @@ static int ls_pcie_g4_read_other_conf(struct pci_bus *bus, unsigned int devfn,
struct ls_pcie_g4 *pcie = to_ls_pcie_g4(pci);
int ret;
- if (pcie->rev == REV_1_0 && where == PCI_VENDOR_ID)
+ if (pcie->rev == REV_1_0)
ls_pcie_g4_lut_writel(pcie, PCIE_LUT_GCR,
0 << PCIE_LUT_GCR_RRE);
ret = pci_generic_config_read(bus, devfn, where, size, val);
- if (pcie->rev == REV_1_0 && where == PCI_VENDOR_ID)
+ if (pcie->rev == REV_1_0)
ls_pcie_g4_lut_writel(pcie, PCIE_LUT_GCR,
1 << PCIE_LUT_GCR_RRE);