Re: A question about shpcp.

From: Lukas Wunner
Date: Tue Jul 02 2019 - 08:28:49 EST


On Thu, Jun 27, 2019 at 12:16:18PM +0000, linmiaohe wrote:
> In qemu+shpcp+pcie scene, hotplug a network card(virtio) would take more
> than 5 seconds. It's because 5 seconds delayed_work in func
> handle_button_press_event with case STATIC_STATE. And this will break some
> protocols with timeout within 5 seconds.
> It's very nice of you if you could tell me why is 5*HZ there and if this
> delay can be reduced?

According to Table 2-4 of the PCI Standard Hot-Plug Controller and
Subsystem Specification, "System software is waiting 5 seconds to
provide the user with an opportunity to cancel the hot-plug operation."
(http://drydkim.com/MyDocuments/PCI%20Spec/specifications/shpc1_0.pdf)

So the reason the delay can't be reduced or removed is because the spec
mandates it.

Thanks,

Lukas