Skip to content

Commit 222f64e

Browse files
shimodaygregkh
authored andcommitted
PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction
[ Upstream commit 880d51c ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e14379d commit 222f64e

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
@@ -112,7 +112,7 @@ static int pci_epf_test_data_transfer(struct pci_epf_test *epf_test,
112112
size_t len, dma_addr_t dma_remote,
113113
enum dma_transfer_direction dir)
114114
{
115-
struct dma_chan *chan = (dir == DMA_DEV_TO_MEM) ?
115+
struct dma_chan *chan = (dir == DMA_MEM_TO_DEV) ?
116116
epf_test->dma_chan_tx : epf_test->dma_chan_rx;
117117
dma_addr_t dma_local = (dir == DMA_MEM_TO_DEV) ? dma_src : dma_dst;
118118
enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;

0 commit comments

Comments
 (0)