pciehp: use completion to wait irq_thread 'pciehp_ist'
hulk inclusion category: bugfix bugzilla: NA CVE: NA ------------------- When I use the following command to power on a slot which has been powered off already. echo 1 > /sys/bus/pci/slots/22/power It prints the following error: -bash: echo: write error: No such device But the slot is actually powered on and the devices is probed. In function 'pciehp_sysfs_enable_slot()', we use 'wait_event()' to wait until 'ctrl->pending_events' is cleared in 'pciehp_ist()'. But in some situation, when 'pciehp_ist()' is woken up on a nearby CPU after 'pciehp_request' is called, 'ctrl->pending_events' is cleared before we go into sleep state. 'wait_event()' will check the condition before going into sleep. So we return immediately and '-ENODEV' is return. This patch use struct completion to wait until irq_thread 'pciehp_ist' is completed. Signed-off-by:Xiongfeng Wang <wangxiongfeng2@huawei.com> Reviewed-by:
Yao Hongbo <yaohongbo@huawei.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>
Please register or sign in to comment