Linux-HyperV List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Haiyang Zhang" <haiyangz@linux.microsoft.com>
Cc: linux-hyperv@vger.kernel.org
Subject: Re: [PATCH net-next v3] net: mana: Add handler for sriov configure
Date: Thu, 09 Jul 2026 21:01:55 +0000	[thread overview]
Message-ID: <20260709210156.4629D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260708205924.2408673-1-haiyangz@linux.microsoft.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Calling `pci_disable_sriov()` in the PF's `shutdown` path forces the teardown of already-shut-down VFs, triggering a `dev_WARN_ONCE` stack trace that can cause a kernel panic on shutdown.
--

--- Patch [1]: [PATCH net-next v3] net: mana: Add handler for sriov configure ---
commit 4f33a45546e7a470eda04866cd0e6294bcfd526c
Author: Haiyang Zhang <haiyangz@microsoft.com>

net: mana: Add handler for sriov configure

This patch adds an SR-IOV configuration handler to the mana driver, allowing
it to request or disable VFs. It also adds SR-IOV disable calls to the
device remove and shutdown paths.

> diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> index e8b7ffb47eb98..dff66a2a4f598 100644
> --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
> +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
[ ... ]
> @@ -2488,6 +2490,8 @@ static void mana_gd_shutdown(struct pci_dev *pdev)
>  
>  	dev_info(&pdev->dev, "Shutdown was called\n");
>  
> +	pci_disable_sriov(pdev);
> +

[Severity: High]
Will this trigger a kernel warning during system shutdown when VFs are active?

During system shutdown, the driver core calls device_shutdown() iterating in
reverse creation order. First, it calls mana_gd_shutdown() on the VFs, which
partially tears down the VF and disables the PCI device:

mana_gd_shutdown()
    ...
    pci_disable_device(pdev); 

Next, device_shutdown() calls mana_gd_shutdown() on the PF. Calling
pci_disable_sriov() here destroys the VF PCI devices and unregisters them
from the bus, which synchronously forces a call to the VF's remove callback:

mana_gd_remove()
    ...
    pci_disable_device(pdev); 

Since pci_disable_device() is called unconditionally at the end of both
mana_gd_shutdown() and mana_gd_remove(), this second call detects that the
device is already disabled and fires a warning. On production systems with
panic_on_warn=1, this converts a normal shutdown into a kernel panic.

>  	mana_rdma_remove(&gc->mana_ib);
>  	mana_remove(&gc->mana, true);
[ ... ]

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

  reply	other threads:[~2026-07-09 21:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 20:59 [PATCH net-next v3] net: mana: Add handler for sriov configure Haiyang Zhang
2026-07-09 21:01 ` sashiko-bot [this message]
2026-07-10 19:19 ` Haiyang Zhang

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=20260709210156.4629D1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=haiyangz@linux.microsoft.com \
    --cc=linux-hyperv@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox