Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 2019 16:51:37 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r347443 - stable/11/sys/amd64/vmm/io
Message-ID:  <201905101651.x4AGpb2K092174@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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