[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#665420: [3.2.11 -> 3.2.12 regression] pata_jmicron hdd/dvd/cdrom drives not detected, gave up waiting for root device



Jonathan Nieder wrote:

>                                Hopefully the patch will be part of
> mainline and stable kernels soon.

The patch was acked by the PCI maintainer[1].  I've attached a diff
against the packaging repository to include it, for convenience.

Thanks,
Jonathan

[1] http://thread.gmane.org/gmane.linux.kernel.pci/14503/focus=14522
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 18893)
+++ debian/changelog	(working copy)
@@ -1,3 +1,9 @@
+linux-2.6 (3.2.13-2) UNRELEASED; urgency=low
+
+  * ASPM: Fix pcie devices with non-pcie children (Closes: #665420)
+
+ -- Jonathan Nieder <jrnieder@gmail.com>  Thu, 29 Mar 2012 17:17:12 -0500
+
 linux-2.6 (3.2.13-1) unstable; urgency=low
 
   * New upstream stable update:
Index: debian/patches/series/base
===================================================================
--- debian/patches/series/base	(revision 18893)
+++ debian/patches/series/base	(working copy)
@@ -84,3 +84,4 @@
 + bugfix/all/Don-t-limit-non-nested-epoll-paths.patch
 + bugfix/all/CIFS-Fix-a-spurious-error-in-cifs_push_posix_locks.patch
 + bugfix/all/kbuild-do-not-check-for-ancient-modutils-tools.patch
++ bugfix/all/ASPM-Fix-pcie-devices-with-non-pcie-children.patch
Index: debian/patches/bugfix/all/ASPM-Fix-pcie-devices-with-non-pcie-children.patch
===================================================================
--- debian/patches/bugfix/all/ASPM-Fix-pcie-devices-with-non-pcie-children.patch	(revision 0)
+++ debian/patches/bugfix/all/ASPM-Fix-pcie-devices-with-non-pcie-children.patch	(working copy)
@@ -0,0 +1,67 @@
+From: Matthew Garrett <mjg@redhat.com>
+Date: Tue, 27 Mar 2012 10:17:41 -0400
+Subject: 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
+
+[jn: with more symptoms in log message]
+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
+Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
+Acked-by: Bjorn Helgaas <bhelgaas@google.com>
+---
+ drivers/pci/pcie/aspm.c |   13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
+index 24f049e73952..22751622568f 100644
+--- a/drivers/pci/pcie/aspm.c
++++ b/drivers/pci/pcie/aspm.c
+@@ -500,9 +500,6 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev)
+ 	int pos;
+ 	u32 reg32;
+ 
+-	if (aspm_disabled)
+-		return 0;
+-
+ 	/*
+ 	 * Some functions in a slot might not all be PCIe functions,
+ 	 * very strange. Disable ASPM for the whole slot
+@@ -511,6 +508,16 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev)
+ 		pos = pci_pcie_cap(child);
+ 		if (!pos)
+ 			return -EINVAL;
++
++		/*
++		 * If ASPM is disabled then we're not going to change
++		 * the BIOS state. It's safe to continue even if it's a
++		 * pre-1.1 device
++		 */
++
++		if (aspm_disabled)
++			continue;
++
+ 		/*
+ 		 * Disable ASPM for pre-1.1 PCIe device, we follow MS to use
+ 		 * RBER bit to determine if a function is 1.1 version device
+-- 
+1.7.10.rc1
+

Reply to: