linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-clk@vger.kernel.org,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	"Sylwester Nawrocki" <snawrocki@kernel.org>,
	"Chanwoo Choi" <cw00.choi@samsung.com>,
	"Bartłomiej Żołnierkiewicz" <b.zolnierkie@samsung.com>
Subject: Re: [PATCH 08/10] clk: samsung: Add support for setting registers state before suspend
Date: Thu, 6 Sep 2018 18:15:20 +0200	[thread overview]
Message-ID: <20180906161520.zafvr2j5n4y7osgg@kozik-lap> (raw)
In-Reply-To: <20180906132530eucas1p1aa247751e59e06039f07d7802881e728~R0nEDIXJ90352303523eucas1p1k@eucas1p1.samsung.com>

On Thu, Sep 06, 2018 at 03:25:29PM +0200, Marek Szyprowski wrote:
> Hi Krzysztof,
> 
> On 2018-08-31 16:59, Krzysztof Kozlowski wrote:
> > On Wed, 29 Aug 2018 at 17:51, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
> >> Some registers of clock controller have to be set to certain values before
> >> entering system suspend state. Till now drivers did that on their own,
> >> but it will be easier to handle it by generic code and let drivers simply
> >> to provide the list of registers and their state.
> >>
> >> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> >> ---
> >>   drivers/clk/samsung/clk.c | 23 +++++++++++++----------
> >>   drivers/clk/samsung/clk.h | 18 ++++++++++++++++--
> >>   2 files changed, 29 insertions(+), 12 deletions(-)
> >>
> >> diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c
> >> index 8634884aa11c..ab467a7f973a 100644
> >> --- a/drivers/clk/samsung/clk.c
> >> +++ b/drivers/clk/samsung/clk.c
> >> @@ -290,9 +290,12 @@ static int samsung_clk_suspend(void)
> >>   {
> >>          struct samsung_clock_reg_cache *reg_cache;
> >>
> >> -       list_for_each_entry(reg_cache, &clock_reg_cache_list, node)
> >> +       list_for_each_entry(reg_cache, &clock_reg_cache_list, node) {
> >>                  samsung_clk_save(reg_cache->reg_base, reg_cache->rdump,
> >>                                  reg_cache->rd_num);
> >> +               samsung_clk_restore(reg_cache->reg_base, reg_cache->rsuspend,
> >> +                               reg_cache->rsuspend_num);
> >> +       }
> >>          return 0;
> >>   }
> >>
> >> @@ -310,9 +313,11 @@ static struct syscore_ops samsung_clk_syscore_ops = {
> >>          .resume = samsung_clk_resume,
> >>   };
> >>
> >> -void samsung_clk_sleep_init(void __iomem *reg_base,
> >> +void samsung_clk_sleep_init2(void __iomem *reg_base,
> > Like Chanwoo, I also do not like the init2. Quite frankly, I do not
> > see what problem you want to solve it by adding "2" suffix - not
> > touching Exynos5433 code?
> 
> I didn't want to change Exynos5433 and clock drivers cleaned in patches
> 2-7, as I see no point adding "NULL, 0" parameters there.
> 
> > In such case more meaningful prefix would be
> > better. But I think this should be avoided especially that in patch
> > 9/10 you use both of them.
> 
> Okay, so it is just a matter of name. What about
> samsung_clk_extended_sleep_init() ?
> 
> I don't want to add another temporary structure just to pass some
> arguments to that function...

Yes, I am fine with this approach.

> > Separate topic - It is getting confusing. The existing Exynos5433 code
> > has support for suspend_regs (used in its device-level runtime PM) and
> > here you are extending generic code on syscore level. Maybe this could
> > be unified somehow?
> 
> Well, you can consider this patch as a first step of unification.
> Implementing device based suspend/resume for OF_CLK_DECLARE() based
> drivers is quite complicated now (mainly because that initialization
> is done much before platform bus and dt-based devices are registered),
> but I hope one day this can be also unified.

Indeed... so I will keep my fingers crossed for that work :)

Best regards,
Krzysztof

  reply	other threads:[~2018-09-06 20:51 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180829155058eucas1p1db74951957e2d911ba91ddcc07df52ac@eucas1p1.samsung.com>
2018-08-29 15:50 ` [PATCH 00/10] Cleanup suspend/resume code in Samsung clock drivers Marek Szyprowski
     [not found]   ` <CGME20180829155059eucas1p28a20924521edaa4c9bd3d9683d0f2d0d@eucas1p2.samsung.com>
2018-08-29 15:50     ` [PATCH 01/10] clk: samsung: Remove excessive include Marek Szyprowski
2018-08-30  0:00       ` Chanwoo Choi
2018-08-30  6:34       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155059eucas1p26a0ea66a0fc96c73cdd60648b82bd23e@eucas1p2.samsung.com>
2018-08-29 15:50     ` [PATCH 02/10] clk: samsung: s3c2410: Use generic helper for handling suspend/resume Marek Szyprowski
2018-08-30  1:10       ` Chanwoo Choi
2018-08-30  6:39       ` Krzysztof Kozlowski
2018-08-30 11:26         ` Marek Szyprowski
2018-08-31  6:34           ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155059eucas1p16fecde00348e0a2e6707aaf2a76320be@eucas1p1.samsung.com>
2018-08-29 15:50     ` [PATCH 03/10] clk: samsung: s3c2412: " Marek Szyprowski
2018-08-30  1:17       ` Chanwoo Choi
2018-08-30  6:42       ` Krzysztof Kozlowski
2018-08-30 12:50         ` Marek Szyprowski
2018-08-30 13:10           ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155100eucas1p1ba8149066e026fc15f82091968b78a08@eucas1p1.samsung.com>
2018-08-29 15:50     ` [PATCH 04/10] clk: samsung: s3c2443: " Marek Szyprowski
2018-08-30  1:18       ` Chanwoo Choi
2018-08-31  6:33       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155100eucas1p16cded24187167d4af4d43f64c7abd88b@eucas1p1.samsung.com>
2018-08-29 15:50     ` [PATCH 05/10] clk: samsung: s3c64xx: " Marek Szyprowski
2018-08-30  1:18       ` Chanwoo Choi
2018-08-31  6:35       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155101eucas1p2f6ecb6ad0eb37fa725ac950cad73c423@eucas1p2.samsung.com>
2018-08-29 15:50     ` [PATCH 06/10] clk: samsung: s5pv210: " Marek Szyprowski
2018-08-30  1:18       ` Chanwoo Choi
2018-08-31  6:36       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155101eucas1p22b694bf6395d8efcb33ba3802e287c88@eucas1p2.samsung.com>
2018-08-29 15:50     ` [PATCH 07/10] clk: samsung: exynos5250: " Marek Szyprowski
2018-08-30  1:19       ` Chanwoo Choi
2018-08-31  6:36       ` Krzysztof Kozlowski
     [not found]   ` <CGME20180829155102eucas1p1ca7a26c10847dcb585f01b54657e29cb@eucas1p1.samsung.com>
2018-08-29 15:50     ` [PATCH 08/10] clk: samsung: Add support for setting registers state before suspend Marek Szyprowski
2018-08-30  1:36       ` Chanwoo Choi
2018-08-31 14:59       ` Krzysztof Kozlowski
2018-09-06 13:25         ` Marek Szyprowski
2018-09-06 16:15           ` Krzysztof Kozlowski [this message]
     [not found]   ` <CGME20180829155102eucas1p2a4b1c554623ff97a23f85f26a6b537e2@eucas1p2.samsung.com>
2018-08-29 15:50     ` [PATCH 09/10] clk: samsung: exynos4: Use generic helper for handling suspend/resume Marek Szyprowski
2018-09-06 19:49       ` Sylwester Nawrocki
2018-09-07  6:27         ` Marek Szyprowski
     [not found]   ` <CGME20180829155103eucas1p16b6cddb4babcfb60a3257e017bea347e@eucas1p1.samsung.com>
2018-08-29 15:50     ` [PATCH 10/10] clk: samsung: exynos5420: " Marek Szyprowski

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=20180906161520.zafvr2j5n4y7osgg@kozik-lap \
    --to=krzk@kernel.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=snawrocki@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).