Skip to content

Commit 880d51c

Browse files
shimodaybjorn-helgaas
authored andcommitted
PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction
In pci_epf_test_init_dma_chan() epf_test->dma_chan_rx is assigned from dma_request_channel() with DMA_DEV_TO_MEM as filter.dma_mask. However, in pci_epf_test_data_transfer() if the dir is DMA_DEV_TO_MEM, epf->dma_chan_rx should be used but instead we are using epf_test->dma_chan_tx. Fix it. Link: https://lore.kernel.org/r/[email protected] Fixes: 8353813 ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities") Tested-by: Kunihiko Hayashi <[email protected]> Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Frank Li <[email protected]>
1 parent 4c50f93 commit 880d51c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/endpoint/functions/pci-epf-test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static int pci_epf_test_data_transfer(struct pci_epf_test *epf_test,
121121
size_t len, dma_addr_t dma_remote,
122122
enum dma_transfer_direction dir)
123123
{
124-
struct dma_chan *chan = (dir == DMA_DEV_TO_MEM) ?
124+
struct dma_chan *chan = (dir == DMA_MEM_TO_DEV) ?
125125
epf_test->dma_chan_tx : epf_test->dma_chan_rx;
126126
dma_addr_t dma_local = (dir == DMA_MEM_TO_DEV) ? dma_src : dma_dst;
127127
enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;

0 commit comments

Comments
 (0)