svn commit: r347443 - stable/11/sys/amd64/vmm/io

John Baldwin jhb at FreeBSD.org
Fri May 10 16:51:38 UTC 2019


Author: jhb
Date: Fri May 10 16:51:36 2019
New Revision: 347443
URL: https://svnweb.freebsd.org/changeset/base/347443

Log:
  Complete the MFC of 345963 after the MFC of 333174.
  
  Suggested by:	kib

Modified:
  stable/11/sys/amd64/vmm/io/ppt.c

Modified: stable/11/sys/amd64/vmm/io/ppt.c
==============================================================================
--- stable/11/sys/amd64/vmm/io/ppt.c	Fri May 10 16:45:17 2019	(r347442)
+++ stable/11/sys/amd64/vmm/io/ppt.c	Fri May 10 16:51:36 2019	(r347443)
@@ -354,25 +354,12 @@ ppt_is_mmio(struct vm *vm, vm_paddr_t gpa)
 static void
 ppt_pci_reset(device_t dev)
 {
-	int ps;
 
 	if (pcie_flr(dev,
-		     max(pcie_get_max_completion_timeout(dev) / 1000, 10),
-		     true))
+	     max(pcie_get_max_completion_timeout(dev) / 1000, 10), true))
 		return;
 
-	/*
-	 * If FLR fails, attempt a power-management reset by cycling
-	 * the device in/out of D3 state.
-	 * PCI spec says we can only go into D3 state from D0 state.
-	 * Transition from D[12] into D0 before going to D3 state.
-	 */
-	ps = pci_get_powerstate(dev);
-	if (ps != PCI_POWERSTATE_D0 && ps != PCI_POWERSTATE_D3)
-		pci_set_powerstate(dev, PCI_POWERSTATE_D0);
-	if (pci_get_powerstate(dev) != PCI_POWERSTATE_D3)
-		pci_set_powerstate(dev, PCI_POWERSTATE_D3);
-	pci_set_powerstate(dev, ps);
+	pci_power_reset(dev);
 }
 
 int


More information about the svn-src-stable mailing list