Re: [PATCH 1/2] mailbox: Use per-thread completion to fix wrong completion order

From: Jassi Brar
Date: Sun Jul 20 2025 - 17:13:29 EST


On Wed, Jun 18, 2025 at 3:04 AM Joonwon Kang <joonwonkang@xxxxxxxxxx> wrote:
>
> Previously, a sender thread in mbox_send_message() could be woken up at
> a wrong time in blocking mode. It is because there was only a single
> completion for a channel whereas messages from multiple threads could be
> sent in any order; since the shared completion could be signalled in any
> order, it could wake up a wrong sender thread.
>
> This commit resolves the false wake-up issue with the following changes:
> - Completions are created as many as the number of concurrent sender
> threads
> - A completion is created in a sender thread's stack
> - Each slot of the message queue, i.e. `msg_data`, contains a pointer to
> its target completion
> - tx_tick() signals the completion of the currently active slot of the
> message queue
>
> Link: https://lore.kernel.org/all/1490809381-28869-1-git-send-email-jaswinder.singh@xxxxxxxxxx

Is your issue different from what is described in the Link?

thanks