[PATCH v3 3/3] net: mctp i3c: clamp transfer lengths to the controller limits

Patil, Shubham Sanjay shubpati at amd.com
Tue Nov 24 20:17:04 PST 2026


Hi Jeremy,

On 11/25/2026 6:09 AM, Jeremy Kerr wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> Hi Shubham,
> 
>> mctp_i3c_setup() takes the maximum read and write lengths straight from
>> GETMRL and GETMWL. Those describe the endpoint alone, so on a controller
>> with a smaller limit every read can be built too large and rejected.
>> Transmit packets can similarly reach the controller even when they are
>> larger than its transmit buffer. The receive path also allocates an skb
>> for data the hardware can never deliver.
>>
>> Use i3c_device_get_max_read_xfer_bytes() and
>> i3c_device_get_max_write_xfer_bytes() instead, which return the smaller
>> of the endpoint and controller limits.
>>
>> Behaviour is unchanged when neither reports a limit, as the helpers
>> return 0 exactly as the GETMRL and GETMWL fields do today.
>>
>> Signed-off-by: Shubham Patil <shubhamsanjay.patil at amd.com>
> 
> Looks good, thanks!
> 
> For the MCTP side of things:
> 
> Reviewed-by: Jeremy Kerr <jk at codeconstruct.com.au>
> 
> Since this depends on the new i3c helpers, which (I assume) would be
> going through the i3c tree, I assume the whole series should stay
> together?

Yes, MCTP changes will go along with new I3C API's, whole series will 
stay together.


Thanks,
Shubham

> 
> Cheers,
> 
> 
> Jeremy




More information about the linux-i3c mailing list