PCI: fix conflict between SR-IOV and config space sizing

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, April 1, 2009 - 11:08 am

Gitweb:     http://git.kernel.org/linus/853346e4354c948b50a6fb0002f8af2cf5fbf2ae
Commit:     853346e4354c948b50a6fb0002f8af2cf5fbf2ae
Parent:     ceb93a9ff16612314d757874b6415ffbb2091576
Author:     Yu Zhao <yu.zhao@intel.com>
AuthorDate: Sat Mar 21 22:05:11 2009 +0800
Committer:  Jesse Barnes <jbarnes@virtuousgeek.org>
CommitDate: Thu Mar 26 15:50:18 2009 -0700

    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>
---
 drivers/pci/probe.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 56c71e5..e2f3dd0 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -713,7 +713,6 @@ int pci_setup_device(struct pci_dev *dev)
 	dev->dev.bus = &pci_bus_type;
 	dev->hdr_type = hdr_type & 0x7f;
 	dev->multifunction = !!(hdr_type & 0x80);
-	dev->cfg_size = pci_cfg_space_size(dev);
 	dev->error_state = pci_channel_io_normal;
 	set_pcie_port_type(dev);
 
@@ -738,6 +737,9 @@ int pci_setup_device(struct pci_dev *dev)
 	dev_dbg(&dev->dev, "found [%04x:%04x] class %06x header type %02x\n",
 		 dev->vendor, dev->device, class, dev->hdr_type);
 
+	/* need to have dev->class ready */
+	dev->cfg_size = pci_cfg_space_size(dev);
+
 	/* "Unknown power state" */
 	dev->current_state = PCI_UNKNOWN;
 
@@ -959,9 +961,6 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
 		return NULL;
 	}
 
-	/* need to have dev->class ready */
-	dev->cfg_size = pci_cfg_space_size(dev);
-
 	return dev;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
PCI: fix conflict between SR-IOV and config space sizing, Linux Kernel Mailing ..., (Wed Apr 1, 11:08 am)