Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jun 2020 10:53:41 +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: r362322 - stable/12/sys/compat/linuxkpi/common/include/linux
Message-ID:  <202006181053.05IArf8X088409@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu Jun 18 10:53:40 2020
New Revision: 362322
URL: https://svnweb.freebsd.org/changeset/base/362322

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/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	Thu Jun 18 10:52:51 2020	(r362321)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/pci.h	Thu Jun 18 10:53:40 2020	(r362322)
@@ -648,7 +648,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)



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