Skip to content

Commit 29b83a6

Browse files
Songyang Litsbogend
authored andcommitted
MIPS: Octeon: Add PCIe link status check
The standard PCIe configuration read-write interface is used to access the configuration space of the peripheral PCIe devices of the mips processor after the PCIe link surprise down, it can generate kernel panic caused by "Data bus error". So it is necessary to add PCIe link status check for system protection. When the PCIe link is down or in training, assigning a value of 0 to the configuration address can prevent read-write behavior to the configuration space of peripheral PCIe devices, thereby preventing kernel panic. Signed-off-by: Songyang Li <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent a1b7508 commit 29b83a6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/mips/pci/pcie-octeon.c

100644100755
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,18 @@ static inline uint64_t __cvmx_pcie_build_config_addr(int pcie_port, int bus,
230230
{
231231
union cvmx_pcie_address pcie_addr;
232232
union cvmx_pciercx_cfg006 pciercx_cfg006;
233+
union cvmx_pciercx_cfg032 pciercx_cfg032;
233234

234235
pciercx_cfg006.u32 =
235236
cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG006(pcie_port));
236237
if ((bus <= pciercx_cfg006.s.pbnum) && (dev != 0))
237238
return 0;
238239

240+
pciercx_cfg032.u32 =
241+
cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port));
242+
if ((pciercx_cfg032.s.dlla == 0) || (pciercx_cfg032.s.lt == 1))
243+
return 0;
244+
239245
pcie_addr.u64 = 0;
240246
pcie_addr.config.upper = 2;
241247
pcie_addr.config.io = 1;

0 commit comments

Comments
 (0)