svn commit: r349079 - stable/12/sys/dev/pci

Colin Percival cperciva at FreeBSD.org
Sat Jun 15 20:25:37 UTC 2019


Author: cperciva
Date: Sat Jun 15 20:25:36 2019
New Revision: 349079
URL: https://svnweb.freebsd.org/changeset/base/349079

Log:
  MFC r348681: Only respond to the PCIe Attention Button if a device is
  already plugged in.
  
  This unbreaks attaching disks to EC2 "bare metal" instances.

Modified:
  stable/12/sys/dev/pci/pci_pci.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/pci/pci_pci.c
==============================================================================
--- stable/12/sys/dev/pci/pci_pci.c	Sat Jun 15 20:24:19 2019	(r349078)
+++ stable/12/sys/dev/pci/pci_pci.c	Sat Jun 15 20:25:36 2019	(r349079)
@@ -1167,9 +1167,11 @@ pcib_pcie_intr_hotplug(void *arg)
 {
 	struct pcib_softc *sc;
 	device_t dev;
+	uint16_t old_slot_sta;
 
 	sc = arg;
 	dev = sc->dev;
+	old_slot_sta = sc->pcie_slot_sta;
 	sc->pcie_slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2);
 
 	/* Clear the events just reported. */
@@ -1185,7 +1187,8 @@ pcib_pcie_intr_hotplug(void *arg)
 			    "Attention Button Pressed: Detach Cancelled\n");
 			sc->flags &= ~PCIB_DETACH_PENDING;
 			callout_stop(&sc->pcie_ab_timer);
-		} else {
+		} else if (old_slot_sta & PCIEM_SLOT_STA_PDS) {
+			/* Only initiate detach sequence if device present. */
 			device_printf(dev,
 		    "Attention Button Pressed: Detaching in 5 seconds\n");
 			sc->flags |= PCIB_DETACH_PENDING;


More information about the svn-src-all mailing list