public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Peter De Schrijver <pdeschrijver@nvidia.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>
Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] soc/tegra: pmc: Query PCLK clock rate at probe time
Date: Mon, 29 Jul 2019 16:07:37 +0300	[thread overview]
Message-ID: <7e76b679-1a65-fa14-2cc6-2b27ece8131c@gmail.com> (raw)
In-Reply-To: <f7879942-0875-1f27-5870-3f8414c2148d@gmail.com>

25.07.2019 14:15, Dmitry Osipenko пишет:
> 25.07.2019 12:36, Peter De Schrijver пишет:
>> On Tue, Jul 23, 2019 at 05:35:10AM +0300, Dmitry Osipenko wrote:
>>> The PCLK clock is running off SCLK, which is a critical clock that is
>>> very unlikely to randomly change its rate. It's also a bit clumsy (and
>>> apparently incorrect) to query the clock's rate with interrupts being
>>> disabled because clk_get_rate() takes a mutex and that's the case during
>>> suspend/cpuidle entering.
>>>
>>
>> SCLK and PCLK certainly can change rate at runtime, although the code to
>> handle this hasn't reached upstream yet.
> 
> Okay, maybe this patch is indeed not very worthwhile then. I'm leaving
> it up to you, guys, to decide.
> 

I now recalled what was the initial reason for this patch because
happened to bump into the problem once again.. it's really problematic
to call clk_get_rate() with the disabled preemption because some clk
notifier handler may block (EMC) and cause reschedule, hence the CCF
'prepare' mutex is kept locked during of CPUIDLE driver entering LP2
state and thus causing system lockup, since scheduling with the disabled
interrupts obviously won't work well.

So this patch actually is needed to be applied or some other solution
have to be provided. Since PCLK rate currently isn't altering anywhere
in the kernel, I'd suggest to imply apply this series. Please let me
know if you have any objections. I may re-iterate this patch with an
extended commit message, describing the resolved problem in a more
details, if necessary.

  reply	other threads:[~2019-07-29 13:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  2:35 [PATCH v2 1/2] soc/tegra: pmc: Query PCLK clock rate at probe time Dmitry Osipenko
2019-07-23  2:35 ` [PATCH v2 2/2] soc/tegra: pmc: Remove unnecessary memory barrier Dmitry Osipenko
2019-07-25  9:36 ` [PATCH v2 1/2] soc/tegra: pmc: Query PCLK clock rate at probe time Peter De Schrijver
2019-07-25 11:15   ` Dmitry Osipenko
2019-07-29 13:07     ` Dmitry Osipenko [this message]
2019-07-30 17:40       ` Dmitry Osipenko

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=7e76b679-1a65-fa14-2cc6-2b27ece8131c@gmail.com \
    --to=digetx@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=pdeschrijver@nvidia.com \
    --cc=thierry.reding@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