Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp332343pxu; Wed, 7 Oct 2020 04:29:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxviRmwGOaaSxi65m5LyF9128BnW81u034aIlDXirjaY1gJsTge0NM4NxL4ltIi1PO2Q0Uh X-Received: by 2002:a17:906:2818:: with SMTP id r24mr3002978ejc.100.1602070196966; Wed, 07 Oct 2020 04:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602070196; cv=none; d=google.com; s=arc-20160816; b=ijhrNOvKjecwWYPbbDlxZxFVMawmi8gSz0h2atEyWV+EE9+lkK0mbGYYbbYakaFA40 SHGrWw8q7lu8b1RKiwkGGGefymOanAr9syF9kFqfAhjbGuX1ojQZ4RkVaUZjICVjEOHO 6H97LaH3lFqcF4XT/nbfSHBvzkh+/Z811oyqZjociy1zAbMqmj2QrVQ/k+8lQFZj5HtX Z8AfiXyrlMxe+srCOHi7wyo9EDOfXws4L5lIGphvk7LKp7LcoKaroZNTmDENwcWxZwor jF9r/noUD8zeb9q93ZantrhXpzMhtC7ZMzEX5dFkFV9Ugl02HmSZfQyWPVriW9Hmea7p 4kEg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=R4491OeUhuWmwZEUh1RlbAi48b9aoDJ9hsZZiY40yEs=; b=UtjMcycESa+HnTeKiPN+UMTA+LqMCo/BxMN5HP3JfwLd2z/39cJMsIxO3aUNSn5aob Kjt/i5e57Ag90PvPbvWw3pZKtdYH895Wa8r3ZEL1DAAxJEw88Eby/E+I9UZ7XKU+H29v DYqEb0ax7ohQnCO9NZCnftudU8QCQRCvXaN/v/Kh7ja4ZHPr0lZEftgMO/psNvzwhA5w lEHzkEVKX4m3DIhQAV0C1ekRqOecc2MYlXRrYMoC/5gu9zyzcoYW76A5FI3W1qVauDbf uBsV/E0XWSAu9l6fpsg6QjCvkQzTxeUIS7kpn9kHLy7bghGmRCftBxo3tUU8sPrnrmW5 6ySQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dyt9iTFp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si1113909edd.286.2020.10.07.04.29.33; Wed, 07 Oct 2020 04:29:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dyt9iTFp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727784AbgJGL2M (ORCPT + 99 others); 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: linux-kernel@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