* [PATCH RESEND] PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction
@ 2023-02-21 10:17 Yoshihiro Shimoda
2023-02-21 20:08 ` Bjorn Helgaas
0 siblings, 1 reply; 4+ messages in thread
From: Yoshihiro Shimoda @ 2023-02-21 10:17 UTC (permalink / raw)
To: lpieralisi, kw, mani, kishon, bhelgaas, Frank.Li
Cc: linux-pci, Yoshihiro Shimoda
In the 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 the pci_epf_test_data_transfer(),
if the dir is DMA_DEV_TO_MEM, it should use epf->dma_chan_rx,
but it used epf_test->dma_chan_tx. So, fix it. Otherwise,
results of pcitest with enabled DMA will be NG on eDMA
environment.
Fixes: 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with DMA capabilities")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 55283d2379a6..3a720ed4655e 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -113,7 +113,7 @@ static int pci_epf_test_data_transfer(struct pci_epf_test *epf_test,
enum dma_transfer_direction dir)
{
struct dma_chan *chan = (dir == DMA_DEV_TO_MEM) ?
- epf_test->dma_chan_tx : epf_test->dma_chan_rx;
+ epf_test->dma_chan_rx : epf_test->dma_chan_tx;
dma_addr_t dma_local = (dir == DMA_MEM_TO_DEV) ? dma_src : dma_dst;
enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
struct pci_epf *epf = epf_test->epf;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND] PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction
2023-02-21 10:17 [PATCH RESEND] PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction Yoshihiro Shimoda
@ 2023-02-21 20:08 ` Bjorn Helgaas
2023-02-22 0:49 ` Yoshihiro Shimoda
0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2023-02-21 20:08 UTC (permalink / raw)
To: Yoshihiro Shimoda
Cc: lpieralisi, kw, mani, kishon, bhelgaas, Frank.Li, linux-pci
On Tue, Feb 21, 2023 at 07:17:06PM +0900, Yoshihiro Shimoda wrote:
> In the 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 the pci_epf_test_data_transfer(),
> if the dir is DMA_DEV_TO_MEM, it should use epf->dma_chan_rx,
> but it used epf_test->dma_chan_tx. So, fix it. Otherwise,
> results of pcitest with enabled DMA will be NG on eDMA
> environment.
"NG"?
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH RESEND] PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction
2023-02-21 20:08 ` Bjorn Helgaas
@ 2023-02-22 0:49 ` Yoshihiro Shimoda
2023-02-22 19:53 ` Bjorn Helgaas
0 siblings, 1 reply; 4+ messages in thread
From: Yoshihiro Shimoda @ 2023-02-22 0:49 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: lpieralisi@kernel.org, kw@linux.com, mani@kernel.org,
kishon@kernel.org, bhelgaas@google.com, Frank.Li@nxp.com,
linux-pci@vger.kernel.org
Hi Bjorn,
> From: Bjorn Helgaas, Sent: Wednesday, February 22, 2023 5:08 AM
>
> On Tue, Feb 21, 2023 at 07:17:06PM +0900, Yoshihiro Shimoda wrote:
> > In the 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 the pci_epf_test_data_transfer(),
> > if the dir is DMA_DEV_TO_MEM, it should use epf->dma_chan_rx,
> > but it used epf_test->dma_chan_tx. So, fix it. Otherwise,
> > results of pcitest with enabled DMA will be NG on eDMA
> > environment.
>
> "NG"?
I'm sorry, I completely mistook this.
This should be "NOT OKAY", not "NG".
I'll fix this patch on v2.
Best regards,
Yoshihiro Shimoda
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND] PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction
2023-02-22 0:49 ` Yoshihiro Shimoda
@ 2023-02-22 19:53 ` Bjorn Helgaas
0 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2023-02-22 19:53 UTC (permalink / raw)
To: Yoshihiro Shimoda
Cc: lpieralisi@kernel.org, kw@linux.com, mani@kernel.org,
kishon@kernel.org, bhelgaas@google.com, Frank.Li@nxp.com,
linux-pci@vger.kernel.org
On Wed, Feb 22, 2023 at 12:49:14AM +0000, Yoshihiro Shimoda wrote:
> > From: Bjorn Helgaas, Sent: Wednesday, February 22, 2023 5:08 AM
> > On Tue, Feb 21, 2023 at 07:17:06PM +0900, Yoshihiro Shimoda wrote:
> > > In the 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 the pci_epf_test_data_transfer(),
> > > if the dir is DMA_DEV_TO_MEM, it should use epf->dma_chan_rx,
> > > but it used epf_test->dma_chan_tx. So, fix it. Otherwise,
> > > results of pcitest with enabled DMA will be NG on eDMA
> > > environment.
> >
> > "NG"?
>
> I'm sorry, I completely mistook this.
> This should be "NOT OKAY", not "NG".
That should match something printed by pcitest, which would be a good
thing. Thanks for expanding it for non-pcitest experts like me!
Bjorn
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-22 19:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-21 10:17 [PATCH RESEND] PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction Yoshihiro Shimoda
2023-02-21 20:08 ` Bjorn Helgaas
2023-02-22 0:49 ` Yoshihiro Shimoda
2023-02-22 19:53 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).