Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4753271rwb; Tue, 20 Sep 2022 20:15:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6CzgHrzVTWTtWlfdZUmFRLK8UHe+Clpe0MnWZcgbe7VxotryHK49cmgAZX0jyllq4y0xLT X-Received: by 2002:a63:82c7:0:b0:439:f2da:d103 with SMTP id w190-20020a6382c7000000b00439f2dad103mr14741298pgd.475.1663730113071; Tue, 20 Sep 2022 20:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663730113; cv=none; d=google.com; s=arc-20160816; b=ZJ4bM4tvlcVNNb5uNdxxtlczAFPvV48+0yYS5YBOEGF4Q0UwtgJwyuRoJNDBLaz1Tg cCSe+t5m+nSFB0PRS3JD0Fufm/2GiBg6o5MP3yQsmN8qrPuf0Zo8cDCdCKMUm2qfS5Xv RB/aUsnN6oTSRn8Cil1EH0zsi1UQ7ojvsFatI07kODLuhwFkBfgxHC9np+lRj74HdTvU T3+IE4gfDkrZzO75jehxLzKLSwjtOom5QXuBKzlA0eDT8I9pFuj+e0P+aDf2HYs0IXWK X5+nvhIT+E7DMIu9zE+9nDwugg+gRGbZc1K8iztcmlYLWTUFfGV8Vmu7yapWxxGJ0baZ 0UAQ== 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=a1/JrpahI0MCnEJkWnZC0/MOqcEnsO92UJD6M/si+Ww=; b=k0ZDdxLg6GA5AeWBPNoBUsNsneeF1FHKteCNpBVN/speA69uJH801yWEaP6zFv6ImQ XPGeSUpQPfb/1spjbQl0NEZziLGfNHRfubpJan5Pegc/QQ0diwBNDhcWuFsrKc8FFm9p cFuqb1pJzdMsYPbwFQwYNW0yZa6hM0aS2/+gkL44a+//MHUG+9cT5yegkSZXsWO/k2YQ nsLwiyGyuzIKTwp4kq5eQjWsHgnT1cXu19PpcxVc6QRcJrYuJHcuL/bPVWkQQKmrOWc7 77G10AfFRXkjR2hhEJJYefo7tCI3Di/GaXJkvnvWR9pEk4vnn3UroLX6guh3gAkUzh7r Z+2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Nnn6Ba/d"; 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 f20-20020a635114000000b004369ae910dbsi1512010pgb.539.2022.09.20.20.14.58; Tue, 20 Sep 2022 20:15:13 -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="Nnn6Ba/d"; 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 S230287AbiIUDHR (ORCPT + 99 others); Tue, 20 Sep 2022 23:07:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230312AbiIUDHL (ORCPT ); Tue, 20 Sep 2022 23:07:11 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92C877E02B for ; Tue, 20 Sep 2022 20:07:10 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id t70so4618522pgc.5 for ; Tue, 20 Sep 2022 20:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=a1/JrpahI0MCnEJkWnZC0/MOqcEnsO92UJD6M/si+Ww=; b=Nnn6Ba/dbQ5V/6rjJfnskHVktjzMORpcnUjkNu9n5iJxqbYbCD74gh+Vl8h8Sw0Xin 4+/0YH5zhTXKqdWdDovWnUZGjDfvcpcwCOOAvdTl47OubWyWOPyDujdoxasDjWegXGeo mdPtr9E+Pl3+LOJHPSiHfJX5G3i2OBLfMY1FxcT2Gq4qeiUItiv47tL4grhjHjFpeTUe PqP9FmX+22Bw2XwI9By4W6XFRHMwci54+lDsRDomDGqJZZ4W+JAQYxwbOGBSpCXWIGL/ sPJt/zhwtayCTtj9GHKNf9kzh8D6H1e+5i8wl9p9poM75H7Q6mk9njDhFYMRL+Yzgh49 Rt7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=a1/JrpahI0MCnEJkWnZC0/MOqcEnsO92UJD6M/si+Ww=; b=z2hUIhHpTy6nTMWLq92Cwya+kLYJL59BGBF2oQ85WIpA7tpVZKty6tdEBn8LOagb9U BvYBJal5zn9s1EVlXmPhir++5JpYDyibMu1aR3NpsT/2bNhdfYNjpxXNETy1yjY/OjTM i3We7pwuJp9NPRYo+opNr4uq+g5b27gqdAfHUFCrb3hYm7trMGyVlKyM/U61JLX+BL0t X4cFBEi/AJnLw65s/2eXR9NGx2GxQ3IC6pspeJY9kDFxx6l4T9bkKexMPxOh4G4/eNlf B2eSt3EZLOQDitRmGgHo3RQ3Awh65AWiLwqRfrPbH7hqsrUJYS2Hu9FnZJrE0IM6c3L4 Y18A== X-Gm-Message-State: ACrzQf02W+YVpXkMPLdMf1XH0j+ZD9PmR+DpXSwcA65eoKSrFaIiwCWW O9bv2yJWtK+q6gbM7t5XzoY1cQ== X-Received: by 2002:a63:8843:0:b0:439:3c8e:c2c0 with SMTP id l64-20020a638843000000b004393c8ec2c0mr23013880pgd.404.1663729629829; Tue, 20 Sep 2022 20:07:09 -0700 (PDT) Received: from localhost.localdomain ([2401:4900:1c61:8e50:8ba8:7ad7:f34c:2f5]) by smtp.gmail.com with ESMTPSA id y23-20020aa78f37000000b0053e61633057sm690846pfr.132.2022.09.20.20.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 20:07:09 -0700 (PDT) From: Bhupesh Sharma To: dmaengine@vger.kernel.org Cc: 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.sharma@linaro.org, bhupesh.linux@gmail.com, vkoul@kernel.org, Rob Herring Subject: [PATCH v7 1/1] dma: qcom: bam_dma: Add support to initialize interconnect path Date: Wed, 21 Sep 2022 08:36:49 +0530 Message-Id: <20220921030649.1436434-2-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220921030649.1436434-1-bhupesh.sharma@linaro.org> References: <20220921030649.1436434-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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; + } + ret = clk_prepare_enable(bdev->bamclk); if (ret) { dev_err(bdev->dev, "failed to prepare/enable clock\n"); -- 2.37.1