Re: [PATCH v3 3/3] net: mctp i3c: clamp transfer lengths to the controller limits
From: Jeremy Kerr
Date: Tue Nov 24 2026 - 19:39:51 EST
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@xxxxxxx>
Looks good, thanks!
For the MCTP side of things:
Reviewed-by: Jeremy Kerr <jk@xxxxxxxxxxxxxxxxxxxx>
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?
Cheers,
Jeremy