mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: Jack Howarth <howarth@bromo.msbb.uc.edu>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>,
	Yinghai Lu <yhlu.kernel@gmail.com>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86,pci: dmi check for mackpro 2.2 mmconf
Date: Mon, 21 Jul 2008 14:49:59 +0800	[thread overview]
Message-ID: <1216622999.838.1.camel@sli10-desk.sh.intel.com> (raw)
In-Reply-To: <20080719191438.GA19759@bromo.msbb.uc.edu>

On Sat, 2008-07-19 at 15:14 -0400, Jack Howarth wrote:
> On Sat, Jul 19, 2008 at 12:04:48PM -0700, Jesse Barnes wrote:
> > On Saturday, July 19, 2008 11:40 am Jack Howarth wrote:
> > > Jesse,
> > >     It seems that MacBook Pro users aren't the only ones suffering from
> > > PCIE_ASPM...
> > >
> > > http://groups.google.com/group/linux.kernel/browse_thread/thread/cc1b8b3ef6
> > >4e3257/dd4e427510bde7f0?lnk=raot
> > >
> > > I also discovered the pcie_noaspm kernel option from that thread which
> > > allows me to boot the kernels built with PCIE_ASPM support by disabling
> > > that feature.
> > 
> > Yeah, that's a good data point.  Thanks.  Sounds like there may also be some 
> > ACPI interaction going on...
> > 
> > Jesse
> 
> Jesse,
>    For what its worth, acpi=off alone is insufficent to inhibit the
> kernel freezes when PCIE aspm is in use.
As Jesse suggested, maybe we should blacklist all pcie pre-1.1 devices.
please try.

Thanks,
Shaohua
---
 drivers/pci/pcie/aspm.c  |   10 ++++++++++
 include/linux/pci_regs.h |    1 +
 2 files changed, 11 insertions(+)

Index: linux/drivers/pci/pcie/aspm.c
===================================================================
--- linux.orig/drivers/pci/pcie/aspm.c	2008-07-21 14:12:16.000000000 +0800
+++ linux/drivers/pci/pcie/aspm.c	2008-07-21 14:46:24.000000000 +0800
@@ -510,6 +510,7 @@ static int pcie_aspm_sanity_check(struct
 {
 	struct pci_dev *child_dev;
 	int child_pos;
+	u32 reg32;
 
 	/*
 	 * Some functions in a slot might not all be PCIE functions, very
@@ -519,6 +520,15 @@ static int pcie_aspm_sanity_check(struct
 		child_pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP);
 		if (!child_pos)
 			return -EINVAL;
+
+		/*
+		 * 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
+		 */
+		pci_read_config_dword(child_dev, child_pos + PCI_EXP_DEVCAP,
+			&reg32);
+		if (!(reg32 & PCI_EXP_DEVCAP_RBER))
+			return -EINVAL;
 	}
 	return 0;
 }
Index: linux/include/linux/pci_regs.h
===================================================================
--- linux.orig/include/linux/pci_regs.h	2008-07-21 14:25:05.000000000 +0800
+++ linux/include/linux/pci_regs.h	2008-07-21 14:27:00.000000000 +0800
@@ -374,6 +374,7 @@
 #define  PCI_EXP_DEVCAP_ATN_BUT	0x1000	/* Attention Button Present */
 #define  PCI_EXP_DEVCAP_ATN_IND	0x2000	/* Attention Indicator Present */
 #define  PCI_EXP_DEVCAP_PWR_IND	0x4000	/* Power Indicator Present */
+#define  PCI_EXP_DEVCAP_RBER	0x8000	/* Role-Based Error Reporting */
 #define  PCI_EXP_DEVCAP_PWR_VAL	0x3fc0000 /* Slot Power Limit Value */
 #define  PCI_EXP_DEVCAP_PWR_SCL	0xc000000 /* Slot Power Limit Scale */
 #define PCI_EXP_DEVCTL		8	/* Device Control */



  reply	other threads:[~2008-07-21  6:42 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-18 16:41 Yinghai Lu
2008-07-18 16:50 ` Jack Howarth
2008-07-18 17:44 ` H. Peter Anvin
2008-07-18 17:47   ` Yinghai Lu
2008-07-18 17:49     ` H. Peter Anvin
2008-07-18 17:54       ` Yinghai Lu
2008-07-18 20:19         ` Ingo Molnar
2008-07-18 20:21           ` Yinghai Lu
2008-07-18 20:21 ` Ingo Molnar
2008-07-18 20:26   ` Yinghai Lu
2008-07-19  0:58     ` Jack Howarth
2008-07-19  1:22       ` Yinghai Lu
2008-07-19  3:28         ` Jack Howarth
2008-07-19  3:43           ` Justin Mattock
2008-07-19  4:45           ` Yinghai Lu
2008-07-19  5:12             ` Jack Howarth
2008-07-19  5:28               ` Yinghai Lu
2008-07-19 17:26                 ` Jesse Barnes
2008-07-19 18:19                   ` Jack Howarth
2008-07-19 18:40                   ` Jack Howarth
2008-07-19 19:04                     ` Jesse Barnes
2008-07-19 19:14                       ` Jack Howarth
2008-07-21  6:49                         ` Shaohua Li [this message]
2008-07-22 21:15                           ` Jesse Barnes
2008-07-18 20:22 ` [PATCH] x86,pci: detect end_bus_number according to acpi/e820 reserved Yinghai Lu
2008-07-18 20:48   ` Ingo Molnar
2008-07-18 21:48   ` Jack Howarth
2008-07-18 22:27     ` Yinghai Lu
2008-07-18 22:42       ` Jesse Barnes
2008-07-20  6:48         ` Ingo Molnar
2008-07-19  9:16   ` [PATCH] x86,pci: detect end_bus_number according to acpi/e820 reserved - fix Yinghai Lu
2008-07-20  6:44     ` Ingo Molnar
2008-07-22 23:37 [PATCH] x86,pci: dmi check for mackpro 2.2 mmconf Jack Howarth
2008-07-23  0:23 ` Jesse Barnes
2008-07-23  1:00   ` Jack Howarth
2008-07-23  1:32     ` Jesse Barnes
2008-07-23  1:41       ` Jack Howarth
2008-07-23  1:54         ` Shaohua Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1216622999.838.1.camel@sli10-desk.sh.intel.com \
    --to=shaohua.li@intel.com \
    --cc=howarth@bromo.msbb.uc.edu \
    --cc=hpa@zytor.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=yhlu.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®