From patchwork Wed May 19 14:36:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 442450 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1386794jac; Wed, 19 May 2021 07:39:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZwpj+Sak3l6A28g16MwO5Ou8IKqowONW20nyzZOb8KSoOsRyO+/twZ63kGSbmDbB3HEZb X-Received: by 2002:a92:c26f:: with SMTP id h15mr10155830ild.298.1621435160990; Wed, 19 May 2021 07:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621435160; cv=none; d=google.com; s=arc-20160816; b=JdJYWc6MzZ+UFxv1p58ZDcmBcphQ11upkudD2ZXb+Ni4l4kZLKLx4H0eWJ/RuI4Q/7 nM0R72efk4gKtXeHZ68EeH5XQ6L+vXJgp9PouFPMtRD+8+KkJ/oEDd9GCJAWA2zYHIoX Uoeu+TKJklSjvE9TBkGF0lojgo9BakR5Ohe/Zgwk+RMjcQzbZsGJagsY1bWE5fLg246K i//YtHuqkKAjis5GKCB7yBYPQSvQ0GFC5i0Pr6HX8baLvj7IUVU2qxGUH+CeQkqAOfy/ HyZgBSPP/3MqxWnCVWsA28sJqOhVcaQncXS2tU4tnpTiAWlDL8JMk6/+Um6VWodYkcqs ji3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9/tRHikibb3VDcl2hDfDt+wuIOHwmbk3mgz2i/PihKw=; b=yuD/u6KG4uXXBWI5AQ5xhe4edB5Lo2+4E1XAbEilACRO6XIi8o9sDOtZP8qbvwekFJ /3E77o3AJBr6Bxv5D8Sk8Wc+1jJS2Ycg2wKj0jqWxc7AE5qo48NZnVpWXy1pdjGUIFi1 eqwCAx2YLSGoSfxaNYyy8BK3Pim42yw1Bv8vCCmXK/ByBt5MLgt4ADpL+RBWGhPxOTBi YvCR6unl/r7vsGqljOIiUQfH4/9Ync4YZN45+IkJFxrElEAJPSs/2LQBsK87HqNRi/Y4 X3HGKESKSsV1/KrJLAsSQbjsnOxHJc3urvBjtkUSscEXWRo0d5WXuu0wm8XuCC6Qe5MB VmSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u7a89WZV; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si12174517ilg.123.2021.05.19.07.39.20; Wed, 19 May 2021 07:39:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@linaro.org header.s=google header.b=u7a89WZV; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 S1354417AbhESOkj (ORCPT + 3 others); Wed, 19 May 2021 10:40:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354430AbhESOk2 (ORCPT ); Wed, 19 May 2021 10:40:28 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F16A6C061352 for ; Wed, 19 May 2021 07:38:32 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id x18so5743452pfi.9 for ; Wed, 19 May 2021 07:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9/tRHikibb3VDcl2hDfDt+wuIOHwmbk3mgz2i/PihKw=; b=u7a89WZVIzdktaGkwWnlPlSmIYDzJGnbfm2CzHxBCMEXDIfmNMOp1L93vDZcA3DCeY g8Bpv1A/OuH0LefeJglan+PMxiZvB3+FXyoqBTYIIVZRAgQMTyhi8kLEmyUBubi2OdOl litNXvhurgiw0cbCTNxEUyGwmhW44MEJ1MC+CXylJpcsWhkv/E8CceaHzap3LI2NMtSq qcyT6r3qbHwIDIR0djgRhem08/+U14EkkuTYd+ilqHqwvQrSCfI+ITg5319w+fs6O40U kmO7/QsI7o0lWCYTJsn/gVTXbZZAL/Z6xy0h3HSyznfKI4MRanSyAHxeZGsHUs1k/IiD hOMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9/tRHikibb3VDcl2hDfDt+wuIOHwmbk3mgz2i/PihKw=; b=ghY9Jq8XLowyanw/G/OYRCXDDFo184vfiBguNUgAHnSeqaUPIeuF0CdOgPal92lTgX riGKRjdPiexZdGmg3aTifg6v2/lpJfISe942HTzquyxkNKsrOLBrnDlXI8MsQLpRm8pc j0r7HKER9VyygrLCUSlD0/P+eIDEPxX6WSrJ+4IS30WCjeJmanRTQhl+hxAJuJZCLM+1 dkSBYHwnrQNNCPfbZffgJQtXXmPz1DEA8Zwu5DK42ulU/zmhpJei6+wiZR5yHB3cgdH4 yFBhGQQEPHx1oXIQFs3CAiGFTbfJAsf4rzWeE8gdpyQZo4HjxhCaHZZmd4AJTl6tn7X8 SaEg== X-Gm-Message-State: AOAM530c0EQ6dLyFhG7jCHClQKt78Ddo9oeWCJcB0DBOXxLTgFA+E+Yh Mp8WG/FgJ+R9+nygedSVT9WXpg== X-Received: by 2002:a63:6486:: with SMTP id y128mr11051673pgb.414.1621435112516; Wed, 19 May 2021 07:38:32 -0700 (PDT) Received: from localhost.localdomain.name ([122.177.135.250]) by smtp.gmail.com with ESMTPSA id o24sm9239515pgl.55.2021.05.19.07.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 07:38:32 -0700 (PDT) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org Cc: bhupesh.sharma@linaro.org, Thara Gopinath , Bjorn Andersson , Rob Herring , Andy Gross , Herbert Xu , "David S . Miller" , Stephen Boyd , Michael Turquette , Vinod Koul , dmaengine@vger.kernel.org, linux-clk@vger.kernel.org, linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com Subject: [PATCH v3 10/17] dma: qcom: bam_dma: Add support to initialize interconnect path Date: Wed, 19 May 2021 20:06:53 +0530 Message-Id: <20210519143700.27392-11-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210519143700.27392-1-bhupesh.sharma@linaro.org> References: <20210519143700.27392-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 Cc: Andy Gross Cc: Herbert Xu Cc: David S. Miller Cc: Stephen Boyd Cc: Michael Turquette Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Cc: linux-clk@vger.kernel.org Cc: linux-crypto@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: bhupesh.linux@gmail.com Signed-off-by: Thara Gopinath [ bhupesh.sharma@linaro.org: Make header file inclusion alphabetical and use devm_of_icc_get() ] Signed-off-by: Bhupesh Sharma --- drivers/dma/qcom/bam_dma.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.31.1 diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index c8a77b428b52..4b03415b8183 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,14 @@ 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"); + 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;