From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Adi Prasan <itsadi2409@gmail.com>
Cc: alex.aring@gmail.com, stefan@datenfreihafen.org,
linux-wpan@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: mac802154: fix race between slave_close() and in-flight async tx
Date: Sun, 04 Oct 2026 16:46:04 +0200 [thread overview]
Message-ID: <875wzhle1f.fsf@bootlin.com> (raw)
In-Reply-To: <20261002144827.3479-1-itsadi2409@gmail.com> (Adi Prasan's message of "Fri, 2 Oct 2026 14:48:27 +0000")
On 02/10/2026 at 14:48:27 GMT, Adi Prasan <itsadi2409@gmail.com> wrote:
> netif_stop_queue() prevents new packets from being sent to the driver,
> but it does not wait for a transmission that is already in progress.
>
> drv_xmit_async() can still be running on another CPU when
> mac802154_slave_close() calls drv_stop(). Stopping the queue only
> prevents new transmissions; it does not synchronize with an already
> running tx operation.
>
> This was checked against mac802154_hwsim as well. hwsim_hw_xmit() is
> synchronous, while hwsim_hw_stop() only sets a flag, so there is no
> pending work or locking in the driver that needs to be synchronized.
>
> The race is in the core between stopping the queue and an in-flight
> tx operation. The fix therefore belongs in the common mac802154 code,
> using the same handling already used by ieee802154_suspend(): hold and
> synchronize the queue around ieee802154_stop_device().
>
> Signed-off-by: Adi Prasan <itsadi2409@gmail.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
prev parent reply other threads:[~2026-10-04 14:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 17:06 [PATCH] mac802154: synchronize pending transmissions before stopping the hardware Adi Prasan
2026-09-25 9:03 ` Miquel Raynal
2026-10-02 14:48 ` [PATCH v2] net: mac802154: fix race between slave_close() and in-flight async tx Adi Prasan
2026-10-04 14:46 ` Miquel Raynal [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=875wzhle1f.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=alex.aring@gmail.com \
--cc=itsadi2409@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=stefan@datenfreihafen.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.