mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
To: Stephen Boyd <swboyd@chromium.org>, <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>,
	<tiwai@suse.com>
Subject: Re: [PATCH v6 7/8] remoteproc: qcom: Add support for memory sandbox
Date: Mon, 19 Sep 2022 19:29:09 +0530	[thread overview]
Message-ID: <e9b0187b-f4b1-5aef-862e-7bc2bbab4e1a@quicinc.com> (raw)
In-Reply-To: <CAE-0n53CUPAW2P5uC-4fN+qPw0PLCaz4Dfom7htYOTT9-o+A9Q@mail.gmail.com>


On 9/12/2022 4:31 AM, Stephen Boyd wrote:
Thanks for Your time Stephen!!!
> Quoting Srinivasa Rao Mandadapu (2022-09-08 06:23:41)
>> diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
>> index ccb5592..e55d593 100644
>> --- a/drivers/remoteproc/qcom_q6v5_adsp.c
>> +++ b/drivers/remoteproc/qcom_q6v5_adsp.c
>> @@ -9,6 +9,7 @@
>>   #include <linux/firmware.h>
>>   #include <linux/interrupt.h>
>>   #include <linux/io.h>
>> +#include <linux/iommu.h>
>>   #include <linux/iopoll.h>
>>   #include <linux/kernel.h>
>>   #include <linux/mfd/syscon.h>
>> @@ -48,6 +49,8 @@
>>   #define LPASS_PWR_ON_REG               0x10
>>   #define LPASS_HALTREQ_REG              0x0
>>
>> +#define SID_MASK_DEFAULT        0xF
>> +
>>   #define QDSP6SS_XO_CBCR                0x38
>>   #define QDSP6SS_CORE_CBCR      0x20
>>   #define QDSP6SS_SLEEP_CBCR     0x3c
>> @@ -333,6 +336,42 @@ static int adsp_load(struct rproc *rproc, const struct firmware *fw)
>>          return 0;
>>   }
>>
>> +static void adsp_unmap_smmu(struct rproc *rproc)
>> +{
>> +       struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
> Drop the cast, it's unnecessary.
Okay. Will drop casting.
>
>> +
>> +       iommu_unmap(rproc->domain, adsp->mem_phys, adsp->mem_size);
>> +}
>> +
> [..]
>> @@ -343,9 +382,17 @@ static int adsp_start(struct rproc *rproc)
>>          if (ret)
>>                  return ret;
>>
>> +       if (adsp->has_iommu) {
>> +               ret = adsp_map_smmu(adsp, rproc);
>> +               if (ret) {
>> +                       dev_err(adsp->dev, "ADSP smmu mapping failed\n");
>> +                       goto disable_irqs;
>> +               }
>> +       }
>> +
>>          ret = clk_prepare_enable(adsp->xo);
>>          if (ret)
>> -               goto disable_irqs;
>> +               goto adsp_smmu_unmap;
>>
>>          ret = qcom_rproc_pds_enable(adsp, adsp->proxy_pds,
>>                                      adsp->proxy_pd_count);
>> @@ -401,6 +448,9 @@ static int adsp_start(struct rproc *rproc)
>>          qcom_rproc_pds_disable(adsp, adsp->proxy_pds, adsp->proxy_pd_count);
>>   disable_xo_clk:
>>          clk_disable_unprepare(adsp->xo);
>> +adsp_smmu_unmap:
>> +       if (adsp->has_iommu)
>> +               adsp_unmap_smmu(rproc);
> Why not pass adsp directly to adsp_unmap_smmu()? And even better would
> be to make it a no-op when adsp->has_iommu is false, so that the code
> reads straight-line otherwise.
Okay. Will update accordingly.
>
>>   disable_irqs:
>>          qcom_q6v5_unprepare(&adsp->q6v5);
>>
>> @@ -429,6 +479,9 @@ static int adsp_stop(struct rproc *rproc)
>>          if (ret)
>>                  dev_err(adsp->dev, "failed to shutdown: %d\n", ret);
>>
>> +       if (adsp->has_iommu)
>> +               adsp_unmap_smmu(rproc);
>> +
>>          handover = qcom_q6v5_unprepare(&adsp->q6v5);
>>          if (handover)
>>                  qcom_adsp_pil_handover(&adsp->q6v5);
>> --
>> 2.7.4
>>

  reply	other threads:[~2022-09-19 14:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 13:23 [PATCH v6 0/8] Update ADSP pil loader for SC7280 platform Srinivasa Rao Mandadapu
2022-09-08 13:23 ` [PATCH v6 1/8] dt-bindings: remoteproc: qcom: Add SC7280 ADSP support Srinivasa Rao Mandadapu
2022-09-11 22:52   ` Stephen Boyd
2022-09-14  8:58   ` Sibi Sankar
2022-09-19 14:04     ` Srinivasa Rao Mandadapu
2022-09-08 13:23 ` [PATCH v6 2/8] remoteproc: qcom: Add flag in adsp private data structure Srinivasa Rao Mandadapu
2022-09-14  9:06   ` Sibi Sankar
2022-09-19 14:05     ` Srinivasa Rao Mandadapu
2022-09-08 13:23 ` [PATCH v6 3/8] remoteproc: qcom: Add compatible name for SC7280 ADSP Srinivasa Rao Mandadapu
2022-09-11 22:53   ` Stephen Boyd
2022-09-14  9:22   ` Sibi Sankar
2022-09-19 14:11     ` Srinivasa Rao Mandadapu
2022-09-08 13:23 ` [PATCH v6 4/8] remoteproc: qcom: Update rproc parse firmware callback Srinivasa Rao Mandadapu
2022-09-11 22:55   ` Stephen Boyd
2022-09-19 13:57     ` Srinivasa Rao Mandadapu
2022-09-14  9:35   ` Sibi Sankar
2022-09-19 14:15     ` Srinivasa Rao Mandadapu
2022-09-08 13:23 ` [PATCH v6 5/8] remoteproc: qcom: Replace hard coded values with macros Srinivasa Rao Mandadapu
2022-09-14  9:37   ` Sibi Sankar
2022-09-08 13:23 ` [PATCH v6 6/8] remoteproc: qcom: Add efuse evb selection control Srinivasa Rao Mandadapu
2022-09-11 22:57   ` Stephen Boyd
2022-09-14  9:42   ` Sibi Sankar
2022-09-08 13:23 ` [PATCH v6 7/8] remoteproc: qcom: Add support for memory sandbox Srinivasa Rao Mandadapu
2022-09-11 23:01   ` Stephen Boyd
2022-09-19 13:59     ` Srinivasa Rao Mandadapu [this message]
2022-09-14 10:10   ` Sibi Sankar
2022-09-19 14:19     ` Srinivasa Rao Mandadapu
2022-09-08 13:23 ` [PATCH v6 8/8] remoteproc: qcom: Update QDSP6 out-of-reset timeout value Srinivasa Rao Mandadapu
2022-09-14  9:45   ` Sibi Sankar
2022-09-19 14:20     ` Srinivasa Rao Mandadapu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9b0187b-f4b1-5aef-862e-7bc2bbab4e1a@quicinc.com \
    --to=quic_srivasam@quicinc.com \
    --cc=agross@kernel.org \
    --cc=bgoswami@quicinc.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=judyhsiao@chromium.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=quic_plai@quicinc.com \
    --cc=quic_rohkumar@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=swboyd@chromium.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®