[{"id":3672841,"web_url":"http://patchwork.ozlabs.org/comment/3672841/","msgid":"<CABb+yY3hYcJ82QGor3w5KKHUGz9Pc1k64Jdf-94E4Yvv0DTeyQ@mail.gmail.com>","list_archive_url":null,"date":"2026-04-02T18:03:05","subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","submitter":{"id":4220,"url":"http://patchwork.ozlabs.org/api/people/4220/","name":"Jassi Brar","email":"jassisinghbrar@gmail.com"},"content":"On Thu, Apr 2, 2026 at 12:07 PM Joonwon Kang <joonwonkang@google.com> wrote:\n>\n> When the mailbox controller failed transmitting message, the error code\n> was only passed to the client's tx done handler and not to\n> mbox_send_message(). For this reason, the function could return a false\n> success. This commit resolves the issue by introducing the tx status and\n> checking it before mbox_send_message() returns.\n>\nCan you please share the scenario when this becomes necessary? This\ncan potentially change the ground underneath some clients, so we have\nto be sure this is really useful.\n\nThanks\nJassi\n\n\n> Cc: stable@vger.kernel.org\n> Signed-off-by: Joonwon Kang <joonwonkang@google.com>\n> ---\n>  drivers/mailbox/mailbox.c          | 20 +++++++++++++++-----\n>  include/linux/mailbox_controller.h |  2 ++\n>  2 files changed, 17 insertions(+), 5 deletions(-)\n>\n> diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c\n> index d63386468982..ea9aec9dc947 100644\n> --- a/drivers/mailbox/mailbox.c\n> +++ b/drivers/mailbox/mailbox.c\n> @@ -21,7 +21,10 @@\n>  static LIST_HEAD(mbox_cons);\n>  static DEFINE_MUTEX(con_mutex);\n>\n> -static int add_to_rbuf(struct mbox_chan *chan, void *mssg, struct completion *tx_complete)\n> +static int add_to_rbuf(struct mbox_chan *chan,\n> +                      void *mssg,\n> +                      struct completion *tx_complete,\n> +                      int *tx_status)\n>  {\n>         int idx;\n>\n> @@ -34,6 +37,7 @@ static int add_to_rbuf(struct mbox_chan *chan, void *mssg, struct completion *tx\n>         idx = chan->msg_free;\n>         chan->msg_data[idx].data = mssg;\n>         chan->msg_data[idx].tx_complete = tx_complete;\n> +       chan->msg_data[idx].tx_status = tx_status;\n>         chan->msg_count++;\n>\n>         if (idx == MBOX_TX_QUEUE_LEN - 1)\n> @@ -91,12 +95,13 @@ static void msg_submit(struct mbox_chan *chan)\n>\n>  static void tx_tick(struct mbox_chan *chan, int r, int idx)\n>  {\n> -       struct mbox_message mssg = {MBOX_NO_MSG, NULL};\n> +       struct mbox_message mssg = {MBOX_NO_MSG, NULL, NULL};\n>\n>         scoped_guard(spinlock_irqsave, &chan->lock) {\n>                 if (idx >= 0 && idx != chan->active_req) {\n>                         chan->msg_data[idx].data = MBOX_NO_MSG;\n>                         chan->msg_data[idx].tx_complete = NULL;\n> +                       chan->msg_data[idx].tx_status = NULL;\n>                         return;\n>                 }\n>\n> @@ -116,8 +121,10 @@ static void tx_tick(struct mbox_chan *chan, int r, int idx)\n>         if (chan->cl->tx_done)\n>                 chan->cl->tx_done(chan->cl, mssg.data, r);\n>\n> -       if (r != -ETIME && chan->cl->tx_block)\n> +       if (r != -ETIME && chan->cl->tx_block) {\n> +               *mssg.tx_status = r;\n>                 complete(mssg.tx_complete);\n> +       }\n>  }\n>\n>  static enum hrtimer_restart txdone_hrtimer(struct hrtimer *hrtimer)\n> @@ -286,15 +293,16 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)\n>         int t;\n>         int idx;\n>         struct completion tx_complete;\n> +       int tx_status = 0;\n>\n>         if (!chan || !chan->cl || mssg == MBOX_NO_MSG)\n>                 return -EINVAL;\n>\n>         if (chan->cl->tx_block) {\n>                 init_completion(&tx_complete);\n> -               t = add_to_rbuf(chan, mssg, &tx_complete);\n> +               t = add_to_rbuf(chan, mssg, &tx_complete, &tx_status);\n>         } else {\n> -               t = add_to_rbuf(chan, mssg, NULL);\n> +               t = add_to_rbuf(chan, mssg, NULL, NULL);\n>         }\n>\n>         if (t < 0) {\n> @@ -318,6 +326,8 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)\n>                         idx = t;\n>                         t = -ETIME;\n>                         tx_tick(chan, t, idx);\n> +               } else if (tx_status < 0) {\n> +                       t = tx_status;\n>                 }\n>         }\n>\n> diff --git a/include/linux/mailbox_controller.h b/include/linux/mailbox_controller.h\n> index 912499ad08ed..890da97bcb50 100644\n> --- a/include/linux/mailbox_controller.h\n> +++ b/include/linux/mailbox_controller.h\n> @@ -117,10 +117,12 @@ struct mbox_controller {\n>   * struct mbox_message - Internal representation of a mailbox message\n>   * @data:              Data packet\n>   * @tx_complete:       Pointer to the transmission completion\n> + * @tx_status:         Pointer to the transmission status\n>   */\n>  struct mbox_message {\n>         void *data;\n>         struct completion *tx_complete;\n> +       int *tx_status;\n>  };\n>\n>  /**\n> --\n> 2.53.0.1185.g05d4b7b318-goog\n>","headers":{"Return-Path":"\n <linux-tegra+bounces-13546-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-tegra@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=UZG7WqtD;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13546-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"UZG7WqtD\"","smtp.subspace.kernel.org;\n arc=pass smtp.client-ip=209.85.210.46","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"],"Received":["from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmqTl3t76z1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 05:03:23 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 48BE330102C3\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  2 Apr 2026 18:03:20 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7BADD2E8B98;\n\tThu,  2 Apr 2026 18:03:19 +0000 (UTC)","from mail-ot1-f46.google.com (mail-ot1-f46.google.com\n [209.85.210.46])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id EACF836BCF5\n\tfor <linux-tegra@vger.kernel.org>; Thu,  2 Apr 2026 18:03:17 +0000 (UTC)","by mail-ot1-f46.google.com with SMTP id\n 46e09a7af769-7d86eb7c854so681373a34.3\n        for <linux-tegra@vger.kernel.org>;\n Thu, 02 Apr 2026 11:03:17 -0700 (PDT)"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775152999; cv=pass;\n b=f8RPceo5D8X2dAn8J95dOmhhH+sL6KTeKV3vHRaybBFFwWjshAhKJ+4+fRCwKB1/0qIhmqmQxVP1yMQZ5rX/YFbPT9M+mOJobjvA14uODySDxloz+x2ptt+vd9YQq+iJetsFTQY2S27xzg/06BfMg0mKZR7jWbSeqFmOrtNhaP8=","i=1; a=rsa-sha256; t=1775152997; cv=none;\n        d=google.com; s=arc-20240605;\n        b=eMwl8V5ocFnhtJ877FpC2B4vRb35tif1KcUQQKbADdRkgIzuyD2/+9d5FART2JNqEw\n         5RkaWsDuoHOiHO6KEkIvvnC8T2FPEGIb10vR2ldIKxZySwkjIGgbCAHUJvNpBchaiKUr\n         HHxwuhFDiFWTe2KtjUJhhDjQXrHMX6/ca4ZSH61VQ6Cf+vXiUE1y7Qgx7Si2oEo+axup\n         4POrUC8flMzi5/pgdPMRg+uT9cpqmMjgOAmoPPTs4/fUtlD32sgbW2VST15WfBCuZRW2\n         jh+lTQq70D909n9lcyh1SsTRwFC3O05AFRwoyYkMMEa/R+ffe46abXi2Ps3f65HtWW0D\n         8oww=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775152999; c=relaxed/simple;\n\tbh=d+41bWrPZASMK3eSIbSSj318xtKaXZplSr2koxtWAOI=;\n\th=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:\n\t To:Cc:Content-Type;\n b=OT2r1IUYbpHfHIss+CCJHZfDBxSQLwlRTOn+NM79OIuwxl2B9WsGxYMM/jnTu19TF8DwRFKk63kl6ozoLFNOnp+hHC0N0u6xUAWwYZHh/ed0NSL1B07n/wPVF9qDjDFZ033gly9Qr0dYr6SX1VHjZ266LivbeLw46iv3F6q3ff4=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:dkim-signature;\n        bh=M0TW/KELxmP6HAx/s1ZGX6uuibSSGSUbIAcodT49xPg=;\n        fh=gOPOHrHffc0CyHGbMTPippH5P2rOC0agjRRCB77I08g=;\n        b=AHlrQABkKz96oXQKk5VdDf9KF9IEm2n74lc5yy+hYBsnre6h3NfIZkxUm4tk7czRyv\n         w3Rmb0LhVmGSuqzjI111nZuqjEx3XZUmfHGglGAiyTV9uECdEo7tBqJBQyyL3LHisAfR\n         FnB4h/i66WJKVsLlBoxoM666n1PEQbESHa+rMByT9ANyFYHgE+ZMKUHtLsvSXEMkljXL\n         L/EpTXrtDeXj6w8/qqqnPvAqS1pmPdhCuEuNcnM9lljtpKnxD8j7DpL38VG8ijSxJoYn\n         oLVhoWV7sk2MRt/85Ob+eFekcy5croAfdZdSYF2pbYNTl466gmNxcWzwXXSq7bDvzXRe\n         prsA==;\n        darn=vger.kernel.org"],"ARC-Authentication-Results":["i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=UZG7WqtD; arc=pass smtp.client-ip=209.85.210.46","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1775152997; x=1775757797;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=M0TW/KELxmP6HAx/s1ZGX6uuibSSGSUbIAcodT49xPg=;\n        b=UZG7WqtDKYhsXpbN2DMSWFZ756CS6iB41FR/9CLATLVZzHAFZXV/zg8ZFhDkdcuqTF\n         Eb/WEnxwaRGWeBopVhlL9FDfRF5DyAMPpnTIwo6Q7my7RBWtSl8regLuGduV8qPmXqwZ\n         q61PbRO53BSFWtYfRpEVXcLaqXyAs5dQl2EQ/RIx4mWRr46DpSzMYukHyFyj5S9Pzh2m\n         ckth0F0V9sLrSWG0TUydjuPbb0XmdYX7HmeErUjuPuAVd8nXvQwpqTMfuA38cvfhnNso\n         QUoVtGAw++SXV/hSe4f0Al1GEGNyHkaA0EBxJdh+h5pOpU3tYC3j/GBfTMkF7jqFPkrL\n         H6pg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775152997; x=1775757797;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=M0TW/KELxmP6HAx/s1ZGX6uuibSSGSUbIAcodT49xPg=;\n        b=oBLW5oiVgqmmHGyEYUTlvp907dbrzdlEIG/NvKr+/UHvfBxMY4KXkcGF8fSWeCio3w\n         u82rwIfss8m0ks01llvcvqw4OusEfAp5m6kjbeXvlbA8ANqIOB3KfpGk1bVHHSjgXWHk\n         tecs0bDGa5xpNJpWpdCa2NFsJPH2HB14IX+MD9e55EHVtQ6mfoxHfQQ3LF7ypgPfzd51\n         UXSL0chHhbPZXH5eLwXu2Hcwsgx3oUhafJxXK+flYyPdm2DYxywjC+0i1W2o0Eh3PVtu\n         wNrPa6JPOoo9QObzVKW2jxEbX5nfyVuA7MicOkYxdOIkH7mTH1uP/u0JLogW61/e+7qi\n         3v6g==","X-Forwarded-Encrypted":"i=1;\n AJvYcCXvJBlqO1tIII67U8is73Pk+5IymEP0W23zG0ZvfX/2R2smk62MiSpRHZM1nwWLyrsKkPzMPGV9625AXQ==@vger.kernel.org","X-Gm-Message-State":"AOJu0YxCET84A7Ig85jh+I3uX3caVcjJ5VMI2JIKmj9IwAfjvZd0Atsr\n\tXvp3wYTv2G1MDQpeMYjJ1FURPewP+yd2084wdD6yEau0cC1CxduO7PJoGLS5uF3UR8EEYxGIQsk\n\teNWFsfNVOLQrJPoXYst3fxI4wsMlWD/U=","X-Gm-Gg":"ATEYQzyg88ADgdCaixJDpp9DqA9tx5HtfFgRAvyMlDeOawxzD2u7dzxrmXxSElKrpxm\n\tXSG5FS32M+DpFJmph60nGrTZq3MFvXxNilYDICLUXOQMG3M0mMupyoIPoO5kPTUxyh4uix7HN3c\n\tdh2vvL8JNZCrS4rapwLOHt/Do3x/IbS/RoAwLiPjX7EJmoVFg+2ecy2Vw/TTDxVPgfkRNHowKl/\n\tkoiQwTf65/TMY2naK9p5uI246v+y4RIzUud49TvkhA4ZAmQbX2zC8PQMnbXBcmVwtbYRxCBERfC\n\tVBIb529E","X-Received":"by 2002:a05:6830:611b:b0:7d7:c96c:c5d6 with SMTP id\n 46e09a7af769-7dbb6f1aea6mr240409a34.1.1775152996668; Thu, 02 Apr 2026\n 11:03:16 -0700 (PDT)","Precedence":"bulk","X-Mailing-List":"linux-tegra@vger.kernel.org","List-Id":"<linux-tegra.vger.kernel.org>","List-Subscribe":"<mailto:linux-tegra+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-tegra+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","References":"<20260402170641.2082547-1-joonwonkang@google.com>\n <20260402170641.2082547-3-joonwonkang@google.com>","In-Reply-To":"<20260402170641.2082547-3-joonwonkang@google.com>","From":"Jassi Brar <jassisinghbrar@gmail.com>","Date":"Thu, 2 Apr 2026 13:03:05 -0500","X-Gm-Features":"AQROBzCl5IvjHSRY9VamVjuRyy3ZLLYtLTcWUCKJtq-4tAuHHgLfoU-JXy74tSw","Message-ID":"\n <CABb+yY3hYcJ82QGor3w5KKHUGz9Pc1k64Jdf-94E4Yvv0DTeyQ@mail.gmail.com>","Subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","To":"Joonwon Kang <joonwonkang@google.com>","Cc":"matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,\n\tthierry.reding@gmail.com, jonathanh@nvidia.com, linux-kernel@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org,\n\tlinux-tegra@vger.kernel.org, stable@vger.kernel.org","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable"}},{"id":3673171,"web_url":"http://patchwork.ozlabs.org/comment/3673171/","msgid":"<20260403151950.2592581-1-joonwonkang@google.com>","list_archive_url":null,"date":"2026-04-03T15:19:47","subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","submitter":{"id":91088,"url":"http://patchwork.ozlabs.org/api/people/91088/","name":"Joonwon Kang","email":"joonwonkang@google.com"},"content":"> On Thu, Apr 2, 2026 at 12:07 PM Joonwon Kang <joonwonkang@google.com> wrote:\n> >\n> > When the mailbox controller failed transmitting message, the error code\n> > was only passed to the client's tx done handler and not to\n> > mbox_send_message(). For this reason, the function could return a false\n> > success. This commit resolves the issue by introducing the tx status and\n> > checking it before mbox_send_message() returns.\n> >\n> Can you please share the scenario when this becomes necessary? This\n> can potentially change the ground underneath some clients, so we have\n> to be sure this is really useful.\n\nI would say the problem here is generic enough to apply to all the cases where\nthe send result needs to be checked. Since the return value of the send API is\nnot the real send result, any users who believe that this blocking send API\nwill return the real send result could fall for that. For example, users may\nthink the send was successful even though it was not actually. I believe it is\nuncommon that users have to register a callback solely to get the send result\neven though they are using the blocking send API already. Also, I guess there\nis no special reason why only the mailbox send API should work this way among\nother typical blocking send APIs. For these reasons, this patch makes the send\nAPI return the real send result. This way, users will not need to register the\nredundant callback and I think the return value will align with their common\nexpectation.\n\nRegarding the change in the ground for some clients, could you help to clarify\na bit more on what change, you expect, would surprise the clients?\n\nThanks,\nJoonwon Kang\n\n> \n> Thanks\n> Jassi\n> \n> \n> > Cc: stable@vger.kernel.org\n> > Signed-off-by: Joonwon Kang <joonwonkang@google.com>\n> > ---\n> >  drivers/mailbox/mailbox.c          | 20 +++++++++++++++-----\n> >  include/linux/mailbox_controller.h |  2 ++\n> >  2 files changed, 17 insertions(+), 5 deletions(-)\n> >\n> > diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c\n> > index d63386468982..ea9aec9dc947 100644\n> > --- a/drivers/mailbox/mailbox.c\n> > +++ b/drivers/mailbox/mailbox.c\n> > @@ -21,7 +21,10 @@\n> >  static LIST_HEAD(mbox_cons);\n> >  static DEFINE_MUTEX(con_mutex);\n> >\n> > -static int add_to_rbuf(struct mbox_chan *chan, void *mssg, struct completion *tx_complete)\n> > +static int add_to_rbuf(struct mbox_chan *chan,\n> > +                      void *mssg,\n> > +                      struct completion *tx_complete,\n> > +                      int *tx_status)\n> >  {\n> >         int idx;\n> >\n> > @@ -34,6 +37,7 @@ static int add_to_rbuf(struct mbox_chan *chan, void *mssg, struct completion *tx\n> >         idx = chan->msg_free;\n> >         chan->msg_data[idx].data = mssg;\n> >         chan->msg_data[idx].tx_complete = tx_complete;\n> > +       chan->msg_data[idx].tx_status = tx_status;\n> >         chan->msg_count++;\n> >\n> >         if (idx == MBOX_TX_QUEUE_LEN - 1)\n> > @@ -91,12 +95,13 @@ static void msg_submit(struct mbox_chan *chan)\n> >\n> >  static void tx_tick(struct mbox_chan *chan, int r, int idx)\n> >  {\n> > -       struct mbox_message mssg = {MBOX_NO_MSG, NULL};\n> > +       struct mbox_message mssg = {MBOX_NO_MSG, NULL, NULL};\n> >\n> >         scoped_guard(spinlock_irqsave, &chan->lock) {\n> >                 if (idx >= 0 && idx != chan->active_req) {\n> >                         chan->msg_data[idx].data = MBOX_NO_MSG;\n> >                         chan->msg_data[idx].tx_complete = NULL;\n> > +                       chan->msg_data[idx].tx_status = NULL;\n> >                         return;\n> >                 }\n> >\n> > @@ -116,8 +121,10 @@ static void tx_tick(struct mbox_chan *chan, int r, int idx)\n> >         if (chan->cl->tx_done)\n> >                 chan->cl->tx_done(chan->cl, mssg.data, r);\n> >\n> > -       if (r != -ETIME && chan->cl->tx_block)\n> > +       if (r != -ETIME && chan->cl->tx_block) {\n> > +               *mssg.tx_status = r;\n> >                 complete(mssg.tx_complete);\n> > +       }\n> >  }\n> >\n> >  static enum hrtimer_restart txdone_hrtimer(struct hrtimer *hrtimer)\n> > @@ -286,15 +293,16 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)\n> >         int t;\n> >         int idx;\n> >         struct completion tx_complete;\n> > +       int tx_status = 0;\n> >\n> >         if (!chan || !chan->cl || mssg == MBOX_NO_MSG)\n> >                 return -EINVAL;\n> >\n> >         if (chan->cl->tx_block) {\n> >                 init_completion(&tx_complete);\n> > -               t = add_to_rbuf(chan, mssg, &tx_complete);\n> > +               t = add_to_rbuf(chan, mssg, &tx_complete, &tx_status);\n> >         } else {\n> > -               t = add_to_rbuf(chan, mssg, NULL);\n> > +               t = add_to_rbuf(chan, mssg, NULL, NULL);\n> >         }\n> >\n> >         if (t < 0) {\n> > @@ -318,6 +326,8 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)\n> >                         idx = t;\n> >                         t = -ETIME;\n> >                         tx_tick(chan, t, idx);\n> > +               } else if (tx_status < 0) {\n> > +                       t = tx_status;\n> >                 }\n> >         }\n> >\n> > diff --git a/include/linux/mailbox_controller.h b/include/linux/mailbox_controller.h\n> > index 912499ad08ed..890da97bcb50 100644\n> > --- a/include/linux/mailbox_controller.h\n> > +++ b/include/linux/mailbox_controller.h\n> > @@ -117,10 +117,12 @@ struct mbox_controller {\n> >   * struct mbox_message - Internal representation of a mailbox message\n> >   * @data:              Data packet\n> >   * @tx_complete:       Pointer to the transmission completion\n> > + * @tx_status:         Pointer to the transmission status\n> >   */\n> >  struct mbox_message {\n> >         void *data;\n> >         struct completion *tx_complete;\n> > +       int *tx_status;\n> >  };\n> >\n> >  /**\n> > --\n> > 2.53.0.1185.g05d4b7b318-goog\n> >","headers":{"Return-Path":"\n <linux-tegra+bounces-13554-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-tegra@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256\n header.s=20251104 header.b=oPAz2bJY;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13554-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=\"oPAz2bJY\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.216.73","smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnMtm0WyTz1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 02:23:28 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id B001A3011790\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 15:19:55 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 524B03C5547;\n\tFri,  3 Apr 2026 15:19:55 +0000 (UTC)","from mail-pj1-f73.google.com (mail-pj1-f73.google.com\n [209.85.216.73])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id BE1D81DE894\n\tfor <linux-tegra@vger.kernel.org>; Fri,  3 Apr 2026 15:19:52 +0000 (UTC)","by mail-pj1-f73.google.com with SMTP id\n 98e67ed59e1d1-3594620fe97so4357404a91.1\n        for <linux-tegra@vger.kernel.org>;\n Fri, 03 Apr 2026 08:19:52 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775229595; cv=none;\n b=uuKUyTIkrUSS4JSskmjbekqrWLsSTn8xoH/EeMxGmxibNFTZB3SGFuuzglQFewYNpHmITcVZK5b9zdIU4S4jg6O0Hx6F/7oBWmL/SvHvGvVrtPkP85QkevXSharM0oerp2lVh/vlE26Lp+we+zf81w4dysNQMEOHCNk6izmTrQw=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775229595; c=relaxed/simple;\n\tbh=uA+6V46rf6BOemDNgqn1Ld9hPYGCKqeJGfmxwLPppmM=;\n\th=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:\n\t To:Cc:Content-Type;\n b=PsbXkgcfM6n/jAhApqW8ySQnld007JZcYrUGg+qOOdy8NF1YfnhwUCzZiS76H+dH/lNGH1bXNZcspZxa/aLkZn4M5kDQFkvdU6vHk9TSlfbqPN1z/DW9Ypvz/p7iVb4VeUYR0Syj3fcaMFt9Hvjv9cQuG9HlOB2ShI3z5K9sdx8=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com;\n spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com;\n dkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=oPAz2bJY; arc=none smtp.client-ip=209.85.216.73","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=google.com; s=20251104; t=1775229592; x=1775834392;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:cc:to:from:subject:message-id:references\n         :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id\n         :reply-to;\n        bh=uTxlcaECIOSPGuWyVGV6jMrdulKgnVXDtGKmH5N3sQ8=;\n        b=oPAz2bJYijjKA93RCct32bDF+otXfrANys3svf4OG1dqO42V50uTwy6xf9dEfa1J3Y\n         fVSvqhbzZSFonm/VNLYGxAQJtQBokZeMTE2z5AMQY59eri42H/PT4tlSrVb/rGZObI+k\n         qgtaS0ysi22NZBXb4MhpYR1vzwNTdXBuKUNZVXe8V6tKPAAfJsDs8v0rbtOitKlbuc3p\n         jB9ofUfsA3RjW//eM6mg6hqljhU/CGLEFxc6xQnJufGQXkFqM4Qh4s95KohfP1pEOswW\n         nhaVAZ+y2bAOm4fpbT4FtlTbm113PbVVXXBpT7m36boosh50+wE4K1QgBBf5Gz/H8shb\n         brmA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775229592; x=1775834392;\n        h=content-transfer-encoding:cc:to:from:subject:message-id:references\n         :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject\n         :date:message-id:reply-to;\n        bh=uTxlcaECIOSPGuWyVGV6jMrdulKgnVXDtGKmH5N3sQ8=;\n        b=dlUM4Lu0o+XKBhDVfLIPJeWzv4IJznx4D5lmXs93opEaMXstmp4n8xeMvKNku13qDK\n         hCGm1v01YTQz+8+RQ63yPOntj+XCFTsow/kZj1hR2SfcSeMTiQcSvS2XP4VLV1siZ8mE\n         FJPtQ3ak0rmbLZ8qiG1ly5bYcZPKDAi86OSieiMgK2RyHVnJ1Xgrx/svPiZi8FSmG1rV\n         yAFyJQ1zZHKbx4tgP6J6dhO6Vi1M7nFPntmJFDp/az8067V+VZkwRrupum9nU+10mfnH\n         UDH/kfKNpLJ6ZQPU25bJ0mxfev4G9yhFp6X/TpUfBZpHMONOACwt3S+pcSLno49CzKcl\n         DqOw==","X-Forwarded-Encrypted":"i=1;\n AJvYcCX897qOlir4lhYoTrQQqPXaA6y7kc4lpih73T01fgHCwMO8L5uFXd9VYPbb0VLsO/X030HqNIWfGHkw8w==@vger.kernel.org","X-Gm-Message-State":"AOJu0YyaoEb8PM3ehxm8nupDJGjmC6ajaFNnyWqeA06S6qcznsRizrCn\n\tlOiZIF+/5O3PUqtM9A+stvu3C82CRo53OLp6kopEmXlZoHuuQcTZIe+tp8rMQWPMAUs9BoWkoXO\n\tJy36nyBV3irEHgf+c10AYId8H0Q==","X-Received":"from pgcn23.prod.google.com ([2002:a63:7217:0:b0:c73:bace:526e])\n (user=joonwonkang job=prod-delivery.src-stubby-dispatcher) by\n 2002:a05:6a20:7354:b0:39b:e321:784f with SMTP id\n adf61e73a8af0-39f2f05041dmr3566398637.40.1775229591907;\n Fri, 03 Apr 2026 08:19:51 -0700 (PDT)","Date":"Fri,  3 Apr 2026 15:19:47 +0000","In-Reply-To":"\n <CABb+yY3hYcJ82QGor3w5KKHUGz9Pc1k64Jdf-94E4Yvv0DTeyQ@mail.gmail.com>","Precedence":"bulk","X-Mailing-List":"linux-tegra@vger.kernel.org","List-Id":"<linux-tegra.vger.kernel.org>","List-Subscribe":"<mailto:linux-tegra+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-tegra+unsubscribe@vger.kernel.org>","Mime-Version":"1.0","References":"\n <CABb+yY3hYcJ82QGor3w5KKHUGz9Pc1k64Jdf-94E4Yvv0DTeyQ@mail.gmail.com>","X-Mailer":"git-send-email 2.53.0.1213.gd9a14994de-goog","Message-ID":"<20260403151950.2592581-1-joonwonkang@google.com>","Subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","From":"Joonwon Kang <joonwonkang@google.com>","To":"jassisinghbrar@gmail.com","Cc":"angelogioacchino.delregno@collabora.com, jonathanh@nvidia.com,\n\tjoonwonkang@google.com, linux-arm-kernel@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,\n\tlinux-tegra@vger.kernel.org, matthias.bgg@gmail.com, stable@vger.kernel.org,\n\tthierry.reding@gmail.com, akpm@linux-foundation.org","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable"}},{"id":3673218,"web_url":"http://patchwork.ozlabs.org/comment/3673218/","msgid":"<CABb+yY23aTXeXu6G-8sHjw32DCqmhsJLu2Mt-txenOgTBiyv+A@mail.gmail.com>","list_archive_url":null,"date":"2026-04-03T16:36:34","subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","submitter":{"id":4220,"url":"http://patchwork.ozlabs.org/api/people/4220/","name":"Jassi Brar","email":"jassisinghbrar@gmail.com"},"content":"On Fri, Apr 3, 2026 at 10:19 AM Joonwon Kang <joonwonkang@google.com> wrote:\n>\n> > On Thu, Apr 2, 2026 at 12:07 PM Joonwon Kang <joonwonkang@google.com> wrote:\n> > >\n> > > When the mailbox controller failed transmitting message, the error code\n> > > was only passed to the client's tx done handler and not to\n> > > mbox_send_message(). For this reason, the function could return a false\n> > > success. This commit resolves the issue by introducing the tx status and\n> > > checking it before mbox_send_message() returns.\n> > >\n> > Can you please share the scenario when this becomes necessary? This\n> > can potentially change the ground underneath some clients, so we have\n> > to be sure this is really useful.\n>\n> I would say the problem here is generic enough to apply to all the cases where\n> the send result needs to be checked. Since the return value of the send API is\n> not the real send result, any users who believe that this blocking send API\n> will return the real send result could fall for that. For example, users may\n> think the send was successful even though it was not actually. I believe it is\n> uncommon that users have to register a callback solely to get the send result\n> even though they are using the blocking send API already. Also, I guess there\n> is no special reason why only the mailbox send API should work this way among\n> other typical blocking send APIs. For these reasons, this patch makes the send\n> API return the real send result. This way, users will not need to register the\n> redundant callback and I think the return value will align with their common\n> expectation.\n>\nClients submit a message into the Mailbox subsystem to be sent out to\nthe remote side which can happen immediately or later.\nIf submission fails, clients get immediately notified. If transmission\nfails (which is now internal to the subsystem) it is reported to the\nclient by a callback.\nIf the API was called mbox_submit_message (which it actually is)\ninstead of mbox_send_message, there would be no confusion.\nWe can argue how good/bad the current implementation is, but the fact\nis that it is here. And I am reluctant to cause churn without good\nreason.\nAgain, as I said, any, _legal_, setup scenario will help me come over\nmy reluctance.\n\nThanks\nJassi","headers":{"Return-Path":"\n <linux-tegra+bounces-13556-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-tegra@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=ky0li6vr;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13556-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"ky0li6vr\"","smtp.subspace.kernel.org;\n arc=pass smtp.client-ip=209.85.161.43","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnPcw4C1dz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 03:41:36 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id F265F3001C51\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 16:36:49 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5D31E3CB2CF;\n\tFri,  3 Apr 2026 16:36:49 +0000 (UTC)","from mail-oo1-f43.google.com (mail-oo1-f43.google.com\n [209.85.161.43])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id E594F30EF6B\n\tfor <linux-tegra@vger.kernel.org>; Fri,  3 Apr 2026 16:36:47 +0000 (UTC)","by mail-oo1-f43.google.com with SMTP id\n 006d021491bc7-6836ab45de0so32315eaf.1\n        for <linux-tegra@vger.kernel.org>;\n Fri, 03 Apr 2026 09:36:47 -0700 (PDT)"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775234209; cv=pass;\n b=Cvu41qJDxilHsWAUXlrMiO7rur6mUpPqaGvtR2HPJ1Y2Y2dcxgUutws1Ptt0iMCO+mwdNzuFirtdt0QLXAdLUeiSmlv180oOyGZ27V1+/I3UwXBbckUAN8E5yZrhBsedGXq6I9JSCFdTeBgfAFD1h5XSnhCfiZa7kKGqaryysDM=","i=1; a=rsa-sha256; t=1775234207; cv=none;\n        d=google.com; s=arc-20240605;\n        b=HVutfWZD9fETMb/3d7optDVHqqDbM4KsXa/WhT2IswP5a8J39DmDWmKWixNDnIqIhI\n         5yVKDkQTZgfl5AO1NYKyzlIv402VYrNry3K0WnlPXw/lbT0uYpkA5noqECqWaUX/cLqP\n         QGy/Q9r7ctF/b0xG7r1KxHXnWOkngoo0pdQOUkxQhzf+T6g2QJJA1lkGq+3WB5z4ZEqz\n         MpQRQtcvvkhyhowSu5LOdm0L/eemFIOex0pEE/zJdWfsNxMAv0b113weohNvoHMLb7uc\n         rUSzTqsHQFegw19touvbcw29PyfE+kQISp6fpqe4ygVSK+uisBBW48RnD80ilQsyDHkS\n         zvcQ=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775234209; c=relaxed/simple;\n\tbh=mhIYPi+ZTj650hQKyeIbVrsNYbY3op5BHueN/8Cl9Xs=;\n\th=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:\n\t To:Cc:Content-Type;\n b=FIEbs1NDyW46ZhknENQ2rPQjUnoC3qF0FTgSw2iYiXSRCnwNguUGJ2TtmdWb4r6SbkdVh80ldtjMr8bW3R+sP9m8pwoBM0OFcibUAN3yqyk+cRBLCzRqgMSVLy6b2pFALL0gb7vSH72v0wsU48rzVAcBfE0oBX28q2SwYb7/MIE=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:dkim-signature;\n        bh=mhIYPi+ZTj650hQKyeIbVrsNYbY3op5BHueN/8Cl9Xs=;\n        fh=nPahoowW49gmYPlCGq/hi1mG1PsFQgfmAebmOCeb518=;\n        b=dk+aYIT21Ed0QEW5gfQD3qhvjbhpqvR4qRDHuGi/kx3r8Uh2qX3QeWc9XqJmDanL7t\n         WIybvXRicnhyaCRHvCaDYGuvruFgr8OD0kr8UfA2T5uFNqlO9NbEHhHlpIdrTH2nOWpE\n         UlzXibJe0jgMzcoZwFR/7ZHJw3Rsj5v65DJ77SFm1LMRcvQB5z6Qz5hKcVUhupDOM8dl\n         iAcads1y4xAIsNQVHlYHNlqQJwuTwtW4gxFRGJAw7C1Zzzls2LGwRTUIoj8pYx4ReaNO\n         f6JuPbVOuIVJwwSnFGLfZ2pWJJ5Z3jpm1un8mQCfhP/QwOgqfDiHAbMv9BAQJAnch8g/\n         v0Kw==;\n        darn=vger.kernel.org"],"ARC-Authentication-Results":["i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=ky0li6vr; arc=pass smtp.client-ip=209.85.161.43","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1775234207; x=1775839007;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=mhIYPi+ZTj650hQKyeIbVrsNYbY3op5BHueN/8Cl9Xs=;\n        b=ky0li6vrd2pYiGVkSaMFBf7mfkcpE93MZ/J0rRq50oOw38Aux76GJbxTk+hczSxbKg\n         2sBqh05nGYid0jRDIQJTjihDRetjxLLJvX8pAvKcw2KHH3nn3yFZlt4jyS5nNKgeqJdx\n         jgnbxig6Do3Cy8Ff/ZWjK4y1edRtu72jfGNoRim2+2q6i08CJfeZXEh2fyOxdEO+WdY3\n         v7gRP2aK9fOyhGH0Tv+Slg1No9RwJlDv8YAjajPLLD0GbvN1JLWknp6lKSJtbxOE4ijF\n         buR9YWKhCKtVKAnWtmDQylLjGkf8dNo6wDZ9RJyxSTraJsJ4EQAfqqdB6KCqYtDIHSoK\n         Nh6A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775234207; x=1775839007;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=mhIYPi+ZTj650hQKyeIbVrsNYbY3op5BHueN/8Cl9Xs=;\n        b=XxOWf8rT2Bpc5k8qoL/XrLEkKgs1KvEZVPYOoE8qb5qlm5fuAhsBuJZwZS85llF+86\n         XsihehL3FvF3Qg9wxyo5TmM76qE5xLYu1FgE1694VHQGcNY57qMg12jjw0E3yk1QU/Bf\n         aj4xRBYroAeUpUZJgTLeP+DDJq/7ml8qlIAjRXYbQcvSYmqHS20FJ94DYYSQyyMikzCx\n         NmaWEzfAZmjC82mHunj+6uRu0AD6C91Js/gt1TY9AlTClf0qWB0IlOW66o2g+YG2+vTy\n         G4PcSU4JqcOSd37RkoawsIMAZCDIJts2vLp9NPKrqIxdgyx+gpradlwscrCK0xtFFv4f\n         hy5Q==","X-Forwarded-Encrypted":"i=1;\n AJvYcCV27C4KI7EwXHEFJmBMPnp1TfIJwuKWa4aYzcGNKZwPtBXa0zOpfbB4kp4fXZbPq9MtpLUpydJEhRecHw==@vger.kernel.org","X-Gm-Message-State":"AOJu0Yw7y+936z9POkC+pL1BJfvfotZkVp1cny9cruaGT2uVZpTeOUa/\n\tFuTu+41pTZ6UYUM4ZRbU2Jyeqe6bXs1KoesBiTHPUjUo0JiE400h7DSMDgpOp1uYycBNufs4Jzk\n\tJBruBcZXVjKp3DvjpjXRUgAXa0JMOVz0=","X-Gm-Gg":"ATEYQzweAaZpniToq1jZtsSlz2zLC7gZ/LvbED8kOxRuU/TMjLJ1EY1whjykqSn1/ST\n\tFzooHrKgwN4xAzjtqAOY7574bYgruMJtCinWg7AxacJCVhdBS6RxUMb0X8eO+jbF7UmTEucnyTY\n\tPmMWOnSDJJfIiht8jPaCDyRe+kQPz6ouQzsGj7Ln5792aa9yKtZB7XdKYtJ15LnTWlQqozBM4pE\n\t1qw0rGmV7oD3hYVpg6zl/OyxUkYVul/0AnVe6pvqzoLgQ292pYRtkfcCOft99RB+ldttEly5B9Y\n\t60VZ4NCk","X-Received":"by 2002:a05:6820:f023:b0:67e:1259:aac4 with SMTP id\n 006d021491bc7-6821d747f8bmr1924347eaf.26.1775234206887; Fri, 03 Apr 2026\n 09:36:46 -0700 (PDT)","Precedence":"bulk","X-Mailing-List":"linux-tegra@vger.kernel.org","List-Id":"<linux-tegra.vger.kernel.org>","List-Subscribe":"<mailto:linux-tegra+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-tegra+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","References":"\n <CABb+yY3hYcJ82QGor3w5KKHUGz9Pc1k64Jdf-94E4Yvv0DTeyQ@mail.gmail.com>\n <20260403151950.2592581-1-joonwonkang@google.com>","In-Reply-To":"<20260403151950.2592581-1-joonwonkang@google.com>","From":"Jassi Brar <jassisinghbrar@gmail.com>","Date":"Fri, 3 Apr 2026 11:36:34 -0500","X-Gm-Features":"AQROBzCNnfUiQJss0MRPovDqMc4MnIhdZ3NJ2hHQRVK29Ar7Ti2BAIx3xKRl0IM","Message-ID":"\n <CABb+yY23aTXeXu6G-8sHjw32DCqmhsJLu2Mt-txenOgTBiyv+A@mail.gmail.com>","Subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","To":"Joonwon Kang <joonwonkang@google.com>","Cc":"angelogioacchino.delregno@collabora.com, jonathanh@nvidia.com,\n\tlinux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tlinux-mediatek@lists.infradead.org, linux-tegra@vger.kernel.org,\n\tmatthias.bgg@gmail.com, stable@vger.kernel.org, thierry.reding@gmail.com,\n\takpm@linux-foundation.org","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable"}},{"id":3673430,"web_url":"http://patchwork.ozlabs.org/comment/3673430/","msgid":"<20260404114752.3052748-1-joonwonkang@google.com>","list_archive_url":null,"date":"2026-04-04T11:47:51","subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","submitter":{"id":91088,"url":"http://patchwork.ozlabs.org/api/people/91088/","name":"Joonwon Kang","email":"joonwonkang@google.com"},"content":"> On Fri, Apr 3, 2026 at 10:19 AM Joonwon Kang <joonwonkang@google.com> wrote:\n> >\n> > > On Thu, Apr 2, 2026 at 12:07 PM Joonwon Kang <joonwonkang@google.com> wrote:\n> > > >\n> > > > When the mailbox controller failed transmitting message, the error code\n> > > > was only passed to the client's tx done handler and not to\n> > > > mbox_send_message(). For this reason, the function could return a false\n> > > > success. This commit resolves the issue by introducing the tx status and\n> > > > checking it before mbox_send_message() returns.\n> > > >\n> > > Can you please share the scenario when this becomes necessary? This\n> > > can potentially change the ground underneath some clients, so we have\n> > > to be sure this is really useful.\n> >\n> > I would say the problem here is generic enough to apply to all the cases where\n> > the send result needs to be checked. Since the return value of the send API is\n> > not the real send result, any users who believe that this blocking send API\n> > will return the real send result could fall for that. For example, users may\n> > think the send was successful even though it was not actually. I believe it is\n> > uncommon that users have to register a callback solely to get the send result\n> > even though they are using the blocking send API already. Also, I guess there\n> > is no special reason why only the mailbox send API should work this way among\n> > other typical blocking send APIs. For these reasons, this patch makes the send\n> > API return the real send result. This way, users will not need to register the\n> > redundant callback and I think the return value will align with their common\n> > expectation.\n> >\n> Clients submit a message into the Mailbox subsystem to be sent out to\n> the remote side which can happen immediately or later.\n> If submission fails, clients get immediately notified. If transmission\n> fails (which is now internal to the subsystem) it is reported to the\n> client by a callback.\n> If the API was called mbox_submit_message (which it actually is)\n> instead of mbox_send_message, there would be no confusion.\n> We can argue how good/bad the current implementation is, but the fact\n> is that it is here. And I am reluctant to cause churn without good\n> reason.\n> Again, as I said, any, _legal_, setup scenario will help me come over\n> my reluctance.\n\nmbox_send_message() in blocking mode is not only for submitting the message in\nthe first place if we read through the API docs.\n\nFrom the API doc for `mbox_send_message()`:\n```\n * If the client had set 'tx_block', the call will return\n * either when the remote receives the data or when 'tx_tout' millisecs\n * run out.\n```\n\nFrom the API doc for `struct mbox_client`:\n```\n * @tx_block:\t\tIf the mbox_send_message should block until data is\n *\t\t\ttransmitted.\n```\n\nWith the docs, I think it is apparent that the API covers \"transmission\" of the\nmessage, not only submission of it. If sumbitting is the sole purpose of the\nAPI, what does the API block for in the first place? We would not need the\nblocking mode at all then.\n\nThe current return value of the API in failure cases is as follows:\n\n - When submission fails, returns failure.\n - When submission succeeds but timeout occurs during transmission, return\n   failure, i.e. -ETIME.\n - When submission succeeds but transmission fails without timeout, return\n   success.\n\nThe third case looks problematic. This patch is focusing on this. There is also\ndisparity to handle the failure between timeout(the second case) and\nnon-timeout(the third case). Why does it not return failure when non-timeout\nerror occurs during transmission whereas it does when timeout occurs during\ntransmission? If the API is solely for submission, why does it return failure\ninstead of success in the second case?\n\nIn the third case, the controller(or the client) will inform the mailbox core\nof the transmission failure. Then, why not return that failure as a return\nvalue of the API despite having this information in the core?\n\nAn alternative to fixing this issue would be adding the API doc by saying like:\n\n - In blocking mode, the send API will return -ETIME when timeout occurs during\n   transmission, but it will not return failure but success(since submission\n   itself was successful before transmission) when other errors occur during\n   transmission. Users have to register a callback to collect the error code\n   when non-timeout error occurs.\n\nBut, I think we can go away with this unnecessary confusion by fixing the API\njust to return the error code when error occurs regardless of whether it is\ntimeout or not. Then, we could simply say:\n\n - In blocking mode, the send API will return failure when error occurs.\n\nSince this patch is pointing out this anomaly of the send API's behavior, I\nam not sure what scenario we would need more. In other words, the current way\nof working would be more surprising to the users than the fixed version of it\nas it was when I found out this issue for the first time.\n\nDo you think that this change will cause any other problem on the client side\nthan fixing the existing issue? If not, I am wondering why not go fix the\nissue with this patch.\n\nThanks,\nJoonwon Kang","headers":{"Return-Path":"\n <linux-tegra+bounces-13561-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-tegra@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256\n header.s=20251104 header.b=Lw1ACzpA;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13561-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=\"Lw1ACzpA\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.214.201","smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com"],"Received":["from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnv3j2m9zz1yG2\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 22:48:01 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 2961C3006813\n\tfor <incoming@patchwork.ozlabs.org>; Sat,  4 Apr 2026 11:47:57 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7359833F598;\n\tSat,  4 Apr 2026 11:47:56 +0000 (UTC)","from mail-pl1-f201.google.com (mail-pl1-f201.google.com\n [209.85.214.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 182913321C2\n\tfor <linux-tegra@vger.kernel.org>; Sat,  4 Apr 2026 11:47:54 +0000 (UTC)","by mail-pl1-f201.google.com with SMTP id\n d9443c01a7336-2b2489af602so24774395ad.1\n        for <linux-tegra@vger.kernel.org>;\n Sat, 04 Apr 2026 04:47:54 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775303276; cv=none;\n b=kjB0pNhA7KsgNj2r6/74JR0ql7yW8ZIVz4P6EYWUdJR9V8i0X4hik7aPz3sD7sk3Wn56ceDI4/w+bxLBwNhFaAnRb2YClWS/eCfKnlbdDjpyvIDQM3zFeK1XrEICHN/KhrEAKI1n2T+Rr0XUVNxb8piwZhSOvjH+9R0nBEgi0Rc=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775303276; c=relaxed/simple;\n\tbh=dy8yhJzNiwRlEiywyAKmr/JdveTelkXEUEII/JcVTvg=;\n\th=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:\n\t To:Cc:Content-Type;\n b=PthxqE3izVaM8IhZqydGLPaYbFQ1eMz8MSGdzHytu2J4UlN7eWeYskN8Lk5uRK9UpV2dPcbR+ZJzRec3+jlFO8Ex5zs9xl+/QSmk+vZYUBuMNc82H22kzaO3ZnCXkYiJcbArJzabCqI+Mo9BSZSGA3ygBbiBv6O8Ud0ZOfv1qE8=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com;\n spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com;\n dkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=Lw1ACzpA; arc=none smtp.client-ip=209.85.214.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=google.com; s=20251104; t=1775303274; x=1775908074;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:cc:to:from:subject:message-id:references\n         :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id\n         :reply-to;\n        bh=0G1qQkwBhPOCSaPNNZcA5R2UExCpSWly+t1LnZq/nHI=;\n        b=Lw1ACzpA7Y04E5a02q/Lc+FpOJdES0g9AoMhVBD0F9O5X2i0ymnCTtrb0Na9hQ27EW\n         xMn2GCo/I4S2sTh1Y8xEy8TsNe6bl4UF3OmJM7zKVW+M1cXapWkuSjHogwrWxGZiJ1MG\n         QXlG86Lt59FBoLGe88LAO5aOnS0v1JliuysHmnQlqccR1Y4lX1D0ZS2T2ngptzZM8kOi\n         OBWho+ReIq5Kpz8sCvYq28DRf80xt3hjftZ/vvquJoRWPBsHf/XIvRqGRyPBt5bVP0Cc\n         cPH0kJmn336XUeyeoMcWRKiTffbhbZDvIxhIqLCRct+9FQGX7jr+IDm/qpLq8XgyVdXf\n         GWhA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775303274; x=1775908074;\n        h=content-transfer-encoding:cc:to:from:subject:message-id:references\n         :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject\n         :date:message-id:reply-to;\n        bh=0G1qQkwBhPOCSaPNNZcA5R2UExCpSWly+t1LnZq/nHI=;\n        b=FkOiUIRRVE6Pc7jrwYZkoU5ZCnmv0c7IEdX02L1syqdGkR2Ykt3r7cfPz6pqyhGFQJ\n         2oLG6NHaptCyEdXnkygdpLb/TE+OQXyREuGtm5WGZvCvjrv2hG3nq7SwgV3Rb48eXLnt\n         Rj7aLWNYkAq2XcA61SCqt//uK8/CcmWtU39SL09P9D4y8GpkzbcP5JJILaBMqViOslW+\n         JQwXG5gL4za87J73ZE+KrDDk8lIkJZ5DlU6tcAGqxD3jfoObjLZSdBHApQrS5Cpu9DxJ\n         W4+y3fB/qL2vVMdDFQXSfGM2JRlKZWlsZtjTzLQC0mQifqt54mZC3jYbeG1d+654JewT\n         GgMw==","X-Forwarded-Encrypted":"i=1;\n AJvYcCWk6mdDiP47uS53AzoW6J7iWBXH5oSCwM7NvWuOEv3aFxecHe7tABWH3QO6ZpscIGuQjaHlAPfDWtKr0g==@vger.kernel.org","X-Gm-Message-State":"AOJu0YyZRKbqx/NxohjHdu+H9iCX6yh4U1KqntefDci3QNs4i/5jlCF+\n\ths1UMFkZKAL1VqQaoNzO1/z3PVrZ0HPxlds7h/eGZPHVutS33tAgIflkcpF3IEdiZ6v+v9xCz2V\n\t350plO6/Y7MOy2HV3pBxNoWfrog==","X-Received":"from plbjz3.prod.google.com ([2002:a17:903:4303:b0:2b0:6207:5fd3])\n (user=joonwonkang job=prod-delivery.src-stubby-dispatcher) by\n 2002:a17:903:2ec8:b0:2b0:aebe:259 with SMTP id\n d9443c01a7336-2b2821a7fbemr58943675ad.19.1775303273972;\n Sat, 04 Apr 2026 04:47:53 -0700 (PDT)","Date":"Sat,  4 Apr 2026 11:47:51 +0000","In-Reply-To":"\n <CABb+yY23aTXeXu6G-8sHjw32DCqmhsJLu2Mt-txenOgTBiyv+A@mail.gmail.com>","Precedence":"bulk","X-Mailing-List":"linux-tegra@vger.kernel.org","List-Id":"<linux-tegra.vger.kernel.org>","List-Subscribe":"<mailto:linux-tegra+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-tegra+unsubscribe@vger.kernel.org>","Mime-Version":"1.0","References":"\n <CABb+yY23aTXeXu6G-8sHjw32DCqmhsJLu2Mt-txenOgTBiyv+A@mail.gmail.com>","X-Mailer":"git-send-email 2.53.0.1213.gd9a14994de-goog","Message-ID":"<20260404114752.3052748-1-joonwonkang@google.com>","Subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","From":"Joonwon Kang <joonwonkang@google.com>","To":"jassisinghbrar@gmail.com","Cc":"akpm@linux-foundation.org, angelogioacchino.delregno@collabora.com,\n\tjonathanh@nvidia.com, joonwonkang@google.com,\n\tlinux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tlinux-mediatek@lists.infradead.org, linux-tegra@vger.kernel.org,\n\tmatthias.bgg@gmail.com, stable@vger.kernel.org, thierry.reding@gmail.com,\n\tlee@kernel.org","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable"}},{"id":3678579,"web_url":"http://patchwork.ozlabs.org/comment/3678579/","msgid":"<20260417084335.2092188-1-joonwonkang@google.com>","list_archive_url":null,"date":"2026-04-17T08:43:34","subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","submitter":{"id":91088,"url":"http://patchwork.ozlabs.org/api/people/91088/","name":"Joonwon Kang","email":"joonwonkang@google.com"},"content":"> On Fri, Apr 3, 2026 at 10:19 AM Joonwon Kang <joonwonkang@google.com> wrote:\n> >\n> > > On Thu, Apr 2, 2026 at 12:07 PM Joonwon Kang <joonwonkang@google.com> wrote:\n> > > >\n> > > > When the mailbox controller failed transmitting message, the error code\n> > > > was only passed to the client's tx done handler and not to\n> > > > mbox_send_message(). For this reason, the function could return a false\n> > > > success. This commit resolves the issue by introducing the tx status and\n> > > > checking it before mbox_send_message() returns.\n> > > >\n> > > Can you please share the scenario when this becomes necessary? This\n> > > can potentially change the ground underneath some clients, so we have\n> > > to be sure this is really useful.\n> >\n> > I would say the problem here is generic enough to apply to all the cases where\n> > the send result needs to be checked. Since the return value of the send API is\n> > not the real send result, any users who believe that this blocking send API\n> > will return the real send result could fall for that. For example, users may\n> > think the send was successful even though it was not actually. I believe it is\n> > uncommon that users have to register a callback solely to get the send result\n> > even though they are using the blocking send API already. Also, I guess there\n> > is no special reason why only the mailbox send API should work this way among\n> > other typical blocking send APIs. For these reasons, this patch makes the send\n> > API return the real send result. This way, users will not need to register the\n> > redundant callback and I think the return value will align with their common\n> > expectation.\n> >\n> Clients submit a message into the Mailbox subsystem to be sent out to\n> the remote side which can happen immediately or later.\n> If submission fails, clients get immediately notified. If transmission\n> fails (which is now internal to the subsystem) it is reported to the\n> client by a callback.\n> If the API was called mbox_submit_message (which it actually is)\n> instead of mbox_send_message, there would be no confusion.\n> We can argue how good/bad the current implementation is, but the fact\n> is that it is here. And I am reluctant to cause churn without good\n> reason.\n> Again, as I said, any, _legal_, setup scenario will help me come over\n> my reluctance.\n> \n> Thanks\n> Jassi\n\nHi Jassi, can we continue discussing this issue from where we left off last\ntime?\n\nThanks,\nJoonwon Kang","headers":{"Return-Path":"\n <linux-tegra+bounces-13786-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-tegra@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256\n header.s=20251104 header.b=P2xJ8+9J;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13786-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=\"P2xJ8+9J\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.215.202","smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxpSL0Frsz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 18:48:18 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id B6FC7307D8F8\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 08:43:39 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 80DA53AEF4F;\n\tFri, 17 Apr 2026 08:43:39 +0000 (UTC)","from mail-pg1-f202.google.com (mail-pg1-f202.google.com\n [209.85.215.202])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 1630D3750B2\n\tfor <linux-tegra@vger.kernel.org>; Fri, 17 Apr 2026 08:43:37 +0000 (UTC)","by mail-pg1-f202.google.com with SMTP id\n 41be03b00d2f7-c76cb2dce57so341291a12.1\n        for <linux-tegra@vger.kernel.org>;\n Fri, 17 Apr 2026 01:43:37 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776415419; cv=none;\n b=gLOkYu4hhrZhA+Gww6ROjzxorZPlWizeXru5HpaDsKfciD2z0bxwS/dQcAlDM+jL9pXOOFYWwRZ9Ca3jXxl7wDiI1q9ioBFwgviTEO8U6ko0QeZZStbdFSPisuiC9HRfLVtrKMzTpX938/DbCrQTok7oS9k5uiOG2TBwUMTA9uw=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776415419; c=relaxed/simple;\n\tbh=JMis1PWBmQ2nY0YUn8Z/PvKMUmrRKtNhJv6gZchAt+s=;\n\th=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:\n\t To:Cc:Content-Type;\n b=RN0bfosDj9BN/CnSk1cpNodrawFAoA2ngK3B/mAsqwu4JqlCNjb8ubdccZKFmbiWcHEmPl+ldi0LoXG7ZV4iJ3r1iitR0iaiC3+pThGG0yPHvx19hzY8xE9cWJMCPXwiBHIZcJKQuWBesj972KPv5XFgV427z4/ozYso7Tbx8o8=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com;\n spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com;\n dkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=P2xJ8+9J; arc=none smtp.client-ip=209.85.215.202","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=google.com; s=20251104; t=1776415417; x=1777020217;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:cc:to:from:subject:message-id:references\n         :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id\n         :reply-to;\n        bh=JMis1PWBmQ2nY0YUn8Z/PvKMUmrRKtNhJv6gZchAt+s=;\n        b=P2xJ8+9JXzms47E7PWeEjYeToPBvwMRXGyKfHzmfYyGc6TwOQd2VayFrCaTBTPj29s\n         eWAU3Po7LtrjsUKyGb+y/sS/xxPXyWdkiHeTo52eUARxn9VipLo9fflZ+aVuzzL5ZrEl\n         8gcNZXITxXe/dhET0V9VrmV0m0pJCwVbi51T9SeWsdYqw/HKIOeEeVU1a7o2AS/+/FEX\n         GTVjg7s/xFVvvQltrwqdROTZyQFQCjIMmAlqqOUGvE1sUNDndlt9jrS/a47Aorxnjs82\n         fzuQAJLqFv4iZEZ4Ouod0rrjPOcPKJxcCLHXBYK4sZrrL2peB4mmFD3xnCS705KQQKuH\n         ALpg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776415417; x=1777020217;\n        h=content-transfer-encoding:cc:to:from:subject:message-id:references\n         :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject\n         :date:message-id:reply-to;\n        bh=JMis1PWBmQ2nY0YUn8Z/PvKMUmrRKtNhJv6gZchAt+s=;\n        b=VJzNwI3S9ZGih5zEyuVXpeGxj4sP2DS8Z9CY/xoQAOe52vRjGuo7Ww+dr/bpUvB0oC\n         JKjG769M5awZQpD6bKwMEJh5wUtvF6SoLtjI24okLZihEPit9Mzbwi2tw0YG9RpQrrpS\n         jUANvZhqzsrspkf1f7+HtqmdNFsT/s3ORvzUKkOi4W3RT0jj5OLW+B3zgftAO2425bta\n         l1YABdTyjwS3eHzALfMu2LvVtiU8ODBZuMCCs+mEYCTooK0fJGexiE3GBd7II2yK+i00\n         TpI7Hb/lIhlJXcoKy5NaO6WNt1DmgN91PUnj8Syy1hrllJAXcFjspdzr+sGhlTsS/zHw\n         YKRQ==","X-Forwarded-Encrypted":"i=1;\n AFNElJ8QR/ASZ4gWwHqclM6GevzVnSfEL99uRcg37ngPaO7L/Ucm6cABGS8IS9ARsgngfyg0oO1oo9xAHuUE4A==@vger.kernel.org","X-Gm-Message-State":"AOJu0Yz5MA/pgB6BpWNSnHKwm1DXmra2lyyHc/70quvdp2+Z54JeofZw\n\t7GGYkjygMpGkl/MJVA9p/Ae+HIqtI56zvYo02MCcxyWvR8GGv0ogQosgqxBWYzDF5HzfDIEXdOu\n\tlajyoAFcB4KGeviJyOjgdhRXJZg==","X-Received":"from pfhx21.prod.google.com\n ([2002:a05:6a00:1895:b0:82f:7163:35c4])\n (user=joonwonkang job=prod-delivery.src-stubby-dispatcher) by\n 2002:a05:6a00:a248:b0:82f:316:3208 with SMTP id\n d2e1a72fcca58-82f8c8fb879mr1813947b3a.29.1776415417107;\n Fri, 17 Apr 2026 01:43:37 -0700 (PDT)","Date":"Fri, 17 Apr 2026 08:43:34 +0000","In-Reply-To":"\n <CABb+yY23aTXeXu6G-8sHjw32DCqmhsJLu2Mt-txenOgTBiyv+A@mail.gmail.com>","Precedence":"bulk","X-Mailing-List":"linux-tegra@vger.kernel.org","List-Id":"<linux-tegra.vger.kernel.org>","List-Subscribe":"<mailto:linux-tegra+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-tegra+unsubscribe@vger.kernel.org>","Mime-Version":"1.0","References":"\n <CABb+yY23aTXeXu6G-8sHjw32DCqmhsJLu2Mt-txenOgTBiyv+A@mail.gmail.com>","X-Mailer":"git-send-email 2.54.0.rc1.555.g9c883467ad-goog","Message-ID":"<20260417084335.2092188-1-joonwonkang@google.com>","Subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","From":"Joonwon Kang <joonwonkang@google.com>","To":"jassisinghbrar@gmail.com","Cc":"akpm@linux-foundation.org, angelogioacchino.delregno@collabora.com,\n\tjonathanh@nvidia.com, joonwonkang@google.com,\n\tlinux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tlinux-mediatek@lists.infradead.org, linux-tegra@vger.kernel.org,\n\tmatthias.bgg@gmail.com, stable@vger.kernel.org, thierry.reding@gmail.com","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable"}},{"id":3678939,"web_url":"http://patchwork.ozlabs.org/comment/3678939/","msgid":"<CABb+yY2yBZ+hgr-=Uh_sRk-TJZRfsk2AYtoS5rPtUN8kVsUScA@mail.gmail.com>","list_archive_url":null,"date":"2026-04-18T02:50:00","subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","submitter":{"id":4220,"url":"http://patchwork.ozlabs.org/api/people/4220/","name":"Jassi Brar","email":"jassisinghbrar@gmail.com"},"content":"On Fri, Apr 17, 2026 at 3:43 AM Joonwon Kang <joonwonkang@google.com> wrote:\n>\n> > On Fri, Apr 3, 2026 at 10:19 AM Joonwon Kang <joonwonkang@google.com> wrote:\n> > >\n> > > > On Thu, Apr 2, 2026 at 12:07 PM Joonwon Kang <joonwonkang@google.com> wrote:\n> > > > >\n> > > > > When the mailbox controller failed transmitting message, the error code\n> > > > > was only passed to the client's tx done handler and not to\n> > > > > mbox_send_message(). For this reason, the function could return a false\n> > > > > success. This commit resolves the issue by introducing the tx status and\n> > > > > checking it before mbox_send_message() returns.\n> > > > >\n> > > > Can you please share the scenario when this becomes necessary? This\n> > > > can potentially change the ground underneath some clients, so we have\n> > > > to be sure this is really useful.\n> > >\n> > > I would say the problem here is generic enough to apply to all the cases where\n> > > the send result needs to be checked. Since the return value of the send API is\n> > > not the real send result, any users who believe that this blocking send API\n> > > will return the real send result could fall for that. For example, users may\n> > > think the send was successful even though it was not actually. I believe it is\n> > > uncommon that users have to register a callback solely to get the send result\n> > > even though they are using the blocking send API already. Also, I guess there\n> > > is no special reason why only the mailbox send API should work this way among\n> > > other typical blocking send APIs. For these reasons, this patch makes the send\n> > > API return the real send result. This way, users will not need to register the\n> > > redundant callback and I think the return value will align with their common\n> > > expectation.\n> > >\n> > Clients submit a message into the Mailbox subsystem to be sent out to\n> > the remote side which can happen immediately or later.\n> > If submission fails, clients get immediately notified. If transmission\n> > fails (which is now internal to the subsystem) it is reported to the\n> > client by a callback.\n> > If the API was called mbox_submit_message (which it actually is)\n> > instead of mbox_send_message, there would be no confusion.\n> > We can argue how good/bad the current implementation is, but the fact\n> > is that it is here. And I am reluctant to cause churn without good\n> > reason.\n> > Again, as I said, any, _legal_, setup scenario will help me come over\n> > my reluctance.\n> >\n> > Thanks\n> > Jassi\n>\n> Hi Jassi, can we continue discussing this issue from where we left off last\n> time?\n>\nLong passionate essays are difficult to read, so I haven't yet. A\nsimple description of some setup that you think is not supported, will\nkeep the discussion focused.\nIf your platform is supported but you think the api is not clear,\nupdates to the documentation are welcome\n\nThanks,\nJassi","headers":{"Return-Path":"\n <linux-tegra+bounces-13794-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-tegra@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=L5NJc7Zz;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13794-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"L5NJc7Zz\"","smtp.subspace.kernel.org;\n arc=pass smtp.client-ip=209.85.161.50","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fyGYs1vdwz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 18 Apr 2026 12:54:41 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 5A60330A301C\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 18 Apr 2026 02:50:14 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 320B82D060D;\n\tSat, 18 Apr 2026 02:50:14 +0000 (UTC)","from mail-oo1-f50.google.com (mail-oo1-f50.google.com\n [209.85.161.50])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id B0F6E285C89\n\tfor <linux-tegra@vger.kernel.org>; Sat, 18 Apr 2026 02:50:12 +0000 (UTC)","by mail-oo1-f50.google.com with SMTP id\n 006d021491bc7-6946d60f21fso166890eaf.2\n        for <linux-tegra@vger.kernel.org>;\n Fri, 17 Apr 2026 19:50:12 -0700 (PDT)"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776480614; cv=pass;\n b=js4fbXYLxTtEfx6ES0KKy6NkyQDiLFQVDFiHkevsFOuYloRB94KBNZ7ouDHintjqi7JsFfN3Tu8o3bHEqYU+tCXfHxab1cLAI2L7BX4ueurX++O3LMqVcQ4yOcTsqDq4Tg9Clhb/8MKNCgzzB512T1K57mEZpm7tsiZxu7GGOM0=","i=1; a=rsa-sha256; t=1776480612; cv=none;\n        d=google.com; s=arc-20240605;\n        b=N8Od5IABgjHmc4gOQzwpCpHZAmvvg3SIDmBEiQQTGPvzUnVNNkoTQ2zSEXugWNuEVJ\n         q8xIN0QYdyRCzsQHDO7wOP4qIZdBUqw52eUNSy9abSWe/KTO3pIX2+HkhPeo7AdCrz7b\n         pGAJpKXs+rZrKI0ETXqrGN8fkTcm5rDATW+Dg1d60lCsS6Ew8EIyEm0SHzolWRo0+UwM\n         yVi7C+ggsgKVYeuZplwySHgVTxEL3s5sPS8GSALwKOOPsxv+gAndLmAoV45pjkogDNBr\n         0GxHXhGfnh/nkLNGcn2Il2idfJfpXQaP8arw+AGQmM9sjjo5gMKOl1KB892vBBQ3bnbG\n         pzjw=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776480614; c=relaxed/simple;\n\tbh=sTpB3zFGMA4+49UPAPJnoMPYvm1cGwiY/ChissLecvk=;\n\th=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:\n\t To:Cc:Content-Type;\n b=Hg1zc71CRX5CoP/nr/vB0i51w+Amue7UwcDHYAw85I0NZhMq0ufdEXtIO+dadZkqCLN7+dSmaTxQCppYNoafQ9Bjf1pFv1uvKeHLRsLQReK0h19Kv0Q0mZeJi3F3sm+MDZs9xtKXOnsEpF9qx0uHfKw3Ev8ZsvzU+SzpCwIrqCo=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:dkim-signature;\n        bh=sTpB3zFGMA4+49UPAPJnoMPYvm1cGwiY/ChissLecvk=;\n        fh=OnzMlhcAir6UDOQ06LQvgXGLEXQGm94J0Z1r0NKVcvo=;\n        b=hByNYGR/jipk33VUoTQ7BnvZiXxdJY5M3egAFS1mkjFdtfAdnkQT1Ux4yctFjjSaWI\n         XyDRnsOe4VKwJlZgK82qPMJhfdeQo5QFILfxuwLybS7yhdfPKufJlY7AWmLeKZG1wNnc\n         2UBj1ZH6DHwFb1SYv78bif1gOF47l8nt3IE2VdX7zgMYxZHHuRDQ9cRm8wov0Q/fH8lG\n         klSCz2AgWCaomZg1p4ANl7NXrM0+m1Rxsmi3Hz9CADS8dt8RBi7CaATrH8EjAWJoWN7D\n         rvKYYRr0npw7nQRvfJdR+MrA/nRIEjHqLlToTxcZbnamJUUvrpAUugkiXkB+9PWBQV6a\n         vVsw==;\n        darn=vger.kernel.org"],"ARC-Authentication-Results":["i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=L5NJc7Zz; arc=pass smtp.client-ip=209.85.161.50","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1776480612; x=1777085412;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=sTpB3zFGMA4+49UPAPJnoMPYvm1cGwiY/ChissLecvk=;\n        b=L5NJc7ZzD0XXlkyFqphmwJmka1ifEx9lll7Ih42v1Pxw6TPc6HSqH1N2zLl5Udogbd\n         UeWodJKrbTNtEoaFGu2iYhcw9/yihXYsxUhcOIzAzQPSUzbl809K3yX3r+YGyaBfAGUh\n         TIyP0/iVY+aySRe8Y+mSD3V+wHus9MuP0Bj1xMWHM88XDNTq9q/rs+zFhsne6K7QtfQB\n         FIKhmeu1RJFRDH+5asPJYrsoreqXu9Kgzqtypuld0LWlUg6Lyi04fcBAlgUFFrsbEDhg\n         ZREqERpnbnpRhWMMgcuV6UJhLdIUlkGHN0DkUQMWrsTSJjY3u6UshQVnVev8mfsQS/6D\n         oyRg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776480612; x=1777085412;\n        h=content-transfer-encoding:cc:to:subject:message-id:date:from\n         :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=sTpB3zFGMA4+49UPAPJnoMPYvm1cGwiY/ChissLecvk=;\n        b=jlVy/8JoQ9JesfwOMOOYJ/B8sANQsjHXu0QNzBIgoTvq4b86s+u8c1KsUDLiN85T0+\n         CM2rkUrlFpOCT0mOuhuvx3auI+HdAH9Q8tgqOemEAIHM8pYXcro3oN3o0Z9GYQusv/qs\n         vsKLPhLrVVmqiM5Szf121KAMezKNsdpsKkFMDtUulOInfbp+x5E3JBfYyyjgG3kG0WIO\n         eWsu8ggKNf/YdwohhGSy7mflcCKGhUdjNWIMmx2ZeYXa5vmp53hNegktxRv5ELB3cUG7\n         /NqLihcbVsJYRuRfpcnMwGUiOeS8bColUqBa7sd1OhK3WYkCS+OAlAfcvGr0PB/ohjiW\n         RlAg==","X-Forwarded-Encrypted":"i=1;\n AFNElJ+OHy3TLcXgEouzLtpkuTGPyExownpuIaKEGaMp82G9kcRL4bXy1zMKVEAQ/SSze2Ouefyb/SJi7y6VCA==@vger.kernel.org","X-Gm-Message-State":"AOJu0YyRKO+VI25a+zyzOXlJMZKRI0aMj5Xn6jK8xd1WYO9bSqk6leqy\n\tnreLPQc22wF5sjXEb97wN5TQbVmwNis6WOBjtQA1zyy2Rt7WjhdjNbmg4IGpw263ZLCAW8/z5n2\n\tXmVKkuz3Y5OMw52ltQr3FAyKIl8nkYBs=","X-Gm-Gg":"AeBDiev4VGjXrQg7G6YqucwkOUJ2pFwU685LEe0XrmBiflBp4y9xkb5t2P4TfZXN8Nl\n\t2XncXbq3D+woJzGtTF8XDpfMLJP1vKIV8HnflpD1JFZKQzZ+kNNqeI5iJhkwYKZz97Wk5gXaqar\n\tZ2/tnPzQQG1slAS5RfHV/6UfNI3zthZbCV+apPZOmUPhoqJ2xaZI3qeLs/Dvk35M47NxWMb0IJF\n\tyKdNNobeLdy5Rx/oXgpFNGVmAaGxk9DctqlwWuJL0NjRguXv/s0/QPvEKcQbZYNg270H58puibK\n\tgQbw5ALIKdoGZZ0ejmc=","X-Received":"by 2002:a05:6820:604:b0:689:7cd7:259e with SMTP id\n 006d021491bc7-69462f44c08mr3366697eaf.57.1776480611628; Fri, 17 Apr 2026\n 19:50:11 -0700 (PDT)","Precedence":"bulk","X-Mailing-List":"linux-tegra@vger.kernel.org","List-Id":"<linux-tegra.vger.kernel.org>","List-Subscribe":"<mailto:linux-tegra+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-tegra+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","References":"\n <CABb+yY23aTXeXu6G-8sHjw32DCqmhsJLu2Mt-txenOgTBiyv+A@mail.gmail.com>\n <20260417084335.2092188-1-joonwonkang@google.com>","In-Reply-To":"<20260417084335.2092188-1-joonwonkang@google.com>","From":"Jassi Brar <jassisinghbrar@gmail.com>","Date":"Fri, 17 Apr 2026 21:50:00 -0500","X-Gm-Features":"AQROBzBa_VS1wWtSKDMjmtBp02-qplt4Nx2TejF_JEV5fvEqT0eLpBXx6xGnZnk","Message-ID":"\n <CABb+yY2yBZ+hgr-=Uh_sRk-TJZRfsk2AYtoS5rPtUN8kVsUScA@mail.gmail.com>","Subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","To":"Joonwon Kang <joonwonkang@google.com>","Cc":"akpm@linux-foundation.org, angelogioacchino.delregno@collabora.com,\n\tjonathanh@nvidia.com, linux-arm-kernel@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,\n\tlinux-tegra@vger.kernel.org, matthias.bgg@gmail.com, stable@vger.kernel.org,\n\tthierry.reding@gmail.com","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable"}},{"id":3678940,"web_url":"http://patchwork.ozlabs.org/comment/3678940/","msgid":"<20260418033900.3652042-1-joonwonkang@google.com>","list_archive_url":null,"date":"2026-04-18T03:38:59","subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","submitter":{"id":91088,"url":"http://patchwork.ozlabs.org/api/people/91088/","name":"Joonwon Kang","email":"joonwonkang@google.com"},"content":"> On Fri, Apr 17, 2026 at 3:43 AM Joonwon Kang <joonwonkang@google.com> wrote:\n> >\n> > > On Fri, Apr 3, 2026 at 10:19 AM Joonwon Kang <joonwonkang@google.com> wrote:\n> > > >\n> > > > > On Thu, Apr 2, 2026 at 12:07 PM Joonwon Kang <joonwonkang@google.com> wrote:\n> > > > > >\n> > > > > > When the mailbox controller failed transmitting message, the error code\n> > > > > > was only passed to the client's tx done handler and not to\n> > > > > > mbox_send_message(). For this reason, the function could return a false\n> > > > > > success. This commit resolves the issue by introducing the tx status and\n> > > > > > checking it before mbox_send_message() returns.\n> > > > > >\n> > > > > Can you please share the scenario when this becomes necessary? This\n> > > > > can potentially change the ground underneath some clients, so we have\n> > > > > to be sure this is really useful.\n> > > >\n> > > > I would say the problem here is generic enough to apply to all the cases where\n> > > > the send result needs to be checked. Since the return value of the send API is\n> > > > not the real send result, any users who believe that this blocking send API\n> > > > will return the real send result could fall for that. For example, users may\n> > > > think the send was successful even though it was not actually. I believe it is\n> > > > uncommon that users have to register a callback solely to get the send result\n> > > > even though they are using the blocking send API already. Also, I guess there\n> > > > is no special reason why only the mailbox send API should work this way among\n> > > > other typical blocking send APIs. For these reasons, this patch makes the send\n> > > > API return the real send result. This way, users will not need to register the\n> > > > redundant callback and I think the return value will align with their common\n> > > > expectation.\n> > > >\n> > > Clients submit a message into the Mailbox subsystem to be sent out to\n> > > the remote side which can happen immediately or later.\n> > > If submission fails, clients get immediately notified. If transmission\n> > > fails (which is now internal to the subsystem) it is reported to the\n> > > client by a callback.\n> > > If the API was called mbox_submit_message (which it actually is)\n> > > instead of mbox_send_message, there would be no confusion.\n> > > We can argue how good/bad the current implementation is, but the fact\n> > > is that it is here. And I am reluctant to cause churn without good\n> > > reason.\n> > > Again, as I said, any, _legal_, setup scenario will help me come over\n> > > my reluctance.\n> > >\n> > > Thanks\n> > > Jassi\n> >\n> > Hi Jassi, can we continue discussing this issue from where we left off last\n> > time?\n> >\n> Long passionate essays are difficult to read, so I haven't yet. A\n> simple description of some setup that you think is not supported, will\n> keep the discussion focused.\n> If your platform is supported but you think the api is not clear,\n> updates to the documentation are welcome\n\nSorry that it was hard for you to read. The long form was to explain what is\nmisaligned and problematic with data and examples for better understanding\nbecause your previous long essays did not make much sense to me. Please go\nthrough it and let me know if anything is unclear to you. In the mean time, I\nwill prepare a new version of patch with some update to the API doc.\n\nThanks,\nJoonwon Kang","headers":{"Return-Path":"\n <linux-tegra+bounces-13795-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-tegra@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256\n header.s=20251104 header.b=KfubM8NL;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13795-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=\"KfubM8NL\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.215.202","smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fyHYH14B2z1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 18 Apr 2026 13:39:15 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 24F81302417B\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 18 Apr 2026 03:39:05 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id EBC4E30F94B;\n\tSat, 18 Apr 2026 03:39:04 +0000 (UTC)","from mail-pg1-f202.google.com (mail-pg1-f202.google.com\n [209.85.215.202])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 93A9D29B799\n\tfor <linux-tegra@vger.kernel.org>; Sat, 18 Apr 2026 03:39:03 +0000 (UTC)","by mail-pg1-f202.google.com with SMTP id\n 41be03b00d2f7-c794d89a715so672740a12.1\n        for <linux-tegra@vger.kernel.org>;\n Fri, 17 Apr 2026 20:39:03 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776483544; cv=none;\n b=H1PZdgtuj+bu5vWVhVJ6F1dRFc40SjgeXUNpO9UfkHphgWVzjqT2hrF9IQX8lS4wO1Yt/3M0D8n+f05dCIsRz3CzNe2jR5Yq8BytrEUT+Yab/eEuN9KQxO6hCSoabno0ChtdWzhLiUJckrDqxk5xgTl3DEDp62Y/SQ8noBYLrBU=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776483544; c=relaxed/simple;\n\tbh=G+ETtzwm86y2ubyHKvTZyBSdg3SjvxcOgxe973ohm5w=;\n\th=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:\n\t To:Cc:Content-Type;\n b=DXxF+BFUPoZQc/PUBf1t0dt6Rj63Yphoiwf22QFJVe+MVIQP6yn+20Dczly1vPnjCrDo3a6pfjSC2E9WA8vzLy5gV/F6cOEAJjhudiZ7DBQqV+3gTVZeuNFIOjtcpyN33YFaQOrtLLwkGUDiTuL0t2/tryXakxx8VPSNRG0TPKo=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com;\n spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com;\n dkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=KfubM8NL; arc=none smtp.client-ip=209.85.215.202","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=google.com; s=20251104; t=1776483543; x=1777088343;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:cc:to:from:subject:message-id:references\n         :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id\n         :reply-to;\n        bh=G+ETtzwm86y2ubyHKvTZyBSdg3SjvxcOgxe973ohm5w=;\n        b=KfubM8NLzlZlE1wq7b54dcvzl18ZF7uGnCXD2jDdg+S6Q/FeyVOGdhHlZGzau8vvRT\n         tjNNxAK3xJX3jCxT9b9jI2muzv+DicnnU9+0tEOVGxs4hDRdJKnRL6wuPMkr8oN8guSP\n         9MbTx54IduTxAaemmh2OHi9Cs8GVtWH3j4k527Mf9mU41xdav35yRf0dhmxj4DCvdvy/\n         ILySRynBjfhybtb1iK7AoTLkl3JisShlzs6bmEWL47n8/H/eY1xGLG0SlZIWgW2jgCYI\n         V6pySQz9k/FuGoUliD1n2mtNF9verKkDKIv8vYgACs7g1VAyXetA1ksy+2kylp9YIbBI\n         yxbw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776483543; x=1777088343;\n        h=content-transfer-encoding:cc:to:from:subject:message-id:references\n         :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject\n         :date:message-id:reply-to;\n        bh=G+ETtzwm86y2ubyHKvTZyBSdg3SjvxcOgxe973ohm5w=;\n        b=AD1JF7o7RYBSOlHYILKzdZaE18A9a0ztdkRWggz7uCKrNZxZnQjc6WTixnCjWyIO/S\n         YOVyrG1ILnNzX9y/C1y71dHsTJfHDM12863+aLnRG8BDQHU/suiw53khlsXGfXmojWaX\n         YO8s+sxHWygqRW7XLQiXmBfaVqdnj2UYR/cvspchnLayfM6njaBucjMeHkmPzjkkpZGV\n         8ARHWFDN0UWxeqYlyXvqgRBVEYHuPo0p5n4aOOTDV8M9iUrUrGECV1thpTSQUziatFOq\n         dBHJZYMe4YIy7gVBj4pV3mvFil9WpM7Q4YX12Ey26qhMgN22bB11bOyPOsoGGB8iBrkp\n         tl5Q==","X-Forwarded-Encrypted":"i=1;\n AFNElJ8TfcWio6hq8nQ9BxDD9pFgBFbkmnWf7sA70V5/KoWqnCBP+3+T+vRACzzNFjoP9oBEFxTTpA93bhNtWQ==@vger.kernel.org","X-Gm-Message-State":"AOJu0Yz8HmiZqYLFKnJn0qqXXvv3UdsCIUjWoZOfvwgOpmdKmxmzfya9\n\t2S4Ti4b0HIwo7e8UVwTkY7P4H1ALeg7FuMCpCI6RQ+p80ObK5llBJiWq6p7X6R2tWHUis/IG8iG\n\tA31t1rECp+7HLQKqi9emCCSFxsw==","X-Received":"from pgbfp6.prod.google.com\n ([2002:a05:6a02:2ce6:b0:c76:a6b1:ed23])\n (user=joonwonkang job=prod-delivery.src-stubby-dispatcher) by\n 2002:a05:6300:8088:b0:39f:216:f400 with SMTP id\n adf61e73a8af0-3a08d708cc3mr4939472637.14.1776483542721;\n Fri, 17 Apr 2026 20:39:02 -0700 (PDT)","Date":"Sat, 18 Apr 2026 03:38:59 +0000","In-Reply-To":"\n <CABb+yY2yBZ+hgr-=Uh_sRk-TJZRfsk2AYtoS5rPtUN8kVsUScA@mail.gmail.com>","Precedence":"bulk","X-Mailing-List":"linux-tegra@vger.kernel.org","List-Id":"<linux-tegra.vger.kernel.org>","List-Subscribe":"<mailto:linux-tegra+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-tegra+unsubscribe@vger.kernel.org>","Mime-Version":"1.0","References":"\n <CABb+yY2yBZ+hgr-=Uh_sRk-TJZRfsk2AYtoS5rPtUN8kVsUScA@mail.gmail.com>","X-Mailer":"git-send-email 2.54.0.rc1.555.g9c883467ad-goog","Message-ID":"<20260418033900.3652042-1-joonwonkang@google.com>","Subject":"Re: [PATCH v3 2/2] mailbox: Make mbox_send_message() return error\n code when tx fails","From":"Joonwon Kang <joonwonkang@google.com>","To":"jassisinghbrar@gmail.com","Cc":"akpm@linux-foundation.org, angelogioacchino.delregno@collabora.com,\n\tjonathanh@nvidia.com, joonwonkang@google.com,\n\tlinux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tlinux-mediatek@lists.infradead.org, linux-tegra@vger.kernel.org,\n\tmatthias.bgg@gmail.com, stable@vger.kernel.org, thierry.reding@gmail.com","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable"}}]