linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>,
	Viresh Kumar <vireshk@kernel.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-clk <linux-clk@vger.kernel.org>,
	Stephan Gerhold <stephan@gerhold.net>
Subject: Re: [PATCH] clk: ux500: Initialize DSI clocks before registering
Date: Mon, 23 Dec 2019 10:16:02 +0100	[thread overview]
Message-ID: <CAPDyKFrYZ3UHAaBdkO9+R+19hEp4yecgdxP=OzWD=VRJ1G4bEw@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdaE1T6yt4u5uO+SZB18KjrVp2_4Qd9gr_aN0v5GTJ2VGw@mail.gmail.com>

+ Viresh

On Sun, 22 Dec 2019 at 22:46, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Sun, Dec 22, 2019 at 9:29 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> > The DSI clocks need to be initialized properly and cannot
> > rely on boot defaults, this is especially important for the
> > U8420 SYSCLK variant of the PRCMU firmware which requires
> > that you poke these registers right before trying to use
> > the HS DSI clock. Some vital setup such as the PRCM_TVCLK_MGT
> > register will not happen unless we call this making some
> > displays fail to work on the U8420.
> >
> > Cc: Ulf Hansson <ulf.hansson@linaro.org>
> > Cc: Stephan Gerhold <stephan@gerhold.net>
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>
> Sorry I got lost in the macros for CLK_MGT_ENTRY
> that does poke these registers including PRCM_TVCLK_MGT.
>
> I need to figure out what is actually going wrong with the
> DSI clocks here.

In the downstream kernel, I authored a patch that added a new per
clock config flag "CLK_BOOT_NOGATE", which was set for DSI clocks and
its friends. If this flag was set, the clock was prevented from being
unprepared/disabled by the common clock core, even if unused.

This was only needed during the boot process, when the bootloaders
have turned on the clock, HW wise. As then those needed to stay on,
else things would break, in one way or the other.

I looked at using CLK_IGNORE_UNUSED, but it doesn't help, when there
is another leaf clock using the same parent as the DSI clock (or
something along those lines). In principle, all "unused" clocks can
become disabled/unprepared, way before the late_initcall
clk_disable_unused() get called - if there is a leaf clock being
disabled.

Finally, to allow clocks that had the new CLK_BOOT_NOGATE flag set, to
be unprepared/disabled after boot, the flag was cleared for all clocks
in the path of the late_initcall path clk_disable_unused().

I can quickly re-base and submit these patches, if you like, but I am
guessing the clk maintainers may object to it, but I don't know.

That said, maybe the suggested "Boot constraint framework" [1], that
has been worked on by Viresh, is the proper solution for this.

Hope this helps!

Kind regards
Uffe

[1]
https://lore.kernel.org/lkml/cover.1519380923.git.viresh.kumar@linaro.org/

  reply	other threads:[~2019-12-23  9:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-22 20:29 [PATCH] clk: ux500: Initialize DSI clocks before registering Linus Walleij
2019-12-22 21:46 ` Linus Walleij
2019-12-23  9:16   ` Ulf Hansson [this message]
2019-12-23  9:28     ` Viresh Kumar
2019-12-23  9:33       ` Ulf Hansson
2019-12-23 16:25     ` Linus Walleij

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='CAPDyKFrYZ3UHAaBdkO9+R+19hEp4yecgdxP=OzWD=VRJ1G4bEw@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=stephan@gerhold.net \
    --cc=vireshk@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).