[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXv+5F8ABGTRdUrf0j68cLiHZHSEFjwDOBtfTZBTOWt9APVVQ@mail.gmail.com>
Date: Mon, 18 Aug 2025 11:53:10 +0800
From: Chen-Yu Tsai <wenst@...omium.org>
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
Subject: Re: [PATCH] i2c: mediatek: fix potential incorrect use of I2C_MASTER_WRRD
On Sat, Aug 16, 2025 at 3:55 PM Leilk Liu <leilk.liu@...iatek.com> 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: 173b77e8d8fe ("i2c: mediatek: add i2c first write then read optimization")
>
> Signed-off-by: Leilk.Liu <leilk.liu@...iatek.com>
This was
Suggested-by: Chen-Yu Tsai <wenst@...omium.org>
internally because the code looked funny.
Reviewed-by: Chen-Yu Tsai <wenst@...omium.org>
Powered by blists - more mailing lists