Re: [PATCH v3 3/3] net: mctp i3c: clamp transfer lengths to the controller limits
From: Patil, Shubham Sanjay
Date: Tue Nov 24 2026 - 23:17:20 EST
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@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?
Yes, MCTP changes will go along with new I3C API's, whole series will stay together.
Thanks,
Shubham
Cheers,
Jeremy