hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8Z2JH
--------------------------------
Powering off nvme device may cause a Data Link Layer State Changed event. This event results in re-enabling the device. In order to fix this issue, clear out the Presence Detect Changed and Data Link Layer State Changed events in p_slot->work.data.
Fixes: 8f7e505394e4 ("pciehp: do not wake up irq_thread for sysfs operation") Signed-off-by: Jialin Zhang zhangjialin11@huawei.com --- drivers/pci/hotplug/pciehp_ctrl.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 2d549c97ac42..29fbda494d4a 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c @@ -125,6 +125,8 @@ static void remove_board(struct slot *p_slot, bool safe_removal) /* Ignore link or presence changes caused by power off */ atomic_and(~(PCI_EXP_SLTSTA_DLLSC | PCI_EXP_SLTSTA_PDC), &ctrl->pending_events); + p_slot->work.data = p_slot->work.data & ~(PCI_EXP_SLTSTA_PDC | + PCI_EXP_SLTSTA_DLLSC); }
/* turn off Green LED */