Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3029352pxb; Tue, 12 Jan 2021 04:45:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHvNNoALA4H8qppJt3z/W98gAyZScfd9jFssCeVllfgQeP+Q2NHcEHso7nAh0Ilj9LBjDj X-Received: by 2002:a05:6402:697:: with SMTP id f23mr3352459edy.318.1610455541872; Tue, 12 Jan 2021 04:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610455541; cv=none; d=google.com; s=arc-20160816; b=LJeKca8mpG9gEQjgd42DwksS41aakEjMkaZlqQCAd65JPFBSd83ZAnkfHxAE2rKkj6 ypS8ptpEz70s37dFD/ZXo8+JybI641ryz2OrwIHTmFYdheVarIhRbhiQ5ZblihdNYngL H3sRdJQ80NW3eNVBTUV96EhuyDFgtvEmaZerB1vFFn+JvSw3k8fc2RtlYecsK9uf+HZX 5I/GO7jXmlQmMl0//Ywe0W6/ZBo5TKg8NDhf9ZUTBN7un2t2p1lOqZjVeRH6+zQcuax6 yMrILMduHYBFrzBaeQCP7s/Bc0nu2MVtyoBzoj9fO9AeDQuNH085PsEjBczl49G9cuJ2 gzow== 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=9jBCuIaDNIiWpFbGHrv6w3EqJtKv8gCUFbR8zPDWzNI=; b=grb5VSRGdOwb4PUa/7rbnumd0NwZqonp4fH+WD4QtSBMffDK9qUyb49nmAhrGot4KA uhZ6ZoGIkMhQI6d831s/L+aJMTgCYA1Vb7EZ+eVnt6UeV4+0uSYdJEsSCS0bQ/yV5Wdu 8SO9OSM3rWMh0UZmyZlQeUxupJA1atXGYJlZgFqUCOmNF8DO+OlxMAs8STp4M/Xky8Mq k884Lgse2WujGFpFbuDpION2Wax8TFy26X31EKXaKSHwQ9f4cNHreRl69/vqV2ZKm8Lp MEoWsmCBZv9cbwk5VEZi2R5WzzckEG6BtGN0mWAsp8U89TsYkZW1aLTG118VmWCkZCfT UktQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pqy1p9Oh; 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 dm18si1228298edb.422.2021.01.12.04.45.18; Tue, 12 Jan 2021 04:45:41 -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=pqy1p9Oh; 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 S2404453AbhALKLn (ORCPT + 99 others); Tue, 12 Jan 2021 05:11:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:46918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389927AbhALKLn (ORCPT ); Tue, 12 Jan 2021 05:11:43 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C3EF022CBE; Tue, 12 Jan 2021 10:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610446262; bh=SJdJsLW3E8Nwahw4Ky16T74RFBuZ491EnoseBaUMOIU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pqy1p9OhYmPgyJKboHZC2ehmLQo/7Rdm9ZtwZJUJJh1Capla4PRjxfOAXx8uxpOD6 6pcFdlWXd8HXcxBJparAK4h9EhrRU7bZLGqn3M8cI5Mq7x7JKHiPa9TlxG1R4pwyGK t7JX9IpHQpMTAkJhaFelUI7pqcvTqaqM/dQUMDutwBvq5I+2od8uBiEgoA+nUi69qC 3WxsGyy5foUF6MFAvu8fH47zbxKwwYBd2gJ6HZ1q9tGxW9x/4KC2jCG1yrWM7JXhwg GFmcZvUAhEF7kMPIwuAyrtaHDSg5aPckswS6DMfSIjwaidJL9d3Jun0jDOHZg8QjKF 8OF1U9zLGvCwQ== Date: Tue, 12 Jan 2021 15:40:56 +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: <20210112101056.GI2771@vkoul-mobl> References: <1608215842-15381-1-git-send-email-mdalam@codeaurora.org> <20201221092355.GA3323@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 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? > > 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..? -- ~Vinod