Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2229554pxu; Fri, 9 Oct 2020 11:03:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGaX9oqpB6O/DgtFLhLl79rRDaFo4IUY0NVhD7XywPNTQE0MH0rl0pEQ2eKhYPM1kqbyw9 X-Received: by 2002:a17:907:20b2:: with SMTP id pw18mr14979036ejb.159.1602266632050; Fri, 09 Oct 2020 11:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602266632; cv=none; d=google.com; s=arc-20160816; b=Xp5vl8bo+RtjVwHRTf4t1P2qB1fOwi/hPht3Pi5qf3F61o4PhId86XyXQWrNHBEj5n 9DAKLU8uC7CY9Jt8virbRhUC/BQFeAsnH66UQwBotCMBeTeHNkRrJn1FtccgymWxZWjN fyprSkGc66KjQtuI3o7K6G2dyIKICIcvalNME1mPBSsaBTliyMlvIqlDAp1G8loyGQ5A qXjry+AwL82oUZ9HwnulXXTNgO+B8G6FBltQtecxHbPuYJUoIAIuj2SpZMb8YMED03wA 22ztPPgCHd1XP9k/h31aceAuhVXop5QeEmVKI5rg/9LPJCyi+y49YO6rD39FMpEKYKdr LE4w== 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=F3IqDL2QLIBKrC5EHTcvaQ8Pa+wXfpOO9+S8aEe6RUA=; b=kObzyfWERkZJBVoQTGQ7dWA+DqjrlKAFOGPSg2FMy7c0WtXG0NU/T63w2uY5PTshF7 elYIzVYOTTBq08c7bTlE1iUBLWcH2JDK2DZ9QdP520GHVSfP2smhppulW4ibAOPsLIAN L3vbT4KdOSzBEPiRCSN2Om495wu0YR9byeNbVPTakRM9Vvvi0uJs3LW6er8zn370kDOq 9nMJi2TKigCOyxFsG613rXqkLzxmbdDCngzofVCZDs35fcMGM6xNfGJ9CZOViNeXsLMx tWeEdKx+ifRkX+KE83h5uRUy+YWmxlO4dUmrOWw0kAoSUUvas5yXi46aJLlMFDM79Dx3 7brA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ijRQptxk; 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 c18si6661610eja.521.2020.10.09.11.03.12; Fri, 09 Oct 2020 11:03:52 -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=ijRQptxk; 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 S2388019AbgJILPV (ORCPT + 99 others); Fri, 9 Oct 2020 07:15:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:49396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730660AbgJILPV (ORCPT ); Fri, 9 Oct 2020 07:15:21 -0400 Received: from localhost (unknown [122.182.251.219]) (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 5829922269; Fri, 9 Oct 2020 11:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602242120; bh=k6uaFEKd/nFzgD4ScYH6xfNS3bhBKlY2u9F/RvcymNI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ijRQptxkA5gWAk6lsRYj2aYknp99koRLvxsGj8/yZipBPJEtmvpsDtXna0V/ez6d0 RajF4Rd6uIQ/hw2qIjBT9MUM3BW6R+Yt57vH1e5yEq5oXPcdiBvutf9o4On7Rmcz8N 5CK4yiQ1gSfnNCiGNG67r2W647FDfEkPPjwYaYuc= Date: Fri, 9 Oct 2020 16:45:15 +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 v4 2/3] dmaengine: add peripheral configuration Message-ID: <20201009111515.GF2968@vkoul-mobl> References: <20201008123151.764238-1-vkoul@kernel.org> <20201008123151.764238-3-vkoul@kernel.org> <20201009103019.GD2968@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09-10-20, 13:45, Peter Ujfalusi wrote: > Hi Vinod, > > On 09/10/2020 13.30, Vinod Koul wrote: > > Hi Peter, > > > > On 09-10-20, 12:04, Peter Ujfalusi wrote: > >> On 08/10/2020 15.31, Vinod Koul wrote: > >>> Some complex dmaengine controllers have capability to program the > >>> peripheral device, so pass on the peripheral configuration as part of > >>> dma_slave_config > >>> > >>> Signed-off-by: Vinod Koul > >>> --- > >>> include/linux/dmaengine.h | 5 +++++ > >>> 1 file changed, 5 insertions(+) > >>> > >>> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h > >>> index 6fbd5c99e30c..a15dc2960f6d 100644 > >>> --- a/include/linux/dmaengine.h > >>> +++ b/include/linux/dmaengine.h > >>> @@ -418,6 +418,9 @@ enum dma_slave_buswidth { > >>> * @slave_id: Slave requester id. Only valid for slave channels. The dma > >>> * slave peripheral will have unique id as dma requester which need to be > >>> * pass as slave config. > >>> + * @peripheral_config: peripheral configuration for programming peripheral > >>> + * for dmaengine transfer > >>> + * @peripheral_size: peripheral configuration buffer size > >>> * > >>> * This struct is passed in as configuration data to a DMA engine > >>> * in order to set up a certain channel for DMA transport at runtime. > >>> @@ -443,6 +446,8 @@ struct dma_slave_config { > >>> u32 dst_port_window_size; > >>> bool device_fc; > >>> unsigned int slave_id; > >>> + void *peripheral_config; > >>> + size_t peripheral_size; > >> > >> Do you foresee a need of src/dst pair of these? > >> If we do DEV_TO_DEV with different type of peripherals it is going to > >> cause issues. > > > > Not really as the channel already has direction and this is per channel. > > Yes, in case of DEV_TO_MEM or MEM_TO_DEV. > > > If for any any reason subsequent txn is for different direction, I would > > expect that parameters are set again before prep_ calls > > But in DEV_TO_DEV? Do we support that :D > If we have two peripherals, both needs config: > p1_config and p2_config > > What and how would one use the single peripheral_config? Since the config is implementation specific, I do not think it limits. You may create struct peter_config { struct p1_config; struct p2_config; }; > > If only one of them needs config, then sure, the driver can pin-point > which one the single config might apply to. > > Or you chain the same type of peripheral and you would need different > config for tx and rx? > > - P?ter > > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- ~Vinod