diff options
author | Matthew Garrett <mjg@redhat.com> | 2012-03-27 10:17:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-31 15:49:56 -0400 |
commit | c9651e70ad0aa499814817cbf3cc1d0b806ed3a1 (patch) | |
tree | 6347cadf5e3d2835bf63dc52a8fdfe2daaea5161 | |
parent | cdb0f9a1ad2ee3c11e21bc99f0c2021a02844666 (diff) |
ASPM: Fix pcie devices with non-pcie children
Since 3.2.12 and 3.3, some systems are failing to boot with a BUG_ON.
Some other systems using the pata_jmicron driver fail to boot because no
disks are detected. Passing pcie_aspm=force on the kernel command line
works around it.
The cause: commit 4949be16822e ("PCI: ignore pre-1.1 ASPM quirking when
ASPM is disabled") changed the behaviour of pcie_aspm_sanity_check() to
always return 0 if aspm is disabled, in order to avoid cases where we
changed ASPM state on pre-PCIe 1.1 devices.
This skipped the secondary function of pcie_aspm_sanity_check which was
to avoid us enabling ASPM on devices that had non-PCIe children, causing
trouble later on. Move the aspm_disabled check so we continue to honour
that scenario.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=42979 and
http://bugs.debian.org/665420
Reported-by: Romain Francoise <romain@orebokech.com> # kernel panic
Reported-by: Chris Holland <bandidoirlandes@gmail.com> # disk detection trouble
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: stable@vger.kernel.org
Tested-by: Hatem Masmoudi <hatem.masmoudi@gmail.com> # Dell Latitude E5520
Tested-by: janek <jan0x6c@gmail.com> # pata_jmicron with JMB362/JMB363
[jn: with more symptoms in log message]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/pci/pcie/aspm.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 4bdef24cd412..b500840a143b 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c | |||
@@ -508,9 +508,6 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev) | |||
508 | int pos; | 508 | int pos; |
509 | u32 reg32; | 509 | u32 reg32; |
510 | 510 | ||
511 | if (aspm_disabled) | ||
512 | return 0; | ||
513 | |||
514 | /* | 511 | /* |
515 | * Some functions in a slot might not all be PCIe functions, | 512 | * Some functions in a slot might not all be PCIe functions, |
516 | * very strange. Disable ASPM for the whole slot | 513 | * very strange. Disable ASPM for the whole slot |
@@ -519,6 +516,16 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev) | |||
519 | pos = pci_pcie_cap(child); | 516 | pos = pci_pcie_cap(child); |
520 | if (!pos) | 517 | if (!pos) |
521 | return -EINVAL; | 518 | return -EINVAL; |
519 | |||
520 | /* | ||
521 | * If ASPM is disabled then we're not going to change | ||
522 | * the BIOS state. It's safe to continue even if it's a | ||
523 | * pre-1.1 device | ||
524 | */ | ||
525 | |||
526 | if (aspm_disabled) | ||
527 | continue; | ||
528 | |||
522 | /* | 529 | /* |
523 | * Disable ASPM for pre-1.1 PCIe device, we follow MS to use | 530 | * Disable ASPM for pre-1.1 PCIe device, we follow MS to use |
524 | * RBER bit to determine if a function is 1.1 version device | 531 | * RBER bit to determine if a function is 1.1 version device |