diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2021-10-19 09:12:22 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2023-01-06 06:27:34 +0100 |
commit | 22227165e7c468d90f97b06a9ef2fe572add7fa5 (patch) | |
tree | 62b1535038efbe18195884c548373e88766c52e4 /drivers/pci/hotplug/pciehp.h | |
parent | 76dcd734eca23168cb008912c0f69ff408905235 (diff) | |
download | linux-22227165e7c468d90f97b06a9ef2fe572add7fa5.tar.gz |
pciehp: fast unplug for virtual machinespcie-hotplug
The PCIe specification asks the OS to wait five seconds after the
attention button has been pressed before actually un-plugging the
device. This gives the operator the chance to cancel the operation
by pressing the attention button again within those five seconds.
For physical hardware this makes sense. Picking the wrong button
by accident can easily happen and it can be corrected that way.
For virtual hardware the benefits are questionable. Typically
users find the five second delay annoying.
This patch adds the fast_virtual_unplug module parameter to the
pciehp driver. When enabled (which is the default) the linux
kernel will simply skip the delay for virtual pcie ports, which
reduces the total time for the unplug operation from 6-7 seconds
to 1-2 seconds.
Virtual pcie ports are identified by PCI ID. For now the qemu
pcie root ports are detected, other hardware can be added easily.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/pci/hotplug/pciehp.h')
-rw-r--r-- | drivers/pci/hotplug/pciehp.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index e0a614acee05..fbadf1c8577e 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h @@ -81,6 +81,7 @@ extern int pciehp_poll_time; * @request_result: result of last user request submitted to the IRQ thread * @requester: wait queue to wake up on completion of user request, * used for synchronous slot enable/disable request via sysfs + * @is_virtual: virtual machine pcie port. * * PCIe hotplug has a 1:1 relationship between controller and slot, hence * unlike other drivers, the two aren't represented by separate structures. @@ -112,6 +113,8 @@ struct controller { unsigned int ist_running; int request_result; wait_queue_head_t requester; + + bool is_virtual; }; /** |