[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250505184945.5adcac55@kernel.org>
Date: Mon, 5 May 2025 18:49:45 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Moon Yeounsu <yyyynoom@...il.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v2] net: dlink: add synchronization for stats
update
On Sat, 3 May 2025 08:50:49 +0900 Moon Yeounsu wrote:
> Also, I believe that `spin_lock_irq()` in `get_stats()` should be
> changed to `spin_lock_irqsave()` since `get_stats()` can be called
> from IRQ context (via `rio_interrupt()` -> `rio_error()` ->
> `get_stats()`). In my view, calling `spin_unlock_irq()` in this
> context could be risky, as it would re-enable local IRQs via
> local_irq_enable().
>
> There are two ways to lock the `get_stats()` function: either add a
> new parameter to check whether it's in IRQ context, or simply use
> `spin_lock_irqsave()`. I found that `rio_free_tx()` behaves like the
> first case. I'd appreciate your opinion on which approach would be
> preferable here.
If there's a call path from the IRQ I'd go with spin_lock_irqsave()
Powered by blists - more mailing lists