===================================================================
@@ -165,6 +165,7 @@ static void pcie_aspm_configure_common_c
u16 reg16 = 0;
struct pci_dev *child_dev;
int same_clock = 1;
+ int loop_count = 0;
/*
* all functions of a slot should have the same Slot Clock
@@ -210,14 +211,21 @@ static void pcie_aspm_configure_common_c
/* retrain link */
reg16 |= PCI_EXP_LNKCTL_RL;
pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16);
+ dev_printk (KERN_INFO, &pdev->dev, "Writing 0x%x to %d\n",
+ reg16, pos + PCI_EXP_LNKCTL);
/* Wait for link training end */
- while (1) {
+ while (loop_count < 100) {
pci_read_config_word(pdev, pos + PCI_EXP_LNKSTA, ®16);
+ dev_printk (KERN_INFO, &pdev->dev, "Reading 0x%x at %d\n",
+ reg16, pos + PCI_EXP_LNKSTA);
if (!(reg16 & PCI_EXP_LNKSTA_LT))
break;
cpu_relax();
+ loop_count++;
}
+ if (loop_count == 100)
+ dev_printk (KERN_WARNING, &pdev->dev, "Could not configure ASPM\n");
}
/*