Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2018 10:13:49 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r341853 - stable/12/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201812121013.wBCADnBK007807@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Dec 12 10:13:49 2018
New Revision: 341853
URL: https://svnweb.freebsd.org/changeset/base/341853

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

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

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h
==============================================================================
--- stable/12/sys/compat/linuxkpi/common/include/linux/pci.h	Wed Dec 12 10:12:14 2018	(r341852)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/pci.h	Wed Dec 12 10:13:49 2018	(r341853)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812121013.wBCADnBK007807>