devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Sasha Levin <sashal@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Serge Semin <Sergey.Semin@baikalelectronics.ru>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Paul Burton <paulburton@kernel.org>,
	Ralf Baechle <ralf@linux-mips.org>, Arnd Bergmann <arnd@arndb.de>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-mips@vger.kernel.org
Subject: Re: [PATCH AUTOSEL 4.19 080/106] mips: Add udelay lpj numbers adjustment
Date: Sat, 11 Jul 2020 12:01:49 +0200	[thread overview]
Message-ID: <20200711100149.GA2397222@aurel32.net> (raw)
In-Reply-To: <20200608232238.3368589-80-sashal@kernel.org>

On 2020-06-08 19:22, Sasha Levin wrote:
> From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> 
> [ Upstream commit ed26aacfb5f71eecb20a51c4467da440cb719d66 ]
> 
> Loops-per-jiffies is a special number which represents a number of
> noop-loop cycles per CPU-scheduler quantum - jiffies. As you
> understand aside from CPU-specific implementation it depends on
> the CPU frequency. So when a platform has the CPU frequency fixed,
> we have no problem and the current udelay interface will work
> just fine. But as soon as CPU-freq driver is enabled and the cores
> frequency changes, we'll end up with distorted udelay's. In order
> to fix this we have to accordinly adjust the per-CPU udelay_val
> (the same as the global loops_per_jiffy) number. This can be done
> in the CPU-freq transition event handler. We subscribe to that event
> in the MIPS arch time-inititalization method.
> 
> Co-developed-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  arch/mips/kernel/time.c | 70 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 70 insertions(+)
> 
> diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
> index bfe02ded25d1..1e631a484ddf 100644
> --- a/arch/mips/kernel/time.c
> +++ b/arch/mips/kernel/time.c
> @@ -22,12 +22,82 @@
>  #include <linux/smp.h>
>  #include <linux/spinlock.h>
>  #include <linux/export.h>
> +#include <linux/cpufreq.h>
> +#include <linux/delay.h>
>  
>  #include <asm/cpu-features.h>
>  #include <asm/cpu-type.h>
>  #include <asm/div64.h>
>  #include <asm/time.h>
>  
> +#ifdef CONFIG_CPU_FREQ
> +
> +static DEFINE_PER_CPU(unsigned long, pcp_lpj_ref);
> +static DEFINE_PER_CPU(unsigned long, pcp_lpj_ref_freq);
> +static unsigned long glb_lpj_ref;
> +static unsigned long glb_lpj_ref_freq;
> +
> +static int cpufreq_callback(struct notifier_block *nb,
> +			    unsigned long val, void *data)
> +{
> +	struct cpufreq_freqs *freq = data;
> +	struct cpumask *cpus = freq->policy->cpus;
                                     ^^^^^^

The policy member has been added in kernel 5.2, so kernel 4.19.129 and
later do not build anymore when CONFIG_CPU_FREQ=y.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2020-07-11 10:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200608232238.3368589-1-sashal@kernel.org>
2020-06-08 23:21 ` [PATCH AUTOSEL 4.19 020/106] spi: dw: Enable interrupts in accordance with DMA xfer mode Sasha Levin
2020-06-08 23:21 ` [PATCH AUTOSEL 4.19 021/106] clocksource: dw_apb_timer: Make CPU-affiliation being optional Sasha Levin
2020-06-08 23:21 ` [PATCH AUTOSEL 4.19 022/106] clocksource: dw_apb_timer_of: Fix missing clockevent timers Sasha Levin
2020-06-08 23:21 ` [PATCH AUTOSEL 4.19 027/106] spi: dw: Fix Rx-only DMA transfers Sasha Levin
2020-06-08 23:21 ` [PATCH AUTOSEL 4.19 036/106] dt-bindings: display: mediatek: control dpi pins mode to avoid leakage Sasha Levin
2020-06-08 23:21 ` [PATCH AUTOSEL 4.19 059/106] mips: cm: Fix an invalid error code of INTVN_*_ERR Sasha Levin
2020-06-08 23:22 ` [PATCH AUTOSEL 4.19 079/106] mips: MAAR: Use more precise address mask Sasha Levin
2020-06-08 23:22 ` [PATCH AUTOSEL 4.19 080/106] mips: Add udelay lpj numbers adjustment Sasha Levin
2020-07-11 10:01   ` Aurelien Jarno [this message]
2020-06-08 23:22 ` [PATCH AUTOSEL 4.19 099/106] spi: dw: Return any value retrieved from the dma_transfer callback Sasha Levin

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=20200711100149.GA2397222@aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paulburton@kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=robh+dt@kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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).