Thread (4 messages) 4 messages, 2 authors, 2025-03-31

Re: [PATCH net-next v5] net: dlink: add support for reporting stats via `ethtool -S` and `ip -s -s link show`

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-03-31 21:25:58
Also in: lkml

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:
quoted
On Mon,  9 Dec 2024 18:28:27 +0900 Moon Yeounsu wrote:  
quoted
+	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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help