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/20230412063447.2841177-1-yoshihiro.shimoda.uh@renesas.com Fixes: 8353813 ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities") Tested-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Frank Li <Frank.Li@nxp.com>
1 parent 4c50f93 commit 880d51c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)