mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: Naman Jain <namjain@linux.microsoft.com>
Cc: Sahil Chandna <sahilchandna@linux.microsoft.com>,
	kys@microsoft.com,  haiyangz@microsoft.com, wei.liu@kernel.org,
	decui@microsoft.com, longli@microsoft.com,
	 lpieralisi@kernel.org, kwilczynski@kernel.org, robh@kernel.org,
	bhelgaas@google.com,  linux-hyperv@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	 mhklinux@outlook.com
Subject: Re: [PATCH v3] PCI: hv: Warn when wait_for_response() waits indefinitely
Date: Fri, 11 Sep 2026 12:29:05 +0200	[thread overview]
Message-ID: <hen5k4ejonfffwdir7tfa2gnmxwfbbqabrjtwooo4o5pjf5gnz@x52vfm5phv3l> (raw)
In-Reply-To: <c8b6e10f-dd52-4c74-8d16-268563d8bc1f@linux.microsoft.com>

On Wed, Sep 09, 2026 at 03:01:22PM +0530, Naman Jain wrote:
> 
> 
> On 9/8/2026 5:00 PM, Sahil Chandna wrote:
> > A guest can wait indefinitely in wait_for_response() for the host to
> > send either a rescind message or a packet completion. If the
> > host does not send either, the guest can remain blocked with no
> > diagnostic indicating a reason.
> > This was observed during a guest kernel upgrade in which the
> > host-side application handling the PCI channel faulted, causing the
> > guest to never receive the completion request.
> > Add a warning in wait_for_response() when the wait exceeds
> > a timeout so that such a hang is visible in the guest's kernel log
> > and can be correlated with host-side state.
> > 
> > Suggested-by: Michael Kelley <mhklinux@outlook.com>
> > Signed-off-by: Sahil Chandna <sahilchandna@linux.microsoft.com>
> > ---
> > Changes since v2:
> > - Add counter based timeout instead of introducing another timer
> > Link to v2: https://lore.kernel.org/all/20260902115854.2629164-1-sahilchandna@linux.microsoft.com/
> > 
> > Changes since v1:
> > - Removed periodic warning to one time warning in 2 minutes
> > - Include vmbus relid and stuck PCI msg.
> > Link to v1: https://lore.kernel.org/all/20260825051850.2438816-1-sahilchandna@linux.microsoft.com/
> >   drivers/pci/controller/pci-hyperv.c | 46 ++++++++++++++++++++++-------
> >   1 file changed, 36 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> > index 89816a2bd7cd..bd07402c47ed 100644
> > --- a/drivers/pci/controller/pci-hyperv.c
> > +++ b/drivers/pci/controller/pci-hyperv.c
> > @@ -1040,19 +1040,38 @@ static void put_pcichild(struct hv_pci_dev *hpdev)
> > 
> >   /*
> >    * 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.
> > + * so let's use polling here, since this is not a hot path. If
> > + * wait_for_response() has been polling for 2 minutes
> > + * without either a rescind or completion, add a warning.
> >    */
> > +#define PCI_RESPONSE_HANG_TICKS 1200
> > +
> 
> Nit, I think this variable name could be misleading, as this represents a
> loop counter for a retry logic, but not exactly *ticks* from kernel
> terminology.
> 
> I would have preferred something like: PCI_RESPONSE_WARN_POLL_COUNT.
> 

PCI_RESPONSE_POLL_COUNT?

- Mani

-- 
மணிவண்ணன் சதாசிவம்

  reply	other threads:[~2026-09-11 10:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 11:30 Sahil Chandna
2026-09-09  9:31 ` Naman Jain
2026-09-11 10:29   ` Manivannan Sadhasivam [this message]
2026-09-13 22:39     ` Wei Liu
2026-09-14 10:41       ` Sahil Chandna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=hen5k4ejonfffwdir7tfa2gnmxwfbbqabrjtwooo4o5pjf5gnz@x52vfm5phv3l \
    --to=mani@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kwilczynski@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=lpieralisi@kernel.org \
    --cc=mhklinux@outlook.com \
    --cc=namjain@linux.microsoft.com \
    --cc=robh@kernel.org \
    --cc=sahilchandna@linux.microsoft.com \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®