Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp167318rwb; Wed, 21 Sep 2022 19:45:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6DGAfaHc0hQeVddzzFDZPEnKNDJuL6WznHIEKZoWe115gvcRChdIp4boTxYKNUbbnFxAHq X-Received: by 2002:a17:90b:4acf:b0:202:65e3:da5a with SMTP id mh15-20020a17090b4acf00b0020265e3da5amr12747325pjb.174.1663814709553; Wed, 21 Sep 2022 19:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663814709; cv=none; d=google.com; s=arc-20160816; b=yuYijPqcrsexNqSdOVXJU47EBrci9GCqQXinY0lTChJ8zYMLWANEIjHR6XXMHewAjn xxW4c4iV/ncPfoeExwJX/0TZP1UufiFnOGBzMxhBWlbSLvojCzjBuAoA0XIkirg8umG4 fYwYBqjmxPMkbIOrCS/D8nTmGG2BMMYZxVcCkUDG73NnSKYt/y7utBCP0/Sf4G4Um726 VnRrOuH1KlklqwucL4reow6CDnmDtgMo+nkCmWIbV9RE/zPywNBoaqirOACMTYmnjxHC mY722qyAXlk3oLlOUMJU6d0W7z1g/DzaGU0JB2vmtQkUyPOVM9qeP3CbgeZl82vnOpkG Op0w== 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=PUk5PvPgseN5tzeJn0/C8qvKI/jovpv3b02+uZS4awQ=; b=y42aD68RBaZDPBu8GF8KV+x12xJFkNzV6lR+lP2gNdceWaZEq+3VAhNyvEqq2XvqvO J+/rkvQ491xX5Ec3xK7evbqWMYdcErtHLrsewsbrEOc3BEZyDJXnxWYTyH5yd3dsMZNT oZ7ydu1EXsJpIH0bKjwBrxeqlCgNf/dS8ZZkt2fLUB9QWN21KkOZ4Bowrl75JFQuq39Z etAHq4SMvKygXsUn6JZ+Tcl1MPLaQJLYzSbTWbRHxGIGZHg+2KnPCzzsxw1cwiRzfJUo Y4Ie1bWdqwQTcV6ZOu5rM+U89+cL6VnVItb5H/COkNTn9+tZ86hmQC7/745Mc6RV8UBU dOwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=twmF+KMs; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n6-20020aa79046000000b0053dd073fc8dsi4461484pfo.175.2022.09.21.19.44.48; Wed, 21 Sep 2022 19:45:09 -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=@kernel.org header.s=k20201202 header.b=twmF+KMs; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229673AbiIVCiU (ORCPT + 99 others); Wed, 21 Sep 2022 22:38:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbiIVCiT (ORCPT ); Wed, 21 Sep 2022 22:38:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59F5EAC25B; Wed, 21 Sep 2022 19:38:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E881763145; Thu, 22 Sep 2022 02:38:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1A36C433D6; Thu, 22 Sep 2022 02:38:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663814297; bh=MOtwl9mtwhtHTWDeXYdNcwvXQVIElYFyIDDemYh6RtQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=twmF+KMsN6Awv35vKFSKmpcxIR9EJ/rmGSpB1v+r1o1Q4xXjCNi8Zdmv44LIDZsTu /qREctSOI92mNJI03HKwsbvummXIha6buUJLJCVbM5J3938Yd6lB2ukaZ71KWYCRT2 4XUSqL99aNvOIdWODuqKAdfYgwZZUywPHNEarGPMd3OsSRk8SuA4DiDxofSaTn3cs9 AcQTp0jHWmuvV5QDnvvmkPzGl/uoEejgYBrZrO9TnDLPDFvpU4wYcWJV5A3/JEarmI 2euJ+VWZLrutaD4s7aim7XbmQaTHZTLtSYz0qBRqbeXRF9kDndnAZ3K0Oc+Ic4P19R RV4t6khNZM3mA== Date: Thu, 22 Sep 2022 08:08:13 +0530 From: Vinod Koul 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, Rob Herring Subject: Re: [PATCH v7 1/1] dma: qcom: bam_dma: Add support to initialize interconnect path Message-ID: References: <20220921030649.1436434-1-bhupesh.sharma@linaro.org> <20220921030649.1436434-2-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220921030649.1436434-2-bhupesh.sharma@linaro.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 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? > + > ret = clk_prepare_enable(bdev->bamclk); > if (ret) { > dev_err(bdev->dev, "failed to prepare/enable clock\n"); > -- > 2.37.1 -- ~Vinod