Linux USB
 help / color / mirror / Atom feed
From: Mahdi Yari <m.yary16@gmail.com>
To: netdev@vger.kernel.org
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, oneukum@suse.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mahdi Yari <m.yary16@gmail.com>
Subject: Re: [PATCH net] usbnet: don't lose rx mode updates that arrive during set_rx_mode()
Date: Thu,  3 Dec 2026 14:37:40 +0330	[thread overview]
Message-ID: <20261203110740.33917-1-m.yary16@gmail.com> (raw)
In-Reply-To: <179627810686.3146.17258058159289526658@kernel.org>

> - [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

      reply	other threads:[~2026-12-03 11:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  6:05 [PATCH net] usbnet: don't lose rx mode updates that arrive during set_rx_mode() Mahdi Yari
2026-12-02  6:11 ` sashiko-bot
2026-12-02  9:14 ` Oliver Neukum
2026-12-03  6:08 ` netdev-bot+sashiko
2026-12-03 11:07   ` Mahdi Yari [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=20261203110740.33917-1-m.yary16@gmail.com \
    --to=m.yary16@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=pabeni@redhat.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