From: Jonathan McDowell <noodles@earth.li>
To: linux-pci@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Re-add quirk for ServerWorks bridge secondary buses
Date: Wed, 23 Mar 2011 21:36:52 -0700 [thread overview]
Message-ID: <20110324043652.GA4835@earth.li> (raw)
I have a board with a ServerWorks CIOB-X2 bridge on it (2 in fact) that
is not having the secondary buses off it correctly discovered with
2.6.38. There seems to have been some discussion about this back in
2001, when a patch very similar to the below was being discussed about
2.4. As far as I can tell the opinion was that the PCI BIOS should be
providing this information, and I can't see this quirk in git history at
all.
My board does not have a standard BIOS, so pcibios_last_bus is not
appropriately updated by the PCI BIOS routines. This quirk allows the
detection of the 8 buses that are behind the 2 bridges on my board.
Without it none of them are discovered.
(Unfortunately the unique PCI device I could potentially use as a more
specific quirk hook is behind one of these bridges, and the only useful
identifying info from the BIOS is in the MPTABLE, which doesn't appear
to be easily usable for quirks. This quirk could be tightened up to just
the CIOB-X2 entry and suit my needs, but I left the fuller table as
that's what the original patch I found had associated with it.)
Signed-Off-By: Jonathan McDowell <noodles@earth.li>
-----
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 6dd8955..12a0305f 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -521,3 +521,35 @@ static void sb600_disable_hpet_bar(struct pci_dev *dev)
}
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, 0x4385, sb600_disable_hpet_bar);
+
+/*
+ * ServerWorks host bridges -- Find and scan all secondary buses.
+ * Register 0x44 contains first, 0x45 last bus number routed there.
+ *
+ */
+static void __init pci_fixup_serverworks(struct pci_dev *dev)
+{
+ u8 busno1, busno2;
+
+ pci_read_config_byte(dev, 0x44, &busno1);
+ pci_read_config_byte(dev, 0x45, &busno2);
+ if (busno2 < busno1)
+ busno2 = busno1;
+ if (busno2 > pcibios_last_bus) {
+ pcibios_last_bus = busno2;
+ dev_info(&dev->dev, "ServerWorks host bridge: last bus %02x\n",
+ pcibios_last_bus);
+ }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
+ PCI_DEVICE_ID_SERVERWORKS_HE, pci_fixup_serverworks);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
+ /* CIOB */ 0x006, pci_fixup_serverworks);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
+ PCI_DEVICE_ID_SERVERWORKS_LE, pci_fixup_serverworks);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
+ /* CMIC_HE */ 0x0011, pci_fixup_serverworks);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
+ /* CMIC_LE_IMBB */ 0x0000, pci_fixup_serverworks);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
+ /* CIOBX2 */ 0x0101, pci_fixup_serverworks);
-----
J.
--
Most people are descended from apes. Redheads are descended from cats.
next reply other threads:[~2011-03-24 5:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 4:36 Jonathan McDowell [this message]
2011-03-24 5:50 ` [PATCH] Re-add quirk for ServerWorks bridge secondary buses Bjorn Helgaas
2011-03-24 18:27 ` Jonathan McDowell
[not found] ` <AANLkTimDV5m0Ug5H76HcdfFNrJaZcdGrChxVpCp9dMW6@mail.gmail.com>
2011-03-28 20:36 ` Jonathan McDowell
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=20110324043652.GA4835@earth.li \
--to=noodles@earth.li \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.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