public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paweł Chmiel" <pawel.mikolaj.chmiel@gmail.com>
To: Sylwester Nawrocki <snawrocki@kernel.org>
Cc: kgene@kernel.org, krzk@kernel.org, mturquette@baylibre.com,
	sboyd@kernel.org, s.nawrocki@samsung.com, tomasz.figa@gmail.com,
	cw00.choi@samsung.com, linux-samsung-soc@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] clk: exynos7: Keep aclk_fsys1_200 enabled
Date: Mon, 9 Nov 2020 17:35:29 +0100	[thread overview]
Message-ID: <0efe8698-68b6-030f-4b8b-f52dbc3d1be9@gmail.com> (raw)
In-Reply-To: <a2fdef20-9c0d-ee59-bc2f-411391f4f58b@kernel.org>



On 09.11.2020 13:32, Sylwester Nawrocki wrote:
> Hi Paweł,
> 
> On 11/7/20 13:14, Paweł Chmiel wrote:
>> This clock must be always enabled to allow access to any registers in
>> fsys1 CMU. Until proper solution based on runtime PM is applied
>> (similar to what was done for Exynos5433), fix this by calling
>> clk_prepare_enable() directly from clock provider driver.
>>
>> It was observed on Samsung Galaxy S6 device (based on Exynos7420), where
>> UFS module is probed before pmic used to power that device.
>> In this case defer probe was happening and that clock was disabled by
>> UFS driver, causing whole boot to hang on next CMU access.
>>
>> Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
> 
>> --- a/drivers/clk/samsung/clk-exynos7.c
>> +++ b/drivers/clk/samsung/clk-exynos7.c
> 
>> @@ -571,6 +572,10 @@ static const struct samsung_cmu_info top1_cmu_info __initconst = {
>>   static void __init exynos7_clk_top1_init(struct device_node *np)
>>   {
>>   	samsung_cmu_register_one(np, &top1_cmu_info);
>> +	/*
>> +	 * Keep top FSYS1 aclk enabled permanently. It's required for CMU register access.
>> +	 */
>> +	clk_prepare_enable(__clk_lookup("aclk_fsys1_200"));
> 
> Thanks for the patch. Could you rework it to avoid the __clk_lookup() call?
> I.e. could you change it to something along the lines of:
Hi.
I'll send v3 version with this fixed.

Thanks for review and comments
> 
> -------------8<----------------
> diff --git a/drivers/clk/samsung/clk-exynos7.c b/drivers/clk/samsung/clk-exynos7.c
> index 87ee1ba..9ecf498 100644
> --- a/drivers/clk/samsung/clk-exynos7.c
> +++ b/drivers/clk/samsung/clk-exynos7.c
> @@ -570,7 +570,15 @@ static const struct samsung_cmu_info top1_cmu_info __initconst = {
>  
>  static void __init exynos7_clk_top1_init(struct device_node *np)
>  {
> -       samsung_cmu_register_one(np, &top1_cmu_info);
> +       struct samsung_clk_provider *ctx;
> +       struct clk_hw **hws;
> +
> +       ctx = samsung_cmu_register_one(np, &top1_cmu_info);
> +       if (!ctx)
> +               return;
> +       hws = ctx->clk_data.hws;
> +
> +       clk_prepare_enable(hws[CLK_ACLK_FSYS1_200]);
>  }
>  
>  CLK_OF_DECLARE(exynos7_clk_top1, "samsung,exynos7-clock-top1",
> -------------8<----------------
> ?
> 
> --
> Regards,
> Sylwester
> 
> 

      parent reply	other threads:[~2020-11-09 16:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-07 12:14 [PATCH v2] clk: exynos7: Keep aclk_fsys1_200 enabled Paweł Chmiel
2020-11-08 18:41 ` Krzysztof Kozlowski
2020-11-09 12:32 ` Sylwester Nawrocki
2020-11-09 12:43   ` Sylwester Nawrocki
2020-11-09 16:35   ` Paweł Chmiel [this message]

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=0efe8698-68b6-030f-4b8b-f52dbc3d1be9@gmail.com \
    --to=pawel.mikolaj.chmiel@gmail.com \
    --cc=cw00.choi@samsung.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=s.nawrocki@samsung.com \
    --cc=sboyd@kernel.org \
    --cc=snawrocki@kernel.org \
    --cc=tomasz.figa@gmail.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