Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp523730iob; Fri, 13 May 2022 06:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcVi2b5cFhnJ2F1LemwW4V6zPe0mYCKIWxYH+nqMIp/cwqSyJ8IgUWu+ZnfrTLBpzy3yAC X-Received: by 2002:a05:6000:1786:b0:20c:6063:5014 with SMTP id e6-20020a056000178600b0020c60635014mr4141115wrg.251.1652450346128; Fri, 13 May 2022 06:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652450346; cv=none; d=google.com; s=arc-20160816; b=yiv99P7YQw6H795MYXiBMtxPrZOqNZdilPG9dnvz/enbeaDrTektGnBirLpEvdJUHh a5QIvPGMwz7X6L9rtNvtFN6rTjJ5M6u4v+mMCTE60F99Q9GxWhJXkNjoXmBqf5BP413c tAbXWmsjPlOOb+vJxFp+m1aqXwHuIlWqAxQHxLBYTj80pQYYhQRu6G1/XZ+MzxWShuoQ 1tQgsR62+MRFGT2UbrAT4o2/lkqJG0UevXarw4roZErsKRjlnC8UXgsjmCL+NOgCF8us /ZKtQigfGiiZqDE8fzo/AyCNjXOhdYWZEZg/x5oKVl+E4Z8FGNyWVckHzaWz3hlDJaG5 +wKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=UxYHPKKpJ3gJqXFoP77Myjabfl2sbzgjV+P+sSNGRWw=; b=uAW1yuOusXLqkif+rc3kMueIWy2PYlh6EFCs0wegiuTz0Lbla/y2OogcTpFVTCyQgc 6RMdnQQD3k+9qhX2wSwcAeG6zCSbniGVEtJApiuQqykxJukzSC/KmpctOPs5RjWTQrae +69/RfoL8d4+vF34/ujBTKQJmIWpWu8Cg+rIK9Nt+TbGpMVtdmylv4owoCkONP81sJTT p5pXQO4sbavUowU8kuwQcEG394tVcIM5593vazQWTny8yFtTwUgG/+CHimwrXR6MXLww bsG6sf5LjR5t5q76XHYRkjTKGX8fxepQO7DGltpPQKnJOLrE6lk8fVImqUz3ZAqvBjIz MHkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dntSTokM; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g7-20020a5d64e7000000b0020ab844e683si2331762wri.193.2022.05.13.06.58.36; Fri, 13 May 2022 06:59:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dntSTokM; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359530AbiELXjG (ORCPT + 99 others); Thu, 12 May 2022 19:39:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346147AbiELXjE (ORCPT ); Thu, 12 May 2022 19:39:04 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72F80286FF5 for ; Thu, 12 May 2022 16:39:03 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id t25so8373853ljd.6 for ; Thu, 12 May 2022 16:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=UxYHPKKpJ3gJqXFoP77Myjabfl2sbzgjV+P+sSNGRWw=; b=dntSTokMCD79xEtTvx5gvFLZ5kcRTVQvoV2VPYYERLJmmXiz8hnZSVDnP5IRfnKQUn ZRfwt04aYzGCx8etnz3Pt4PT37pe+yuK2lDiN0QvmVc3rdyKwtOBvwfFiFPDItgmHizs N21m6rv0vm5mQFGwV1g9g+u1qot7Raepaj9hn6j3Nhyuvgxfg6RnOmRpmQ3oc9WBr70Y SH1B3vHIoDr1PKZOmRqy5Va2boCmz0BaJ9P4FywUSRmsW1zkUrYabqM+ZG+/aGXYknOt rKDATdfV7mPz+Uxn7gKMo82OIsAo1XE631ID/Q0Kzv3fULwtFosMAoDi/Wqej469bHPh 326A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=UxYHPKKpJ3gJqXFoP77Myjabfl2sbzgjV+P+sSNGRWw=; b=S/Tg4pGtYvIu8tRt0GSwnI7cxMidm6Y1i3ajsQHzzwT0Ecc4IERO9ZwKZsxk/7/xP2 9s1wgp8KKjVlAbE/6BeinyynVcxEQLjRqWixQNg6oUxpxpM2L042SeAS85RiB5zAvjoo b1hbwIm3OI3QOYRmRYAuGxt8+6kT+bN+QksVnD9zy9c0XSwnDeXIJ835efImOFiJ8SpD J51AreNbMI3wtTKja1t5p/xC7uTXfmR92L5E/csL/XasvyZuYK1uFHSCMbBxY0PsG+YC Ihb1jYwMDQpJkeTnve6GvQCPKD4hIE67QmRfAtscdut6+XascEv009eU+nygbcC8/VcO oQPQ== X-Gm-Message-State: AOAM530EEY9nlBHJyZsj1sF8AqRvyjLfN0BJkWcmi9FXhBlQ4THzOUwF serESrecvwYk9PEsWRL6bBHnHw== X-Received: by 2002:a05:651c:312:b0:251:f8b8:184e with SMTP id a18-20020a05651c031200b00251f8b8184emr1465068ljp.9.1652398741790; Thu, 12 May 2022 16:39:01 -0700 (PDT) Received: from [192.168.1.211] ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id j18-20020a056512345200b004725b701c94sm135316lfr.42.2022.05.12.16.39.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 May 2022 16:39:01 -0700 (PDT) Message-ID: <49615bc9-c7a4-09ed-c89f-39c50e1d90ba@linaro.org> Date: Fri, 13 May 2022 02:39:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v5 13/22] dma: qcom: bam_dma: Add support to initialize interconnect path Content-Language: en-GB To: Bhupesh Sharma , linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org Cc: bhupesh.linux@gmail.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, agross@kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net, stephan@gerhold.net, Thara Gopinath , Bjorn Andersson References: <20211110105922.217895-1-bhupesh.sharma@linaro.org> <20211110105922.217895-14-bhupesh.sharma@linaro.org> From: Dmitry Baryshkov In-Reply-To: <20211110105922.217895-14-bhupesh.sharma@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 10/11/2021 13:59, 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 > 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. > > Cc: Bjorn Andersson > Cc: Rob Herring > Signed-off-by: Bhupesh Sharma > [Make header file inclusion alphabetical and use 'devm_of_icc_get()'] > Signed-off-by: Thara Gopinath > --- > drivers/dma/qcom/bam_dma.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c > index c8a77b428b52..19fb17db467f 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 > @@ -392,6 +393,7 @@ struct bam_device { > const struct reg_offset_data *layout; > > struct clk *bamclk; > + struct icc_path *mem_path; > int irq; > > /* dma start transaction tasklet */ > @@ -1284,6 +1286,15 @@ static int bam_dma_probe(struct platform_device *pdev) > return ret; > } > > + /* Ensure that interconnects are initialized */ > + bdev->mem_path = devm_of_icc_get(bdev->dev, "memory"); Also, as a note, the "memory" is not a good name for the ICC path. Usually they take the form of "src-dst". However in this case you can probably use NULL for the first and the only icc path. > + Extra newline, not necessary. > + if (IS_ERR(bdev->mem_path)) { > + ret = PTR_ERR(bdev->mem_path); > + dev_err(bdev->dev, "failed to acquire icc path %d\n", ret); > + goto err_disable_clk; > + } > + > ret = bam_init(bdev); > if (ret) > goto err_disable_clk; -- With best wishes Dmitry