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] [day] [month] [year] [list]
Message-ID: <1f1377ebec26f767a4af9a0c542817be7cfaeddc.camel@mediatek.com>
Date: Thu, 23 Oct 2025 04:03:30 +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: "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
	"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
	Sirius Wang (王皓昱) <Sirius.Wang@...iatek.com>,
	Moudy Ho (何宗原) <Moudy.Ho@...iatek.com>,
	Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
	Xiandong Wang (王先冬)
	<Xiandong.Wang@...iatek.com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "nicolas@...fresne.ca"
	<nicolas@...fresne.ca>, Paul-pl Chen (陳柏霖)
	<Paul-pl.Chen@...iatek.com>, "linux-mediatek@...ts.infradead.org"
	<linux-mediatek@...ts.infradead.org>, Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@...iatek.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"fshao@...omium.org" <fshao@...omium.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 v8 10/20] soc: mediatek: mtk-cmdq: Extend cmdq_pkt_write
 API for SoCs without subsys ID

On Mon, 2025-10-20 at 12:04 +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 17/10/25 08:44, Jason-JH Lin ha scritto:
> > This patch extends the cmdq_pkt_write API to support SoCs that do
> > not
> > have subsys ID mapping by introducing new register write APIs:
> > - cmdq_pkt_write_pa() and cmdq_pkt_write_subsys() replace
> >    cmdq_pkt_write()
> > - cmdq_pkt_write_mask_pa() and cmdq_pkt_write_mask_subsys() replace
> >    cmdq_pkt_write_mask()
> > 
> > To ensure consistent function pointer interfaces, both
> > cmdq_pkt_write_pa() and cmdq_pkt_write_subsys() provide subsys and
> > pa_base parameters. This unifies how register writes are invoked,
> > regardless of whether subsys ID is supported by the device.
> > 
> > All GCEs support writing registers by PA (with mask) without
> > subsys,
> > but this requires extra GCE instructions to convert the PA into a
> > GCE
> > readable format, reducing performance compared to using subsys
> > directly.
> > Therefore, subsys is preferred for register writes when available.
> > 
> > API documentation and function pointer declarations in
> > cmdq_client_reg
> > have been updated. The original write APIs will be removed after
> > all
> > CMDQ users transition to the new interfaces.
> > 
> > Signed-off-by: Jason-JH Lin <jason-jh.lin@...iatek.com>
> > ---
> >   drivers/soc/mediatek/mtk-cmdq-helper.c | 54 +++++++++++++++++
> >   include/linux/soc/mediatek/mtk-cmdq.h  | 83
> > ++++++++++++++++++++++++++
> >   2 files changed, 137 insertions(+)
> > 
> 
> > diff --git a/include/linux/soc/mediatek/mtk-cmdq.h
> > b/include/linux/soc/mediatek/mtk-cmdq.h
> > index 154d0511a0ad..f6dc43c036bd 100644
> > --- a/include/linux/soc/mediatek/mtk-cmdq.h
> > +++ b/include/linux/soc/mediatek/mtk-cmdq.h
> > @@ -57,6 +57,10 @@ struct cmdq_client_reg {
> >       phys_addr_t pa_base;
> >       u16 offset;
> >       u16 size;
> > +     int (*reg_write)(struct cmdq_pkt *pkt, u8 subsys, u32
> > pa_base,
> > +                      u16 offset, u32 value);
> 
> (*pkt_write)
> 
> > +     int (*reg_write_mask)(struct cmdq_pkt *pkt, u8 subsys, u32
> > pa_base,
> > +                           u16 offset, u32 value, u32 mask);
> 
> (*pkt_write_mask)
> 
> those names make a lot more sense.
> 
Hi Angelo,

The reason why I use reg_write/reg_write_mask is to imply these APIs
only provide writing HW register address function, not writing DRAM
address.
So we don't need to care about mminfra_offset in these APIs.

I can add comment for this.

What do you think?
Or should I change its name to pkt_write/pkt_write_amsk?

Regards,
Jason-JH Lin

> After applying the requested changes,
> 
> Reviewed-by: AngeloGioacchino Del Regno
> <angelogioacchino.delregno@...labora.com>
> 
> >   };

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ