Re: [PATCH v2 RESEND] i2c: tegra: check msg length in SMBUS block read

Wolfram Sang
2025-04-29T03:18:01Z

[-- Attachment #1: Type: text/plain, Size: 759 bytes --]

> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]