linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] firmware: arm_scmi: Avoid to call mbox_client_txdone on txdone_irq mode
@ 2024-02-01  9:57 Pin-Chuan Liu
  2024-02-02 10:56 ` Cristian Marussi
  0 siblings, 1 reply; 5+ messages in thread
From: Pin-Chuan Liu @ 2024-02-01  9:57 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: wsd_upstream, cylen.yao, Pin-Chuan Liu, linux-arm-kernel,
	linux-kernel, linux-mediatek

On txdone_irq mode, tx_tick is done from mbox_chan_txdone.
Calling to mbox_client_txdone could get error message
and return directly, add a check to avoid this.

Signed-off-by: Pin-Chuan Liu <flash.liu@mediatek.com>
---
V1 -> V2:
 - Remove Change-Id
 - Use single line comment
 
 drivers/firmware/arm_scmi/mailbox.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c
index b8d470417e8f..d391463e3208 100644
--- a/drivers/firmware/arm_scmi/mailbox.c
+++ b/drivers/firmware/arm_scmi/mailbox.c
@@ -8,6 +8,7 @@
 
 #include <linux/err.h>
 #include <linux/device.h>
+#include <linux/mailbox_controller.h>
 #include <linux/mailbox_client.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -275,7 +276,10 @@ static void mailbox_mark_txdone(struct scmi_chan_info *cinfo, int ret,
 	 * Unfortunately, we have to kick the mailbox framework after we have
 	 * received our message.
 	 */
-	mbox_client_txdone(smbox->chan, ret);
+
+	/* With txdone_irq mode, kick can be done by mbox_chan_txdone */
+	if (!(smbox->chan->mbox->txdone_irq))
+		mbox_client_txdone(smbox->chan, ret);
 }
 
 static void mailbox_fetch_response(struct scmi_chan_info *cinfo,
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-07 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-01  9:57 [PATCH v2] firmware: arm_scmi: Avoid to call mbox_client_txdone on txdone_irq mode Pin-Chuan Liu
2024-02-02 10:56 ` Cristian Marussi
     [not found]   ` <053cb4a2edfe576412942daed2f7055b2ba9e207.camel@mediatek.com>
     [not found]     ` <56e1b2f5adbca437a14b738e1c58a054f6302fcd.camel@mediatek.com>
2024-03-06  9:49       ` Cristian Marussi
2024-03-06 16:08         ` Cristian Marussi
     [not found]           ` <c6a24e4c9b97b8a47a822fb4fcbc4b955ac5fbc5.camel@mediatek.com>
2024-03-07 16:22             ` Cristian Marussi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).