]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Fix devfn for VPD access through function 0
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 15 Sep 2015 17:17:21 +0000 (11:17 -0600)
committerBjorn Helgaas <helgaas@kernel.org>
Thu, 24 Sep 2015 22:06:32 +0000 (17:06 -0500)
commit9d3dc194e2a5a573781eba46dbcb7d96e0014125
tree42cd8cc1a0587095cc8835a8c1d454643ccddcd6
parent0344784fc5c0bae508fa2f668dd141b73c3d6fc7
PCI: Fix devfn for VPD access through function 0

Commit b84fe6712a22 ("PCI: Add dev_flags bit to access VPD through function
0") passes PCI_SLOT(devfn) for the devfn parameter of pci_get_slot().
Generally this works because we're fairly well guaranteed that a PCIe
device is at slot address 0, but for the general case, including
conventional PCI, it's incorrect.  We need to get the slot and then convert
it back into a devfn.

Fixes: b84fe6712a22 ("PCI: Add dev_flags bit to access VPD through function 0")
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Myron Stowe <myron.stowe@redhat.com>
Acked-by: Mark Rustad <mark.d.rustad@intel.com>
CC: stable@vger.kernel.org
drivers/pci/access.c