* [PATCH] firmware: arm_scmi: Avoid to call mbox_client_txdone on txdone_irq mode
@ 2024-02-01 4:52 Pin-Chuan Liu
2024-02-01 8:44 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 3+ messages in thread
From: Pin-Chuan Liu @ 2024-02-01 4:52 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>
Change-Id: Iacbe0d36ef9cc16974c013c3e94c47dc79eae52b
---
drivers/firmware/arm_scmi/mailbox.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c
index b8d470417e8f..f6fe801c2e34 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,12 @@ 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] firmware: arm_scmi: Avoid to call mbox_client_txdone on txdone_irq mode
2024-02-01 4:52 [PATCH] firmware: arm_scmi: Avoid to call mbox_client_txdone on txdone_irq mode Pin-Chuan Liu
@ 2024-02-01 8:44 ` AngeloGioacchino Del Regno
2024-02-01 10:01 ` Flash Liu (劉炳傳)
0 siblings, 1 reply; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-02-01 8:44 UTC (permalink / raw)
To: Pin-Chuan Liu, Sudeep Holla, Cristian Marussi, Matthias Brugger
Cc: wsd_upstream, cylen.yao, linux-arm-kernel, linux-kernel, linux-mediatek
Il 01/02/24 05:52, Pin-Chuan Liu ha scritto:
> 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>
> Change-Id: Iacbe0d36ef9cc16974c013c3e94c47dc79eae52b
Change-Id is something internal to you and has no meaning upstream.
Please remove it.
> ---
> drivers/firmware/arm_scmi/mailbox.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c
> index b8d470417e8f..f6fe801c2e34 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,12 @@ 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.
> + */
Besides, you need one single line for this comment
Regards,
Angelo
> + if (!(smbox->chan->mbox->txdone_irq))
> + mbox_client_txdone(smbox->chan, ret);
> }
>
> static void mailbox_fetch_response(struct scmi_chan_info *cinfo,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] firmware: arm_scmi: Avoid to call mbox_client_txdone on txdone_irq mode
2024-02-01 8:44 ` AngeloGioacchino Del Regno
@ 2024-02-01 10:01 ` Flash Liu (劉炳傳)
0 siblings, 0 replies; 3+ messages in thread
From: Flash Liu (劉炳傳) @ 2024-02-01 10:01 UTC (permalink / raw)
To: matthias.bgg, sudeep.holla, angelogioacchino.delregno, cristian.marussi
Cc: Cylen Yao (姚立三),
wsd_upstream, linux-kernel, linux-arm-kernel, linux-mediatek
Thanks to Angelo, V2 updated.
Best,
Pin-Chuan
On Thu, 2024-02-01 at 09:44 +0100, AngeloGioacchino Del
Regno wrote:
> Il 01/02/24 05:52, Pin-Chuan Liu ha scritto:
> > 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>
> > Change-Id: Iacbe0d36ef9cc16974c013c3e94c47dc79eae52b
>
> Change-Id is something internal to you and has no meaning upstream.
> Please remove it.
>
> > ---
> > drivers/firmware/arm_scmi/mailbox.c | 8 +++++++-
> > 1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/firmware/arm_scmi/mailbox.c
> > b/drivers/firmware/arm_scmi/mailbox.c
> > index b8d470417e8f..f6fe801c2e34 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,12 @@ 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.
> > + */
>
> Besides, you need one single line for this comment
>
> Regards,
> Angelo
>
> > + if (!(smbox->chan->mbox->txdone_irq))
> > + mbox_client_txdone(smbox->chan, ret);
> > }
> >
> > static void mailbox_fetch_response(struct scmi_chan_info *cinfo,
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-01 10:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01 4:52 [PATCH] firmware: arm_scmi: Avoid to call mbox_client_txdone on txdone_irq mode Pin-Chuan Liu
2024-02-01 8:44 ` AngeloGioacchino Del Regno
2024-02-01 10:01 ` Flash Liu (劉炳傳)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®