From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] drivers: firmware: psci: define more generic PSCI_FN_NATIVE macro
Date: Mon, 14 Sep 2015 14:17:45 +0100 [thread overview]
Message-ID: <20150914131745.GA25469@red-moon> (raw)
In-Reply-To: <1434638494-514-3-git-send-email-sudeep.holla@arm.com>
On Thu, Jun 18, 2015 at 03:41:33PM +0100, Sudeep Holla wrote:
> This patch replaces the definition and usage of PSCI_0_2_FN_NATIVE with
> the new and more generic macro PSCI_FN_NATIVE that can be used with any
> version. This will be useful for the new features introduced in PSCIv1.0
> and for any future revisions.
>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> drivers/firmware/psci.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
> index 68d0c2f6d004..752ca7c9eb97 100644
> --- a/drivers/firmware/psci.c
> +++ b/drivers/firmware/psci.c
> @@ -29,13 +29,13 @@
> /*
> * While a 64-bit OS can make calls with SMC32 calling conventions, for some
> * calls it is necessary to use SMC64 to pass or return 64-bit values. For such
> - * calls PSCI_0_2_FN_NATIVE(x) will choose the appropriate (native-width)
> + * calls PSCI_FN_NATIVE(x) will choose the appropriate (native-width)
Nit: Comment should be PSCI_FN_NATIVE(version, name), fixed it up in my
branch.
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> * function ID.
> */
> #ifdef CONFIG_64BIT
> -#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN64_##name
> +#define PSCI_FN_NATIVE(version, name) PSCI_##version##_FN64_##name
> #else
> -#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN_##name
> +#define PSCI_FN_NATIVE(version, name) PSCI_##version##_FN_##name
> #endif
>
> /*
> @@ -169,7 +169,7 @@ static int psci_migrate(unsigned long cpuid)
> static int psci_affinity_info(unsigned long target_affinity,
> unsigned long lowest_affinity_level)
> {
> - return invoke_psci_fn(PSCI_0_2_FN_NATIVE(AFFINITY_INFO),
> + return invoke_psci_fn(PSCI_FN_NATIVE(0_2, AFFINITY_INFO),
> target_affinity, lowest_affinity_level, 0);
> }
>
> @@ -180,7 +180,7 @@ static int psci_migrate_info_type(void)
>
> static unsigned long psci_migrate_info_up_cpu(void)
> {
> - return invoke_psci_fn(PSCI_0_2_FN_NATIVE(MIGRATE_INFO_UP_CPU),
> + return invoke_psci_fn(PSCI_FN_NATIVE(0_2, MIGRATE_INFO_UP_CPU),
> 0, 0, 0);
> }
>
> @@ -267,16 +267,17 @@ static void __init psci_init_migrate(void)
> static void __init psci_0_2_set_functions(void)
> {
> pr_info("Using standard PSCI v0.2 function IDs\n");
> - psci_function_id[PSCI_FN_CPU_SUSPEND] = PSCI_0_2_FN_NATIVE(CPU_SUSPEND);
> + psci_function_id[PSCI_FN_CPU_SUSPEND] =
> + PSCI_FN_NATIVE(0_2, CPU_SUSPEND);
> psci_ops.cpu_suspend = psci_cpu_suspend;
>
> psci_function_id[PSCI_FN_CPU_OFF] = PSCI_0_2_FN_CPU_OFF;
> psci_ops.cpu_off = psci_cpu_off;
>
> - psci_function_id[PSCI_FN_CPU_ON] = PSCI_0_2_FN_NATIVE(CPU_ON);
> + psci_function_id[PSCI_FN_CPU_ON] = PSCI_FN_NATIVE(0_2, CPU_ON);
> psci_ops.cpu_on = psci_cpu_on;
>
> - psci_function_id[PSCI_FN_MIGRATE] = PSCI_0_2_FN_NATIVE(MIGRATE);
> + psci_function_id[PSCI_FN_MIGRATE] = PSCI_FN_NATIVE(0_2, MIGRATE);
> psci_ops.migrate = psci_migrate;
>
> psci_ops.affinity_info = psci_affinity_info;
> --
> 1.9.1
>
next prev parent reply other threads:[~2015-09-14 13:17 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
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 [this message]
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=20150914131745.GA25469@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.
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).