Page MenuHomeFreeBSD

pci: Make PCIe Eject timeout configurable
ClosedPublic

Authored by cperciva on Mar 31 2025, 4:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 7, 1:45 AM
Unknown Object (File)
Tue, Nov 4, 3:11 AM
Unknown Object (File)
Tue, Nov 4, 3:11 AM
Unknown Object (File)
Tue, Nov 4, 3:11 AM
Unknown Object (File)
Tue, Nov 4, 3:10 AM
Unknown Object (File)
Sun, Nov 2, 2:29 AM
Unknown Object (File)
Thu, Oct 30, 11:48 PM
Unknown Object (File)
Sat, Oct 25, 12:47 AM
Subscribers

Details

Summary

PCIe mandates a 5 second delay between when the "Attention Button" is
pressed and when the associated device is detached; this is to allow
for the button to be pressed a second time to cancel the ejection. On
some systems this 5 second delay may not be desireable; so introduce a
hw.pci.pcie_hp_detach_timeout sysctl (which can also be set as a loader
tunable) which specifies the timeout in milliseconds (default 5000).
If set to zero, the device is detached immediately.

MFC after: 2 weeks
Sponsored by: Amazon

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Requires https://reviews.freebsd.org/D49584 to work properly (otherwise setting the sysctl(8) gets confused).

jhb added inline comments.
sys/dev/pci/pci_pci.c
798

Humm, if I had been more forward-thinking there should be a hw.pci.pcie_hp node and this should be an enable node under that.

802
1076–1086
This revision is now accepted and ready to land.Apr 2 2025, 4:56 PM

Thanks, committed with the two minor changes you suggested.

This revision was automatically updated to reflect the committed changes.