From: Hsin-Yi Wang <hsinyi@chromium.org>
To: "jason-jh.lin" <jason-jh.lin@mediatek.com>
Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Devicetree List <devicetree@vger.kernel.org>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>,
lkml <linux-kernel@vger.kernel.org>,
Project_Global_Chrome_Upstream_Group@mediatek.com,
Hsin-Yi Wang <hsinyi@google.com>,
nancy.lin@mediatek.com, singo.chang@mediatek.com
Subject: Re: [PATCH v2 5/5] mailbox: cmdq: fix GCE can not receive hardward event
Date: Wed, 14 Jul 2021 14:32:56 +0800 [thread overview]
Message-ID: <CAJMQK-g-3-WeLMH57cJBWVt1=i7SuxwGG2Ae253igEEX9oywKA@mail.gmail.com> (raw)
In-Reply-To: <20210705053429.4380-6-jason-jh.lin@mediatek.com>
On Mon, Jul 5, 2021 at 1:35 PM jason-jh.lin <jason-jh.lin@mediatek.com> wrote:
>
> For the design of GCE hardware event signal transportation,
> evnet rx will send the event signal to all GCE event merges
> after receiving the event signal from the other hardware.
>
> Because GCE event merges need to response to event rx, their
> clocks must be enabled at that time.
>
> To make sure all the gce clock is enabled while receiving the
> hardware event, each cmdq mailbox should enable or disable
> the others gce clk at the same time.
>
> Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com>
> ---
> drivers/mailbox/mtk-cmdq-mailbox.c | 102 +++++++++++++++++++++++------
> 1 file changed, 83 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
> index fc67888a677c..44a3cf252fd5 100644
> --- a/drivers/mailbox/mtk-cmdq-mailbox.c
> +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
> @@ -19,6 +19,7 @@
>
> #define CMDQ_OP_CODE_MASK (0xff << CMDQ_OP_CODE_SHIFT)
> #define CMDQ_NUM_CMD(t) (t->cmd_buf_size / CMDQ_INST_SIZE)
> +#define CMDQ_GCE_NUM_MAX (2)
>
> #define CMDQ_CURR_IRQ_STATUS 0x10
> #define CMDQ_SYNC_TOKEN_UPDATE 0x68
> @@ -73,14 +74,16 @@ struct cmdq {
> u32 thread_nr;
> u32 irq_mask;
> struct cmdq_thread *thread;
> - struct clk *clock;
> + struct clk *clock[CMDQ_GCE_NUM_MAX];
> bool suspended;
> u8 shift_pa;
> + u32 gce_num;
> };
>
> struct gce_plat {
> u32 thread_nr;
> u8 shift;
> + u32 gce_num;
> };
>
> u8 cmdq_get_shift_pa(struct mbox_chan *chan)
> @@ -120,11 +123,15 @@ static void cmdq_init(struct cmdq *cmdq)
> {
> int i;
>
> - WARN_ON(clk_enable(cmdq->clock) < 0);
> + for (i = 0; i < cmdq->gce_num; i++)
> + WARN_ON(clk_enable(cmdq->clock[i]) < 0);
> +
You can use clk_bulk_enable instead of looping. Same for clk_bulk_disable.
<snip>
parent reply other threads:[~2021-07-14 6:33 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20210705053429.4380-6-jason-jh.lin@mediatek.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJMQK-g-3-WeLMH57cJBWVt1=i7SuxwGG2Ae253igEEX9oywKA@mail.gmail.com' \
--to=hsinyi@chromium.org \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=chunkuang.hu@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hsinyi@google.com \
--cc=jason-jh.lin@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=nancy.lin@mediatek.com \
--cc=singo.chang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).