Skip to content

Commit 70c2e03

Browse files
committed
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: 180b068 ("thunderbolt: Allow multiple DMA tunnels over a single XDomain connection") Cc: [email protected] Reported-by: Pengfei Xu <[email protected]> Tested-by: Pengfei Xu <[email protected]> Signed-off-by: Mika Westerberg <[email protected]>
1 parent 44c026a commit 70c2e03

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/thunderbolt/dma_test.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ static int dma_test_start_rings(struct dma_test *dt)
192192
}
193193

194194
ret = tb_xdomain_enable_paths(dt->xd, dt->tx_hopid,
195-
dt->tx_ring ? dt->tx_ring->hop : 0,
195+
dt->tx_ring ? dt->tx_ring->hop : -1,
196196
dt->rx_hopid,
197-
dt->rx_ring ? dt->rx_ring->hop : 0);
197+
dt->rx_ring ? dt->rx_ring->hop : -1);
198198
if (ret) {
199199
dma_test_free_rings(dt);
200200
return ret;
@@ -218,9 +218,9 @@ static void dma_test_stop_rings(struct dma_test *dt)
218218
tb_ring_stop(dt->tx_ring);
219219

220220
ret = tb_xdomain_disable_paths(dt->xd, dt->tx_hopid,
221-
dt->tx_ring ? dt->tx_ring->hop : 0,
221+
dt->tx_ring ? dt->tx_ring->hop : -1,
222222
dt->rx_hopid,
223-
dt->rx_ring ? dt->rx_ring->hop : 0);
223+
dt->rx_ring ? dt->rx_ring->hop : -1);
224224
if (ret)
225225
dev_warn(&dt->svc->dev, "failed to disable DMA paths\n");
226226

0 commit comments

Comments
 (0)