Re: [PATCH net] usbnet: don't lose rx mode updates that arrive during set_rx_mode()

From: Mahdi Yari

Date: Thu Dec 03 2026 - 06:08:19 EST


> - [Medium] On weakly ordered CPUs this fix can still lose an rx-mode
> update, because only the reader side of the bit handoff has a barrier.

Agreed. The set_bit() in usbnet_defer_kevent() is unordered, so on
arm64 or POWER a kevent that is already running can see the bit before
the mc list change, clear it and send the old filter, and the requeued
kevent then skips. x86 can't hit this, which is why my tests didn't.

v2 will add smp_mb__before_atomic() in usbnet_set_rx_mode() to pair with
the test_and_clear_bit(). I'm putting it there rather than in
usbnet_defer_kevent() so the other events are unchanged. herd7 with the
LKMM allows the lost update without the barrier and forbids it with it.

pw-bot: cr