PCI: hv: Do not wait forever on a device that has disappeared
authorDexuan Cui <decui@microsoft.com>
Wed, 23 May 2018 21:12:01 +0000 (21:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Jun 2018 20:49:22 +0000 (22:49 +0200)
commit3fe4b0cf93833af2ef497784bdfb2a4eecaabb6e
treead36bd7293ecfcc6e423b21ed6498064a4376e49
parentdd4be396b8c5d926775f664a6b2aad0509fa6cc3
PCI: hv: Do not wait forever on a device that has disappeared

commit c3635da2a336441253c33298b87b3042db100725 upstream.

Before the guest finishes the device initialization, the device can be
removed anytime by the host, and after that the host won't respond to
the guest's request, so the guest should be prepared to handle this
case.

Add a polling mechanism to detect device presence.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
[lorenzo.pieralisi@arm.com: edited commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/host/pci-hyperv.c