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)
Tue, Oct 7, 2:59 PM
Unknown Object (File)
Fri, Oct 3, 4:47 PM
Unknown Object (File)
Fri, Oct 3, 4:43 AM
Unknown Object (File)
Sat, Sep 27, 3:25 PM
Unknown Object (File)
Thu, Sep 18, 1:51 AM
Unknown Object (File)
Sep 7 2025, 11:35 PM
Unknown Object (File)
Aug 13 2025, 10:11 PM
Unknown Object (File)
Jul 7 2025, 3:27 PM
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.