Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5894340rdb; Thu, 14 Dec 2023 02:47:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfMnOea38az0JbytPjPOwiO9QVpHahstg2+hJr0EVi+nzWLj3Ez6UYGM10otXBI79FueIe X-Received: by 2002:a17:90a:d70f:b0:28b:36f:f23b with SMTP id y15-20020a17090ad70f00b0028b036ff23bmr1311608pju.22.1702550865228; Thu, 14 Dec 2023 02:47:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702550865; cv=none; d=google.com; s=arc-20160816; b=RpjwSAPMbZs7UWkyUaNBo7Pb42N8vLGD+lMw4yTPEShS4o3Fe7W1ohrBRJm91CiZbV aYB/nNIsolarK60vyDLQ+NCXuIN5yeW9xBCTLayC9hk6xAYQDAxHxWiXHIsQmlWsz0fT OkBxH/rP4XWiNDK5M5iwufe6tgAMgLbtGxC6LGOUXaChj8XFoRE828qCTCJyfOTegpze EeuuW09rV8Q1LQa1DVIEfcfxJqE/CeQ4jvP2swgh0tbUud8B5s/+kF1Fop9ngJN64+XI ed7r2NsQDIdpXqz0PL2tU5lRl7YOFh5ZSHLX8fS5xIquzAnq8wE+dCfuXlqqych1yyiQ 6idA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/GquBgyk2EQmc48v+xffBHJgUcOqNDc0+keiJqXw6a0=; fh=5/x4dVaGZybx+Vrkstj0IbwK20yWIXY+vKYhGEvRS6g=; b=gRhd06mNHNnK1KJ9cy+Vtx0fowVvKKKBe+2BudPG4y25lXzVTjnuQQaJso+vuSPNOw b8aSXHvqlTSUMPigMBzdQ96ujqB67Sz7V8eC/juA+HhN5XXq+oQAaoui9jg7VyxcKLjY Xy1kL39pakUrVSrLOmlP+1715H1Znh86Nydcmh1QpdFo0pjOWlMps7JlLPbsKYpU7R7t a/5BWhuaWs8++G0vqBY3+r0tZVpIzOsOGeNTER8DJEpSA+0cqGMalhCrRV07pWCg9EyK DlhVnXpKJGmrIs6x9vET2D/yvp0hRyQ7NjHlYAuFIrRPe++gcvnbOVE8mnPZAlhtqpcz o9QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZsL4pq9D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id k2-20020a17090a62c200b00280479459f7si1823100pjs.50.2023.12.14.02.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 02:47:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZsL4pq9D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7DA2C808EE7D; Thu, 14 Dec 2023 02:47:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443734AbjLNKr3 (ORCPT + 99 others); Thu, 14 Dec 2023 05:47:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443716AbjLNKr1 (ORCPT ); Thu, 14 Dec 2023 05:47:27 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8DCEBD for ; Thu, 14 Dec 2023 02:47:33 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A651EC433C7; Thu, 14 Dec 2023 10:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702550853; bh=G10Hq0xP/zK5MeKYT++ROANkyAPjg2roDsTG8VsGAWE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZsL4pq9DfAK53U5u0VlSzDgEKFAmJsuM15de8Y+gdaEo1drG48/N2Ek0Zzl4ZxG0A Mf2E4KD480cgTl4B9MOAWbJKEohV3EbhLdAKM25MDZcw3i1SQHhAasg2vrjFGI4o9Y MGujhdkdIez3+Se9qwSryB5t4n/3SXxcYgKMefiQuhnYVrQAjQZGmaZL7yLdMWSmYz LhCdUxebjvd2ZqL8ockuBP7H0x8BVZ3tfkNkB08ehd//TNON17XKFuAiJ4O4K5gc0l UEHodsCAHbC6bij499aX7hb6dCDoQBlqHjwzQ56TUPmSH8DEfhanRGI2TM7bRJ4BKV QKq14cK2XLs+Q== Date: Thu, 14 Dec 2023 16:17:19 +0530 From: Manivannan Sadhasivam To: Krishna Chaitanya Chundru Cc: Manivannan Sadhasivam , lpieralisi@kernel.org, kw@linux.com, kishon@kernel.org, bhelgaas@google.com, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/9] PCI: epf-mhi: Enable MHI async read/write support Message-ID: <20231214104719.GM2938@thinkpad> References: <20231127124529.78203-1-manivannan.sadhasivam@linaro.org> <20231127124529.78203-7-manivannan.sadhasivam@linaro.org> <20231214100936.GI2938@thinkpad> <8929dcd0-af98-5b18-2d90-aad7b5928578@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8929dcd0-af98-5b18-2d90-aad7b5928578@quicinc.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 14 Dec 2023 02:47:42 -0800 (PST) On Thu, Dec 14, 2023 at 03:44:21PM +0530, Krishna Chaitanya Chundru wrote: > > On 12/14/2023 3:39 PM, Manivannan Sadhasivam wrote: > > On Thu, Dec 14, 2023 at 03:10:01PM +0530, Krishna Chaitanya Chundru wrote: > > > On 11/27/2023 6:15 PM, Manivannan Sadhasivam wrote: > > > > Now that both eDMA and iATU are prepared to support async transfer, let's > > > > enable MHI async read/write by supplying the relevant callbacks. > > > > > > > > In the absence of eDMA, iATU will be used for both sync and async > > > > operations. > > > > > > > > Signed-off-by: Manivannan Sadhasivam > > > > --- > > > > drivers/pci/endpoint/functions/pci-epf-mhi.c | 7 ++++--- > > > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c > > > > index 3d09a37e5f7c..d3d6a1054036 100644 > > > > --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c > > > > +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c > > > > @@ -766,12 +766,13 @@ static int pci_epf_mhi_link_up(struct pci_epf *epf) > > > > mhi_cntrl->raise_irq = pci_epf_mhi_raise_irq; > > > > mhi_cntrl->alloc_map = pci_epf_mhi_alloc_map; > > > > mhi_cntrl->unmap_free = pci_epf_mhi_unmap_free; > > > > + mhi_cntrl->read_sync = mhi_cntrl->read_async = pci_epf_mhi_iatu_read; > > > > + mhi_cntrl->write_sync = mhi_cntrl->write_async = pci_epf_mhi_iatu_write; > > > > if (info->flags & MHI_EPF_USE_DMA) { > > > > mhi_cntrl->read_sync = pci_epf_mhi_edma_read; > > > > mhi_cntrl->write_sync = pci_epf_mhi_edma_write; > > > > - } else { > > > > - mhi_cntrl->read_sync = pci_epf_mhi_iatu_read; > > > > - mhi_cntrl->write_sync = pci_epf_mhi_iatu_write; > > > > + mhi_cntrl->read_async = pci_epf_mhi_edma_read_async; > > > > + mhi_cntrl->write_async = pci_epf_mhi_edma_write_async; > > > I think the read_async & write async should be updated inside the if > > > condition where MHI_EPF_USE_DMA flag is set. > > > > > That's what being done here. Am I missing anything? > > > > - Mani > > It should be like this as edma sync & aysnc read write should be update only > if DMA is supported, in the patch I see async function pointers are being > updated with the edma function pointers for IATU operations. > >                 if (info->flags & MHI_EPF_USE_DMA) { > > mhi_cntrl->read_sync = pci_epf_mhi_edma_read; > mhi_cntrl->write_sync = pci_epf_mhi_edma_write; > mhi_cntrl->read_async = pci_epf_mhi_edma_read_async; > mhi_cntrl->write_async = pci_epf_mhi_edma_write_async; > } Are you reading the patch correctly? Please take a look at this commit: https://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi.git/tree/drivers/pci/endpoint/functions/pci-epf-mhi.c?h=mhi-next&id=d1c6f4ba4746ed41fde8269cb5fea88bddb60504#n771 - Mani > - Krishna Chaitanya. > > > > - Krishna Chaitanya. > > > > > > > } > > > > /* Register the MHI EP controller */ -- மணிவண்ணன் சதாசிவம்