linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Maulik Shah <quic_mkshah@quicinc.com>
Cc: bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	rafael@kernel.org, daniel.lezcano@linaro.org,
	quic_lsrao@quicinc.com, quic_rjendra@quicinc.com
Subject: Re: [PATCH 09/10] soc: qcom: rpmh-rsc: Save base address of drv
Date: Fri, 14 Jan 2022 13:35:47 +0100	[thread overview]
Message-ID: <CAPDyKFrASmBKRLLvWS-TUBdrtgPieuu1p0jco+qAuWo6HV2E=A@mail.gmail.com> (raw)
In-Reply-To: <1641749107-31979-10-git-send-email-quic_mkshah@quicinc.com>

On Sun, 9 Jan 2022 at 18:26, Maulik Shah <quic_mkshah@quicinc.com> wrote:
>
> Add changes to save drv's base address for rsc. This is
> used to read drv's configuration such as solver mode is
> supported or to write into CONTROL_TCS registers.
>
> Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  drivers/soc/qcom/rpmh-internal.h |  2 ++
>  drivers/soc/qcom/rpmh-rsc.c      | 18 ++++++++----------
>  2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/soc/qcom/rpmh-internal.h b/drivers/soc/qcom/rpmh-internal.h
> index 32ac117..6770bbb 100644
> --- a/drivers/soc/qcom/rpmh-internal.h
> +++ b/drivers/soc/qcom/rpmh-internal.h
> @@ -91,6 +91,7 @@ struct rpmh_ctrlr {
>   * Resource State Coordinator controller (RSC)
>   *
>   * @name:               Controller identifier.
> + * @base:               Start address of the DRV registers in this controller.
>   * @tcs_base:           Start address of the TCS registers in this controller.
>   * @id:                 Instance id in the controller (Direct Resource Voter).
>   * @num_tcs:            Number of TCSes in this DRV.
> @@ -115,6 +116,7 @@ struct rpmh_ctrlr {
>   */
>  struct rsc_drv {
>         const char *name;
> +       void __iomem *base;
>         void __iomem *tcs_base;
>         int id;
>         int num_tcs;
> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
> index 5875ad5..c2a7c6c 100644
> --- a/drivers/soc/qcom/rpmh-rsc.c
> +++ b/drivers/soc/qcom/rpmh-rsc.c
> @@ -882,8 +882,7 @@ static int rpmh_rsc_pd_attach(struct rsc_drv *drv, struct device *dev)
>         return dev_pm_genpd_add_notifier(dev, &drv->genpd_nb);
>  }
>
> -static int rpmh_probe_tcs_config(struct platform_device *pdev,
> -                                struct rsc_drv *drv, void __iomem *base)
> +static int rpmh_probe_tcs_config(struct platform_device *pdev, struct rsc_drv *drv)
>  {
>         struct tcs_type_config {
>                 u32 type;
> @@ -897,9 +896,9 @@ static int rpmh_probe_tcs_config(struct platform_device *pdev,
>         ret = of_property_read_u32(dn, "qcom,tcs-offset", &offset);
>         if (ret)
>                 return ret;
> -       drv->tcs_base = base + offset;
> +       drv->tcs_base = drv->base + offset;
>
> -       config = readl_relaxed(base + DRV_PRNT_CHLD_CONFIG);
> +       config = readl_relaxed(drv->base + DRV_PRNT_CHLD_CONFIG);
>
>         max_tcs = config;
>         max_tcs &= DRV_NUM_TCS_MASK << (DRV_NUM_TCS_SHIFT * drv->id);
> @@ -961,7 +960,6 @@ static int rpmh_rsc_probe(struct platform_device *pdev)
>         char drv_id[10] = {0};
>         int ret, irq;
>         u32 solver_config;
> -       void __iomem *base;
>
>         /*
>          * Even though RPMh doesn't directly use cmd-db, all of its children
> @@ -988,11 +986,11 @@ static int rpmh_rsc_probe(struct platform_device *pdev)
>                 drv->name = dev_name(&pdev->dev);
>
>         snprintf(drv_id, ARRAY_SIZE(drv_id), "drv-%d", drv->id);
> -       base = devm_platform_ioremap_resource_byname(pdev, drv_id);
> -       if (IS_ERR(base))
> -               return PTR_ERR(base);
> +       drv->base = devm_platform_ioremap_resource_byname(pdev, drv_id);
> +       if (IS_ERR(drv->base))
> +               return PTR_ERR(drv->base);
>
> -       ret = rpmh_probe_tcs_config(pdev, drv, base);
> +       ret = rpmh_probe_tcs_config(pdev, drv);
>         if (ret)
>                 return ret;
>
> @@ -1015,7 +1013,7 @@ static int rpmh_rsc_probe(struct platform_device *pdev)
>          * 'HW solver' mode where they can be in autonomous mode executing low
>          * power mode to power down.
>          */
> -       solver_config = readl_relaxed(base + DRV_SOLVER_CONFIG);
> +       solver_config = readl_relaxed(drv->base + DRV_SOLVER_CONFIG);
>         solver_config &= DRV_HW_SOLVER_MASK << DRV_HW_SOLVER_SHIFT;
>         solver_config = solver_config >> DRV_HW_SOLVER_SHIFT;
>         if (!solver_config) {
> --
> 2.7.4
>

  reply	other threads:[~2022-01-14 12:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09 17:24 [PATCH 00/10] Add APSS RSC to Cluster power domain Maulik Shah
2022-01-09 17:24 ` [PATCH 01/10] arm64: dts: qcom: sm8150: Correct TCS configuration for apps rsc Maulik Shah
2022-01-09 17:24 ` [PATCH 02/10] arm64: dts: qcom: sm8250: Add cpuidle states Maulik Shah
2022-01-14 12:30   ` Ulf Hansson
2022-01-09 17:25 ` [PATCH 03/10] arm64: dts: qcom: sm8350: Correct TCS configuration for apps rsc Maulik Shah
2022-01-09 17:25 ` [PATCH 04/10] arm64: dts: qcom: sm8450: Update cpuidle states parameters Maulik Shah
2022-01-14 12:30   ` Ulf Hansson
2022-01-17  8:12     ` Maulik Shah
2022-01-09 17:25 ` [PATCH 05/10] dt-bindings: soc: qcom: Update devicetree binding document for rpmh-rsc Maulik Shah
2022-01-14 12:31   ` Ulf Hansson
2022-01-21 23:06   ` Rob Herring
2022-01-09 17:25 ` [PATCH 06/10] soc: qcom: rpmh-rsc: Attach RSC to cluster PM domain Maulik Shah
2022-01-14 12:30   ` Ulf Hansson
2022-01-09 17:25 ` [PATCH 07/10] arm64: dts: qcom: Add power-domains property for apps_rsc Maulik Shah
2022-01-14 12:33   ` Ulf Hansson
2022-01-09 17:25 ` [PATCH 08/10] PM: domains: Store the closest hrtimer event of the domain CPUs Maulik Shah
2022-01-14 13:38   ` Ulf Hansson
2022-01-25 18:49   ` Ulf Hansson
2022-01-09 17:25 ` [PATCH 09/10] soc: qcom: rpmh-rsc: Save base address of drv Maulik Shah
2022-01-14 12:35   ` Ulf Hansson [this message]
2022-01-09 17:25 ` [PATCH 10/10] soc: qcom: rpmh-rsc: Write CONTROL_TCS with next timer wakeup Maulik Shah
2022-01-14 13:34   ` Ulf Hansson
2022-02-01  5:19 ` (subset) [PATCH 00/10] Add APSS RSC to Cluster power domain Bjorn Andersson
2022-03-29  9:55   ` Amit Pundir
2022-04-25 16:56     ` Amit Pundir

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='CAPDyKFrASmBKRLLvWS-TUBdrtgPieuu1p0jco+qAuWo6HV2E=A@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=quic_lsrao@quicinc.com \
    --cc=quic_mkshah@quicinc.com \
    --cc=quic_rjendra@quicinc.com \
    --cc=rafael@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).