mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
rtase: Avoid sleeping in get_stats64()
The .ndo_get_stats64 callback must not sleep because it can be
called when reading /proc/net/dev.
rtase_get_stats64() calls rtase_dump_tally_counter(), which polls
the tally counter dump bit with read_poll_timeout(). This may
sleep while waiting for the hardware counter dump to complete.
Use read_poll_timeout_atomic() instead to avoid sleeping in the
get_stats64() path.
Fixes: 0796004899 ("rtase: Implement net_device_ops")
Cc: stable@vger.kernel.org
Signed-off-by: Justin Lai <justinlai0215@realtek.com>
Link: https://patch.msgid.link/20260603061816.31356-1-justinlai0215@realtek.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
3a5f3f7aff
commit
9fc237f8d4
|
|
@ -1565,8 +1565,9 @@ static void rtase_dump_tally_counter(const struct rtase_private *tp)
|
|||
rtase_w32(tp, RTASE_DTCCR0, cmd);
|
||||
rtase_w32(tp, RTASE_DTCCR0, cmd | RTASE_COUNTER_DUMP);
|
||||
|
||||
err = read_poll_timeout(rtase_r32, val, !(val & RTASE_COUNTER_DUMP),
|
||||
10, 250, false, tp, RTASE_DTCCR0);
|
||||
err = read_poll_timeout_atomic(rtase_r32, val,
|
||||
!(val & RTASE_COUNTER_DUMP),
|
||||
10, 250, false, tp, RTASE_DTCCR0);
|
||||
|
||||
if (err == -ETIMEDOUT)
|
||||
netdev_err(tp->dev, "error occurred in dump tally counter\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user