From: netdev-bot+sashiko@kernel.org
To: nikhil.rao@amd.com
Cc: brett.creeley@amd.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, richardcochran@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
eric.joyner@amd.com, abhijit.gangurde@amd.com,
allen.hubbe@amd.com
Subject: Re: [PATCH net 1/4] ionic: fix devcmds racing the BAR unmap on PCI reset
Date: Thu, 03 Dec 2026 00:42:23 +0000 [thread overview]
Message-ID: <179625854395.3146.17197499909139989325@kernel.org> (raw)
In-Reply-To: <20261202-b4-pr60-v1-1-b1f6706e065b@amd.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The patch makes `ionic->dev_cmd_lock` protect the lifetime of the
`idev.dev_cmd_regs` pointer, but the lock's comment in `struct ionic`…
--
ionic: fix devcmds racing the BAR unmap on PCI reset
This patch makes dev_cmd_lock protect idev.dev_cmd_regs. ionic_clear_pci()
now clears the pointer under the lock before BAR0 is unmapped.
ionic_get_regs() and ionic_firmware_update() now check the pointer for
NULL while holding the lock, and ionic_vf_start() now takes the lock
around its devcmd.
Closes: https://lore.kernel.org/netdev/179539559673.3135.12079878343644861835@kernel.org/
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
> index ddc2f9770df45..49941fc6bbc41 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
> @@ -219,7 +219,9 @@ static void ionic_clear_pci(struct ionic *ionic)
> {
> if (ionic->num_bars) {
> ionic->idev.dev_info_regs = NULL;
> + mutex_lock(&ionic->dev_cmd_lock);
> ionic->idev.dev_cmd_regs = NULL;
> + mutex_unlock(&ionic->dev_cmd_lock);
[Severity: Low]
This isn't a bug, but should the comment on dev_cmd_lock in struct ionic
(drivers/net/ethernet/pensando/ionic/ionic.h) be updated too? It still
says only:
struct mutex dev_cmd_lock; /* lock for dev_cmd operations */
After this patch, three places rely on the lock to keep
idev.dev_cmd_regs alive. This teardown in ionic_clear_pci() needs it, and
so do the new NULL checks in ionic_get_regs() and in the per-chunk loop
of ionic_firmware_update(). The code doesn't say anywhere that a reader
must hold dev_cmd_lock from the NULL check through the MMIO access.
The comment is still unchanged at the end of the series. The sibling
patch "ionic: fix PHC reads racing the BAR unmap on PCI reset" does
document its matching rule:
spinlock_t lock; /* lock for state_page, cc, tc and idev.hwstamp_regs */
Could dev_cmd_lock get a similar note, for example "lock for dev_cmd
operations and idev.dev_cmd_regs"?
One site still uses the pointer without the lock.
ionic_lif_queue_identify() computes &idev->dev_cmd_regs->data outside
the lock. Its only caller chain is ionic_probe()->ionic_lif_alloc(), and
the commit message excludes probe-time identify on purpose. That
exception is only in the commit message, though, and not in the code.
> ionic->idev.intr_status = NULL;
> ionic->idev.intr_ctrl = NULL;
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-b4-pr60-v1-0-b1f6706e065b%40amd.com
next prev parent reply other threads:[~2026-12-03 0:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 0:38 [PATCH net 0/4] ionic: fix register reads racing the BAR unmap on PCI reset Nikhil P. Rao
2026-12-02 0:38 ` [PATCH net 1/4] ionic: fix devcmds " Nikhil P. Rao
2026-12-03 0:42 ` netdev-bot+sashiko [this message]
2026-12-02 0:38 ` [PATCH net 2/4] ionic: fix device info register reads " Nikhil P. Rao
2026-12-02 0:38 ` [PATCH net 3/4] ionic: fix PHC " Nikhil P. Rao
2026-12-02 0:38 ` [PATCH net 4/4] ionic: fix ethtool coalesce updates racing a " Nikhil P. Rao
2026-12-03 0:42 ` netdev-bot+sashiko
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=179625854395.3146.17197499909139989325@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=abhijit.gangurde@amd.com \
--cc=allen.hubbe@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=eric.joyner@amd.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikhil.rao@amd.com \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/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