çå: [PATCH] mailbox: no error log in mbox_client_txdone() for tx done by irq

From: Zhu, Joe
Date: Mon Jun 01 2020 - 02:57:37 EST


Hi Jassi,
Client can not know how mailbox controller implements TX done. There is no API in mailbox_client.h to get this information.
I think it is framework' responsibility, not client, to handle controller' different behavior. Thanks!

Regards,
Joe


-----éäåä-----
åää: Jassi Brar [mailto:jassisinghbrar@xxxxxxxxx]
åéæé: 2020å5æ31æ 4:25
æää: joe_zhuchg@xxxxxxx
æé: Linux Kernel Mailing List; Zhu, Joe
äé: Re: [PATCH] mailbox: no error log in mbox_client_txdone() for tx done by irq

On Mon, May 11, 2020 at 12:52 AM <joe_zhuchg@xxxxxxx> wrote:
>
> From: Joe Zhu <Chunguang.Zhu@xxxxxxxxxxxxxxx>
>
> client does not know and not care about how controller implement tx done.
> mbox_client_txdone() may be called when controller uses irq method.
>
> Signed-off-by: Joe Zhu <Chunguang.Zhu@xxxxxxxxxxxxxxx>
> ---
> drivers/mailbox/mailbox.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
> index 0b821a5b2db8..116124adf188 100644
> --- a/drivers/mailbox/mailbox.c
> +++ b/drivers/mailbox/mailbox.c
> @@ -189,7 +189,9 @@ EXPORT_SYMBOL_GPL(mbox_chan_txdone);
> void mbox_client_txdone(struct mbox_chan *chan, int r)
> {
> if (unlikely(!(chan->txdone_method & TXDONE_BY_ACK))) {
> - dev_err(chan->mbox->dev, "Client can't run the TX ticker\n");
> + if (unlikely(!(chan->txdone_method & TXDONE_BY_IRQ)))
> + dev_err(chan->mbox->dev,
> + "Client can't run the TX ticker\n");
> return;
> }
If it is not by ACK, client should not call txdone() so we shout
immediately. Otherwise something is wrong.

thanks.