• udev rule not triggered on ubuntu 20.04

    From Vijay Subramanian@21:1/5 to All on Mon Feb 22 22:31:15 2021
    udev rule does not trigger after pci hotreset via setpci

    udev rule (which was placed in /etc/udev/rules.d/00pci_dev_removal_entry.rules)

    ACTION=="add" ATTRS{class}=="0x010802" RUN+="echo PCI_device_class_0x010802_detected > /tmp/udev_notification.out"

    ACTION=="remove" ATTRS{class}=="0x010802" RUN+="echo PCI_device_class_0x010802_removed > /tmp/udev_notification.out"

    There is no sign of udev rule getting triggered or running after doing the below,

    sudo udevadm control --reload-rules && udevadm trigger

    & here are the steps done to trigger the udev rule,

    setpci -s 0000:02:02.0 BRIDGE_CONTROL=$(printf "%04x" $((0x0010|0x40))) (hot reset command via setpci)
    setpci -s 0000:02:02.0 BRIDGE_CONTROL=0x0010 (enable pci device via setpci) echo 1 > /sys/bus/pci/devices/0000:05:00.0/rescan
    Tested the above udev rule on ubuntu 20.04. Point to be noted is, after doing setpci(hot reset both disable & enable) able to see pci dev entry removed & added to the "lspci" command.

    So, there are no issues related to setpci.

    Any leads to help as to find why the udev rule was not getting triggered would be appreciated.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)