[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ab70eb5e0399f11c8d0b55cbf698f25657c7758.camel@mediatek.com>
Date: Mon, 13 Oct 2025 06:24:19 +0000
From: Jason-JH Lin (林睿祥) <Jason-JH.Lin@...iatek.com>
To: "robh@...nel.org" <robh@...nel.org>, "krzk+dt@...nel.org"
<krzk+dt@...nel.org>, AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>, "conor+dt@...nel.org"
<conor+dt@...nel.org>, "mchehab@...nel.org" <mchehab@...nel.org>,
"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>,
"jassisinghbrar@...il.com" <jassisinghbrar@...il.com>
CC: "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
Sirius Wang (王皓昱) <Sirius.Wang@...iatek.com>,
Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
Xiandong Wang (王先冬)
<Xiandong.Wang@...iatek.com>, "nicolas@...fresne.ca" <nicolas@...fresne.ca>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@...iatek.com>,
"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
Paul-pl Chen (陳柏霖) <Paul-pl.Chen@...iatek.com>,
Moudy Ho (何宗原) <Moudy.Ho@...iatek.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Singo Chang (張興國) <Singo.Chang@...iatek.com>,
"wenst@...omium.org" <wenst@...omium.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "matthias.bgg@...il.com"
<matthias.bgg@...il.com>
Subject: Re: [PATCH v7 05/20] soc: mediatek: mtk-cmdq: Add
cmdq_pkt_jump_rel_temp() for removing shift_pa
On Thu, 2025-10-09 at 13:27 +0200, AngeloGioacchino Del Regno wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> Il 27/08/25 13:37, Jason-JH Lin ha scritto:
> > Since shift_pa will be stored into the cmdq_mobx_priv of cmdq_pkt,
> > all
> > the shif_pa parameters in CMDQ helper APIs can be removed.
> >
> > Add cmdq_pkt_jump_rel_temp() for the current users of
> > cmdq_pkt_jump_rel(),
> > and then remove shift_pa after all users have migrated to the new
> > APIs.
> >
> > Fixes: ade176534112 ("soc: mediatek: cmdq: Add parameter shift_pa
> > to cmdq_pkt_jump()")
> > Signed-off-by: Jason-JH Lin <jason-jh.lin@...iatek.com>
> > ---
> > drivers/soc/mediatek/mtk-cmdq-helper.c | 6 ++++++
> > include/linux/soc/mediatek/mtk-cmdq.h | 9 +++++++++
> > 2 files changed, 15 insertions(+)
> >
> > diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c
> > b/drivers/soc/mediatek/mtk-cmdq-helper.c
> > index 8feeaa320359..4b1591e5b1ae 100644
> > --- a/drivers/soc/mediatek/mtk-cmdq-helper.c
> > +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c
> > @@ -515,6 +515,12 @@ int cmdq_pkt_jump_rel(struct cmdq_pkt *pkt,
> > s32 offset, u8 shift_pa)
> > }
> > EXPORT_SYMBOL(cmdq_pkt_jump_rel);
> >
> > +int cmdq_pkt_jump_rel_temp(struct cmdq_pkt *pkt, s32 offset, u8
> > shift_pa)
> > +{
> > + return cmdq_pkt_jump_rel(pkt, offset, shift_pa);
> > +}
> > +EXPORT_SYMBOL(cmdq_pkt_jump_rel_temp);
> > +
> > int cmdq_pkt_eoc(struct cmdq_pkt *pkt)
> > {
> > struct cmdq_instruction inst = {
> > diff --git a/include/linux/soc/mediatek/mtk-cmdq.h
> > b/include/linux/soc/mediatek/mtk-cmdq.h
> > index 0c3906e8ad19..5e3a0e807980 100644
> > --- a/include/linux/soc/mediatek/mtk-cmdq.h
> > +++ b/include/linux/soc/mediatek/mtk-cmdq.h
> > @@ -377,6 +377,9 @@ static inline int cmdq_pkt_jump(struct cmdq_pkt
> > *pkt, dma_addr_t addr, u8 shift_
> > */
> > int cmdq_pkt_jump_rel(struct cmdq_pkt *pkt, s32 offset, u8
> > shift_pa);
> >
> > +/* This wrapper has to be removed after all users migrated to
> > jump_rel */
> > +int cmdq_pkt_jump_rel_temp(struct cmdq_pkt *pkt, s32 offset, u8
> > shift_pa);
>
> /**
> * cmdq_pkt_jump_rel_v0() - Temporary wrapper for new CMDQ helper
> API
> * @pkt: xyz (copy the descriptions from cmdq_pkt_jump_rel() here)
> * @offset: whatever
> * @shift_pa: [DEPRECATED] abc
> *
> * This function is a temporary wrapper that was introduced only for
> ease of
> * migration of the many users of the CMDQ API located in multiple
> kernel
> * subsystems.
> *
> * This has to be removed after all users are migrated to the newer
> CMDQ API.
> */
> static inline int cmdq_pkt_jump_rel_v0(struct cmdq_pkt *pkt, s32
> offset, u8 shift_pa)
> {
> return cmdq_pkt_jump_rel(pkt, offset, shift_pa);
> }
>
> ...so you don't even need to add it in mtk-cmdq-helper.c: less files
> to care about.
>
Got it!
I'll use inline function in cmdq header file and remove the mtk-cmdq-
helper.c one.
Thanks,
Jason-JH Lin
> > +
> > /**
> > * cmdq_pkt_eoc() - Append EOC and ask GCE to generate an IRQ at
> > end of execution
> > * @pkt: The CMDQ packet
> > @@ -506,6 +509,12 @@ static inline int cmdq_pkt_jump_rel(struct
> > cmdq_pkt *pkt, s32 offset, u8 shift_p
> > return -EINVAL;
> > }
> >
> > +/* This wrapper has to be removed after all users migrated to
> > jump_rel */
> > +static inline int cmdq_pkt_jump_rel_temp(struct cmdq_pkt *pkt, s32
> > offset, u8 shift_pa)
> > +{
> > + return -EIMVAL;
> > +}
> > +
> > static inline int cmdq_pkt_eoc(struct cmdq_pkt *pkt)
> > {
> > return -EINVAL;
>
>
>
Powered by blists - more mailing lists