All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hamza Mahfooz" <hamzamahfooz@linux.microsoft.com>,
	linux-hyperv@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI: hv: add vPCI device reset support
Date: Sat, 17 Oct 2026 00:12:00 +0000	[thread overview]
Message-ID: <sashiko-outbox-175060@kernel.org> (raw)
In-Reply-To: <20261016235940.942090-2-hamzamahfooz@linux.microsoft.com>

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().

> +	if (ret)
> +		return ret;
> +
> +	if (comp_pkt.completion_status == STATUS_NOT_SUPPORTED)
> +		return -ENOTTY;
> +
> +	if (comp_pkt.completion_status) {
> +		pci_err(pdev, "Hyper-V device reset failed: %#x\n",
> +			comp_pkt.completion_status);
> +		return -EIO;
> +	}
> +
> +	return 0;
> +}

[ ... ]

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

  reply	other threads:[~2026-10-17  0:12 UTC|newest]

Thread overview: 4+ 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 [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=sashiko-outbox-175060@kernel.org \
    --to=sashiko-bot@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.