Re: [PATCH 2/2] mailbox: Error out early if the mbox driver has failed to submit the message

From: Jassi Brar
Date: Fri Sep 16 2022 - 13:04:54 EST


On Thu, Sep 15, 2022 at 11:50 AM Evgenii Shatokhin
<e.shatokhin@xxxxxxxxx> wrote:
>
> mbox_send_message() places the pointer to the message to the queue
> (add_to_rbuf) then calls msg_submit(chan) to submit the first of the
> queued messaged to the mailbox. Some of mailbox drivers can return
> errors from their .send_data() callbacks, e.g., if the message is
> invalid or there is something wrong with the mailbox device.
>
The message can't be invalid because the client code is written for a
particular provider.

Though it is possible for the mailbox controller to break down for
some reason. In that case, the blocking api will keep retrying until
successful. But ideally the client, upon getting -ETIME, should free()
and request() the channel reset it (because controller drivers usually
don't contain the logic to automatically reset upon some error).

thanks.