pciehp_check_presence(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pciehp_check_presence(9)

okay so bestie, this is a page from the Kernel API Manual β€” yes, the kernel has its own manual, and yes it's iconic. The star of the show is pciehp_check_presence, a function so chill it literally returns nothing. Let's get into it 🫢


✨ NAME ✨

pciehp_check_presence β€” synthesize an event if the presence has changed πŸ’«

like, if your slot's vibe check comes back different than expected, this thing makes an event out of it. no cap.


🌸 SYNOPSIS 🌸

void pciehp_check_presence (struct controller *ctrl );

that's it. that's the whole signature. returns void, takes one pointer. no drama, no return value, just vibes 😌


πŸŽ€ ARGUMENTS πŸŽ€

  • ctrl β€” the controller you wanna check. literally just the controller. that's the one. πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the situation, bestie β€” on probe and on resume, you need an explicit presence check. like, you can't skip it. this is how you bring up an occupied slot, or bring down an unoccupied one. main character behaviour, honestly πŸ‘‘

and why can't you just let events handle it? okay so, it can't be triggered by events in the Slot Status register β€” those may be stale, which is why they get cleared. expired info? we don't know her. clearing it out is the move 🧹✨

secondly (yes there's a secondly), sending an interrupt for "events that occur while interrupt generation is disabled [when] interrupt generation is subsequently enabled" is optional per PCIe r4.0, sec 6.7.3.4. optional!! so we're not relying on it. we do the check ourselves. self-sufficient queen πŸ’…

⚠️ key takeaway: don't trust the Slot Status register events here β€” they might be stale, and they get cleared anyway. the explicit check is the whole point. 🫑

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/pci/hotplug/pciehp_core.c β€” go read it, iykyk πŸ“–πŸ’œ

that's the page, bestie!! 🌸 no notes, ate and left no crumbs πŸ”₯

and for the cute sign-off: this lil gem comes from ./drivers/pci/hotplug, dated October 2026 β€” put that in your calendar and slay πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from