Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp3145919rwb; Sat, 6 Aug 2022 13:54:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR7JfQKQ79zCsyrhGRuQv+lemlvsbG7X7lpNkFpk4NWNun+TOGUs2DymlNNjMDj+jASHWG6h X-Received: by 2002:a17:907:c0d:b0:730:a85d:8300 with SMTP id ga13-20020a1709070c0d00b00730a85d8300mr9138683ejc.558.1659819263404; Sat, 06 Aug 2022 13:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659819263; cv=none; d=google.com; s=arc-20160816; b=ENqmgu5KcFYu6KuOApkEnHakB2DYU7S9YMslJVeEh4pE3OlFxw5RRDITvANShzH/Do GEebFz8qzKs0tlnIQuqj5aSMPzu9q747Jja7zlgSM67k2ZKT82bMyHin0U8L8CUhhJUn seXK2Dxpsh58iOoqcc/rPgTEDsIucfNdfFMSCC8CT206DqK9fCD3cwgnIWlAwuEB6/7Y Y50Aj/XNf0mczMToUDPq6DnyPBPRgdC0b6hmsGy72DIvdU/dgZeL4Xm6/wXF/rIVIRO5 429IPLbiAsVjO/vBZUkJXaNAFtDo5wVF7AUPxifuj10UwvE3crkDy8G7BulfHOTEUkeF WbhQ== 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:cc:from :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=S4woUuE4cWaaJmFqc0XIbQnY/qY0lafx6ivX6M0QD1M=; b=dFw18YbveBytXGltRt6tC36EzuyUlf5+8wohC7uWuObDatg4+5wBbRaz5CesaosRYj OGwjcW1ZdvuilauUBPj17Qi+GfVDqVesekD77HuOMboU2/Gi+12TNpLY6A0jE6xhbWrq Zfeylg0iepzhnR5qb4acI//nOcvMtaz1VOZ2lhOZcDxr3aDs14oogFdT8nRCiWjd5JbA DlK6HEu8DnbU+kxDOGGIHduop9QvJnZ/Kg5VozXnDf67wU1MQTzNa2rxtGng7qWiKRaD NvdtmDvyOqZfaDwxGoyPf9UP0mXo9K6a3mfPpc8nHSEVYVE5H5Hr+WMSPppwk88kJhST o/XQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc10-20020a1709078a0a00b0072b13473584si7092309ejc.918.2022.08.06.13.53.55; Sat, 06 Aug 2022 13:54:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232898AbiHFUjR (ORCPT + 99 others); Sat, 6 Aug 2022 16:39:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232010AbiHFUjO (ORCPT ); Sat, 6 Aug 2022 16:39:14 -0400 Received: from smtp.smtpout.orange.fr (smtp03.smtpout.orange.fr [80.12.242.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61713DF20 for ; Sat, 6 Aug 2022 13:39:12 -0700 (PDT) Received: from [192.168.1.18] ([90.11.190.129]) by smtp.orange.fr with ESMTPA id KQZgoofew9RnzKQZho5L2z; Sat, 06 Aug 2022 22:39:10 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 06 Aug 2022 22:39:10 +0200 X-ME-IP: 90.11.190.129 Message-ID: <2729cd6f-17ff-70d8-52c5-3dceb93e6a82@wanadoo.fr> Date: Sat, 6 Aug 2022 22:39:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 7/8] remoteproc: qcom: Add support for memory sandbox Content-Language: fr To: Srinivasa Rao Mandadapu References: <1659536480-5176-1-git-send-email-quic_srivasam@quicinc.com> <1659536480-5176-8-git-send-email-quic_srivasam@quicinc.com> From: Christophe JAILLET Cc: agross@kernel.org, bgoswami@quicinc.com, bjorn.andersson@linaro.org, broonie@kernel.org, devicetree@vger.kernel.org, judyhsiao@chromium.org, lgirdwood@gmail.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, perex@perex.cz, quic_plai@quicinc.com, quic_rohkumar@quicinc.com, robh+dt@kernel.org, srinivas.kandagatla@linaro.org, swboyd@chromium.org, tiwai@suse.com In-Reply-To: <1659536480-5176-8-git-send-email-quic_srivasam@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org Hi, the error handling below looks odd. Le 03/08/2022 à 16:21, Srinivasa Rao Mandadapu a écrit : > Add memory sandbox support for ADSP based platforms secure booting. > > Signed-off-by: Srinivasa Rao Mandadapu > --- > drivers/remoteproc/qcom_q6v5_adsp.c | 101 +++++++++++++++++++++++++++++++++++- > 1 file changed, 99 insertions(+), 2 deletions(-) > > diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c > index 3dbd035..f81da47 100644 > --- a/drivers/remoteproc/qcom_q6v5_adsp.c > +++ b/drivers/remoteproc/qcom_q6v5_adsp.c > static int adsp_start(struct rproc *rproc) > { > struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; > @@ -341,7 +429,13 @@ static int adsp_start(struct rproc *rproc) > ret = qcom_q6v5_prepare(&adsp->q6v5); > if (ret) > return ret; > - > + if (!adsp->is_wpss) { > + ret = adsp_map_smmu(adsp, rproc); > + if (ret) { > + dev_err(adsp->dev, "ADSP smmu mapping failed\n"); > + goto adsp_smmu_unmap; goto disable_irqs;? > + } > + } > ret = clk_prepare_enable(adsp->xo); > if (ret) > goto disable_irqs; goto adsp_smmu_unmap;? > @@ -402,6 +496,9 @@ static int adsp_start(struct rproc *rproc) > clk_disable_unprepare(adsp->xo); > disable_irqs: > qcom_q6v5_unprepare(&adsp->q6v5); > +adsp_smmu_unmap: > + iommu_unmap(adsp->iommu_dom, adsp->mem_phys, adsp->mem_size); > + iommu_domain_free(adsp->iommu_dom); Should this new hunk be above disable_irqs? And I think that it should be guardd with a "if (!adsp->is_wpss)". CJ > > return ret; > }