[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e8a5d5dae3742c571e1efbe55088ff027012b914.camel@mediatek.com>
Date: Thu, 21 Sep 2023 14:15:22 +0000
From: Jason-JH Lin (林睿祥)
<Jason-JH.Lin@...iatek.com>
To: CK Hu (胡俊光) <ck.hu@...iatek.com>,
"jassisinghbrar@...il.com" <jassisinghbrar@...il.com>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org"
<krzysztof.kozlowski+dt@...aro.org>,
"angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
Singo Chang (張興國)
<Singo.Chang@...iatek.com>,
Johnson Wang (王聖鑫)
<Johnson.Wang@...iatek.com>,
Jason-ch Chen (陳建豪)
<Jason-ch.Chen@...iatek.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Shawn Sung (宋孝謙)
<Shawn.Sung@...iatek.com>,
Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
Elvis Wang (王军) <Elvis.Wang@...iatek.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: Re: [PATCH 06/15] mailbox: mediatek: Add cmdq_mbox_stop to disable
GCE thread
Hi CK,
Thanks for the reviews.
On Tue, 2023-09-19 at 01:24 +0000, CK Hu (胡俊光) wrote:
> Hi, Jason:
>
> On Tue, 2023-09-19 at 03:21 +0800, Jason-JH.Lin wrote:
> > Add cmdq_mbox_stop to disable GCE thread.
> >
> > To support the error handling or the stop flow of the GCE loopping
> > thread, lopping thread user can call cmdq_mbox_stop to disable the
> > GCE HW thread.
> >
> > Signed-off-by: Jason-JH.Lin <jason-jh.lin@...iatek.com>
> > ---
> > drivers/mailbox/mtk-cmdq-mailbox.c | 6 ++++++
> > include/linux/mailbox/mtk-cmdq-mailbox.h | 1 +
> > 2 files changed, 7 insertions(+)
> >
> > diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c
> > b/drivers/mailbox/mtk-cmdq-mailbox.c
> > index 4d62b07c1411..8bd39fecbf00 100644
> > --- a/drivers/mailbox/mtk-cmdq-mailbox.c
> > +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
> > @@ -469,6 +469,12 @@ static void cmdq_mbox_shutdown(struct
> > mbox_chan
> > *chan)
> > spin_unlock_irqrestore(&thread->chan->lock, flags);
> > }
> >
> > +void cmdq_mbox_stop(struct mbox_chan *chan)
> > +{
> > + cmdq_mbox_shutdown(chan);
>
> cmdq_mobx_stop() is equal to cmdq_mbox_shutdown(), so client driver
> could call mbox_free_channel() to do this and this function is
> redundant.
>
I'vd tried to use cmdq->mbox.ops->shutdown(cmdq->clt->chan) in mtk-
cmdq-sec-mbox.c, but it'll call to cmdq_sec_mbox_shutdown().
If I want to call to the cmdq_mbox_shutdown in mtk-cmdq-sec-mailbox.c,
I have to find the way to get the mbox of mtk-cmdq-mailbox.c.
So I think open a API is easy solution for this.
I have called mbox_free_channel() by calling cmdq_mbox_destroy() after
cmdq_mbox_stop() in cmdq_sec_irq_notify_start() in mtk-cmdq-sec-
mailbox.c.
Regards,
Jason-JH.Lin
> Regards,
> CK
>
> > +}
> > +EXPORT_SYMBOL(cmdq_mbox_stop);
> > +
> > static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long
> > timeout)
> > {
> > struct cmdq_thread *thread = (struct cmdq_thread *)chan-
> > > con_priv;
> >
> > diff --git a/include/linux/mailbox/mtk-cmdq-mailbox.h
> > b/include/linux/mailbox/mtk-cmdq-mailbox.h
> > index a8f0070c7aa9..f3e577335acb 100644
> > --- a/include/linux/mailbox/mtk-cmdq-mailbox.h
> > +++ b/include/linux/mailbox/mtk-cmdq-mailbox.h
> > @@ -79,5 +79,6 @@ struct cmdq_pkt {
> > };
> >
> > u8 cmdq_get_shift_pa(struct mbox_chan *chan);
> > +void cmdq_mbox_stop(struct mbox_chan *chan);
> >
> > #endif /* __MTK_CMDQ_MAILBOX_H__ */
Powered by blists - more mailing lists