Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5578104rwb; Mon, 8 Aug 2022 23:43:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR7GfxwLR+8YcxTWN7k975tDbQaLRQUQ4d/8CdKVlQ5ET0XawxGVNyQ1+DX6tUqsUrqqS4yU X-Received: by 2002:a05:6402:3514:b0:440:5538:3a97 with SMTP id b20-20020a056402351400b0044055383a97mr12873821edd.165.1660027385479; Mon, 08 Aug 2022 23:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660027385; cv=none; d=google.com; s=arc-20160816; b=aYzbcUM772ZSITrPoIkuheYZwAk2imwUyzSfRqeOxLhpsjlTJf6p0JYmMfOuAEs/vN pqaJXZccnOInCkK29ZHTVzOPBYdIXhrld20pWVxkHVAE2OKtC+0SPutbQ8nLOfBO6Y2K SqBU593aqfnsssufbWN3LHKPwvGYbjS2SMTUAIOA2rMdtb3H5a5/9OjbUrLwhiPTFgH8 N3gyGmGcWBiyxsR3MJyvBq3OzuMLTs/BU9FtuCAJwpy7lWYLQM8Sy7g8DMiRve+gYZMA mJ1lnvl6HRYWbAf762NYDVjJHfbHlXdndzRJrI3LF/HdAVR8mbhe4jb/eJMpE5T4XofZ uGNg== 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 :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=mg9vIVUx08wD84/AJ2iAaKf+in4l8tFD4HkpfPm7fKM=; b=DDLScwu6IZzYUqL8duTWiGsIgHVNAJTxQzRhS1I04OmtLWWf1Ti3tk1XIy0JUBp0UY jX9KgJUZ7Rg3w066i8xONGHvYTuuQliCalh/cT+H9ZzUSb9M4Yu9rnVG51ixEYaTcXvE llC+dIYfRrOTrcELHY3tmt4bQ2y5F5OY0sFRvNxJK9xeQCyZbRbKRluodZMrBbO2m+T7 n/B2Wb9d1F5FBWv0z3X1ky6ZynbnC9HoFMdLAZEbBIHRMm4sqaXKG4Ov5wFfjXJr3Yld BdsXvWEF9BKBW9i+67wJHigsSa79w8ms+qgi1Ulz/fnWcaKZRglOQ/typujZndi3fwRT 2OCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=qcw3ocxw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020aa7d6c1000000b0043e53ee52b9si7062960edr.120.2022.08.08.23.42.38; Mon, 08 Aug 2022 23:43:05 -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; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=qcw3ocxw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235416AbiHIGet (ORCPT + 99 others); Tue, 9 Aug 2022 02:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233465AbiHIGer (ORCPT ); Tue, 9 Aug 2022 02:34:47 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46A832018A; Mon, 8 Aug 2022 23:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1660026886; x=1691562886; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=mg9vIVUx08wD84/AJ2iAaKf+in4l8tFD4HkpfPm7fKM=; b=qcw3ocxwzR+U//C+Y7QnlcJI4Hlz58wabrOch2Ntrr1qw1CX3Az3A2lP aa1WM4EsIPUnMMhkr3nlxoT8ccnWM5VYnWF+ZeOGhNLjl9iSF7cIZe7sW Vgyu33qwYs++GdSgEUAYoPAgpA+7gZPrL9YL+l1srbyFYYnQFzp8Eitoh 8=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 08 Aug 2022 23:34:46 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2022 23:34:45 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 8 Aug 2022 23:34:44 -0700 Received: from [10.216.39.97] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 8 Aug 2022 23:34:38 -0700 Message-ID: Date: Tue, 9 Aug 2022 12:04:35 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 7/8] remoteproc: qcom: Add support for memory sandbox Content-Language: en-US To: Christophe JAILLET CC: , , , , , , , , , , , , , , , , References: <1659536480-5176-1-git-send-email-quic_srivasam@quicinc.com> <1659536480-5176-8-git-send-email-quic_srivasam@quicinc.com> <2729cd6f-17ff-70d8-52c5-3dceb93e6a82@wanadoo.fr> From: Srinivasa Rao Mandadapu Organization: Qualcomm In-Reply-To: <2729cd6f-17ff-70d8-52c5-3dceb93e6a82@wanadoo.fr> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 8/7/2022 2:09 AM, Christophe JAILLET wrote: Thanks for Your Time CJ!!! > 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;? Yes. will correct it accordingly. > >> +        } >> +    } >>       ret = clk_prepare_enable(adsp->xo); >>       if (ret) >>           goto disable_irqs; > > goto adsp_smmu_unmap;? Yes. will correct it accordingly. > >> @@ -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)". Yes. will correct it accordingly. > > CJ > >>         return ret; >>   } >