Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp469950rwb; Thu, 22 Sep 2022 22:27:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6iOMrqvlv5PmgMpQhaYuFBJeUrPaIgouPdD7o48LOFNNl/2GZHFqH4a/7p+KU82cr0HN7N X-Received: by 2002:a17:907:a0c6:b0:780:bc37:2552 with SMTP id hw6-20020a170907a0c600b00780bc372552mr5478954ejc.314.1663910842632; Thu, 22 Sep 2022 22:27:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663910842; cv=none; d=google.com; s=arc-20160816; b=ncNFOxOHQ6e+Br7UIjs6+AhaRnhNxI1YFH045peZzsIo7f2DdgvrUM1ljtcJBL54+X W9H9LqtClvIvIMXa8msO0rLc4eZY6Hdv+MP2fF21AFzY32aUubQyqSq77tuyboFxUjM2 A9/1PmmCWs8VnhH/qH3/SHgwN7XdG0XLUf51mxT+McjT1asOJR8NhGRJKUwsYUxhoQqX vB0ocCj+Y8VLV0IsrPEk6mVF8zV/K7My+UroIM7XjoTCmNFGUOZdNfkwcSUjevFiW3hJ V2U8Xdm5KbTXbVWAlMN31n6yXMNQdo0IgTYFX0rhtcXJpEHpiYW4spkp7WqB++VEfDm7 cFhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=H2c0hv2ieCNxSdEWPXcGPXlDZHUdAO9roxe+nCV0M+o=; b=k/qJM3L45iqn+EydapXMU4R+Op6s/lsiWiovQXMhXeAOHreThbK6froERNTknlDxGt S9SfQTbqGEt+EkiuqsVd/FIwbMLrNEr5ipJeoifPPliKGL+4uoHoqPc9+G4U5wymBJ52 QbTj2ZVdSgSsrTAN4bhO7nIklDTRCX6sMEEODxNPJmKnrEtZ5o2SBdSgo4tTFKoA6csO Ca2+zNYlnsZO8OIBFTGnlq3bddmNU1nATPmJ1UuENO6MVVtPOAJgIo+pIK3EpSCdpQ8E 6s5uNv1ksiUvb+qqvNbc1jlI5h8BW00+gQSQ4tfP21rwbSEbQNs5Wo00IcRXP5/9qBc5 Ai/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ko4KXGf7; 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 sg16-20020a170907a41000b007413d43db0fsi8096981ejc.732.2022.09.22.22.26.44; Thu, 22 Sep 2022 22:27:22 -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=ko4KXGf7; 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 S229774AbiIWFKs (ORCPT + 99 others); Fri, 23 Sep 2022 01:10:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbiIWFKr (ORCPT ); Fri, 23 Sep 2022 01:10:47 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 120EBD62C0 for ; Thu, 22 Sep 2022 22:10:45 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id q17so13333341lji.11 for ; Thu, 22 Sep 2022 22:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=H2c0hv2ieCNxSdEWPXcGPXlDZHUdAO9roxe+nCV0M+o=; b=ko4KXGf7o8DpC3HGaGgL8EZUrFhgruem/OTHR+zk5XP8Z9NzBjUwwhiTAPpeVc64Ks bHnMcC6EQeiVV/0HLEIfxbqTFBFqv4EENzJNG1i4XKvYOb4dovp7tIvKYIjwxHMvyY+z RVwkE/+hshgTmLCtJDhsJU/12p9JA2GNXrugHeJeG5BmW6OCtVuhrtYFx6QOxHGG/4WM dfMaeCuZE26qBF2JLZk7yQM5gNYB0Av2YfqkbKLYJNIR+VP8jIKDSHc0tO4h8EOaO/CD paVtkciaLEHG8aT5VSXB6MtTwHMluMQ/MFKZGqKv72tyE4wGtrKJhYULEg26v518hAum 4PBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=H2c0hv2ieCNxSdEWPXcGPXlDZHUdAO9roxe+nCV0M+o=; b=jbrEs3wyyANXsEQkzG5sZ1wZj+ZDpWrf/35krsG0ikqKzvQuHlJ9SLjLRHtVwtf5pg BTBam42cbV4FrioD6u6ZAuJcMLxM07xT1w0QA+jK5teX9BgJwVH0gFLJTJUQab1wKC0f 1ui4O01CSSmif4R+NZMklpMfj4rIRbCVWSj871xLroynMvukGVN6+3t0f1bVAJTwMEYA P/AclHXd3BAQ1CsZ+XfTZw6f3iKrYLIIkgMskwZTB4I6RqE3kmLV+zW5Dm2gxsNK668G yRn9DcFN0Ye6uEOXJXYcqqf1VuCu99T3ZDnQNIw9hci851ecdi+soDNJlVkPwoqPS64R nT1Q== X-Gm-Message-State: ACrzQf2yQKcVoX9eAS/aRk2GXXa6hna7mX6wq+M3FWLafmkan7fLK07C nmvM/Kg4dRzf3JU+7zpekwUWg0qQF0KEPwIINlWH/A== X-Received: by 2002:a2e:9606:0:b0:26c:442a:40c2 with SMTP id v6-20020a2e9606000000b0026c442a40c2mr2302429ljh.458.1663909843228; Thu, 22 Sep 2022 22:10:43 -0700 (PDT) MIME-Version: 1.0 References: <20220921030649.1436434-1-bhupesh.sharma@linaro.org> <20220921030649.1436434-2-bhupesh.sharma@linaro.org> In-Reply-To: From: Bhupesh Sharma Date: Fri, 23 Sep 2022 10:40:31 +0530 Message-ID: Subject: Re: [PATCH v7 1/1] dma: qcom: bam_dma: Add support to initialize interconnect path To: Vinod Koul 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, Rob Herring Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Thu, 22 Sept 2022 at 08:08, Vinod Koul wrote: > > On 21-09-22, 08:36, 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. > > > > 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; > > + } > > So this makes us fail on older DT where icc path may not be present. > Should this not be an optional thing? That's a good point. I am not sure if Thara tried this on platforms which don't have the icc path available. I will fix this in v8. Thanks, Bhupesh > > + > > ret = clk_prepare_enable(bdev->bamclk); > > if (ret) { > > dev_err(bdev->dev, "failed to prepare/enable clock\n"); > > -- > > 2.37.1 > > -- > ~Vinod