diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-03-09 00:35:37 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-03-20 13:48:17 -0400 |
commit | dfadd9edff498d767008edc6b2a6e86a7a19934d (patch) | |
tree | 155d439bb862292307b88975bf11cfd9b78d7df2 /drivers/pci/probe.c | |
parent | 745be2e700cdddd5da4e402854a484242c3628df (diff) |
PCI/x86: detect host bridge config space size w/o using quirks
Many host bridges support a 4k config space, so check them directy
instead of using quirks to add them.
We only need to do this extra check for host bridges at this point,
because only host bridges are known to have extended address space
without also having a PCI-X/PCI-E caps. Other devices with this
property could be done with quirks (if there are any).
As a bonus, we can remove the quirks for AMD host bridges with family
10h and 11h since they're not needed any more.
With this patch, we can get correct pci cfg size of new Intel CPUs/IOHs
with host bridges.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Cc: <stable@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 9e7d642e66b0..579a56c8181f 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -847,6 +847,11 @@ int pci_cfg_space_size(struct pci_dev *dev) | |||
847 | { | 847 | { |
848 | int pos; | 848 | int pos; |
849 | u32 status; | 849 | u32 status; |
850 | u16 class; | ||
851 | |||
852 | class = dev->class >> 8; | ||
853 | if (class == PCI_CLASS_BRIDGE_HOST) | ||
854 | return pci_cfg_space_size_ext(dev); | ||
850 | 855 | ||
851 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 856 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); |
852 | if (!pos) { | 857 | if (!pos) { |
@@ -936,7 +941,6 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) | |||
936 | dev->multifunction = !!(hdr_type & 0x80); | 941 | dev->multifunction = !!(hdr_type & 0x80); |
937 | dev->vendor = l & 0xffff; | 942 | dev->vendor = l & 0xffff; |
938 | dev->device = (l >> 16) & 0xffff; | 943 | dev->device = (l >> 16) & 0xffff; |
939 | dev->cfg_size = pci_cfg_space_size(dev); | ||
940 | dev->error_state = pci_channel_io_normal; | 944 | dev->error_state = pci_channel_io_normal; |
941 | set_pcie_port_type(dev); | 945 | set_pcie_port_type(dev); |
942 | 946 | ||
@@ -952,6 +956,9 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) | |||
952 | return NULL; | 956 | return NULL; |
953 | } | 957 | } |
954 | 958 | ||
959 | /* need to have dev->class ready */ | ||
960 | dev->cfg_size = pci_cfg_space_size(dev); | ||
961 | |||
955 | return dev; | 962 | return dev; |
956 | } | 963 | } |
957 | 964 | ||