Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2018 12:26:27 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331355 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201803221226.w2MCQRVO051872@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu Mar 22 12:26:27 2018
New Revision: 331355
URL: https://svnweb.freebsd.org/changeset/base/331355

Log:
  Clear old MSIX IRQ numbers in the LinuxKPI.
  
  When disabling the MSIX IRQ vectors for a PCI device through the
  LinuxKPI, make sure any old MSIX IRQ numbers are no longer visible to
  the linux_pci_find_irq_dev() function else IRQs can be requested from
  the wrong PCI device.
  
  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	Thu Mar 22 12:01:30 2018	(r331354)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h	Thu Mar 22 12:26:27 2018	(r331355)
@@ -425,6 +425,15 @@ pci_disable_msix(struct pci_dev *pdev)
 {
 
 	pci_release_msi(pdev->dev.bsddev);
+
+	/*
+	 * The MSIX IRQ numbers associated with this PCI device are no
+	 * longer valid and might be re-assigned. Make sure
+	 * linux_pci_find_irq_dev() does no longer see them by
+	 * resetting their references to zero:
+	 */
+	pdev->dev.msix = 0;
+	pdev->dev.msix_max = 0;
 }
 
 static inline bus_addr_t



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