aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Zhao <yu.zhao@intel.com>2009-03-21 10:05:11 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-03-26 18:50:18 -0400
commit853346e4354c948b50a6fb0002f8af2cf5fbf2ae (patch)
treeb577bc1e79a44c471635559f0bcbfce424309f73
parentceb93a9ff16612314d757874b6415ffbb2091576 (diff)
PCI: fix conflict between SR-IOV and config space sizing
New pci_cfg_space_size() needs invalid pdev->class, put it in the right place in the pci_setup_device(). Signed-off-by: Yu Zhao <yu.zhao@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--drivers/pci/probe.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 56c71e585f3d..e2f3dd098cfa 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -713,7 +713,6 @@ int pci_setup_device(struct pci_dev *dev)
713 dev->dev.bus = &pci_bus_type; 713 dev->dev.bus = &pci_bus_type;
714 dev->hdr_type = hdr_type & 0x7f; 714 dev->hdr_type = hdr_type & 0x7f;
715 dev->multifunction = !!(hdr_type & 0x80); 715 dev->multifunction = !!(hdr_type & 0x80);
716 dev->cfg_size = pci_cfg_space_size(dev);
717 dev->error_state = pci_channel_io_normal; 716 dev->error_state = pci_channel_io_normal;
718 set_pcie_port_type(dev); 717 set_pcie_port_type(dev);
719 718
@@ -738,6 +737,9 @@ int pci_setup_device(struct pci_dev *dev)
738 dev_dbg(&dev->dev, "found [%04x:%04x] class %06x header type %02x\n", 737 dev_dbg(&dev->dev, "found [%04x:%04x] class %06x header type %02x\n",
739 dev->vendor, dev->device, class, dev->hdr_type); 738 dev->vendor, dev->device, class, dev->hdr_type);
740 739
740 /* need to have dev->class ready */
741 dev->cfg_size = pci_cfg_space_size(dev);
742
741 /* "Unknown power state" */ 743 /* "Unknown power state" */
742 dev->current_state = PCI_UNKNOWN; 744 dev->current_state = PCI_UNKNOWN;
743 745
@@ -959,9 +961,6 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
959 return NULL; 961 return NULL;
960 } 962 }
961 963
962 /* need to have dev->class ready */
963 dev->cfg_size = pci_cfg_space_size(dev);
964
965 return dev; 964 return dev;
966} 965}
967 966