From: Richard Cheng Date: Thu, 2 Apr 2026 09:38:50 +0000 (+0800) Subject: PCI/NPEM: Set LED_HW_PLUGGABLE for hotplug-capable ports X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16d021c878dca22532c984668c9e8cf4722d6a49;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Bjorn Helgaas Reviewed-by: Lukas Wunner Acked-by: Kai-Heng Feng Link: https://patch.msgid.link/20260402093850.23075-1-icheng@nvidia.com --- diff --git a/drivers/pci/npem.c b/drivers/pci/npem.c index ffeeedf6e3112..c51879fcd4386 100644 --- a/drivers/pci/npem.c +++ b/drivers/pci/npem.c @@ -504,7 +504,7 @@ static int pci_npem_set_led_classdev(struct npem *npem, struct npem_led *nled) led->brightness_get = brightness_get; led->max_brightness = 1; led->default_trigger = "none"; - led->flags = 0; + led->flags = LED_HW_PLUGGABLE; ret = led_classdev_register(&npem->dev->dev, led); if (ret)