Skip to content

Commit 8e33470

Browse files
nvax-rgregkh
authored andcommitted
PCI/NPEM: Set LED_HW_PLUGGABLE for hotplug-capable ports
[ Upstream commit 16d021c ] 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: 4e89354 ("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 Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c1f0f29 commit 8e33470

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/pci/npem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ static int pci_npem_set_led_classdev(struct npem *npem, struct npem_led *nled)
504504
led->brightness_get = brightness_get;
505505
led->max_brightness = 1;
506506
led->default_trigger = "none";
507-
led->flags = 0;
507+
led->flags = LED_HW_PLUGGABLE;
508508

509509
ret = led_classdev_register(&npem->dev->dev, led);
510510
if (ret)

0 commit comments

Comments
 (0)