Re: [PATCH v2 1/1] PCI/hotplug: Add 'uevent' sysfs attribute to trigger slot events
From: Ramesh Errabolu
Date: Mon Apr 20 2026 - 15:38:05 EST
Thanks for testing and also giving me the review-by
Regards,
Ramesh
On 4/17/2026 4:53 AM, Niklas Schnelle wrote:
On Thu, 2026-04-16 at 16:39 -0500, Ramesh Errabolu wrote:
Add a write-only 'uevent' sysfs attribute for synthesizingSorry for the review delay. This looks good to me and will really help
uevents for a PCI slot. This extends the existing uevent
support which emits a KOBJ_ADD uevent in pci_hp_add() with
the ability to replay such uevents for cold plugged devices.
As such events are only emitted by hotplug capable PCI slots
so is the support for synthesizing them.
The change was validated by manually triggering 'add' uevent
for a specific hotplug PCI slot:
$ echo "add $(uuidgen)" | sudo tee \
/sys/bus/pci/slots/<slot-id>/uevent
Signed-off-by: Ramesh Errabolu <ramesh@xxxxxxxxxxxxx>
---
drivers/pci/hotplug/pci_hotplug_core.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
with udev rule execution for devices which are discovered in standby
state during boot and thus currently don't create any uevents. Of
course to work by default this still requires a systemd/udev addition
that I know you're also working on.
Consequently, I tested the uevent synthesization with both slots with a
configured (slot powered on) and standby (slot powered off) PCI
function.
Feel free to add:
Reviewed-by: Niklas Schnelle <schnelle@xxxxxxxxxxxxx>
Tested-by: Niklas Schnelle <schnelle@xxxxxxxxxxxxx>
Thanks,
Niklas