Re: [PATCH v2] thunderbolt: Clamp DMA tunnel credits to what a hop register can hold

Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/[email protected]>
Newsgroups gmane.linux.usb.general,gmane.linux.kernel
Message-ID <[email protected]>
Hi,

On Mon, Aug 10, 2026 at 12:14:13PM +0000, Fan Ye via B4 Relay wrote:
> From: Fan Ye <[email protected]>
> 
> struct tb_regs_hop::initial_credits is 7 bits wide, but neither of the
> values tb_tunnel_alloc_dma() picks from is bounded by that: the
> dma_credits module parameter has no upper limit, and neither does the
> host router's baMaxHI. A larger count survives until tb_path_activate()
> copies it into the register and keeps the low bits, leaving the path on
> a credit count nobody asked for.
> 
> Clamp it in tb_tunnel_alloc_dma(), the only entry point for DMA tunnels;
> every step below it can only lower the value further. Carry the count in
> an unsigned int while at it.
> 
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: Fan Ye <[email protected]>

Applied to thunderbolt.git/next, thanks!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.