From: Jakub Kicinski <kuba@kernel.org>
To: Moon Yeounsu <yyyynoom@gmail.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v5] net: dlink: add support for reporting stats via `ethtool -S` and `ip -s -s link show`
Date: Mon, 31 Mar 2025 14:25:57 -0700 [thread overview]
Message-ID: <20250331142557.3e454470@kernel.org> (raw)
In-Reply-To: <Z-rFcxj7XeiMHsz7@mythos-cloud>
On Tue, 1 Apr 2025 01:40:19 +0900 Moon Yeounsu wrote:
> On Tue, Dec 10, 2024 at 07:15:19PM -0800, Jakub Kicinski wrote:
> > On Mon, 9 Dec 2024 18:28:27 +0900 Moon Yeounsu wrote:
> > > + unsigned long flags;
> > > +
> > > + spin_lock_irqsave(&np->stats_lock, flags);
> >
> > I believe spin_lock_bh() is sufficient here, no need to save IRQ flags.
> >
>
> Anyway, base on what I have learned, I believe `spin_lock_irq()`
> should be used in this context instead of `spin_lock_bh()`.
>
> The reason is that the `get_stats()` function can be called from
> an interrupt context (in the top-half).
>
> If my understanding is correct, calling `spin_lock_bh()` in the
> top-half may lead to a deadlock.
>
> The calling sequence is as follows:
> 1. `rio_interrupt()` (registered via `request_irq()`)
> 2. `rio_error()`
> 3. `get_stats()`
Makes sense, please document this in the commit message for v6.
prev parent reply other threads:[~2025-03-31 21:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 9:28 [PATCH net-next v5] net: dlink: add support for reporting stats via `ethtool -S` and `ip -s -s link show` Moon Yeounsu
2024-12-11 3:15 ` Jakub Kicinski
2025-03-31 16:40 ` Moon Yeounsu
2025-03-31 21:25 ` Jakub Kicinski [this message]
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=20250331142557.3e454470@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yyyynoom@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;
as well as URLs for NNTP newsgroup(s).