mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
thunderbolt: Fixes for v7.2-rc7
This includes following USB4/Thunderbolt fixes: - Correct DMA unmapping of USB4STREAM driver. - Fix indexing of bandwidth groups. - More bounds checking for DROM parsing. - Fix ICM USB4 router operation messaging. - Fix crash on ICM error path. All these have been in linux-next with no reported issues. -----BEGIN PGP SIGNATURE----- iQJUBAABCgA+FiEEVTdhRGBbNzLrSUBaAP2fSd+ZWKAFAmpwbsYgHG1pa2Eud2Vz dGVyYmVyZ0BsaW51eC5pbnRlbC5jb20ACgkQAP2fSd+ZWKCoIBAAiGFiQm4tJfJJ xJaYTF0F1Zk76JivRfdM/roVe0j/USMKrsHpPy4v5PoOHqonQm1nWXeOag8ok7sZ alV7LLyZw0YVy7CiaDIMlmozm8x6sSqglHrDU+DWKPlzEjEVH0oLB/WS6l7ALQA3 K6ODuPW7SHSNFvH2p7+AOt5ARHzgNqw7hrveaJyzQELMyGCg77gq0ePkCUqvMKDs KyHMjBpe00WK9VJDiW8rBLtkTM2H98DX4aaK2ECt0mwXLXhSTGPO7Uck2NVK3PnG Oz3KntVXfR6tYoSA90ypvwQVitEzROWB1FFLqswtyMG6I/S6nX1ip8dg2U0iY+lI jxBd538mymZNWpxqWZlSK1NXEernTePqPY70bM5dxsB/DSnCjhEmgO3RzlTjcsao Trxinp9tKxoHKwVjlPUNxx41kRGgRMi5QErcQgKap0xn5wVLC2UxPx67AtLPPYp0 sMZEylcgeo5VC5j71ySfpUYlk8OkonK1KtHoaqh1vwazX7PAeKfcw5FfG07p9lgH Ya64gdoNxU+inWYLyvj9VA6e5Lp17lZQfFvS4KkUZrsVe2LHqQMQy5DEtf+LmOBP ZrewtFfGNv3ZLN5JtGT+p5yZxxtaNy+WzYK3FoZ1Pfkw79VmpuyzxjckMsa68Dcs iIGhb2AswQn9Qh1JUf+XbZ9aHWB/M60= =TCja -----END PGP SIGNATURE----- Merge tag 'thunderbolt-for-v7.2-rc7' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus Mika writes: thunderbolt: Fixes for v7.2-rc7 This includes following USB4/Thunderbolt fixes: - Correct DMA unmapping of USB4STREAM driver. - Fix indexing of bandwidth groups. - More bounds checking for DROM parsing. - Fix ICM USB4 router operation messaging. - Fix crash on ICM error path. All these have been in linux-next with no reported issues. * tag 'thunderbolt-for-v7.2-rc7' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Initialize ->domain_released completion before it is being used thunderbolt: icm: Preserve USB4 proxy data-valid bit thunderbolt: Bound the DROM dual link port number before indexing sw->ports thunderbolt: Fix bandwidth group reservation indexing thunderbolt: stream: Unmap buffers with mapped size
This commit is contained in:
commit
134044e9fa
|
|
@ -394,9 +394,16 @@ static int tb_drom_parse_entry_port(struct tb_switch *sw,
|
|||
return -EIO;
|
||||
}
|
||||
port->link_nr = entry->link_nr;
|
||||
if (entry->has_dual_link_port)
|
||||
if (entry->has_dual_link_port) {
|
||||
if (entry->dual_link_port_nr > sw->config.max_port_number) {
|
||||
tb_sw_warn(sw,
|
||||
"port entry has invalid dual link port number %u\n",
|
||||
entry->dual_link_port_nr);
|
||||
return -EIO;
|
||||
}
|
||||
port->dual_link_port =
|
||||
&port->sw->ports[entry->dual_link_port_nr];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2341,7 +2341,7 @@ static int icm_usb4_switch_op(struct tb_switch *sw, u16 opcode, u32 *metadata,
|
|||
if (tx_data_len) {
|
||||
request.data_len_valid |= ICM_USB4_SWITCH_DATA_VALID;
|
||||
if (tx_data_len < ARRAY_SIZE(request.data))
|
||||
request.data_len_valid =
|
||||
request.data_len_valid |=
|
||||
tx_data_len & ICM_USB4_SWITCH_DATA_LEN_MASK;
|
||||
memcpy(request.data, tx_data, tx_data_len * sizeof(u32));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1226,6 +1226,8 @@ int nhi_probe(struct tb_nhi *nhi)
|
|||
return dev_err_probe(dev, res, "NHI specific init failed\n");
|
||||
}
|
||||
|
||||
init_completion(&nhi->domain_released);
|
||||
|
||||
tb = nhi_select_cm(nhi);
|
||||
if (!tb)
|
||||
return dev_err_probe(dev, -ENODEV,
|
||||
|
|
@ -1233,8 +1235,6 @@ int nhi_probe(struct tb_nhi *nhi)
|
|||
|
||||
dev_dbg(dev, "NHI initialized, starting thunderbolt\n");
|
||||
|
||||
init_completion(&nhi->domain_released);
|
||||
|
||||
res = tb_domain_add(tb, host_reset);
|
||||
if (res) {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ static void tbstream_ring_free(struct tbstream_ring *ring)
|
|||
|
||||
if (sf->frame.buffer_phy)
|
||||
dma_unmap_page(dma_dev, sf->frame.buffer_phy,
|
||||
tb_ring_frame_size(&sf->frame), dir);
|
||||
TB_MAX_FRAME_SIZE, dir);
|
||||
sf->frame.buffer_phy = 0;
|
||||
if (sf->page)
|
||||
__free_page(sf->page);
|
||||
|
|
|
|||
|
|
@ -609,7 +609,7 @@ static int tb_consumed_dp_bandwidth(struct tb *tb,
|
|||
int *consumed_up,
|
||||
int *consumed_down)
|
||||
{
|
||||
int group_reserved[MAX_GROUPS] = {};
|
||||
int group_reserved[MAX_GROUPS + 1] = {};
|
||||
struct tb_cm *tcm = tb_priv(tb);
|
||||
struct tb_tunnel *tunnel;
|
||||
bool downstream;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user