Re: [PATCH 1/2] mailbox: Propagate errors from .send_data() callback to mbox_send_message()
From: Jassi Brar
Date: Fri Sep 16 2022 - 11:58:04 EST
On Thu, Sep 15, 2022 at 11:49 AM Evgenii Shatokhin
<e.shatokhin@xxxxxxxxx> wrote:
>
> msg_submit() calls .send_data() function from the mailbox controller driver
> to place the first of the queued messages to the mailbox. Depending on the
> actual driver used, this operation could fail.
>
> In this case, if mbox_send_message() is called in blocking mode, it will
> always return -ETIME rather than the actual error reported by the
> underlying driver. This could be confusing, so let us propagate the
> error from msg_submit() to mbox_send_message().
>
In blocking mode, the client gets -ETIME because the api waited long
enough for the transfer to be successful.
It is the job of the underlying controller driver to be in a
consistent state and recover from errors. It may print its own error
but the client shouldn't have to differentiate between failure causes.
thanks