On Wed, 6 Feb 2013, Gu Zheng wrote: > On 01/19/2013 02:23 AM, Joe Lawrence wrote: > > >>From 3a51bbad5555ba6c6e144aa5176c8112eb449325 Mon Sep 17 00:00:00 2001 > > From: Joe Lawrence <joe.lawrence@xxxxxxxxxxx> > > Date: Tue, 15 Jan 2013 14:51:57 -0500 > > Subject: [PATCH 1/2] PCI: ASPM exit link state code could skip devices > > > > On PCI bus hotplug removal, pcie_aspm_exit_link_state could potentially skip > > parent devices that have link_state allocated. Instead of exiting early if > > a given device is not PCIe, check that the device's parent is PCIe. This > > enables pcie_aspm_exit_link_state to properly clean up parent link_state when > > the last function in a slot might not be PCIe. > > > > Reviewed-by: David Bulkow <david.bulkow@xxxxxxxxxxx> > > Signed-off-by: Joe Lawrence <joe.lawrence@xxxxxxxxxxx> > > --- > > drivers/pci/pcie/aspm.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c > > index b52630b..6122447 100644 > > --- a/drivers/pci/pcie/aspm.c > > +++ b/drivers/pci/pcie/aspm.c > > @@ -634,7 +634,7 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev) > > struct pci_dev *parent = pdev->bus->self; > > struct pcie_link_state *link, *root, *parent_link; > > > > - if (!pci_is_pcie(pdev) || !parent || !parent->link_state) > > + if (!parent || !pci_is_pcie(parent) || !parent->link_state) > > return; > > if ((pci_pcie_type(parent) != PCI_EXP_TYPE_ROOT_PORT) && > > (pci_pcie_type(parent) != PCI_EXP_TYPE_DOWNSTREAM)) > > Hi Joe, > We encounter the issue you mentioned above, so I used your patch to try to > fix it, but it seems not helpful. Could you please help to look into it ? > > Thanks, > Gu You might want to give Myron's patch [1] a try, for that's the version that Bjorn applied in his tree. While you're there, you might want to add a few printk's that sanity check some of the values. Without a disassembly of your version of pcie_aspm_exit_link_state(), it's hard to know precisely what caused your crash. pcie_aspm_exit_link_state + 0x2a and 0x38 (the addresses noted in your backtrace) seem pretty early in the routine, so perhaps something is strange about the parent pointer or references through it. If all else fails, patch [2] should provide a mechanism to avoid most of pcie_aspm_exit_link_state() from executing (provided you boot with pcie_aspm=off). [1] PCI/ASPM: Deallocate upstream link state even if device is not PCIe http://git.kernel.org/?p=linux/kernel/git/helgaas/pci.git;a=commit;h=84fb913c43475e0d1e061220ef4622e3e82e91d6 [2] PCI/ASPM: Don't touch ASPM if forcibly disabled http://git.kernel.org/?p=linux/kernel/git/helgaas/pci.git;a=commit;h=a26d5ecb3201c11e03663a8f4a7dedc0c5f85c07 Regards, -- Joe -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html