]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Only respond to the PCIe Attention Button if a device is already plugged in.
authorcperciva <cperciva@FreeBSD.org>
Wed, 5 Jun 2019 04:58:42 +0000 (04:58 +0000)
committercperciva <cperciva@FreeBSD.org>
Wed, 5 Jun 2019 04:58:42 +0000 (04:58 +0000)
commitdb106e7939924ad394eae34ee95255336c06d8e7
tree27c5f7d6d2b1c4eef39345e6e362e0c0dd8a5c36
parent4ac6a4f2373a6a9c759b7f159ee4824a96408b52
Only respond to the PCIe Attention Button if a device is already plugged in.

Prior to this commit, if PCIEM_SLOT_STA_ABP and PCIEM_SLOT_STA_PDC are
asserted simultaneously, FreeBSD sets a 5 second "hardware going away" timer
and then processes the "presence detect" change. In the (physically
challenging) case that someone presses the "attention button" and inserts
a new PCIe device at exactly the same moment, this results in FreeBSD
recognizing that the device is present, attaching it, and then detaching it
5 seconds later.

On EC2 "bare metal" hardware this is the precise sequence of events which
takes place when a new EBS volume is attached; virtual machines have no
difficulty effecting physically implausible simultaneity.

This patch changes the handling of PCIEM_SLOT_STA_ABP to only detach a
device if the presence of a device was detected *before* the interrupt
which reports the Attention Button push.

Reported by: Matt Wilson
Reviewed by: jhb
MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D20499
sys/dev/pci/pci_pci.c