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=-4.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 AE533C41604 for ; Wed, 7 Oct 2020 11:28:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5CED720872 for ; Wed, 7 Oct 2020 11:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602070093; bh=kY5VsQub9YBuVn954F0Hvvtht7ZySDXQRDsJceie9iM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=EWXVKto6tTfVicvztDe9vptXa5hYhhLJ0lE6ubJmyckHj+kaGlhiMkADfPsIlUN6y QM4GLA5/StLG70y7v35uI8biiU5uRql5xQbWIYNYTBcu9SyHysZO+5doYKeha4Lxgq RQedE2OWUdvscTWRxo4IS2XhNHbaoErjGMLKq440= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727752AbgJGL2M (ORCPT ); Wed, 7 Oct 2020 07:28:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:55406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727741AbgJGL2M (ORCPT ); Wed, 7 Oct 2020 07:28:12 -0400 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 BBA29206F7; Wed, 7 Oct 2020 11:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602070091; bh=kY5VsQub9YBuVn954F0Hvvtht7ZySDXQRDsJceie9iM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dyt9iTFp03B8OwcY9z0GcHlfMNqCME8N04SBzD7esK8Pm2JFale4d/4z2ph/5yT9C t80gyqdDHIz8cu62TOX2P5E5rRtJ6TKuBckoqsqUtPmRgOcnau30z5pFvCWTfnyj5V jMaDPW9bG1EXTIGpYGxNRii5J8OlE3SOtaC6KdKU= Date: Wed, 7 Oct 2020 16:58:07 +0530 From: Vinod Koul To: Peter Ujfalusi Cc: dmaengine@vger.kernel.org, Rob Herring , Bjorn Andersson , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] dmaengine: add peripheral configuration Message-ID: <20201007112807.GW2968@vkoul-mobl> References: <20200923063410.3431917-1-vkoul@kernel.org> <20200923063410.3431917-3-vkoul@kernel.org> <29f95fff-c484-0131-d1fe-b06e3000fb9f@ti.com> <20201001112307.GX2968@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Peter, On 02-10-20, 11:48, Peter Ujfalusi wrote: > It depends which is best for the use case. > I see the metadata useful when you need to send different > metadata/configuration with each transfer. > It can be also useful when you need it seldom, but for your use case and > setup the dma_slave_config extended with > > enum dmaengine_peripheral peripheral_type; > void *peripheral_config; > > would be a bit more explicit. > > I would then deal with the peripheral config in this way: > when the DMA driver's device_config is called, I would take the > parameters and set a flag that the config needs to be processed as it > has changed. > In the next prep_slave_sg() then I would prepare the TREs with the > config and clear the flag that the next transfer does not need the > configuration anymore. > > In this way each dmaengine_slave_config() will trigger at the next > prep_slave_sg time configuration update for the peripheral to be > included in the TREs. > The set_config would be internal to the DMA driver, clients just need to > update the configuration when they need to and everything is taken care of. Ok I am going to drop the dmaengine_peripheral and make peripheral_config as as you proposed. So will add following to dma_slave_config: void *peripheral_config; Driver can define the config they would like and use. We can eventually look at common implementations and try to unify once we have more users -- ~Vinod