Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1FF0C05027 for ; Fri, 17 Feb 2023 07:07:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbjBQHH5 (ORCPT ); Fri, 17 Feb 2023 02:07:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbjBQHHw (ORCPT ); Fri, 17 Feb 2023 02:07:52 -0500 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8A072822B for ; Thu, 16 Feb 2023 23:07:47 -0800 (PST) Received: by mail-lj1-x242.google.com with SMTP id y20so304297ljc.0 for ; Thu, 16 Feb 2023 23:07:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=DSwBYjZrNmln+ctA3/m+T2GVcsFUCJyV9W5bCg8FwVk=; b=WDYC5mLgBgby4IkaIx/erhiX6pHvAGJfn8AJ4Fg/PsJDfzV1FccE5bSHlt/k0neWN+ 5qavbew9Z52SAlMUJ96LibXdf5m1sH5ZOkRocvtrbl0TH3Xrmt/+XPkVPM59vvG1r+hn HbDNb/N+2xr7ig+uN972FTzu6d3SEDZyRlEFzAp6pA2US89GZjl/hBOEG/IEJWigdGPt Lst25/ZCiiIBlMlLrvVQVm+sR9pDzrACptLz81ApuVfu/gf+8sw7lo47LQefw6+eHJuV yD5/EGCJghbXSuVjvEL6I2t+czet84cYRS2HZBLOMylaDln80DXMzGttG3vaQR6V8971 PI7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DSwBYjZrNmln+ctA3/m+T2GVcsFUCJyV9W5bCg8FwVk=; b=WtGGQcDUwU8qM20jNDEuPH/t2zzvOaPii/fSOzo9rreFTLeQdeiQgUTrpFVPff4pn7 xr0sR/YckcOudNv87XkK54Q7jNya3Beo9mHnqgTyyTu3aVDqSMbx2Ynupo3Mk9U1+Emu i8VzKsELxw8x8nAFneJUHeH9I+idI7qKCAYwcYD4sN9oK4hWgA2u3cpxAlXB+QVY3q8V nosSQ7VGFt1M5pxJVWXr1RCI06wnZ8xjZLySya1Ad3XltWjQHt2hFx/vYjbpARuZ9ICd l9mlNctZKEI03GEFPmCYeHG4Bi7HkVjE7KiYgerySHaLL8INtjDInVBdJVpcSOHif8wV BFyw== X-Gm-Message-State: AO0yUKWnlvH1ypoLtOUjSbFbnRAO+DslsMgSG6/cojNtLpuBNVtfc0LQ gOcwVD3AUDL4d4SSrBWIJ9SW2A== X-Google-Smtp-Source: AK7set/tAqwu8sxy4AE7vnmKG3xqNcDOKRCF7xpzyi9Ted3sLXbDrbOLyQwAqOQnLDHo62Xv/Vt9tQ== X-Received: by 2002:a05:651c:b29:b0:290:7d15:464a with SMTP id b41-20020a05651c0b2900b002907d15464amr134730ljr.5.1676617665835; Thu, 16 Feb 2023 23:07:45 -0800 (PST) Received: from [192.168.1.102] (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id f2-20020a2e1f02000000b00294619d902dsm471489ljf.112.2023.02.16.23.07.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Feb 2023 23:07:44 -0800 (PST) Message-ID: <767e4d8d-b691-1849-71ac-5d6cefbb8d6a@linaro.org> Date: Fri, 17 Feb 2023 09:07:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0.2 Subject: Re: [PATCH v7 1/1] dma: qcom: bam_dma: Add support to initialize interconnect path Content-Language: en-US To: Bhupesh Sharma Cc: dmaengine@vger.kernel.org, agross@kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, thara.gopinath@gmail.com, devicetree@vger.kernel.org, andersson@kernel.org, bhupesh.linux@gmail.com, vkoul@kernel.org, Rob Herring References: <20220921030649.1436434-1-bhupesh.sharma@linaro.org> <20220921030649.1436434-2-bhupesh.sharma@linaro.org> From: Vladimir Zapolskiy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/17/23 06:00, Bhupesh Sharma wrote: > On Thu, 16 Feb 2023 at 19:49, Vladimir Zapolskiy > wrote: >> >> On 9/21/22 06:06, Bhupesh Sharma wrote: >>> From: Thara Gopinath >>> >>> BAM dma engine associated with certain hardware blocks could require >>> relevant interconnect pieces be initialized prior to the dma engine >>> initialization. For e.g. crypto bam dma engine on sm8250. Such requirement >> >> Apparently it's proven that the change description is incorrect, Qualcomm >> crypto engine is working fine on SM8250 and even more recent platforms, >> so far there is no obvious necessity in this change. > > Since your v9 patchset produces no entry in $ cat /proc/crypto on > either RB5 (qrb5165) or (with an additional patch) on sm8150-mtp or > sa8115p-adp with the default arm64 defconfig with linux-next, I am not > sure we can conclude QCE is working with these changes. Hopefully someone else can conclude it independently. You may notice that v9 patchset series does not contain sm8150 specific changes, but sm8250 one (v9 11/14) is present, testing on RB5 is valid. > Please share more details on how you tested this. I do compile linux-next with v9 QCE series applied on top of it and run the kernel on RB5 board, there is nothing really complicated about it. If you missed it, the 'cryptobench benchmark' test etc. have been already described, please find it here: https://lore.kernel.org/linux-crypto/731af3cf-6f18-caf9-ef65-ec73b0744ad9@linaro.org/ -- Best wishes, Vladimir >>> is passed on to the bam dma driver from dt via the "interconnects" >>> property. Add support in bam_dma driver to check whether the interconnect >>> path is accessible/enabled prior to attempting driver intializations. >>> >>> If interconnects are not yet setup, defer the BAM DMA driver probe(). >>> >>> Cc: Bjorn Andersson >>> Cc: Rob Herring >>> Signed-off-by: Thara Gopinath >>> Signed-off-by: Bhupesh Sharma >>> [Bhupesh: Make header file inclusion alphabetical and use 'devm_of_icc_get()'] >>> --- >>> drivers/dma/qcom/bam_dma.c | 10 ++++++++++ >>> 1 file changed, 10 insertions(+) >>> >>> diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c >>> index 2ff787df513e..a5b0cf28ffb7 100644 >>> --- a/drivers/dma/qcom/bam_dma.c >>> +++ b/drivers/dma/qcom/bam_dma.c >>> @@ -26,6 +26,7 @@ >>> #include >>> #include >>> #include >>> +#include >>> #include >>> #include >>> #include >>> @@ -394,6 +395,7 @@ struct bam_device { >>> const struct reg_offset_data *layout; >>> >>> struct clk *bamclk; >>> + struct icc_path *mem_path; >>> int irq; >>> >>> /* dma start transaction tasklet */ >>> @@ -1294,6 +1296,14 @@ static int bam_dma_probe(struct platform_device *pdev) >>> if (IS_ERR(bdev->bamclk)) >>> return PTR_ERR(bdev->bamclk); >>> >>> + /* Ensure that interconnects are initialized */ >>> + bdev->mem_path = devm_of_icc_get(bdev->dev, "memory"); >>> + if (IS_ERR(bdev->mem_path)) { >>> + ret = dev_err_probe(bdev->dev, PTR_ERR(bdev->mem_path), >>> + "failed to acquire icc path\n"); >>> + return ret; >>> + } >>> + >>> ret = clk_prepare_enable(bdev->bamclk); >>> if (ret) { >>> dev_err(bdev->dev, "failed to prepare/enable clock\n"); >> >> I'm resurrecting the comments on this change to emphasize the observation >> that the change is not needed at all to run QCE. >> >> -- >> Best wishes, >> Vladimir