From: Hamza Mahfooz <[email protected]> Sent: Friday, June 12,
2026 10:40 AM
>
The addressees for this patch include the linux-hyperv and linux-pci
mailing lists, but not the broad linux-kernel mailing list. Any reason not
to include the latter? In Documentation/process/submitting-patches.rst,
in the section "Select the recipients for your patch", it says
[email protected] should be used by default for all patches
I subscribe to the broad linux-kernel list and do my own filtering, instead
of subscribing to individual subsystem lists. So I didn't see this patch
until I glanced at https://lore.kernel.org/linux-hyperv/. Following the
guidance to always include linux-kernel would help me, for one. :-)
Thx,
Michael
> It is possible that we never receive a rescind event, in which case we
> will wait indefinitely for a device that will never show up. So, assume
> a device is gone if have been polling for more than 5 seconds.
>
> Cc: [email protected]
> Fixes: c3635da2a336 ("PCI: hv: Do not wait forever on a device that has
> disappeared")
> Signed-off-by: Hamza Mahfooz <[email protected]>
> ---
> drivers/pci/controller/pci-hyperv.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/pci-hyperv.c
> b/drivers/pci/controller/pci-hyperv.c
> index cfc8fa403dad..bd63efc4a210 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -52,6 +52,7 @@
> #include <linux/acpi.h>
> #include <linux/sizes.h>
> #include <linux/of_irq.h>
> +#include <linux/jiffies.h>
> #include <asm/mshyperv.h>
>
> /*
> @@ -1038,6 +1039,8 @@ static void put_pcichild(struct hv_pci_dev *hpdev)
> kfree(hpdev);
> }
>
> +#define TIMEOUT_MS 5000
> +
> /*
> * There is no good way to get notified from vmbus_onoffer_rescind(),
> * so let's use polling here, since this is not a hot path.
> @@ -1045,8 +1048,13 @@ static void put_pcichild(struct hv_pci_dev *hpdev)
> static int wait_for_response(struct hv_device *hdev,
> struct completion *comp)
> {
> + unsigned long timeout = get_jiffies_64() + msecs_to_jiffies(TIMEOUT_MS);
> + unsigned long now;
> +
> while (true) {
> - if (hdev->channel->rescind) {
> + now = get_jiffies_64();
> + if (hdev->channel->rescind ||
> + time_after(now, timeout)) {
> dev_warn_once(&hdev->device, "The device is gone.\n");
> return -ENODEV;
> }
> --
> 2.54.0
>