lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fa46fec3f7ca25532c39e6e864ea692e19b7f5bb.camel@mediatek.com>
Date: Mon, 13 Oct 2025 09:50:48 +0000
From: Jason-JH Lin (林睿祥) <Jason-JH.Lin@...iatek.com>
To: "chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>, "AngeloGioacchino Del
 Regno" <angelogioacchino.delregno@...labora.com>, "robh@...nel.org"
	<robh@...nel.org>, "krzk+dt@...nel.org" <krzk+dt@...nel.org>,
	"jassisinghbrar@...il.com" <jassisinghbrar@...il.com>, "mchehab@...nel.org"
	<mchehab@...nel.org>, "conor+dt@...nel.org" <conor+dt@...nel.org>,
	CK Hu (胡俊光) <ck.hu@...iatek.com>
CC: "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
	Sirius Wang (王皓昱) <Sirius.Wang@...iatek.com>,
	Moudy Ho (何宗原) <Moudy.Ho@...iatek.com>,
	Xiandong Wang (王先冬)
	<Xiandong.Wang@...iatek.com>, "nicolas@...fresne.ca" <nicolas@...fresne.ca>,
	"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@...iatek.com>,
	"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	Paul-pl Chen (陳柏霖) <Paul-pl.Chen@...iatek.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"fshao@...omium.org" <fshao@...omium.org>,
	Singo Chang (張興國) <Singo.Chang@...iatek.com>,
	Nancy Lin (林欣螢) <Nancy.Lin@...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 10/20] soc: mediatek: mtk-cmdq: Add new APIs to replace
 cmdq_pkt_write() and cmdq_pkt_write_mask()

On Fri, 2025-09-05 at 09:41 +0000, CK Hu (胡俊光) wrote:
> On Wed, 2025-08-27 at 19:37 +0800, Jason-JH Lin wrote:
> > To support generating GCE write instructions using both pa_base and
> > subsys, the original cmdq_pkt_write() and cmdq_pkt_write_mask()
> > have
> > been expanded into four new APIs:
> > - Replaced cmdq_pkt_write() to cmdq_pkt_write_pa() and
> >   cmdq_pkt_write_subsys().
> > - Replaced cmdq_pkt_write_mask() to cmdq_pkt_write_mask_pa() and
> >   cmdq_pkt_write_mask_subsys().
> > 
> > The original cmdq_pkt_write() and cmdq_pkt_write_mask() will be
> > removed
> > after all CMDQ users have migrated to the new APIs.
> > 
> > Signed-off-by: Jason-JH Lin <jason-jh.lin@...iatek.com>
> > ---
> >  drivers/soc/mediatek/mtk-cmdq-helper.c | 41 +++++++++++++
> >  include/linux/soc/mediatek/mtk-cmdq.h  | 79
> > ++++++++++++++++++++++++++
> >  2 files changed, 120 insertions(+)
> > 
> > diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c
> > b/drivers/soc/mediatek/mtk-cmdq-helper.c
> > index 41e1997cdd53..7e86299213d8 100644
> > --- a/drivers/soc/mediatek/mtk-cmdq-helper.c
> > +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c
> > @@ -213,6 +213,26 @@ int cmdq_pkt_write(struct cmdq_pkt *pkt, u8
> > subsys, u16 offset, u32 value)
> >  }
> >  EXPORT_SYMBOL(cmdq_pkt_write);
> >  
> > +int cmdq_pkt_write_pa(struct cmdq_pkt *pkt, u8 subsys /*unused*/,
> > u32 pa_base,
> > +		      u16 offset, u32 value)
> 
> subsys is useless. Drop it.
> 
> > +{
> > +	int err;
> > +
> > +	err = cmdq_pkt_assign(pkt, CMDQ_THR_SPR_IDX0,
> > CMDQ_ADDR_HIGH(pa_base));
> > +	if (err < 0)
> > +		return err;
> > +
> > +	return cmdq_pkt_write_s_value(pkt, CMDQ_THR_SPR_IDX0,
> > CMDQ_ADDR_LOW(offset), value);
> > +}
> > +EXPORT_SYMBOL(cmdq_pkt_write_pa);
> > +
> > +int cmdq_pkt_write_subsys(struct cmdq_pkt *pkt, u8 subsys, u32
> > pa_base /*unused*/,
> > +			  u16 offset, u32 value)
> 
> pa_base is useless. Drop it.
> 
> > +{
> > +	return cmdq_pkt_write(pkt, subsys, offset, value);
> > +}
> > +EXPORT_SYMBOL(cmdq_pkt_write_subsys);
> > +
> >  int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys,
> >  			u16 offset, u32 value, u32 mask)
> >  {
> > @@ -230,6 +250,27 @@ int cmdq_pkt_write_mask(struct cmdq_pkt *pkt,
> > u8 subsys,
> >  }
> >  EXPORT_SYMBOL(cmdq_pkt_write_mask);
> >  
> > +int cmdq_pkt_write_mask_pa(struct cmdq_pkt *pkt, u8 subsys
> > /*unused*/, u32 pa_base,
> > +			   u16 offset, u32 value, u32 mask)
> 
> subsys is useless. Drop it.
> 
> > +{
> > +	int err;
> > +
> > +	err = cmdq_pkt_assign(pkt, CMDQ_THR_SPR_IDX0,
> > CMDQ_ADDR_HIGH(pa_base));
> > +	if (err < 0)
> > +		return err;
> > +
> > +	return cmdq_pkt_write_s_mask_value(pkt, CMDQ_THR_SPR_IDX0,
> > +					   CMDQ_ADDR_LOW(offset),
> > value, mask);
> > +}
> > +EXPORT_SYMBOL(cmdq_pkt_write_mask_pa);
> > +
> > +int cmdq_pkt_write_mask_subsys(struct cmdq_pkt *pkt, u8 subsys,
> > u32 pa_base /*unused*/,
> > +			       u16 offset, u32 value, u32 mask)
> 
> pa_base is useless. Drop it.
> 
> > +{
> > +	return cmdq_pkt_write_mask(pkt, subsys, offset, value,
> > mask);
> > +}
> > +EXPORT_SYMBOL(cmdq_pkt_write_mask_subsys);
> > +

Hi CK,

I'll drop the unused parameters.
Thanks for the reviews.

Regards,
Jason-JH Lin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ