svn commit: r362323 - stable/11/sys/compat/linuxkpi/common/include/linux

Hans Petter Selasky hselasky at FreeBSD.org
Thu Jun 18 10:55:47 UTC 2020


Author: hselasky
Date: Thu Jun 18 10:55:46 2020
New Revision: 362323
URL: https://svnweb.freebsd.org/changeset/base/362323

Log:
  MFC r361828:
  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.
  
  Sponsored by:	Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/pci.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/linux/pci.h	Thu Jun 18 10:53:40 2020	(r362322)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/pci.h	Thu Jun 18 10:55:46 2020	(r362323)
@@ -664,7 +664,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)


More information about the svn-src-all mailing list