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: <7a8d8abea33b39107e7f3fef3d9272f63e01a9b4.camel@mediatek.com>
Date: Mon, 13 Oct 2025 09:22:42 +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 12/20] soc: mediatek: Add programming flow for
 unsupported subsys ID hardware

On Thu, 2025-10-09 at 13:41 +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:
> > To support hardware without subsys IDs on new SoCs, add a
> > programming
> > flow that checks whether the subsys ID is valid.
> > 
> > If the subsys ID is valid, the flow will call
> > cmdq_pkt_write_subsys()
> > and cmdq_pkt_write_mask_subsys() instead of the original
> > cmdq_pkt_write() and cmdq_pkt_write_mask().
> > 
> > If the subsys ID is invalid, the flow will call cmdq_pkt_write_pa()
> > and
> > cmdq_pkt_write_mask_pa() to achieve the same functionality.
> > 
> > Signed-off-by: Jason-JH Lin <jason-jh.lin@...iatek.com>
> > ---
> >   drivers/soc/mediatek/mtk-mmsys.c | 12 +++++++++---
> >   drivers/soc/mediatek/mtk-mutex.c |  8 ++++++--
> >   2 files changed, 15 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/soc/mediatek/mtk-mmsys.c
> > b/drivers/soc/mediatek/mtk-mmsys.c
> > index bb4639ca0b8c..0c324846e334 100644
> > --- a/drivers/soc/mediatek/mtk-mmsys.c
> > +++ b/drivers/soc/mediatek/mtk-mmsys.c
> > @@ -167,9 +167,15 @@ static void mtk_mmsys_update_bits(struct
> > mtk_mmsys *mmsys, u32 offset, u32 mask,
> >       u32 tmp;
> > 
> >       if (mmsys->cmdq_base.size && cmdq_pkt) {
> > -             ret = cmdq_pkt_write_mask(cmdq_pkt, mmsys-
> > >cmdq_base.subsys,
> > -                                       mmsys->cmdq_base.offset +
> > offset, val,
> > -                                       mask);
> > +             offset += mmsys->cmdq_base.offset;
> > +             if (mmsys->cmdq_base.subsys != CMDQ_SUBSYS_INVALID)
> > +                     ret = cmdq_pkt_write_mask_subsys(cmdq_pkt,
> > mmsys->cmdq_base.subsys,
> > +                                                      mmsys-
> > >cmdq_base.pa_base, offset,
> > +                                                      val, mask);
> > +             else /* only MMIO access, no need to check
> > mminfro_offset */
> 
> nit: fix typo -> mminfra_offset
> 

Thanks! I'll fix this.

> and also it would be nice if you could also say in a comment that all
> GCEs support
> write_mask_pa() without subsys, but it is less performant - so for
> the platforms
> that do support it, we prefer using it.
> 
> Of course that has to be properly reworded, but that's the idea
> anyway :-)
> 

OK, I'll add more comment for this and other client drivers.

/*
 * Only MMIO access, no need to check mminfra_offset.
 *
 * All GCEs support writing register PA with mask without subsys,
 * but this requires extra GCE instructions to convert the PA into
 * a format that GCE can handle, which is less performance than
 * directly using subsys. Therefore, when subsys is available,
 * we prefer to use subsys for writing register PA.
 */

Regards,
Jason-JH Lin

> after which
> 
> Reviewed-by: AngeloGioacchino Del Regno
> <angelogioacchino.delregno@...labora.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ