PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 12 Apr 2023 06:34:47 +0000 (15:34 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:21:40 +0000 (16:21 +0200)
commit222f64e56b3585af82971127f8bf6497a65d0cc7
treedb5fb9a9e0c8dc0b1a7231d4b03dc2741bfb57b3
parente14379d026d56bde9ec0eb95f253de296e65ef27
PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction

[ Upstream commit 880d51c729a3fa944794feb19f605eefe55916fc ]

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: 8353813c88ef ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/endpoint/functions/pci-epf-test.c