From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 11/13] arm64: enable generic clockevent broadcast
Date: Thu, 17 Oct 2013 11:15:02 +0200 [thread overview]
Message-ID: <525FAA96.90600@linaro.org> (raw)
In-Reply-To: <1381748590-14279-12-git-send-email-lorenzo.pieralisi@arm.com>
On 10/14/2013 01:03 PM, Lorenzo Pieralisi wrote:
> On platforms with power management capabilities, timers that are shut
> down when a CPU enters deep C-states must be emulated using an always-on
> timer and a timer IPI to relay the timer IRQ to target CPUs on an SMP
> system.
>
> This patch enables the generic clockevents broadcast infrastructure for
> arm64, by providing the required Kconfig entries and adding the timer
> IPI infrastructure.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
sidenote: there is more and more duplicated code between arm and arm64.
> ---
> arch/arm64/Kconfig | 2 ++
> arch/arm64/include/asm/hardirq.h | 2 +-
> arch/arm64/kernel/smp.c | 17 +++++++++++++++++
> 3 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index bcf88e4..be88acd 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1,6 +1,7 @@
> config ARM64
> def_bool y
> select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
> + select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
> select ARCH_WANT_OPTIONAL_GPIOLIB
> select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
> select ARCH_WANT_FRAME_POINTERS
> @@ -12,6 +13,7 @@ config ARM64
> select COMMON_CLK
> select CPU_PM if (SUSPEND || CPU_IDLE)
> select GENERIC_CLOCKEVENTS
> + select GENERIC_CLOCKEVENTS_BROADCAST if SMP
> select GENERIC_IOMAP
> select GENERIC_IRQ_PROBE
> select GENERIC_IRQ_SHOW
> diff --git a/arch/arm64/include/asm/hardirq.h b/arch/arm64/include/asm/hardirq.h
> index 990c051..ae4801d 100644
> --- a/arch/arm64/include/asm/hardirq.h
> +++ b/arch/arm64/include/asm/hardirq.h
> @@ -20,7 +20,7 @@
> #include <linux/threads.h>
> #include <asm/irq.h>
>
> -#define NR_IPI 4
> +#define NR_IPI 5
>
> typedef struct {
> unsigned int __softirq_pending;
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index d5488f8..2ed691e 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -61,6 +61,7 @@ enum ipi_msg_type {
> IPI_CALL_FUNC,
> IPI_CALL_FUNC_SINGLE,
> IPI_CPU_STOP,
> + IPI_TIMER,
> };
>
> /*
> @@ -447,6 +448,7 @@ static const char *ipi_types[NR_IPI] = {
> S(IPI_CALL_FUNC, "Function call interrupts"),
> S(IPI_CALL_FUNC_SINGLE, "Single function call interrupts"),
> S(IPI_CPU_STOP, "CPU stop interrupts"),
> + S(IPI_TIMER, "Timer broadcast interrupts"),
> };
>
> void show_ipi_list(struct seq_file *p, int prec)
> @@ -532,6 +534,14 @@ void handle_IPI(int ipinr, struct pt_regs *regs)
> irq_exit();
> break;
>
> +#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
> + case IPI_TIMER:
> + irq_enter();
> + tick_receive_broadcast();
> + irq_exit();
> + break;
> +#endif
> +
> default:
> pr_crit("CPU%u: Unknown IPI message 0x%x\n", cpu, ipinr);
> break;
> @@ -544,6 +554,13 @@ void smp_send_reschedule(int cpu)
> smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE);
> }
>
> +#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
> +void tick_broadcast(const struct cpumask *mask)
> +{
> + smp_cross_call(mask, IPI_TIMER);
> +}
> +#endif
> +
> void smp_send_stop(void)
> {
> unsigned long timeout;
>
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2013-10-17 9:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 11:02 [PATCH v2 00/13] arm64: suspend/resume implementation Lorenzo Pieralisi
2013-10-14 11:02 ` [PATCH v2 01/13] arm64: kernel: add MPIDR_EL1 accessors macros Lorenzo Pieralisi
2013-10-15 10:11 ` Will Deacon
2013-10-15 11:43 ` Lorenzo Pieralisi
2013-10-14 11:02 ` [PATCH v2 02/13] arm64: kernel: build MPIDR_EL1 hash function data structure Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 03/13] arm64: kernel: suspend/resume registers save/restore Lorenzo Pieralisi
2013-10-15 10:59 ` Will Deacon
2013-10-16 8:59 ` Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 04/13] arm64: kernel: cpu_{suspend/resume} implementation Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 05/13] arm64: add CPU PM infrastructure selection Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 06/13] arm64: kernel: implement fpsimd CPU PM notifier Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 07/13] arm: kvm: implement " Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 08/13] arm64: kernel: implement debug monitors CPU PM notifiers Lorenzo Pieralisi
2013-10-15 11:27 ` Will Deacon
2013-10-14 11:03 ` [PATCH v2 09/13] arm64: kernel: refactor code to install/uninstall breakpoints Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 10/13] arm64: kernel: implement HW breakpoints CPU PM notifier Lorenzo Pieralisi
2013-10-14 11:03 ` [PATCH v2 11/13] arm64: enable generic clockevent broadcast Lorenzo Pieralisi
2013-10-17 9:15 ` Daniel Lezcano [this message]
2013-10-14 11:03 ` [PATCH v2 12/13] arm64: kernel: add CPU idle call Lorenzo Pieralisi
2013-10-17 9:20 ` Daniel Lezcano
2013-10-14 11:03 ` [PATCH v2 13/13] arm64: add CPU power management menu/entries Lorenzo Pieralisi
2013-10-17 9:21 ` Daniel Lezcano
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=525FAA96.90600@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).