Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4750717rwl; Wed, 28 Dec 2022 08:19:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXvKuwFV8rEenCCZJDpYj4BEtIbAEOkCApjGQUtbVlA+lkIhWU6hoIUXyBIMmsDuOcjk0kAV X-Received: by 2002:a05:6402:449a:b0:47d:88f3:1165 with SMTP id er26-20020a056402449a00b0047d88f31165mr25361402edb.12.1672244345358; Wed, 28 Dec 2022 08:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672244345; cv=none; d=google.com; s=arc-20160816; b=AzxEUtqhbBtuzhA4bAJ++7L0C6+XXf4VWH9AJYe1ONfAkehwRBh8pznNHyVUrWXHtv mfiWbFeRVsYiW8B+5l/KZJqxhmEVsNo1CfnNZCbq4dHO7xBLofV7R5JicTGEJgFl+XsO VoJx2ua4qN+AtbTWsGjjdTxWeZZtDqmXDbN+bokPtNxlCE51+VUUMRgVTEyEU/GKrIDH 8D5kTmE5ywpzJ3QS/kKIfL8ES/uJti2yiHtSYmRBMj9ERN+26mkO1Br2B3FhEL3FBbV6 pliEtbKwtmcD1cnnR0N7tV9+sUZRJdkpLXE96A86VaghdAcYnS+4Oxbs91cQoBHfuhzL W5/A== 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=yDZvkBvSrq1P74c4ojvaQa9MsowatpZHUMPzWldA71g=; b=SYNIUXxhL6xKE7vrMLBbbuG5THQk6OdharqP5E6Tb1LDldcMHDOcv+AxvW2bjyaPaB dfMwBcxdoZvBAEnUmZlj32otQBwF3CJXz8yKt8FbYUgqSyM7grMZ/iS7dpl2HzXw/iYy jIsZe8inNbhXhDICMLcwycTZqPKYTresC2BBLXX0tHzc5mau9IJf38zuR2FHzOth2uv3 /sMPemPCwy6un5l44fZ/ZNV4uDjReAbjZmzgu7J6DphKng/m4Hv1YMJXbIPlZGsGhK7u SauyHAABebnp/2wTrHcRAunyuyOJ0Tc5c9I74jrNcCBIDGWQH/b49OV5e03QLiT8VE+T qdQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PvScfYgv; 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 hv15-20020a17090760cf00b007ade22f401bsi13876426ejc.759.2022.12.28.08.18.30; Wed, 28 Dec 2022 08:19:05 -0800 (PST) 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=PvScfYgv; 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 S234461AbiL1QRl (ORCPT + 99 others); Wed, 28 Dec 2022 11:17:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234687AbiL1QRO (ORCPT ); Wed, 28 Dec 2022 11:17:14 -0500 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59AD71AD85 for ; Wed, 28 Dec 2022 08:15:22 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id x37so10050947ljq.1 for ; Wed, 28 Dec 2022 08:15:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=yDZvkBvSrq1P74c4ojvaQa9MsowatpZHUMPzWldA71g=; b=PvScfYgvO3aKt+TMrMAphrHdT1QPEOwJ934NeEOIEm/AIH7IDlhU+biY4NyGOaTmHJ RJ/7qRlSvn9OVXYjsO3PIkSSoU3MAY46ACg3CyyymURWTyKvuypz8YTPvsIll6C5lQO/ btXjEww9oaYKWMoiPJeYYwU8aKc3h+m6bdf3RrElHoOgH+0Udzhs+x6AwVoxm2B1WmaS B7iXQdJ/S95Pfy3i2Qlsl9LNuGKspn+SS2w3OlYqXFD/aImEb2HQPaSz+jzwpVPw4hNP 2hCSMAYwi6dNaFHyKQp/2X001ibstnXadYYNFHTMMF2lVQWf8mtIOWWJiSisxlkqIyvE jB8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yDZvkBvSrq1P74c4ojvaQa9MsowatpZHUMPzWldA71g=; b=fponMwvVfqoBma4cZW+Huot//2DU4M1ZHGGVPA7H4VfQ5VWiZpgQauzPgG5aHyw3ic +tNhGUL6tf4Hv1PjGJckWdsoJ2HMdWweZAZSlgAO15fEcAUau7Zq7RHQ9Sh+rRqnVaIE WQMFOdmg3Di6svTnxrb7ZIPZfwYnlxG3VdPObmoKM5e0pQRTAO3XmuYwOfDAjZDlutbJ SleK9kglka0w616ES4ho6bXOMvV+nVGpobE6k9Qf/jaNbn/R+8e1v05Th5Y55g7+ZR+9 e4q+bAgKEhEFyqMbvWTMDCw6+O8w99St0uNspF+6NlS5z38d2Bnt9TQfbUCYmCYEA2XW ipZw== X-Gm-Message-State: AFqh2kqUjWpnpwKWjpKhTD8za4FRQlpwvihGT93SwWLiqIHyPyhyafdo hMhBIqLSmzs12g0aJHParuKf9Q== X-Received: by 2002:a2e:8e2e:0:b0:27f:bcad:a770 with SMTP id r14-20020a2e8e2e000000b0027fbcada770mr3379097ljk.52.1672244120567; Wed, 28 Dec 2022 08:15:20 -0800 (PST) Received: from ?IPV6:2001:14ba:a085:4d00::8a5? (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id r18-20020a2e8e32000000b0027cf0ecab3fsm1995465ljk.138.2022.12.28.08.15.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Dec 2022 08:15:19 -0800 (PST) Message-ID: <7a145132-181b-cf52-18f4-4fd1b8a565d8@linaro.org> Date: Wed, 28 Dec 2022 18:15:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v7 1/1] dma: qcom: bam_dma: Add support to initialize interconnect path Content-Language: en-GB To: Vinod Koul , 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 References: <20220921030649.1436434-1-bhupesh.sharma@linaro.org> <20220921030649.1436434-2-bhupesh.sharma@linaro.org> From: Dmitry Baryshkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 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 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 22/09/2022 05:38, 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? If "interconnects" property is not present, of_icc_get() returns NULL. So the driver will not err out (correct). All ICC functions will treat NULL path correctly (by doing nothing). So this patch is correct. However we'd need v8 anyway, there needs to be a bindings update. Bhupesh, this has been lingering for some time. We need this for several platforms. Any chance for the v8? > >> + >> ret = clk_prepare_enable(bdev->bamclk); >> if (ret) { >> dev_err(bdev->dev, "failed to prepare/enable clock\n"); >> -- >> 2.37.1 > -- With best wishes Dmitry