Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1679110pxj; Wed, 19 May 2021 11:16:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjEIZH+nyken6joSSHybpr7wAk8SzCb/8Xk++AbsIGXzfhgAKDtG9+vxUgwH3p5hD3SETP X-Received: by 2002:a17:906:fc1e:: with SMTP id ov30mr439653ejb.526.1621448214907; Wed, 19 May 2021 11:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621448214; cv=none; d=google.com; s=arc-20160816; b=V+FsDKJHYPrBbK1rkJdUJFnI5l2/YJEm7NiUOdE99hntleP28eRYxFy5uw6nZKGS4H ZYMi6rJnULwmkAF1gUcgTqHvkfwYvSSn7ayGv/1aUXXcc+yAqxRkhL78ftlkGHC2/HLY HHneDgERkHBmIyIUpPrxaLk5ERPAhfJdoIQohKMiVkrRbbiWM7Mk2EJXPwD9oCdocGjB 8dveJS0b1gbLL880WCiu8hfagDb6JVcPw4OR6IS1FTj9zrAZf/PtmbNZGpGUYWeH05rH dB/GlHYsWw3BKjUX8Wk6piYFjop4Qfhvww7qtUW1+JpCcBGc55JWIvOr1wFnTJoWuScH lhLg== 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=zp3it5Zu0KA9JHtt+jDEOh0cwWAwW8S1nVYQo9cUI6g=; b=Gvhd8otDN40RWkEei3ICjLSikoQPzbctEhpHW8OLnUiECGpurt4iuPvAeZJYEgQZTY HDPq2yFxyQwNZaXy/OgUCMXOqArlShC0jaYJ8XmPZ+IKx7bD0sPr4ao7RIsjah8hXuOp 7Re75+TwOTSDK0OLtnMZte+m2ICQxWPyQQdm4IdzNImFPCRWUCHxKvX7fxdFF4g/4FH/ wA16gIxNI9FAMNxKKXQUhAAZW3zPd8IQBqmW9gUXoSEz686BvBDSRyxJaeZMtmcm7fpp H9XCNzyXc0bYOxZUl2ts0oACi0DHY7Q/Fu3aZKNHLnNvWOdiCOXjQgh+GosA6iClG8U2 fS1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M+LBCcMH; 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 g12si22575826edn.564.2021.05.19.11.16.31; Wed, 19 May 2021 11:16:54 -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=M+LBCcMH; 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 S234223AbhEROlM (ORCPT + 99 others); Tue, 18 May 2021 10:41:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234490AbhEROlH (ORCPT ); Tue, 18 May 2021 10:41:07 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 076DAC061760 for ; Tue, 18 May 2021 07:39:49 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id j75so9936041oih.10 for ; Tue, 18 May 2021 07:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zp3it5Zu0KA9JHtt+jDEOh0cwWAwW8S1nVYQo9cUI6g=; b=M+LBCcMHMPB69ojN8igqTaiE33ZRMpEcF1APy9OlgsLWEwTLhd++g9E5r/PdgPXEYk Sf+oWKImVvjttXeuquw1tqKq5sDT5hjJaJrr+UNwmVU4yyHWnKmjWyMw/MlpRuRujG3f OPz9XnatcZBy1chC6V/PUTr8885yi7PK0DlXuwh780MM5fxWeByS/rU5afx+k05h1jpm 6Fcu7iuPNq3rkO4cA5dE3C1+aLyOA0g1mfkf0PgTpooOLOhwOnpmJucMbwAHPEXBoGUI M0YmbK1i3TawT2Kq/MdoI37cIF1l4xEwiO9riemaM2il88FrHe0Ly8xeiVsF219JVpb/ 6zcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zp3it5Zu0KA9JHtt+jDEOh0cwWAwW8S1nVYQo9cUI6g=; b=PUqsqXzZfClUfZMaSI1t8jDrsPVgCMD3W4Zjc4W7SHttjaLimjyN6GQPDUmr1U+UWL 7DT5JXN1k0P4KLklIBeruWNSD7m//ZCSXGCA7F64k9KnRIuZvozqllqc7BklaqStvEW9 JtIagTfJhuFaO2gMLaPoMWdi3ZoD5axbqmIc5HNoTVGHy9Oh6+7AwjCRESHSXEZBTsu+ LdbRhpD4Ubt9s+84ou+mFloEv5M8WZm6yJaoLqmCOoMLZ1coAquGrZVQW9XvtbxGulxc mcuMUJPmVSuVQncvPPUHS5v5xUXWDqFvRj21nR+6oNcX0O0mBJGW87bfZr7gGknlUFzW i9iA== X-Gm-Message-State: AOAM533vP5+1IN2Y5UsWKt/btKEzQFr9Rke6CuUqjsx15T5CR50ZnC6f pjmMPt40GAkBAxk3DiX6YlogYoJOipaKG6lW9d6aCA== X-Received: by 2002:a05:6808:f0b:: with SMTP id m11mr3641199oiw.12.1621348788489; Tue, 18 May 2021 07:39:48 -0700 (PDT) MIME-Version: 1.0 References: <20210505213731.538612-1-bhupesh.sharma@linaro.org> <20210505213731.538612-17-bhupesh.sharma@linaro.org> In-Reply-To: From: Bhupesh Sharma Date: Tue, 18 May 2021 20:09:37 +0530 Message-ID: Subject: Re: [PATCH v2 16/17] crypto: qce: Defer probe in case interconnect is not yet initialized To: Thara Gopinath Cc: linux-arm-msm@vger.kernel.org, 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Thara, On Mon, 10 May 2021 at 18:53, Thara Gopinath wrote: > > > > On 5/5/21 5:37 PM, Bhupesh Sharma wrote: > > On some Qualcomm parts the qce crypto driver needs the interconnect between > > the crypto block and main memory to be initialized first before the crypto > > registers can be accessed. So it makes sense to defer the qce crypto driver > > probing in case the interconnect driver is not yet probed. > > > > This fixes the qce probe failure issues when both qce and > > interconnect drivers are compiled as static part of the kernel. > > > > Cc: Thara Gopinath > > 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: Bhupesh Sharma > > --- > > drivers/crypto/qce/core.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c > > index 3e742e9911fa..9915b184f780 100644 > > --- a/drivers/crypto/qce/core.c > > +++ b/drivers/crypto/qce/core.c > > @@ -222,6 +222,20 @@ static int qce_crypto_probe(struct platform_device *pdev) > > return ret; > > > > qce->mem_path = of_icc_get(qce->dev, "memory"); > > + > > + /* Check for NULL return path, which indicates > > + * interconnect API is disabled or the "interconnects" > > + * DT property is missing. > > + */ > > + if (!qce->mem_path) > > + /* On some qcom parts, the qce crypto block needs interconnect > > + * paths to be configured before the registers can be accessed. > > + * Check here for the same. > > + */ > > + if (!strcmp(of_id->compatible, "qcom,ipq6018-qce") || > > + !strcmp(of_id->compatible, "qcom,sdm845-qce")) > > + return -EPROBE_DEFER; > > + > > Hi Bhupesh, > > You don't need this here. of_icc_get returns -EPROBE_DEFER if the > interconnect provider is not initialized yet. Thanks for the review. Yes, I finished testing all the possible combinations with qce, bam dma and interconnect drivers compiled as modules v/s as static parts of the kernel and we don't need this extra check for the interconnect here. We should be fine with checking just the qce_dma_request() return value and returning early in the qce probe() flow if no dma channels are yet available from the bam dma driver. I have made the changes in v3 and will post it for review shortly. Regards, Bhupesh