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=-10.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 039BAC4727E for ; Wed, 7 Oct 2020 05:45:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9152D20B1F for ; Wed, 7 Oct 2020 05:45:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ju0WUPVJ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="FGgaMjpc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9152D20B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PQIOat+r7x9C2uEFurw5A46H1efVkSS+jR5hFf3IYok=; b=Ju0WUPVJvZGPMDwonbXyQRWbl G1pe89RxmfXMCRhWhvMpRO9rWyEVcNqUu2o+H7OCR6iBIdKikN59Mhs1qAp4RjpYZICInlKPbXN6H sA7J/MORLAUkABOQKO5FHu/dvet0eGTBIOT2GFiTvnmVwfUb6eWtPmkMRDWpEzNEROxOi8+oZ9HEO VLPrbSa0gj0a5XxThsipEXCZihu/F7/POlYvi4dim/H9QpL4M9hf2dkG1thgliCyp+qxLANAqOc73 PpndfFgIb604uxzCbFCwrSHbN9gUmuZuHDApLpkOipUF7haKJm3C66W4qoOxb7xX0ECaN+N7ukEIr DQvUXCCJw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ2FK-0005XN-To; Wed, 07 Oct 2020 05:44:14 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ2FH-0005Wf-JW for linux-arm-kernel@lists.infradead.org; Wed, 07 Oct 2020 05:44:12 +0000 Received: from localhost (unknown [122.171.222.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 533C1208C7; Wed, 7 Oct 2020 05:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602049449; bh=szK29eB1aaDwRPv2AAeq7Q2s91RHTL+W1LUcPPKFjlI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FGgaMjpcC8fbyiin8nYnw/U/7+ET6l+beTO3vqzZNA2Bdfz2Uvh+pSNsXRUfM6+1r YdTagc9UNzaXvyTNxTVgl3Y+cvMcXoWB7YyvBp6ZLreZjrkVnK3BpnbHjYWwCjveGD nn50PNOd5b3ebFvLXrhhwQ704jY/nOdoCMhVmDEg= Date: Wed, 7 Oct 2020 11:14:04 +0530 From: Vinod Koul To: Peter Ujfalusi Subject: Re: [PATCH 01/18] dmaengine: of-dma: Add support for optional router configuration callback Message-ID: <20201007054404.GR2968@vkoul-mobl> References: <20200930091412.8020-1-peter.ujfalusi@ti.com> <20200930091412.8020-2-peter.ujfalusi@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200930091412.8020-2-peter.ujfalusi@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201007_014411_869100_B6CBE520 X-CRM114-Status: GOOD ( 24.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nm@ti.com, devicetree@vger.kernel.org, vigneshr@ti.com, lokeshvutla@ti.com, linux-kernel@vger.kernel.org, t-kristo@ti.com, robh+dt@kernel.org, ssantosh@kernel.org, dmaengine@vger.kernel.org, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Peter, On 30-09-20, 12:13, Peter Ujfalusi wrote: > Additional configuration for the DMA event router might be needed for a > channel which can not be done during device_alloc_chan_resources callback > since the router information is not yet present for the drivers. > > If there is a need for additional configuration for the channel if DMA > router is in use, then the driver can implement the device_router_config > callback. So what is the additional information you need, I am looking at the code below and xlate invokes device_router_config() which driver will implement.. Are you using this to configure channels based on info from DT? > > Signed-off-by: Peter Ujfalusi > --- > drivers/dma/of-dma.c | 10 ++++++++++ > include/linux/dmaengine.h | 2 ++ > 2 files changed, 12 insertions(+) > > diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c > index 8a4f608904b9..ec00b20ae8e4 100644 > --- a/drivers/dma/of-dma.c > +++ b/drivers/dma/of-dma.c > @@ -75,8 +75,18 @@ static struct dma_chan *of_dma_router_xlate(struct of_phandle_args *dma_spec, > ofdma->dma_router->route_free(ofdma->dma_router->dev, > route_data); > } else { > + int ret = 0; > + > chan->router = ofdma->dma_router; > chan->route_data = route_data; > + > + if (chan->device->device_router_config) > + ret = chan->device->device_router_config(chan); > + > + if (ret) { > + dma_release_channel(chan); > + chan = ERR_PTR(ret); > + } > } > > /* > diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h > index dd357a747780..d6197fe875af 100644 > --- a/include/linux/dmaengine.h > +++ b/include/linux/dmaengine.h > @@ -800,6 +800,7 @@ struct dma_filter { > * by tx_status > * @device_alloc_chan_resources: allocate resources and return the > * number of allocated descriptors > + * @device_router_config: optional callback for DMA router configuration > * @device_free_chan_resources: release DMA channel's resources > * @device_prep_dma_memcpy: prepares a memcpy operation > * @device_prep_dma_xor: prepares a xor operation > @@ -874,6 +875,7 @@ struct dma_device { > enum dma_residue_granularity residue_granularity; > > int (*device_alloc_chan_resources)(struct dma_chan *chan); > + int (*device_router_config)(struct dma_chan *chan); > void (*device_free_chan_resources)(struct dma_chan *chan); > > struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( > -- > Peter > > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel