Article View: linux.kernel.netdev
Article #26068Re: [PATCH net 1/4] ionic: fix devcmds racing the BAR unmap on PCI reset
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 00:42
Date: Thu, 03 Dec 2026 00:42
69 lines
10715 bytes
10715 bytes
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
Technical Details
Message-ID:
<179625854395.3146.17197499909139989325@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376169-linux-kernel-netdev=dewy.ruReferences:
<20261202-b4-pr60-v1-1-b1f6706e065b@amd.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376169-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <179625854395.3146.17197499909139989325@kernel.org> References: <20261202-b4-pr60-v1-1-b1f6706e065b@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2098242"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:nXINAW4eNaXLi5/t1uLPMS/SSBE= sha256:D7tj5jxcaWWYg2JfsKLEdhSzhXmsfG7CjdczfUBxlcU= sha1:tzFvk9CJmk1MDpx0b9sTP0d4AgU= sha256:Qb7vZlv1/iGuTamg9XTe5kr90szNIbLQYKeXwpVpjQo= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 132921177C5; Thu, 3 Dec 2026 03:42:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s8e903irbgpU; Thu, 3 Dec 2026 03:42:38 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376169-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 9F8801177BE; Thu, 3 Dec 2026 03:42:30 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 466F227F0D; Thu, 3 Dec 2026 00:42:29 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796258546; b=GF/PwWbDmqi+4H8/t5sS2SOZ8R0LMHVATzbw7zWfD8jtiB/yVXmapHB2pH3FsDGjlnY+ tyvlC+zZecedfl4iNJUfS+uNC0K+gzY7FXklPbi3WGlTqOpznNJaxZWsT3LJvyXrWsfSy zWXUpra2jZ5JNrAydaOI1HlIAsi7DgamluofJobxjTLHpkfWCfI0OboNv08mHdYQckvfg EwDX+MEFu7mEnxaN1OsYiSmZuxHkO7Xjgdt7eDs6f3hDbJ2DnkdVl1EKir97H49tpvwoj IYhWaZABFG/XtAPgzhHoAHgJj8k2GtqV3UJCYGORxNdMi+my2jJWWqxb5mlXZEzP8dg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796258546; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=CazVnwECzwVpGvkgz80aWWO1Mqcq8sclZ0qgGo2b7q4=; b=zdaAAy3zH9QgdwTZ0zc4EASknYOgclPMtzCcem0QueQb6qlVxLUltF7JAzlWeIM3jc1s Hu+0woH10VcukNE37H1YS6TfOUZjNdscygj4tsCtIgjy6xbDb99rJn11MZpu2Xz8PFalM Ra7S6Wt3r6otcOWm63BVR9NCAq+3k2fp2SITdKzGFzdJO1XLMjrajyDkBUUF8aqNmD7xe XYpWgE7TxQ0BYiMYgJjpWbGTTeYpWFexsHT9OgF80gtqgrA7/5kb59JD8YdrUDu/Z4Qch T45dv2CBD/8tyoASV/N1isOL5xkW+9gbifwl77gBBzKnHog8TvNGV1g5QLncroGglZQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=j3YGmCoS; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AAC4606A339; Thu, 3 Dec 2026 00:42:26 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=j3YGmCoS X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796258545; b=mZ7loStPLS5iQtszg9GEy9I8JkruMptYq5CJf7ePhZR3pF3HbYdG9F9tAif3HFDMdmPo LW5Cmgy1YEZvTxVB6Mh8cUdod7GO3+WoxlZBoEgArG9Vt/R96MKO97uletIhmIPSWG852 eehtXahmcrEnCdt1wvOACOD4XOO2q/riFTVCq05v3E8st10V9SMDKC6mj9Q0pgTnI2H0j 1+XT7lWXIptuN3eOtl4HzgmWeylZiG7z2ma1n+YEWWCw0xbeF6xcAKvtV8apP40AYFe8r NhaI6adPvlc3WnUuJNnrGOEPcdO+KUVadNyWay2XqDWQ+iI5ThdF4UYLZQCBlGXB2IA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796258545; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=CazVnwECzwVpGvkgz80aWWO1Mqcq8sclZ0qgGo2b7q4=; b=jNxlZr4dMt+wZdTPirRxwhqQhphMPM6qbwgcDX2kGZ/ZTdTJRRblqOtr6oYlK+wD6jWe 4b1xzcWUFUA5iF3iUVSL5DgGU633Pr0K+e+ON/ex/oYn8pvHD8RcYFjhUObxP/GrTKYLJ ed/iA8aD721UWyMciJ8qnZgkXt6yQN9taqC6lacuaCQqw93VnWwVFJfwaa7cHKW3V26Sf WERK1xy83PNwslHn8CdOgM0Bg+0E/Owp4BkVb3AJ/zMXvfwx5WQBs1U24XXiH7D1h3s02 6JldPyOJ0RZOj7kJ4uv0ypLonFkq7jxCd1vML28Vjq2t4NthY85TSstqKBcrMjv33PA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=j3YGmCoS; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 688B7606A322; Thu, 3 Dec 2026 00:42:25 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 652641F00893; Thu, 3 Dec 2026 00:42:24 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796258545; bh=CazVnwECzwVpGvkgz80aWWO1Mqcq8sclZ0qgGo2b7q4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=j3YGmCoSZv806Ca/c4+xkJN3SDCuhb98pdwdzoUNJSWMOXYvJD4FArLMm4Yy1AWur qphbfibM2yLR9up6h1Rjn3Z+DQJa8JeoRspUe4CqkIXN8JbUfZKGuH31w7MlNg9teF AiMHYwHmiROZQYzLTcf9CjDBeHh3XtLKzXmjAfV9duYfEeSlkSJRo8oseifTHvxaXH xy03R5OGbXrVDkDNrTTiytbny9dsNPDmSEpoeUbYbfw6KcfHcG4wvI6jS4Ida86Xz1 GjE1Skw+PZZNhEf/IfmLQje48RRSmG9wzoIos3NJS43EKvH+HigSeahEOMIY5sH6NW XHXqVZHeCdEXQ== X-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 X-In-Reply-To: <20261202-b4-pr60-v1-1-b1f6706e065b@amd.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list