Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp133939pxb; Thu, 14 Jan 2021 22:01:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzX4Zv7PEb4O+ABTnROcw7th59eHFmlLTdiRSRPSs4GEP/tWRE6Kn5L0xPx1RHhskL/Mz6k X-Received: by 2002:a17:906:1701:: with SMTP id c1mr7634266eje.395.1610690492779; Thu, 14 Jan 2021 22:01:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610690492; cv=none; d=google.com; s=arc-20160816; b=JOzh4B0g4Btuq654Ro4WLeg2ZvFjF0oYHGmL7FSU6+GUsHlN2IFIRJN0YqzraUwEdX cNr7V0RotZht5/XYqOXLJCEa8yfbFf1SQm/JuqdR1ce6bLTnsFaqCa1UI9Y2L/uuXQRf e1QeRM0jAekzgBOcDS5UFKbBCd7q/RXw2mhaXjul3TtTSKaqcA8PKUGDwPDc31NYj4BD 0cW3aHmcWfE5mku0ITes7Cq5CXlqC4JKcVHhDQJ4z88Hl21molrdK/LVpZeblsf2kNYd 59/1lUmIE0wKqwCGT8orshNsf2kjxt6QCjLz/be/ezy2x2+Zi68t16b8plJawf2vA5c/ HeNw== 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=CD2SKqQFJZsxdBfZCpwZSovsdONBzqztUKOqlxS2gug=; b=o5Y39ToCxBfPHnrxs4/ABSy3aOwM+vNiCzRciNOQGHUghJUC1Nen3I4rMopZbmQb3b KLrdbjKZVPz1I5pmjw4Rp7BOgig9QXmWsc4rjllr1uaSCCKYY8hpbg6cbjSs883eVwHg aICE9wcgbBR2DeqhZxEJnL5W7S1srvYY733DfAsbZy+UQGirck8abA5vngBIYcJZcwLg hS3dPwX4kT0p7lvAw+emnCDnj3LR6xrchFlLMy9IgUWCtGtUlneMtAr71Zn3GJLKGnIV zmInF3ItN6ru9cTyYoK9TqrI2oo9TAcGWxNqevP+RcS/YjGUSHx5QjcrGO7NahtJ2R+K GZ6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ibY2R7ce; 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 y10si3260279ejb.351.2021.01.14.22.01.05; Thu, 14 Jan 2021 22:01:32 -0800 (PST) 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=k20201202 header.b=ibY2R7ce; 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 S1728290AbhAOF6v (ORCPT + 99 others); Fri, 15 Jan 2021 00:58:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:49936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbhAOF6u (ORCPT ); Fri, 15 Jan 2021 00:58:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 66736239EF; Fri, 15 Jan 2021 05:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610690290; bh=A2xQvZI3cYjFP3+C40z6oPKeq/38VezRg4M7YK6TvpI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ibY2R7ceYe8BqE2hj3mA8qlr2b7m8kLBYZN94Gn+IyG1ykTEfHq32oi7J3Hv7lrOc 1PuWhBRo9FLeuYe5eoX40NDoJvHMIVBNgH9cJ+1rQHwvkMk1/6pjNisMlHVLBPowp1 H54rJcRkH44Wwp1kEtO7qae8Q/HYEGhCdoYStdStZHF/cCDRZmvSMifAhAZMU6YJie E+S5SkCCfwa40egM9HuwiQz5y+YBc8/z79BxZFTplR45BukmDpJns7WyqxHpFhWN9O Q48TNyn+4wIijVkyGSwc+e6asL3nIINHvbhk+MSOoTs62AuaKwTBsD4srhbTmi9Y/M 9iL3BwSb7XH0w== Date: Fri, 15 Jan 2021 11:28:06 +0530 From: Vinod Koul To: mdalam@codeaurora.org Cc: corbet@lwn.net, agross@kernel.org, bjorn.andersson@linaro.org, dan.j.williams@intel.com, dmaengine@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, sricharan@codeaurora.org, mdalam=codeaurora.org@codeaurora.org Subject: Re: [PATCH] dmaengine: qcom: bam_dma: Add LOCK and UNLOCK flag bit support Message-ID: <20210115055806.GE2771@vkoul-mobl> References: <1608215842-15381-1-git-send-email-mdalam@codeaurora.org> <20201221092355.GA3323@vkoul-mobl> <20210112101056.GI2771@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 On 14-01-21, 01:20, mdalam@codeaurora.org wrote: > On 2021-01-12 15:40, Vinod Koul wrote: > > On 12-01-21, 15:01, mdalam@codeaurora.org wrote: > > > On 2020-12-21 23:03, mdalam@codeaurora.org wrote: > > > > On 2020-12-21 14:53, Vinod Koul wrote: > > > > > Hello, > > > > > > > > > > On 17-12-20, 20:07, Md Sadre Alam wrote: > > > > > > This change will add support for LOCK & UNLOCK flag bit support > > > > > > on CMD descriptor. > > > > > > > > > > > > If DMA_PREP_LOCK flag passed in prep_slave_sg then requester of this > > > > > > transaction wanted to lock the DMA controller for this transaction so > > > > > > BAM driver should set LOCK bit for the HW descriptor. > > > > > > > > > > > > If DMA_PREP_UNLOCK flag passed in prep_slave_sg then requester > > > > > > of this > > > > > > transaction wanted to unlock the DMA controller.so BAM driver > > > > > > should set > > > > > > UNLOCK bit for the HW descriptor. > > > > > > > > > > Can you explain why would we need to first lock and then unlock..? How > > > > > would this be used in real world. > > > > > > > > > > I have read a bit of documentation but is unclear to me. Also should > > > > > this be exposed as an API to users, sounds like internal to driver..? > > > > > > > > > > > > > IPQ5018 SoC having only one Crypto Hardware Engine. This Crypto Hardware > > > > Engine > > > > will be shared between A53 core & ubi32 core. There is two separate > > > > driver dedicated > > > > to A53 core and ubi32 core. So to use Crypto Hardware Engine > > > > parallelly for encryption/description > > > > we need bam locking mechanism. if one driver will submit the request > > > > for encryption/description > > > > to Crypto then first it has to set LOCK flag bit on command descriptor > > > > so that other pipes will > > > > get locked. > > > > > > > > The Pipe Locking/Unlocking will be only on command-descriptor. Upon > > > > encountering a command descriptor > > > > Can you explain what is a cmd descriptor? > > In BAM pipe descriptor structure there is a field called CMD (Command > descriptor). > CMD allows the SW to create descriptors of type Command which does not > generate any data transmissions > but configures registers in the Peripheral (write operations, and read > registers operations ). > Using command descriptor enables the SW to queue new configurations > between data transfers in advance. What and when is the CMD descriptor used for..? > > > > > > with LOCK bit set, The BAM will lock all other pipes not related to > > > > the current pipe group, and keep > > > > handling the current pipe only until it sees the UNLOCK set then it > > > > will release all locked pipes. > > > > locked pipe will not fetch new descriptors even if it got event/events > > > > adding more descriptors for > > > > this pipe (locked pipe). > > > > > > > > No need to expose as an API to user because its internal to driver, so > > > > while preparing command descriptor > > > > just we have to update the LOCK/UNLOCK flag. > > > > So IIUC, no api right? it would be internal to driver..? > > Yes its totally internal to deriver. So no need for this patch then, right? -- ~Vinod