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 X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FE20C3F2D1 for ; Wed, 4 Mar 2020 05:10:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D386220665 for ; Wed, 4 Mar 2020 05:10:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="SXGn1tDV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725774AbgCDFK5 (ORCPT ); Wed, 4 Mar 2020 00:10:57 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:49422 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725271AbgCDFK4 (ORCPT ); Wed, 4 Mar 2020 00:10:56 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0245Aj6M021833; Tue, 3 Mar 2020 23:10:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1583298645; bh=3uVn5qRo3GIhs0+ZbtDUve7iCbFJIoICLR+tQsFcDj0=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=SXGn1tDVA49ju/vtsxC1o7ab7U82Vbrb7oPVdm60wwpx+s3pa/tzbojstV6oHqrQ0 TCCCzqJRKfwlMG5MaX/ZNGvIh6DeXwu738wDedIw60zeVhn/2wd7en+Wliu1+/iKGs fGWrk6Ry3WfMkbjoQBF3Kc8Ihw9lseAiQADPaCds= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0245AjBD049080 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 3 Mar 2020 23:10:45 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Tue, 3 Mar 2020 23:10:45 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Tue, 3 Mar 2020 23:10:45 -0600 Received: from [10.24.69.159] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0245AfCp025360; Tue, 3 Mar 2020 23:10:42 -0600 Subject: Re: [PATCH 1/5] PCI: endpoint: functions/pci-epf-test: Add DMA support to transfer data To: Alan Mikhak CC: , , Bjorn Helgaas , , , linux-pci , References: <20200225091130.29467-1-kishon@ti.com> <1582665067-20462-1-git-send-email-alan.mikhak@sifive.com> <7e1202a3-037b-d1f3-f2bf-1b8964787ebd@ti.com> From: Kishon Vijay Abraham I Message-ID: Date: Wed, 4 Mar 2020 10:45:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Hi Alan, On 04/03/20 5:27 am, Alan Mikhak wrote: > On Wed, Feb 26, 2020 at 9:39 AM Alan Mikhak wrote: >> >> On Tue, Feb 25, 2020 at 9:27 PM Kishon Vijay Abraham I wrote: >>> >>> Hi Alan, >>> >>> On 26/02/20 2:41 am, Alan Mikhak wrote: >>>> @@ -380,6 +572,7 @@ static void pci_epf_test_unbind(struct pci_epf *epf) >>>> int bar; >>>> >>>> cancel_delayed_work(&epf_test->cmd_handler); >>>> + pci_epf_clean_dma_chan(epf_test); >>>> pci_epc_stop(epc); >>>> for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { >>>> epf_bar = &epf->bar[bar]; >>>> @@ -550,6 +743,12 @@ static int pci_epf_test_bind(struct pci_epf *epf) >>>> } >>>> } >>>> >>>> + epf_test->dma_supported = true; >>>> + >>>> + ret = pci_epf_init_dma_chan(epf_test); >>>> + if (ret) >>>> + epf_test->dma_supported = false; >>>> + >>>> if (linkup_notifier) { >>>> epf->nb.notifier_call = pci_epf_test_notifier; >>>> pci_epc_register_notifier(epc, &epf->nb); >>>> >>>> Hi Kishon, >>>> >>>> Looking forward to building and trying this patch series on >>>> a platform I work on. > > Hi Kishon, > > I applied this v1 patch series to kernel.org linux 5.6-rc3 and built for > x86_64 Debian and riscv. I verified that when I execute the pcitest > command on the x86_64 host with -d flag, the riscv endpoint performs > the transfer by using an available dma channel. Thank you for testing this. I've posted a new version after renaming the function names to pci_epf_test_init_dma_chan() and pci_epf_test_cleanup_dma_chan() [1] Can you add your "Tested-by: " tag in that series so that Lorenzo can pick it up? Thanks Kishon [1] -> http://lore.kernel.org/r/20200303103752.13076-1-kishon@ti.com > > Regards, > Alan > >>>> >>>> Would you please point me to where I can find the patches >>>> which add pci_epf_init_dma_chan() and pci_epf_clean_dma_chan() >>>> to Linux PCI Endpoint Framework? >>> >>> I've added these functions in pci-epf-test itself instead of adding in >>> the core files. I realized adding it in core files may not be helpful if >>> the endpoint function decides to use more number of DMA channels etc., >> >> Thanks Kishon, >> >> I now realize they are in [PATCH 1/5] of this series. May I suggest renaming >> them to pci_epf_test_init_dma_chan() and pci_epf_test_cleanup_dma_chan()? >> With just pci_epf in their name, I was looking for them in pci-epf-core.c. >> >> Regards, >> Alan >> >>> >>> Thanks >>> Kishon