Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3924091ybf; Tue, 3 Mar 2020 15:57:45 -0800 (PST) X-Google-Smtp-Source: ADFU+vuHt+aETZsA2NkKbK7J08yQD7TPzrnHpUiv7yb+KcjqTJlhhtHQzb4SGA1iFmcsnM6AYgzi X-Received: by 2002:a05:6830:120c:: with SMTP id r12mr280483otp.333.1583279865025; Tue, 03 Mar 2020 15:57:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583279865; cv=none; d=google.com; s=arc-20160816; b=k+Z97L6gyGUxi0nrQ10Rotveyb42tbg1b08Hw7/btnHavYaL15VUtQeJcagKHgyyuC uKL6pyU2j0Wg0Gpo8pXWQGoaj0MA1szZZ3floDteC/S2F1lJNNiSMpjYUVHLDIDF3i+7 XVN0w23HcHt+JNzzAZY7DAToQOAjKErUZoUNqMLrU4Kc2XCYL4TNRXUVR5ljvcwo8iMe jBp/eNKl0W4VW5nNWd/LcuhmmeFEI+PARczKgRniGWRMuuosivlbo+45TZR0QRK+LTFM EYtgd3hvFKfQFOyiByHphDBf9uHS040ptpX3zC/fzFD2nuLyGaFR79XHZaPx31ISN4ri miTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fIWGur3bsHzpzpsDDYwv29XnZSnnJNIFZvGbNS4jrEo=; b=vfXVbKCosRNminif1wG6tiGSXhXDK6aVCTZHjsaq+8WkeDbL72ZXnWS9gmjEx0DTG/ lPFIj+RQ/myyLi4U0pbH2Q4ReQO8hUfRdiK4jaVuZZ17IQmW4oFPfl8SdLmM3lUeEQyw GHC41tp9qPsjEXYbRPExueLbmbeiIjUR+sR9DwUxVOYXGWyrMupJzNQfn+z2Q+mZ7DxP W8Utu8exnqNRAs0ZhTd5+qHa5ZT9Ah2R232eOca69OwV/6gIV9gFeNwQfwD2slYYQUYQ gsTsyPdfRdoq2bBRGl+eP48avHMYNnw/aAKwqzVo7dT2QhnggJghHFNi1ZVCxoQqrxdA 36/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=kDnUpYpd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t79si184468oih.165.2020.03.03.15.57.32; Tue, 03 Mar 2020 15:57:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=kDnUpYpd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727930AbgCCX53 (ORCPT + 99 others); Tue, 3 Mar 2020 18:57:29 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:44487 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727274AbgCCX53 (ORCPT ); Tue, 3 Mar 2020 18:57:29 -0500 Received: by mail-lf1-f68.google.com with SMTP id 7so4279568lfz.11 for ; Tue, 03 Mar 2020 15:57:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fIWGur3bsHzpzpsDDYwv29XnZSnnJNIFZvGbNS4jrEo=; b=kDnUpYpdn4DAr4q2+USJm5D+Fm0EG/v+rd4s9F6wFuVXBRLXddHQ+/f0t4DFkkQ+3Q eBcaSIqkYIuy53rq98q1mHS3xL2RtzGAIQO2CLrUnJdK4EJtDXeVl6PdXaACwg1yxD83 KLoXEudsQ8rXYTgIgtth79gb8JOYaXvThTtjUTvrkO2UnUDAZKVhOyQ0sM0Dh8y0cy7T x7c6ZJRQeiva4BdwyggRsrozYSAaI1lq79XSN90vSRowrZlPAbE1G13Qdg4Ro+8djiBX ZGGI3UFY12ilEHoXGE8jE5rpfmGBT8LYcI/8AzDqCZMiPlySSJpfsoVgP1G8NnIC+kRj tEkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fIWGur3bsHzpzpsDDYwv29XnZSnnJNIFZvGbNS4jrEo=; b=ZqVJKpXREru7elMNCZeMTjiZLdPC77jTUUAbeotI97EVYErYBRkn6GO9ZrzV1VvT+d dK4tGMqvNkJQRJbgsZlLgG2IFDYsJ9wXl3N3/6sVQ1OhcjIVZqRn2xnBhA0yDG35UWBB 8ofel690KTvGpZGfTcQHVVlqbcGvmL/ZI+CnXiwnuTQDBHnmxaJwFkiNqD2tkMgaE1PU pHPLx4Oh/8KGDea0mk3/pydUs2z/aJao1q0DhKCqDl6IqcTA1k0mMLPiOYqP4MpzPrT1 gbWnuAskkWYB6oxrsGD6Kamky7KfNX42gl0QReOYUX4EPl9Sc/YlcB6IhFk+QixwMDa9 4mPw== X-Gm-Message-State: ANhLgQ1M6BkbHFS2Atc8eC8DZY5po1jXKRV+JPlkXyrbnphv2qYtyCiZ I4BZVfLhnLb8k1OKdHjkOW1HVlQ2A+SREaDhA4L0PA== X-Received: by 2002:a19:ca15:: with SMTP id a21mr232523lfg.67.1583279845785; Tue, 03 Mar 2020 15:57:25 -0800 (PST) MIME-Version: 1.0 References: <20200225091130.29467-1-kishon@ti.com> <1582665067-20462-1-git-send-email-alan.mikhak@sifive.com> <7e1202a3-037b-d1f3-f2bf-1b8964787ebd@ti.com> In-Reply-To: From: Alan Mikhak Date: Tue, 3 Mar 2020 15:57:13 -0800 Message-ID: Subject: Re: [PATCH 1/5] PCI: endpoint: functions/pci-epf-test: Add DMA support to transfer data To: Kishon Vijay Abraham I Cc: amurray@thegoodpenguin.co.uk, arnd@arndb.de, Bjorn Helgaas , gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-pci , lorenzo.pieralisi@arm.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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