[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aNWu4hC2Yer7c2kG@shikoro>
Date: Thu, 25 Sep 2025 23:06:42 +0200
From: Wolfram Sang <wsa+renesas@...g-engineering.com>
To: Leilk Liu <leilk.liu@...iatek.com>
Cc: Andi Shyti <andi.shyti@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Qii Wang <qii.wang@...iatek.com>, Wolfram Sang <wsa@...nel.org>,
Liguo Zhang <liguo.zhang@...iatek.com>, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
Project_Global_Chrome_Upstream_Group@...iatek.com,
Chen-Yu Tsai <wenst@...omium.org>
Subject: Re: [PATCH v2] i2c: mediatek: fix potential incorrect use of
I2C_MASTER_WRRD
On Sat, Sep 06, 2025 at 04:24:06PM +0800, Leilk Liu wrote:
> From: "Leilk.Liu" <leilk.liu@...iatek.com>
>
> The old IC does not support the I2C_MASTER_WRRD (write-then-read)
> function, but the current code’s handling of i2c->auto_restart may
> potentially lead to entering the I2C_MASTER_WRRD software flow,
> resulting in unexpected bugs.
>
> Instead of repurposing the auto_restart flag, add a separate flag
> to signal I2C_MASTER_WRRD operations.
>
> Also fix handling of msgs. If the operation (i2c->op) is
> I2C_MASTER_WRRD, then the msgs pointer is incremented by 2.
> For all other operations, msgs is simply incremented by 1.
>
> Fixes: b2ed11e224a2 ("I2C: mediatek: Add driver for MediaTek MT8173 I2C controller")
> Signed-off-by: Leilk.Liu <leilk.liu@...iatek.com>
> Suggested-by: Chen-Yu Tsai <wenst@...omium.org>
> Reviewed-by: Chen-Yu Tsai <wenst@...omium.org>
Applied to for-next, thanks!
Powered by blists - more mailing lists