* Re: [PATCH v2 5/5] mailbox: cmdq: fix GCE can not receive hardward event
[not found] ` <20210705053429.4380-6-jason-jh.lin@mediatek.com>
@ 2021-07-14 6:32 ` Hsin-Yi Wang
0 siblings, 0 replies; only message in thread
From: Hsin-Yi Wang @ 2021-07-14 6:32 UTC (permalink / raw)
To: jason-jh.lin
Cc: Chun-Kuang Hu, Matthias Brugger, Devicetree List,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
moderated list:ARM/Mediatek SoC support, lkml,
Project_Global_Chrome_Upstream_Group, Hsin-Yi Wang, nancy.lin,
singo.chang
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>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-14 6:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20210705053429.4380-1-jason-jh.lin@mediatek.com>
[not found] ` <20210705053429.4380-6-jason-jh.lin@mediatek.com>
2021-07-14 6:32 ` [PATCH v2 5/5] mailbox: cmdq: fix GCE can not receive hardward event Hsin-Yi Wang
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).