mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, matt.fleming@intel.com, Matthew Garrett <mjg@redhat.com>
Subject: [PATCH 2/3] x86: Allow early PCI quirks to trigger on bus 1
Date: Wed, 23 May 2012 14:08:45 -0400	[thread overview]
Message-ID: <1337796526-3649-2-git-send-email-mjg@redhat.com> (raw)
In-Reply-To: <1337796526-3649-1-git-send-email-mjg@redhat.com>

The early PCI quirks code currently only scans bus 0. Extend it to bus 1
in order to allow us to add a quirk for broken Apple firmware, and make
sure that the vendor-generic chipset quirks are only run on bus 0.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
 arch/x86/kernel/early-quirks.c |   31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 3755ef4..dcf4bcf 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -48,6 +48,10 @@ static void __init fix_hypertransport_config(int num, int slot, int func)
 static void __init via_bugs(int  num, int slot, int func)
 {
 #ifdef CONFIG_GART_IOMMU
+	/* Only match on the root bus */
+	if (num > 0)
+		return;
+
 	if ((max_pfn > MAX_DMA32_PFN ||  force_iommu) &&
 	    !gart_iommu_aperture_allowed) {
 		printk(KERN_INFO
@@ -72,6 +76,10 @@ static void __init nvidia_bugs(int num, int slot, int func)
 {
 #ifdef CONFIG_ACPI
 #ifdef CONFIG_X86_IO_APIC
+	/* Only match on the root bus */
+	if (num > 0)
+		return;
+
 	/*
 	 * All timer overrides on Nvidia are
 	 * wrong unless HPET is enabled.
@@ -205,10 +213,7 @@ struct chipset {
 };
 
 /*
- * Only works for devices on the root bus. If you add any devices
- * not on bus 0 readd another loop level in early_quirks(). But
- * be careful because at least the Nvidia quirk here relies on
- * only matching on bus 0.
+ * Only works for devices on the root bus and bus 1.
  */
 static struct chipset early_qrk[] __initdata = {
 	{ PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
@@ -276,17 +281,19 @@ static int __init check_dev_quirk(int num, int slot, int func)
 
 void __init early_quirks(void)
 {
-	int slot, func;
+	int bus, slot, func;
 
 	if (!early_pci_allowed())
 		return;
 
 	/* Poor man's PCI discovery */
-	/* Only scan the root bus */
-	for (slot = 0; slot < 32; slot++)
-		for (func = 0; func < 8; func++) {
-			/* Only probe function 0 on single fn devices */
-			if (check_dev_quirk(0, slot, func))
-				break;
-		}
+	/* Apple Broadcom quirk is on bus 1 */
+	for (bus = 0; bus < 2; bus++) {
+		for (slot = 0; slot < 32; slot++)
+			for (func = 0; func < 8; func++) {
+				/* Only probe function 0 on single fn devices */
+				if (check_dev_quirk(bus, slot, func))
+					break;
+			}
+	}
 }
-- 
1.7.10.2


  reply	other threads:[~2012-05-23 18:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23 18:08 [PATCH 1/3] x86: Expand EFI GOP handle search Matthew Garrett
2012-05-23 18:08 ` Matthew Garrett [this message]
2012-05-23 18:08 ` [PATCH 3/3] x86: Handle broken Broadcom UEFI driver on Apple hardware Matthew Garrett
2012-05-23 20:21 ` [PATCH 1/3] x86: Expand EFI GOP handle search Matt Fleming

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=1337796526-3649-2-git-send-email-mjg@redhat.com \
    --to=mjg@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=x86@kernel.org \
    /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®