Skip to contentSkip to conversation

mailbox: no error log in mbox_client_txdone() for tx done by irq

PATCH In review [email protected] 3 participants 3 messages May 11, 2020 – Jun 1, 2020 Mailbox API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mailbox: no error log in mbox_client_txdone() for tx done by irq

From: Joe Zhu <[email protected]>

client does not know and not care about how controller implement tx done. mbox_client_txdone() may be called when controller uses irq method.

---
 drivers/mailbox/mailbox.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mailbox/mailbox.c +3 -1
index 0b821a5b2db8..116124adf188 100644
@@ -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;
 	}
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 16 lines · On Mon, May 11, 2020 at 12:52 AM <[email protected]> wrote:

From: Joe Zhu <[email protected]>

client does not know and not care about how controller implement tx done. mbox_client_txdone() may be called when controller uses irq method.

---
 drivers/mailbox/mailbox.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mailbox/mailbox.c +0 -0
index 0b821a5b2db8..116124adf188 100644

drivers/mailbox/mailbox.c EXPORT_SYMBOL_GPL(mbox_chan_txdone); · line 196

Quoted 9 lines
drivers/mailbox/mailbox.c +3 -1
@@ -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.

#2 lore raw

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:[email protected]]
发送时间: 2020年5月31日 4:25
收件人: [email protected]
抄送: Linux Kernel Mailing List; Zhu, Joe
主题: Re: [PATCH] mailbox: no error log in mbox_client_txdone() for tx done by irq

Quoted 16 lines · On Mon, May 11, 2020 at 12:52 AM <[email protected]> wrote:

From: Joe Zhu <[email protected]>

client does not know and not care about how controller implement tx done. mbox_client_txdone() may be called when controller uses irq method.

---
 drivers/mailbox/mailbox.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mailbox/mailbox.c +0 -0
index 0b821a5b2db8..116124adf188 100644

drivers/mailbox/mailbox.c EXPORT_SYMBOL_GPL(mbox_chan_txdone); · line 196

Quoted 9 lines
drivers/mailbox/mailbox.c +3 -1
@@ -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.