Re: [PATCH v3 8/9] mailbox: mediatek: Add CMDQ secure mailbox driver

From: Jason-JH Lin (林睿祥)
Date: Wed Jan 03 2024 - 01:54:41 EST


On Thu, 2023-12-28 at 05:31 +0000, CK Hu (胡俊光) wrote:
> Hi, Jason:
>
> On Fri, 2023-12-22 at 12:52 +0800, Jason-JH.Lin wrote:
> > To support secure video path feature, GCE have to read/write
> > registgers
> > in the secure world. GCE will enable the secure access permission
> > to
> > the
> > HW who wants to access the secure content buffer.
> >
> > Add CMDQ secure mailbox driver to make CMDQ client user is able to
> > sending their HW settings to the secure world. So that GCE can
> > execute
> > all instructions to configure HW in the secure world.
> >
> > Signed-off-by: Jason-JH.Lin <jason-jh.lin@xxxxxxxxxxxx>
> > ---
>
> [snip]
>
> > +
> > +static struct mbox_chan *cmdq_sec_mbox_of_xlate(struct
> > mbox_controller *mbox,
> > + const struct
> > of_phandle_args *sp)
> > +{
> > + struct cmdq_thread *thread;
> > + struct cmdq_sec_thread *sec_thread;
> > + int idx = sp->args[0];
> > +
> > + if (mbox->num_chans <= idx) {
> > + pr_err("invalid thrd-idx:%u", idx);
> > + return ERR_PTR(-EINVAL);
> > + }
> > +
> > + thread = (struct cmdq_thread *)mbox->chans[idx].con_priv;
> > + thread->chan = &mbox->chans[idx];
> > + thread->priority = sp->args[1];
> > + sec_thread = container_of(thread, struct cmdq_sec_thread,
> > thread);
> > + sec_thread->timeout_ms = CMDQ_NO_TIMEOUT;
>
> The timeout_ms could only be CMDQ_NO_TIMEOUT, so this driver just has
> no timeout. So drop timeout_ms.
>

OK, I'll drop this.

Regards,
Jason-JH.Lin

> Regards,
> CK
>
> > +
> > + return &mbox->chans[idx];
> > +}
> >