Re: [PATCH v4 3/3] i3c: add i3cdev module to expose i3c dev in /dev

From: Adrian Hunter

Date: Tue Sep 15 2026 - 06:39:41 EST


On 15/09/2026 02:46, Sam Agazaryan wrote:
>> actual_len is a problem. Only 2 controller drivers support it.
>> No I3C device drivers support it. mctp-i3c reads len not actual_len.
>> regmap-i3c ignores len and actual_len. And its definition comment
>> is not exactly correct since it is only valid for reads.
>>
>> Despite that, the additional issue here, is what to do about a short
>> read. Seems like it should be in the uapi, but actual_len needs to
>> be fixed first.
>
> I think something we can do to get around this is to incorporate one
> of Meagan's patches
> [1] which addresses actual_len usage in all the controller drivers.
>
> With controller support we can add a field for actual_len in the UAPI struct:
>
> struct i3c_ioc_xfer {
> __u64 data;
> __u16 len;
> __u16 actual_len;
> union {
> __u8 rnw;
> __u8 cmd;
> };
> __u8 mode;
> __u8 pad[2];
> };
>
> As a follow up, I can also help clean up other i3c drivers in future
> changes, such as mctp-i3c
> since at that point we should have actual_len support across all the
> controller drivers.

It is less confusing if it is all fixed up in one patch. Fix the
comment on actual_len. Make all controller drivers use actual_len
not len for returning the length of data read. And fix up mctp-i3c too.

>
> Thanks,
> Sam
>
> [1] https://lore.kernel.org/r/20260911210935.1353126-3-meaganlloyd@xxxxxxxxxxxxxxxxxxx