[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<PH7PR12MB8178416B09D217B77CC43C04C0802@PH7PR12MB8178.namprd12.prod.outlook.com>
Date: Tue, 29 Apr 2025 04:37:31 +0000
From: Akhil R <akhilrajeev@...dia.com>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>, Andi Shyti
<andi.shyti@...nel.org>
CC: Laxman Dewangan <ldewangan@...dia.com>, "digetx@...il.com"
<digetx@...il.com>, "thierry.reding@...il.com" <thierry.reding@...il.com>,
Jon Hunter <jonathanh@...dia.com>, "wsa@...nel.org" <wsa@...nel.org>,
"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Thierry Reding
<treding@...dia.com>
Subject: RE: [PATCH v2 RESEND] i2c: tegra: check msg length in SMBUS block
read
> > I agree with Thierry, this check is driver independent and it
> > should be done in the library. Anyway, for now, I'm going to take
> > this as this check is now left to the drivers and it would be
> > huge to shift it somewhere else.
>
> The big picture is to support SMBUS3 somewhen which allows for 255 byte
> transfers. Besides that, it usually is not possible to check the value
> outside the driver because it has to act on the value right away. That
> is, the length comes in and exactly this number of bytes has to be read
> in the same message,
>
> > Before I merge, I want to know if you have you seen any failure
> > here? What is the reason you are sending it?
>
> Usually some devices just send more bytes because they can. A value of 0
> would be interesting in deed.
Yes. We have had issues where the client device sends '0' as length if the
transfer is terminated abruptly at the client's side. The actual fix is in the client's
driver, but this check here would ensure that the master does not run into
trouble either.
Regards,
Akhil
Powered by blists - more mailing lists