All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Prashant Gaikwad <pgaikwad-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
	Kevin Hilman <khilman-l0cyMroinI0@public.gmane.org>,
	Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>,
	Mike Turquette
	<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Russell King - ARM Linux
	<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	"linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
	"cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Shilimkar Santosh
	<santosh.shilimkar-l0cyMroinI0@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Richard Zhao
	<richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	Richard Zhao
	<richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v3 1/3] ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp
Date: Tue, 11 Sep 2012 09:16:56 -0600	[thread overview]
Message-ID: <504F55E8.3000803@wwwdotorg.org> (raw)
In-Reply-To: <504F2789.1070006-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

On 09/11/2012 05:59 AM, Prashant Gaikwad wrote:
> On Monday 10 September 2012 10:47 PM, Stephen Warren wrote:
>> On 09/09/2012 07:17 PM, Shawn Guo wrote:
>>> On Fri, Sep 07, 2012 at 10:55:00AM -0600, Stephen Warren wrote:
>>>> Yes, that does solve the problem (well, with
>>>> s/late_init/late_initcall/).
>>>>
>>>> As you imply, that change wouldn't help if cpu-tegra.c was built as a
>>>> module.
>>> I doubt that.  Have you confirmed it with testing?  When you install
>>> module cpu-tegra, the pcie initialization has been done, right?
>> Never mind, the code can't be built as a module anyway.
>>
>> Aside from that, I misinterpreted your test patch, and thought that it
>> was moving the Tegra cpufreq driver initialization earlier, but it's
>> actually moving it later, and in fact by chance after PCIe
>> initialization, which explains why it solves the issue.
>>
>> I think the root of the problem is that cpufreq is lowering the CPU
>> frequency, yet the patch which converted Tegra to the common clock
>> framework removed the code that actually changes the CPU clock rate. So,
>> cpufreq thinks the CPU is running at e.g. 216MHz, but it's actually
>> still running at 1.0GHz, and hence re-calculating the delay loops breaks
>> things, since delays aren't as long as the system thinks they are. The
>> variability is due to whether lowering the CPU frequency just happens to
>> occur before or after the PCIe controller is initialized.
>>
>> Prashant, are you able to fix the clock driver deficiency within the
>> next 2-3 days or so (so I can include the fix in the pull requests I
>> send for 3.7, which need to be sent before the end of the week)? Or, do
>> we need to disable cpufreq for Tegra because of this?
> 
> Your fix looks good to me except the concern I have mentioned in reply
> to that patch.

Well, the cpufreq driver will need explicit knowledge of
Tega20-vs-Tegra30 anyway, due to e.g. differing CPU clock names,
probable different latencies, etc.

WARNING: multiple messages have this Message-ID (diff)
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/3] ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp
Date: Tue, 11 Sep 2012 09:16:56 -0600	[thread overview]
Message-ID: <504F55E8.3000803@wwwdotorg.org> (raw)
In-Reply-To: <504F2789.1070006@nvidia.com>

On 09/11/2012 05:59 AM, Prashant Gaikwad wrote:
> On Monday 10 September 2012 10:47 PM, Stephen Warren wrote:
>> On 09/09/2012 07:17 PM, Shawn Guo wrote:
>>> On Fri, Sep 07, 2012 at 10:55:00AM -0600, Stephen Warren wrote:
>>>> Yes, that does solve the problem (well, with
>>>> s/late_init/late_initcall/).
>>>>
>>>> As you imply, that change wouldn't help if cpu-tegra.c was built as a
>>>> module.
>>> I doubt that.  Have you confirmed it with testing?  When you install
>>> module cpu-tegra, the pcie initialization has been done, right?
>> Never mind, the code can't be built as a module anyway.
>>
>> Aside from that, I misinterpreted your test patch, and thought that it
>> was moving the Tegra cpufreq driver initialization earlier, but it's
>> actually moving it later, and in fact by chance after PCIe
>> initialization, which explains why it solves the issue.
>>
>> I think the root of the problem is that cpufreq is lowering the CPU
>> frequency, yet the patch which converted Tegra to the common clock
>> framework removed the code that actually changes the CPU clock rate. So,
>> cpufreq thinks the CPU is running at e.g. 216MHz, but it's actually
>> still running at 1.0GHz, and hence re-calculating the delay loops breaks
>> things, since delays aren't as long as the system thinks they are. The
>> variability is due to whether lowering the CPU frequency just happens to
>> occur before or after the PCIe controller is initialized.
>>
>> Prashant, are you able to fix the clock driver deficiency within the
>> next 2-3 days or so (so I can include the fix in the pull requests I
>> send for 3.7, which need to be sent before the end of the week)? Or, do
>> we need to disable cpufreq for Tegra because of this?
> 
> Your fix looks good to me except the concern I have mentioned in reply
> to that patch.

Well, the cpufreq driver will need explicit knowledge of
Tega20-vs-Tegra30 anyway, due to e.g. differing CPU clock names,
probable different latencies, etc.

  parent reply	other threads:[~2012-09-11 15:16 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10  5:37 [PATCH v3 0/3] Add a generic cpufreq-cpu0 driver Shawn Guo
2012-08-10  5:37 ` Shawn Guo
2012-08-10  5:37 ` [PATCH v3 1/3] ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp Shawn Guo
2012-08-10  5:37   ` Shawn Guo
2012-09-04 23:27   ` Rafael J. Wysocki
2012-09-04 23:27     ` Rafael J. Wysocki
     [not found]   ` <1344577046-14847-2-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-09-06 22:35     ` Stephen Warren
2012-09-06 22:35       ` Stephen Warren
     [not found]       ` <5049252D.9000802-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-07  2:58         ` Shawn Guo
2012-09-07  2:58           ` Shawn Guo
     [not found]           ` <20120907025847.GI26709-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-09-07 16:55             ` Stephen Warren
2012-09-07 16:55               ` Stephen Warren
2012-09-10  1:17               ` Shawn Guo
2012-09-10  1:17                 ` Shawn Guo
     [not found]                 ` <20120910011741.GP26709-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-09-10 17:17                   ` Stephen Warren
2012-09-10 17:17                     ` Stephen Warren
     [not found]                     ` <504E20BE.8050107-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-11 11:59                       ` Prashant Gaikwad
2012-09-11 11:59                         ` Prashant Gaikwad
     [not found]                         ` <504F2789.1070006-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-09-11 15:16                           ` Stephen Warren [this message]
2012-09-11 15:16                             ` Stephen Warren
2012-08-10  5:37 ` [PATCH v3 2/3] PM / OPP: Initialize OPP table from device tree Shawn Guo
2012-08-10  5:37   ` Shawn Guo
2012-08-16 21:05   ` Rafael J. Wysocki
2012-08-16 21:05     ` Rafael J. Wysocki
     [not found]     ` <201208162305.55114.rjw-KKrjLPT3xs0@public.gmane.org>
2012-08-17  0:52       ` Shawn Guo
2012-08-17  0:52         ` Shawn Guo
2012-08-17  1:53         ` Rob Herring
2012-08-17  1:53           ` Rob Herring
2012-09-04 23:27           ` Rafael J. Wysocki
2012-09-04 23:27             ` Rafael J. Wysocki
2012-08-10  5:37 ` [PATCH v3 3/3] cpufreq: Add a generic cpufreq-cpu0 driver Shawn Guo
2012-08-10  5:37   ` Shawn Guo
2012-09-04 23:18   ` Rafael J. Wysocki
2012-09-04 23:18     ` Rafael J. Wysocki
     [not found]     ` <201209050118.39045.rjw-KKrjLPT3xs0@public.gmane.org>
2012-09-05  1:12       ` Shawn Guo
2012-09-05  1:12         ` Shawn Guo
2012-09-05  4:53         ` AnilKumar, Chimata
2012-09-05  4:53           ` AnilKumar, Chimata
2012-09-05  5:02         ` Shilimkar, Santosh
2012-09-05  5:02           ` Shilimkar, Santosh
2012-09-05 13:38         ` Rafael J. Wysocki
2012-09-05 13:38           ` Rafael J. Wysocki
2012-09-05 13:59           ` Shawn Guo
2012-09-05 13:59             ` Shawn Guo
2012-09-05 20:18             ` Rafael J. Wysocki
2012-09-05 20:18               ` Rafael J. Wysocki
2012-09-06  7:29               ` Shawn Guo
2012-09-06  7:29                 ` Shawn Guo
     [not found]                 ` <20120906072935.GB2362-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-09-06 19:59                   ` Rafael J. Wysocki
2012-09-06 19:59                     ` Rafael J. Wysocki
2012-08-31  6:42 ` [PATCH v3 0/3] " Shawn Guo
2012-08-31  6:42   ` Shawn Guo
2012-09-01  5:53   ` Rafael J. Wysocki
2012-09-01  5:53     ` Rafael J. Wysocki

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=504F55E8.3000803@wwwdotorg.org \
    --to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=khilman-l0cyMroinI0@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=nm-l0cyMroinI0@public.gmane.org \
    --cc=pgaikwad-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=rjw-KKrjLPT3xs0@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=santosh.shilimkar-l0cyMroinI0@public.gmane.org \
    --cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.