All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Cc: sashiko-reviews@lists.linux.dev, linux-hyperv@vger.kernel.org,
	linux-pci@vger.kernel.org, Wei Liu <wei.liu@kernel.org>
Subject: Re: [PATCH 2/2] PCI: hv: add vPCI device reset support
Date: Wed, 21 Oct 2026 00:12:37 -0700	[thread overview]
Message-ID: <20261021071237.GC851443@liuwe-devbox-debian-v2.local> (raw)
In-Reply-To: <atYPfibVVa+nyyb9@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>

On Mon, Oct 19, 2026 at 08:39:26AM -0400, Hamza Mahfooz wrote:
> On Sat, Oct 17, 2026 at 12:12:00AM +0000, sashiko-bot@kernel.org wrote:
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > - [Low] PCI: hv: hv_pci_reset_device() passes 3 arguments to wait_for_response()
> > --
> > 
> > commit 5767f2b6950e5dc7da0b5c142f971d8282c27a56
> > Author: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
> > 
> > PCI: hv: add vPCI device reset support
> > 
> > This commit negotiates Hyper-V vPCI protocol version 1.5 and implements the
> > reset_root_port() callback on pci_host_bridge by sending a PCI_RESET_DEVICE
> > request over the vPCI VMBus channel.
> > 
> > > diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> > > index 89816a2bd7cd3..4bb4ca6da1f7b 100644
> > > --- a/drivers/pci/controller/pci-hyperv.c
> > > +++ b/drivers/pci/controller/pci-hyperv.c
> > 
> > [ ... ]
> > 
> > > @@ -1397,6 +1401,52 @@ static int hv_pcifront_write_config(struct pci_bus *bus, unsigned int devfn,
> > >  	return PCIBIOS_SUCCESSFUL;
> > >  }
> > >  
> > > +static int hv_pci_reset_device(struct pci_host_bridge *bridge,
> > > +			       struct pci_dev *pdev)
> > > +{
> > > +	struct hv_pcibus_device *hbus =
> > > +		container_of(bridge->sysdata, struct hv_pcibus_device, sysdata);
> > > +	struct pci_child_message reset = {};
> > > +	struct hv_pci_compl comp_pkt;
> > > +	struct pci_packet pkt = {
> > > +		.completion_func = hv_pci_generic_compl,
> > > +		.compl_ctxt = &comp_pkt,
> > > +	};
> > > +	enum hv_pcibus_state state;
> > > +	int ret;
> > > +
> > > +	/* Do not take state_lock: eject holds it while removing/locking pdev. */
> > > +	state = READ_ONCE(hbus->state);
> > > +	if (state != hv_pcibus_probed && state != hv_pcibus_installed)
> > > +		return -ENODEV;
> > > +
> > > +	init_completion(&comp_pkt.host_event);
> > > +	reset.message_type.type = PCI_RESET_DEVICE;
> > > +	reset.wslot.slot = devfn_to_wslot(pdev->devfn);
> > > +
> > > +	ret = vmbus_sendpacket(hbus->hdev->channel, &reset, sizeof(reset),
> > > +			       (unsigned long)&pkt, VM_PKT_DATA_INBAND,
> > > +			       VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
> > > +	if (ret)
> > > +		return ret;
> > > +
> > > +	ret = wait_for_response(hbus->hdev, &comp_pkt.host_event,
> > > +				"PCI_RESET_DEVICE");
> > 
> > [Severity: Low]
> > Does this compile when CONFIG_PCI_HYPERV is enabled?
> > 
> > In drivers/pci/controller/pci-hyperv.c, wait_for_response() only accepts two
> > arguments:
> > 
> > static int wait_for_response(struct hv_device *hdev,
> > 			     struct completion *comp)
> > 
> > Passing "PCI_RESET_DEVICE" as a third argument in hv_pci_reset_device()
> > causes the build to fail with too many arguments to wait_for_response().
> > 
> 
> Not sure what tree this was applied to, but that function has 3 params
> as of mainline commit ca039df94983 ("PCI: hv: Warn when
> wait_for_response() waits indefinitely").

The link ...

> > Sashiko AI review · https://sashiko.dev/#/patchset/20261016235940.942090-1-hamzamahfooz@linux.microsoft.com?part=2
> 

... shows that it picked git.lwn.net/docs-next (90d9f76ccb72ec024ef476b4229f3dd1957d7b26).

It looks like it is hallucinating.

Wei

  reply	other threads:[~2026-10-21  7:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 23:59 [PATCH 1/2] PCI: use reset_root_port() for bus reset of devices on a root bus Hamza Mahfooz
2026-10-16 23:59 ` [PATCH 2/2] PCI: hv: add vPCI device reset support Hamza Mahfooz
2026-10-17  0:12   ` sashiko-bot
2026-10-19 12:39     ` Hamza Mahfooz
2026-10-21  7:12       ` Wei Liu [this message]
2026-10-17  0:07 ` [PATCH 1/2] PCI: use reset_root_port() for bus reset of devices on a root bus sashiko-bot

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=20261021071237.GC851443@liuwe-devbox-debian-v2.local \
    --to=wei.liu@kernel.org \
    --cc=hamzamahfooz@linux.microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.