thunderbolt: stream: Undo more if the start fails
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 1/1 thunderbolt: stream: Undo more if the start fails
From: Josef Bacik <[email protected]>
If the receive buffers cannot be allocated or mapped, tbstream_dev_start() stops and frees the rings, but
- leaves the DMA paths through the XDomain connection enabled, with the hop IDs of rings which no longer exist;
- does not release the frame array and the pages which tbstream_dev_alloc_rx_buffers() had allocated and mapped before it failed.
--- drivers/thunderbolt/stream.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/thunderbolt/stream.c +6 -0
@@ -683,6 +683,12 @@ static int tbstream_dev_start(struct tbstream_dev *sdev) err_stop:tb_ring_stop (sdev->rx_ring.ring);tb_ring_stop (sdev->tx_ring.ring); +tb_xdomain_disable_paths (xd, sdev->out_hopid, + sdev->tx_ring.ring->hop, + sdev->in_hopid, + sdev->rx_ring.ring->hop); +if (sdev->rx_ring.frames) +tbstream_ring_free (&sdev->rx_ring); err_free_rx:tb_ring_free (sdev->rx_ring.ring); err_free_tx_buffers:
Signature · 1 line
2.56.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 11 lines
From: Josef Bacik <[email protected]>
If the receive buffers cannot be allocated or mapped,
tbstream_dev_start()stops and frees the rings, but- leaves the DMA paths through the XDomain connection enabled, with the hop IDs of rings which no longer exist;
- does not release the frame array and the pages whichtbstream_dev_alloc_rx_buffers()had allocated and mapped before it failed.
Quoted 8 lines
Fixes 6db21d817b43 ("thunderbolt: Add support for USB4STREAM")Cc stable <[email protected]>Cc Andreas Noever <[email protected]>Cc Mika Westerberg <[email protected]>Cc Yehezkel Bernat <[email protected]>Cc Alan Borzeszkowski <[email protected]>Signed-off-by Josef Bacik <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/2026102751-nibble-synapse-d406@gregkh?part=1
Hi,
Quoted 11 lines · Greg Kroah-Hartman
From: Josef Bacik <[email protected]>
If the receive buffers cannot be allocated or mapped,
tbstream_dev_start()stops and frees the rings, but- leaves the DMA paths through the XDomain connection enabled, with the hop IDs of rings which no longer exist;
- does not release the frame array and the pages whichtbstream_dev_alloc_rx_buffers()had allocated and mapped before it failed.
Quoted 4 lines
Fixes 6db21d817b43 ("thunderbolt: Add support for USB4STREAM")Cc stable <[email protected]>Cc Andreas Noever <[email protected]>Cc Mika Westerberg <[email protected]>
Do you want to take this directly via USB tree? Then,
Greg Kroah-Hartman
maintainerQuoted 14 lines · Mika Westerberg
Hi,
Quoted 11 lines · Greg Kroah-Hartman
From: Josef Bacik <[email protected]>
If the receive buffers cannot be allocated or mapped,
tbstream_dev_start()stops and frees the rings, but- leaves the DMA paths through the XDomain connection enabled, with the hop IDs of rings which no longer exist;
- does not release the frame array and the pages whichtbstream_dev_alloc_rx_buffers()had allocated and mapped before it failed.
Quoted 8 lines
Quoted 4 lines
Fixes 6db21d817b43 ("thunderbolt: Add support for USB4STREAM")Cc stable <[email protected]>Cc Andreas Noever <[email protected]>Cc Mika Westerberg <[email protected]>Do you want to take this directly via USB tree? Then,
I can, thanks!
greg k-h