K 10 svn:author V 3 avg K 8 svn:date V 27 2021-05-21T10:32:34.821752Z K 7 svn:log V 902 PCI hot-plug: use dedicated taskqueue for device attach / detach Attaching and detaching devices can be heavy-weight and detaching can sleep waiting for events. For that reason using the system-wide single-threaded taskqueue_thread is not really appropriate. There is even a possibility for a deadlock if taskqueue_thread is used for detaching. In fact, there is an easy to reproduce deadlock involving nvme, pass and a sudden removal of an NVMe device. A pass peripheral would not release a reference on an nvme sim until pass_shutdown_kqueue() is executed via taskqueue_thread. But the taskqueue's thread is blocked in nvme_detach() -> ... -> cam_sim_free() because of the outstanding reference. Sponsored by: CyberSecure Reviewed by: mav, imp (cherry picked from commit 12588ce02dd835b332952d9fece5881d943554a9) Git Hash: 2def2de60a6d0b979964bb67c5ff0e24d098e4a9 Git Author: avg@FreeBSD.org END