linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Enric Balletbo Serra <eballetbo@gmail.com>
To: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	 Linux ARM <linux-arm-kernel@lists.infradead.org>,
	 "moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	 Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	 chun-jie.chen@mediatek.corp-partner.google.com,
	 Yong Wu <yong.wu@mediatek.com>
Subject: Re: [PATCH 2/3] soc: mtk-pm-domains: do not register smi node as syscon
Date: Mon, 31 May 2021 23:36:07 +0200	[thread overview]
Message-ID: <CAFqH_53nNca8VG=09djYseJBWWg5j=YFTfPjxJL5w-aTyBmCng@mail.gmail.com> (raw)
In-Reply-To: <20210531043502.2702645-2-hsinyi@chromium.org>

Hi Hsin-Yi,

(again without html, sorry for the noise)

Thank you for the patch.

Missatge de Hsin-Yi Wang <hsinyi@chromium.org> del dia dl., 31 de maig
2021 a les 6:35:
>
> Mediatek requires mmsys clocks to be unprepared during suspend,
> otherwise system has chances to hang.
>
> syscon_regmap_lookup_by_phandle_optional() will attach and prepare the
> first clock in smi node, leading to additional prepare to the clock
> which is not balanced with the prepare/unprepare pair in resume/suspend
> callbacks.
>
> If a power domain node requests an smi node and the smi node's first
> clock is an mmsys clock, it will results in an unstabke suspend resume.

Typo s/unstabke/unstable/

I think it would be nice to have a Fixes tag for that patch. So can be
picked for the stable kernel more easily.

>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>

I have a nit below but the patch looks good to me. So

Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

> ---
>  drivers/soc/mediatek/mtk-pm-domains.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/soc/mediatek/mtk-pm-domains.c b/drivers/soc/mediatek/mtk-pm-domains.c
> index 536d8c64b2b4..a9ba71eee4bb 100644
> --- a/drivers/soc/mediatek/mtk-pm-domains.c
> +++ b/drivers/soc/mediatek/mtk-pm-domains.c
> @@ -296,7 +296,7 @@ generic_pm_domain *scpsys_add_one_domain(struct scpsys *scpsys, struct device_no
>  {
>         const struct scpsys_domain_data *domain_data;
>         struct scpsys_domain *pd;
> -       struct device_node *root_node = scpsys->dev->of_node;
> +       struct device_node *root_node = scpsys->dev->of_node, *smi_node;

nit: Personal preference, but I'd prefer to add the smi_node in a new
line, so it's really clear that the only thing you are doing here is
adding a new variable.

>         struct property *prop;
>         const char *clk_name;
>         int i, ret, num_clks;
> @@ -352,9 +352,13 @@ generic_pm_domain *scpsys_add_one_domain(struct scpsys *scpsys, struct device_no
>         if (IS_ERR(pd->infracfg))
>                 return ERR_CAST(pd->infracfg);
>
> -       pd->smi = syscon_regmap_lookup_by_phandle_optional(node, "mediatek,smi");
> -       if (IS_ERR(pd->smi))
> -               return ERR_CAST(pd->smi);
> +       smi_node = of_parse_phandle(node, "mediatek,smi", 0);
> +       if (smi_node) {
> +               pd->smi = device_node_to_regmap(smi_node);
> +               of_node_put(smi_node);
> +               if (IS_ERR(pd->smi))
> +                       return ERR_CAST(pd->smi);
> +       }
>
>         num_clks = of_clk_get_parent_count(node);
>         if (num_clks > 0) {
> --
> 2.32.0.rc0.204.g9fa02ecfa5-goog
>
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-05-31 21:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31  4:35 [PATCH 1/3] soc: mtk-pm-domains: Fix the clock prepared issue Hsin-Yi Wang
2021-05-31  4:35 ` [PATCH 2/3] soc: mtk-pm-domains: do not register smi node as syscon Hsin-Yi Wang
2021-05-31 11:36   ` Chun-Jie Chen
2021-05-31 21:36   ` Enric Balletbo Serra [this message]
2021-05-31  4:35 ` [PATCH 3/3] arm64: dts: mt8183: remove syscon from smi_common node Hsin-Yi Wang
2021-05-31 21:39   ` Enric Balletbo Serra
2021-05-31 10:42 ` [PATCH 1/3] soc: mtk-pm-domains: Fix the clock prepared issue Chun-Jie Chen
2021-05-31 21:38 ` Enric Balletbo Serra

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='CAFqH_53nNca8VG=09djYseJBWWg5j=YFTfPjxJL5w-aTyBmCng@mail.gmail.com' \
    --to=eballetbo@gmail.com \
    --cc=chun-jie.chen@mediatek.corp-partner.google.com \
    --cc=enric.balletbo@collabora.com \
    --cc=hsinyi@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=yong.wu@mediatek.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;
as well as URLs for NNTP newsgroup(s).