public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Joonwon Kang <joonwonkang@google.com>
To: jassisinghbrar@gmail.com
Cc: joonwonkang@google.com, linux-kernel@vger.kernel.org,
	 stable@vger.kernel.org, lee@kernel.org
Subject: Re: [PATCH 2/2 RESEND] mailbox: Make mbox_send_message() return error
Date: Fri,  6 Feb 2026 10:06:22 +0000	[thread overview]
Message-ID: <20260206100622.4166528-1-joonwonkang@google.com> (raw)
In-Reply-To: <CABb+yY2ucPfFhDq3hK6UR3QmqyA+950vkDx0QFtJB+_Yzw66SQ@mail.gmail.com>

> > Previously, when the mailbox controller failed transmitting message, the
> > error code was only passed to the client's tx done handler and not to
> > mbox_send_message(). For this reason, the function could return a false
> > success. This commit resolves the issue by introducing the tx status and
> > checking it before mbox_send_message() returns.
> >
> A client submitted the message, and that client gets the actual
> status. mbox_send_message does not (can not) tell if the message was
> successfully sent or not. For example, consider non-blocking mode when
> mbox_send_message() immediately returns after simply placing the
> message in the fifo. It returns 0, but still the message transmission
> may fail when its turn comes. So I think it is fine as is.

When it comes to non-blocking send function, the common expectation is that
users of the function do not expect the final send result in its return value
of the non-blocking function. And it makes sense for users to register a
callback to collect the final send result. It is a common practice for non-
blocking function.

For blocking send function, however, it will be quite unexpected behavior if
the blocking send function returns no error code but it actually has failed.
Also, it will be uncommon if users of the blocking send function have to
register additional callback just to collect the final send result. If that is
the case, the blocking function requires of users both blocking and callback,
which is redundant.

Overall, I think it will be better if we return error code in blocking mode if
it has actually failed transmiting the request. How do you think?

      reply	other threads:[~2026-02-06 10:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16  8:44 [PATCH 2/2 RESEND] mailbox: Make mbox_send_message() return error code when tx fails Joonwon Kang
2026-01-25  1:51 ` Jassi Brar
2026-02-06 10:06   ` Joonwon Kang [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=20260206100622.4166528-1-joonwonkang@google.com \
    --to=joonwonkang@google.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox