[PATCH 1/1] soc: mediatek: mtk-cmdq: Fold the PA low half in write_pa helpers
Fei Shao
fshao at chromium.org
Tue Dec 1 20:15:18 PST 2026
On Tue, Dec 1, 2026 at 7:25 PM Jason-JH Lin <jason-jh.lin at mediatek.com> wrote:
>
> From: Jason-jh Lin <jason-jh.lin at 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 at vger.kernel.org
> Signed-off-by: Jason-jh Lin <jason-jh.lin at mediatek.com>
> ---
> drivers/soc/mediatek/mtk-cmdq-helper.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
Reviewed-by: Fei Shao <fshao at chromium.org>
More information about the linux-arm-kernel
mailing list