svn commit: r341520 - head/sys/compat/linuxkpi/common/include/linux

Slava Shwartsman slavash at FreeBSD.org
Wed Dec 5 13:17:47 UTC 2018


Author: slavash
Date: Wed Dec  5 13:17:45 2018
New Revision: 341520
URL: https://svnweb.freebsd.org/changeset/base/341520

Log:
  linuxkpi: Really check if PCI is offline
  
  Currently we always return false if for PCI offline query.
  Try to read PCI config, if the return value if 0xffff probably the
  PCI is offline.
  
  Approved by:    hselasky (mentor)
  MFC after:      1 week
  Sponsored by:   Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/pci.h

Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/pci.h	Wed Dec  5 13:17:15 2018	(r341519)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h	Wed Dec  5 13:17:45 2018	(r341520)
@@ -601,9 +601,11 @@ pci_enable_msix_range(struct pci_dev *dev, struct msix
 	return (nvec);
 }
 
-static inline int pci_channel_offline(struct pci_dev *pdev)
+static inline int
+pci_channel_offline(struct pci_dev *pdev)
 {
-	return false;
+
+	return (pci_get_vendor(pdev->dev.bsddev) == 0xffff);
 }
 
 static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)


More information about the svn-src-head mailing list