thunderbolt: dma_test: Use correct value for absent rings when creating paths
Subsystems (3)
PATCH 1/1 thunderbolt: dma_test: Use correct value for absent rings when creating paths
Both tb_xdomain_enable_paths() and tb_xdomain_disable_paths() expect -1, not 0, if the corresponding ring is not needed. For this reason change the driver to use correct value for the rings that are not needed.
Fixes 180b0689425c ("thunderbolt: Allow multiple DMA tunnels over a single XDomain connection")
Reported-by Pengfei Xu <[email protected]>
Tested-by Pengfei Xu <[email protected]>
Signed-off-by Mika Westerberg <[email protected]>
--- drivers/thunderbolt/dma_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/thunderbolt/dma_test.c +4 -4
@@ -192,9 +192,9 @@ static int dma_test_start_rings(struct dma_test *dt) } ret =tb_xdomain_enable_paths (dt->xd, dt->tx_hopid, - dt->tx_ring ? dt->tx_ring->hop :0 , + dt->tx_ring ? dt->tx_ring->hop :-1 , dt->rx_hopid, - dt->rx_ring ? dt->rx_ring->hop :0 ); + dt->rx_ring ? dt->rx_ring->hop :-1 );if (ret) {dma_test_free_rings (dt);return ret;
@@ -218,9 +218,9 @@ static void dma_test_stop_rings(struct dma_test *dt)tb_ring_stop (dt->tx_ring); ret =tb_xdomain_disable_paths (dt->xd, dt->tx_hopid, - dt->tx_ring ? dt->tx_ring->hop :0 , + dt->tx_ring ? dt->tx_ring->hop :-1 , dt->rx_hopid, - dt->rx_ring ? dt->rx_ring->hop :0 ); + dt->rx_ring ? dt->rx_ring->hop :-1 );if (ret)dev_warn (&dt->svc->dev,"failed to disable DMA paths\n" );
Signature · 1 line
2.39.2
Mika Westerberg
AppliedQuoted 9 lines · Mika Westerberg
Both
tb_xdomain_enable_paths()andtb_xdomain_disable_paths()expect -1, not 0, if the corresponding ring is not needed. For this reason change the driver to use correct value for the rings that are not needed.Fixes 180b0689425c ("thunderbolt: Allow multiple DMA tunnels over a single XDomain connection")Reported-by Pengfei Xu <[email protected]>Tested-by Pengfei Xu <[email protected]>Signed-off-by Mika Westerberg <[email protected]>
Applied to thunderbolt.git/fixes.