Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
To: "fshao@chromium.org" <fshao@chromium.org>,
	"rva333@protonmail.com" <rva333@protonmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Zi-hao Huang (黃梓豪)" <Zi-hao.Huang@mediatek.com>,
	"Paul-pl Chen (陳柏霖)" <Paul-pl.Chen@mediatek.com>,
	"jassisinghbrar@gmail.com" <jassisinghbrar@gmail.com>,
	"wenst@chromium.org" <wenst@chromium.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Olivia Wen (温倩苓)" <Olivia.Wen@mediatek.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/1] soc: mediatek: mtk-cmdq: Fold the PA low half in write_pa helpers
Date: Wed, 2 Dec 2026 15:17:51 +0000	[thread overview]
Message-ID: <d0bb962dcc99df9b86700d63d3ca00119ca2fa71.camel@mediatek.com> (raw)
In-Reply-To: <92ae5a199f83ff73115dca3f21739248f06a21c1.camel@mediatek.com>

On Wed, 2026-12-02 at 18:01 +0800, Jason-JH.Lin wrote:
> On Wed, 2026-12-02 at 12:15 +0800, Fei Shao wrote:
> > On Tue, Dec 1, 2026 at 7:25 PM Jason-JH Lin
> > <jason-jh.lin@mediatek.com> wrote:
> > > 
> > > From: Jason-jh Lin <jason-jh.lin@mediatek.com>
> > > 
> > > cmdq_pkt_write_pa() and cmdq_pkt_write_mask_pa() build the
> > > WRITE_S
> > > target address as SPR << 16 | (arg & ~BIT(1)), but only load the
> > > SPR
> > > with CMDQ_ADDR_HIGH(pa_base) and pass only the register offset as
> > > the
> > > WRITE_S argument. When pa_base is not 64K aligned, its low 16
> > > bits
> > > are
> > > lost and the write lands at (pa_base & ~0xffff) + offset, while
> > > the
> > > packet still runs to EOC without error.
> > > 
> > > Fold pa_base + offset into both halves, so the SPR gets
> > > CMDQ_ADDR_HIGH(pa_base + offset) and the WRITE_S argument gets
> > > CMDQ_ADDR_LOW(pa_base + offset).
> > > 
> > > Fixes: 40dc5bbad63b ("soc: mediatek: mtk-cmdq: Extend
> > > cmdq_pkt_write API for SoCs without subsys ID")
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Jason-jh Lin <jason-jh.lin@mediatek.com>
> > > ---
> > >  drivers/soc/mediatek/mtk-cmdq-helper.c | 9 +++++----
> > >  1 file changed, 5 insertions(+), 4 deletions(-)
> > 
> > Reviewed-by: Fei Shao <fshao@chromium.org>
> 
> Hi Fei, Roman,
> 
> Thank you for the reviews.
> 
> However, I found that callers already do the same thing on their
> side.
> 
> MDP3:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=307673410774d5708232d05a977f047c03e2a4bb
> 
> SOC:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=004361f01625fda9f6d4009d0dc5a59e32b7be7d
> 
> DDP(not applied):
> https://patchwork.kernel.org/project/linux-mediatek/patch/20260325035836.2110757-4-jason-jh.lin@mediatek.com/
> 
> 
> Base on the definition to this API, pa_base means the pure base
> address
> of hardware MMIO.
> 
> I think the concept of this patch is correct, but I need to modify
> the
> usage for all callers.
> I'll send v2 including the callers parts.
> 
> If you have any suggestions. Please let me know. Thanks!
> 
> Regards,
> Jason-JH Lin


Hi all,

Please ignore this v1. As pointed out earlier, callers already pass
the low 16 bits of the address in offset, which the fold would break.
I sent a different fix in v2 that corrects client_reg->offset in
cmdq_dev_get_client_reg() instead:

https://lore.kernel.org/all/20261202151352.1541964-1-jason-jh.lin@mediatek.com/

Roman, Fei, since the patch is now different, I did not carry your
Reviewed-by tags. It would be great if you could take another look.

Thanks,
Jason-JH Lin

      reply	other threads:[~2026-12-02 15:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 11:23 [PATCH 1/1] soc: mediatek: mtk-cmdq: Fold the PA low half in write_pa helpers Jason-JH Lin
2026-12-01 15:22 ` Roman Vivchar
2026-12-02  4:15 ` Fei Shao
2026-12-02 10:01   ` Jason-JH Lin (林睿祥)
2026-12-02 15:17     ` Jason-JH Lin (林睿祥) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0bb962dcc99df9b86700d63d3ca00119ca2fa71.camel@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Olivia.Wen@mediatek.com \
    --cc=Paul-pl.Chen@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Zi-hao.Huang@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=fshao@chromium.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=rva333@protonmail.com \
    --cc=stable@vger.kernel.org \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox