From: Lorenzo Bianconi <lorenzo@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v9 2/6] net: airoha: Remove private net_device pointer in airoha_gdm_dev struct
Date: Thu, 4 Jun 2026 09:50:46 +0200 [thread overview]
Message-ID: <aiEuVrrgp9RjieOV@lore-desk> (raw)
In-Reply-To: <20260604060124.ACAD11F00893@smtp.kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2059 bytes --]
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>
> Pre-existing issues:
> - [High] Potential deadlock in airoha_update_hw_stats() due to use of spin_lock() instead of spin_lock_bh().
> --
>
> commit d33fdec52e6f77bf6de4ab248729e1a868e78dc6
> Author: Lorenzo Bianconi <lorenzo@kernel.org>
>
> net: airoha: Remove private net_device pointer in airoha_gdm_dev struct
>
> This commit removes the redundant net_device pointer from the
> airoha_gdm_dev struct. The code now relies on the netdev_from_priv()
> routine to retrieve the net_device pointer. This is a refactoring change
> with no logical modifications.
>
> > diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
> > index 6574901ebd19b..57a16de0a2ec7 100644
> > --- a/drivers/net/ethernet/airoha/airoha_eth.c
> > +++ b/drivers/net/ethernet/airoha/airoha_eth.c
>
> [ ... ]
>
> [Severity: High]
> This isn't a bug introduced by this patch, but I noticed a potential
> deadlock in airoha_update_hw_stats():
>
> drivers/net/ethernet/airoha/airoha_eth.c:airoha_update_hw_stats() {
> ...
> spin_lock(&port->stats.lock);
> ...
> }
>
> Does this code risk a deadlock? The ndo_get_stats64 callback
> (airoha_dev_get_stats64) can be executed in softirq context, while this
> lock is also acquired from process context (e.g., via ethtool) without
> disabling softirqs.
>
> If a softirq interrupts the process context reader holding the lock on the
> same CPU, wouldn't it spin forever trying to acquire the same lock? Should
> spin_lock_bh() be used here instead to prevent this?
As pointed out during previous iterations of the series, I do not think this is
a real issue since ndo_get_stats64() callback can't be run in softirq context.
Moreover, the reported issue has not been introduced by this series.
Regards,
Lorenzo
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260603-airoha-eth-multi-serdes-v9-0-5d476bc2f426@kernel.org?part=2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-06-04 7:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 6:00 [PATCH net-next v9 0/6] net: airoha: Support multiple net_devices connected to the same GDM port Lorenzo Bianconi
2026-06-03 6:00 ` [PATCH net-next v9 1/6] dt-bindings: net: airoha: Add GDM port ethernet child node Lorenzo Bianconi
2026-06-03 6:00 ` [PATCH net-next v9 2/6] net: airoha: Remove private net_device pointer in airoha_gdm_dev struct Lorenzo Bianconi
2026-06-04 6:01 ` sashiko-bot
2026-06-04 7:50 ` Lorenzo Bianconi [this message]
2026-06-03 6:00 ` [PATCH net-next v9 3/6] net: airoha: Support multiple net_devices for a single FE GDM port Lorenzo Bianconi
2026-06-04 6:01 ` sashiko-bot
2026-06-04 8:33 ` Lorenzo Bianconi
2026-06-04 8:41 ` Lorenzo Bianconi
2026-06-03 6:00 ` [PATCH net-next v9 4/6] net: airoha: Do not stop GDM port if it is shared Lorenzo Bianconi
2026-06-03 6:00 ` [PATCH net-next v9 5/6] net: airoha: Introduce WAN device flag Lorenzo Bianconi
2026-06-03 6:00 ` [PATCH net-next v9 6/6] net: airoha: Support multiple LAN/WAN interfaces for hw MAC address configuration Lorenzo Bianconi
2026-06-04 6:01 ` sashiko-bot
2026-06-04 9:03 ` Lorenzo Bianconi
2026-06-04 9:20 ` Lorenzo Bianconi
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=aiEuVrrgp9RjieOV@lore-desk \
--to=lorenzo@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=robh@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