]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI/NPEM: Set LED_HW_PLUGGABLE for hotplug-capable ports
authorRichard Cheng <icheng@nvidia.com>
Thu, 2 Apr 2026 09:38:50 +0000 (17:38 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 6 Apr 2026 17:34:28 +0000 (12:34 -0500)
commit16d021c878dca22532c984668c9e8cf4722d6a49
treed1f4d3c5c2d29e4bae577456bec63182a1a93e0e
parent79253d6fe1cc80938160be2625d270fe5a4252ee
PCI/NPEM: Set LED_HW_PLUGGABLE for hotplug-capable ports

NPEM registers LED classdevs on PCI endpoint that may be behind
hotplug-capable ports. During hot-removal, led_classdev_unregister() calls
led_set_brightness(LED_OFF) which leads to a PCI config read to a
disconnected device, which fails and returns -ENODEV (topology details in
msgid.link below):

  leds 0003:01:00.0:enclosure:ok: Setting an LED's brightness failed (-19)

The LED core already suppresses this for devices with LED_HW_PLUGGABLE set,
but NPEM never sets it. Add the flag since NPEM LEDs are on hot-pluggable
hardware by nature.

Fixes: 4e893545ef87 ("PCI/NPEM: Add Native PCIe Enclosure Management support")
Signed-off-by: Richard Cheng <icheng@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Kai-Heng Feng <kaihengf@nvidia.com>
Link: https://patch.msgid.link/20260402093850.23075-1-icheng@nvidia.com
drivers/pci/npem.c