Ensure pci_channel_offline() actually queries the PCI register space,

and not only the software cache of that register.  Else
pci_channel_offline() won't detect that the PCI device is gone when
using the LinuxKPI.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2020-06-05 08:12:08 +00:00
parent eff8154913
commit c51613866f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361828

View File

@ -657,7 +657,7 @@ static inline int
pci_channel_offline(struct pci_dev *pdev)
{
return (pci_get_vendor(pdev->dev.bsddev) == PCIV_INVALID);
return (pci_read_config(pdev->dev.bsddev, PCIR_VENDOR, 2) == PCIV_INVALID);
}
static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)