From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DCECC77B6E for ; Wed, 12 Apr 2023 04:23:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229509AbjDLEX3 (ORCPT ); Wed, 12 Apr 2023 00:23:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjDLEX1 (ORCPT ); Wed, 12 Apr 2023 00:23:27 -0400 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37848268A; Tue, 11 Apr 2023 21:23:25 -0700 (PDT) Received: from unknown (HELO iyokan2-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 12 Apr 2023 13:23:23 +0900 Received: from mail.mfilter.local (mail-arc02.css.socionext.com [10.213.46.40]) by iyokan2-ex.css.socionext.com (Postfix) with ESMTP id D426D2059053; Wed, 12 Apr 2023 13:23:23 +0900 (JST) Received: from kinkan2.css.socionext.com ([172.31.9.51]) by m-FILTER with ESMTP; Wed, 12 Apr 2023 13:23:23 +0900 Received: from [10.212.156.72] (unknown [10.212.156.72]) by kinkan2.css.socionext.com (Postfix) with ESMTP id F1E7BB6341; Wed, 12 Apr 2023 13:23:22 +0900 (JST) Message-ID: Date: Wed, 12 Apr 2023 13:23:22 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v11 02/13] PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction To: Yoshihiro Shimoda , lpieralisi@kernel.org, robh+dt@kernel.org, kw@linux.com, bhelgaas@google.com, jingoohan1@gmail.com, gustavo.pimentel@synopsys.com Cc: Sergey.Semin@baikalelectronics.ru, marek.vasut+renesas@gmail.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Frank Li References: <20230310123510.675685-1-yoshihiro.shimoda.uh@renesas.com> <20230310123510.675685-3-yoshihiro.shimoda.uh@renesas.com> Content-Language: en-US From: Kunihiko Hayashi In-Reply-To: <20230310123510.675685-3-yoshihiro.shimoda.uh@renesas.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Shimoda-san, On 2023/03/10 21:34, 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 "NOT OKAY" on eDMA > environment. I also encounted this issue and found this patch before sending my fixes patch for the same diff as this one. And I confirmed the issue is fixed using pcitest with eDMA on UniPhier SoCs. For 02/13 patch if not already merged: Tested-by: Kunihiko Hayashi Thank you, > > Fixes: 8353813c88ef ("PCI: endpoint: Enable DMA tests for endpoints with > DMA capabilities") > Signed-off-by: Yoshihiro Shimoda > Reviewed-by: Frank Li > --- > 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 0f9d2ec822ac..172e5ac0bd96 100644 > --- a/drivers/pci/endpoint/functions/pci-epf-test.c > +++ b/drivers/pci/endpoint/functions/pci-epf-test.c > @@ -112,7 +112,7 @@ static int pci_epf_test_data_transfer(struct > pci_epf_test *epf_test, > size_t len, dma_addr_t dma_remote, > enum dma_transfer_direction dir) > { > - struct dma_chan *chan = (dir == DMA_DEV_TO_MEM) ? > + struct dma_chan *chan = (dir == DMA_MEM_TO_DEV) ? > epf_test->dma_chan_tx : > epf_test->dma_chan_rx; > 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; --- Best Regards Kunihiko Hayashi