Re: [PATCH] PCI/NPEM: Set LED_HW_PLUGGABLE for hotplug-capable ports

From: Lukas Wunner

Date: Sun Apr 05 2026 - 03:41:46 EST


On Thu, Apr 02, 2026 at 05:38:50PM +0800, Richard Cheng wrote:
> 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 PCI config on a disconnected
> device, returning -ENODEV:
>
> ```
> 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@xxxxxxxxxx>
> Acked-by: Kai-Heng Feng <kaihengf@xxxxxxxxxx>

Reviewed-by: Lukas Wunner <lukas@xxxxxxxxx>