Page MenuHomeFreeBSD

Fix PCIe HPS hotplug for devices that report improper slot status when link status is 1
Needs ReviewPublic

Authored by linnemannr_gmail.com on Nov 10 2021, 11:37 PM.
Tags
Referenced Files
Unknown Object (File)
Sun, Apr 14, 7:36 PM
Unknown Object (File)
Sat, Apr 6, 5:02 PM
Unknown Object (File)
Sat, Apr 6, 12:39 PM
Unknown Object (File)
Feb 8 2024, 9:52 PM
Unknown Object (File)
Dec 12 2023, 10:36 PM
Unknown Object (File)
Nov 24 2023, 8:54 PM
Unknown Object (File)
Nov 10 2023, 11:15 PM
Unknown Object (File)
Nov 8 2023, 4:53 AM
Subscribers

Details

Reviewers
scottl
jhb
ken
Summary

Separate struct pcib_softc slot state away from slot flags, and
make state transitions more discrete adding both an attached and
detached state

When PDS is cleared, only proceed to DETACHED state from
DETACHING to prevent a bogus PDS 0 on device insertion from
stopping us from attaching if the link is present

In pcib_hotplug_inserted, allow either PDS in the slot state or
DL_ACTIVE in the link state to indicate presence of a device so
that a bogus PDS 0 does not prevent attaching on an active link

In pcib_pcie_dll_timeout, only transition to the DETACHING state
if a hotplug event had put the slot into a DETACH_PENDING state
so that the state machine does not get stuck in DETACHING after
removing a device and the bogus PDS 1 causes the wait for the
DL_ACTIVE change to time out

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

linnemannr_gmail.com created this object with visibility "All Users".
linnemannr_gmail.com changed the visibility from "All Users" to "Public (No Login Required)".Nov 10 2021, 11:53 PM
jrtc27 added inline comments.
sys/dev/pci/pci_pci.c
1159

I believe this isn't under #ifdef NEW_PCIB, so the sysctl needs to be defined outside that ifdef (but can be under PCI_HP)