From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm64: kernel: rename __cpu_suspend to keep it aligned with arm
Date: Wed, 17 Jun 2015 14:57:21 +0100 [thread overview]
Message-ID: <20150617135721.GC27017@red-moon> (raw)
In-Reply-To: <1434462640-19613-2-git-send-email-sudeep.holla@arm.com>
On Tue, Jun 16, 2015 at 02:50:39PM +0100, Sudeep Holla wrote:
> This patch renames __cpu_suspend to cpu_suspend so that it's aligned
> with ARM32. It also removes the redundant wrapper created.
>
> This is preparation to implement generic PSCI system suspend using the
> cpu_{suspend,resume} which now has the same interface on both ARM and
> ARM64.
>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> arch/arm64/include/asm/cpuidle.h | 8 ++------
> arch/arm64/include/asm/suspend.h | 2 +-
> arch/arm64/kernel/cpuidle.c | 4 ++--
> arch/arm64/kernel/psci.c | 2 +-
> arch/arm64/kernel/suspend.c | 6 +++---
> 5 files changed, 9 insertions(+), 13 deletions(-)
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> diff --git a/arch/arm64/include/asm/cpuidle.h b/arch/arm64/include/asm/cpuidle.h
> index 141b2fcabaa6..0f74f05d662a 100644
> --- a/arch/arm64/include/asm/cpuidle.h
> +++ b/arch/arm64/include/asm/cpuidle.h
> @@ -5,20 +5,16 @@
>
> #ifdef CONFIG_CPU_IDLE
> extern int arm_cpuidle_init(unsigned int cpu);
> -extern int cpu_suspend(unsigned long arg);
> +extern int arm_cpuidle_suspend(int index);
> #else
> static inline int arm_cpuidle_init(unsigned int cpu)
> {
> return -EOPNOTSUPP;
> }
>
> -static inline int cpu_suspend(unsigned long arg)
> +static inline int arm_cpuidle_suspend(int index)
> {
> return -EOPNOTSUPP;
> }
> #endif
> -static inline int arm_cpuidle_suspend(int index)
> -{
> - return cpu_suspend(index);
> -}
> #endif
> diff --git a/arch/arm64/include/asm/suspend.h b/arch/arm64/include/asm/suspend.h
> index 003802f58963..59a5b0f1e81c 100644
> --- a/arch/arm64/include/asm/suspend.h
> +++ b/arch/arm64/include/asm/suspend.h
> @@ -21,6 +21,6 @@ struct sleep_save_sp {
> phys_addr_t save_ptr_stash_phys;
> };
>
> -extern int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long));
> +extern int cpu_suspend(unsigned long arg, int (*fn)(unsigned long));
> extern void cpu_resume(void);
> #endif
> diff --git a/arch/arm64/kernel/cpuidle.c b/arch/arm64/kernel/cpuidle.c
> index f8aa16973318..7ce589ca54a4 100644
> --- a/arch/arm64/kernel/cpuidle.c
> +++ b/arch/arm64/kernel/cpuidle.c
> @@ -32,7 +32,7 @@ int arm_cpuidle_init(unsigned int cpu)
> * Return: 0 on success, -EOPNOTSUPP if CPU suspend hook not initialized, CPU
> * operations back-end error code otherwise.
> */
> -int cpu_suspend(unsigned long arg)
> +int arm_cpuidle_suspend(int index)
> {
> int cpu = smp_processor_id();
>
> @@ -42,5 +42,5 @@ int cpu_suspend(unsigned long arg)
> */
> if (!cpu_ops[cpu] || !cpu_ops[cpu]->cpu_suspend)
> return -EOPNOTSUPP;
> - return cpu_ops[cpu]->cpu_suspend(arg);
> + return cpu_ops[cpu]->cpu_suspend(index);
> }
> diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c
> index a0fc99a518b8..4be597228b14 100644
> --- a/arch/arm64/kernel/psci.c
> +++ b/arch/arm64/kernel/psci.c
> @@ -203,7 +203,7 @@ static int __maybe_unused cpu_psci_cpu_suspend(unsigned long index)
> if (!psci_power_state_loses_context(state[index - 1]))
> ret = psci_ops.cpu_suspend(state[index - 1], 0);
> else
> - ret = __cpu_suspend(index, psci_suspend_finisher);
> + ret = cpu_suspend(index, psci_suspend_finisher);
>
> return ret;
> }
> diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c
> index d7daf45ae7a2..400e1265e205 100644
> --- a/arch/arm64/kernel/suspend.c
> +++ b/arch/arm64/kernel/suspend.c
> @@ -51,13 +51,13 @@ void __init cpu_suspend_set_dbg_restorer(void (*hw_bp_restore)(void *))
> }
>
> /*
> - * __cpu_suspend
> + * cpu_suspend
> *
> * arg: argument to pass to the finisher function
> * fn: finisher function pointer
> *
> */
> -int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
> +int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
> {
> struct mm_struct *mm = current->active_mm;
> int ret;
> @@ -82,7 +82,7 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
> * We are resuming from reset with TTBR0_EL1 set to the
> * idmap to enable the MMU; restore the active_mm mappings in
> * TTBR0_EL1 unless the active_mm == &init_mm, in which case
> - * the thread entered __cpu_suspend with TTBR0_EL1 set to
> + * the thread entered cpu_suspend with TTBR0_EL1 set to
> * reserved TTBR0 page tables and should be restored as such.
> */
> if (mm == &init_mm)
> --
> 1.9.1
>
next prev parent reply other threads:[~2015-06-17 13:57 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-16 13:50 [PATCH 0/2] PSCI: system suspend support Sudeep Holla
2015-06-16 13:50 ` [PATCH 1/2] arm64: kernel: rename __cpu_suspend to keep it aligned with arm Sudeep Holla
2015-06-17 13:57 ` Lorenzo Pieralisi [this message]
2015-06-16 13:50 ` [PATCH 2/2] drivers: firmware: psci: add system suspend support Sudeep Holla
2015-06-17 15:08 ` Lorenzo Pieralisi
2015-06-17 15:41 ` Sudeep Holla
2015-06-18 14:41 ` [PATCH v2 0/3] PSCI: " Sudeep Holla
2015-06-18 14:41 ` [PATCH v2 1/3] arm64: kernel: rename __cpu_suspend to keep it aligned with arm Sudeep Holla
2015-06-18 14:55 ` Catalin Marinas
2015-06-18 15:08 ` Sudeep Holla
2015-06-19 13:50 ` Catalin Marinas
2015-06-18 14:41 ` [PATCH v2 2/3] drivers: firmware: psci: define more generic PSCI_FN_NATIVE macro Sudeep Holla
2015-09-14 13:17 ` Lorenzo Pieralisi
2015-09-14 13:21 ` Sudeep Holla
2015-06-18 14:41 ` [PATCH v2 3/3] drivers: firmware: psci: add system suspend support Sudeep Holla
2015-07-14 6:17 ` Jisheng Zhang
2015-07-14 9:14 ` Sudeep Holla
2015-07-14 9:50 ` Jisheng Zhang
2015-07-14 11:02 ` Sudeep Holla
2015-07-14 11:40 ` Jisheng Zhang
2015-07-14 13:18 ` Sudeep Holla
2015-07-15 2:34 ` Jisheng Zhang
2015-07-15 10:20 ` Sudeep Holla
2015-09-14 13:23 ` Lorenzo Pieralisi
2015-09-14 13:32 ` Sudeep Holla
2015-06-18 18:13 ` [PATCH v2 0/3] PSCI: " Ashwin Chaugule
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=20150617135721.GC27017@red-moon \
--to=lorenzo.pieralisi@arm.com \
--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.
Code repositories for project(s) associated with this inbox:
https://80x24.org/mirrors/git.git
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.