Skip to contentSkip to conversation

Fix the PCI-Ex link training bug on MPC8641HPCN board.

PATCH In review Zhang Wei 2 participants 2 messages Jul 10, 2007 PowerPC

lore
Share & tools
lore

Zhang Wei

author
#0 lore raw

PATCH 1/1 Fix the PCI-Ex link training bug on MPC8641HPCN board.

If the PCI-Ex hose link training is failed, the kernel will halt at the PCI scan process on MPC8641HPCN board.

This patch will remove and free the hose from PCI host list if the PCI hose link training is failed.

---
 arch/powerpc/platforms/86xx/pci.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/powerpc/platforms/86xx/pci.c +3 -1
index 73cd5b0..0b7835c 100644
@@ -210,8 +210,10 @@ int __init mpc86xx_add_bridge(struct device_node *dev)
 
 	/* Probe the hose link training status */
 	early_read_config_word(hose, 0, 0, PCIE_LTSSM, &val);
-	if (val < PCIE_LTSSM_L0)
+	if (val < PCIE_LTSSM_L0) {
+		pcibios_free_controller(hose);
 		return -ENXIO;
+	}
 
 	/* Setup the PCIE host controller. */
 	mpc86xx_setup_pcie(hose, rsrc.start, rsrc.end - rsrc.start + 1);
Signature · 1 line
1.5.1
#1 lore raw
Quoted 7 lines · Zhang Wei

If the PCI-Ex hose link training is failed, the kernel will halt at the PCI scan process on MPC8641HPCN board.

This patch will remove and free the hose from PCI host list if the PCI hose link training is failed.

Thanks. Going to roll this into the work Roy's been doing to make PCI code work across 85xx/86xx.

- k

Quoted 23 lines
---
 arch/powerpc/platforms/86xx/pci.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/powerpc/platforms/86xx/pci.c +3 -1
index 73cd5b0..0b7835c 100644
@@ -210,8 +210,10 @@ int __init mpc86xx_add_bridge(struct  
 device_node *dev)
 
 	/* Probe the hose link training status */
 	early_read_config_word(hose, 0, 0, PCIE_LTSSM, &val);
-	if (val < PCIE_LTSSM_L0)
+	if (val < PCIE_LTSSM_L0) {
+		pcibios_free_controller(hose);
 		return -ENXIO;
+	}
 
 	/* Setup the PCIE host controller. */

mpc86xx_setup_pcie(hose, rsrc.start, rsrc.end - rsrc.start + 1);

Signature · 1 line
1.5.1