From: Sudeep Holla <sudeep.holla@arm.com>
To: Jeremy Linton <jeremy.linton@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org,
catalin.marinas@arm.com, will@kernel.org, rjw@rjwysocki.net,
lenb@kernel.org, lorenzo.pieralisi@arm.com,
Sudeep Holla <sudeep.holla@arm.com>
Subject: Re: [PATCH v4 1/2] ACPI/PPTT: Add support for ACPI 6.3 thread flag
Date: Thu, 1 Aug 2019 16:57:36 +0100 [thread overview]
Message-ID: <20190801155736.GD23424@e107155-lin> (raw)
In-Reply-To: <20190801034634.26913-2-jeremy.linton@arm.com>
Hi Jeremy,
On Wed, Jul 31, 2019 at 10:46:33PM -0500, Jeremy Linton wrote:
> ACPI 6.3 adds a flag to the CPU node to indicate whether
> the given PE is a thread. Add a function to return that
> information for a given linux logical CPU.
>
Apart from few minor nits,
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
> ---
> drivers/acpi/pptt.c | 54 +++++++++++++++++++++++++++++++++++++++++++-
> include/linux/acpi.h | 5 ++++
> 2 files changed, 58 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
> index 1e7ac0bd0d3a..84718f6cb741 100644
> --- a/drivers/acpi/pptt.c
> +++ b/drivers/acpi/pptt.c
> @@ -540,6 +540,44 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag)
> return retval;
> }
>
> +/**
> + * check_acpi_cpu_flag() - Determine if CPU node has a flag set
> + * @cpu: Kernel logical CPU number
> + * @rev: The PPTT revision defining the flag
[nit] I would rather put it as minimum PPTT revision that supports the
flag. It aligns with the code too as we are not looking for exact match.
> + * @flag: The flag itself
> + *
> + * Check the node representing a CPU for a given flag.
> + *
> + * Return: -ENOENT if the PPTT doesn't exist, the CPU cannot be found or
> + * the table revision isn't new enough.
> + * 1, any passed flag set
> + * 0, flag unset
> + */
> +static int check_acpi_cpu_flag(unsigned int cpu, int rev, u32 flag)
> +{
> + struct acpi_table_header *table;
> + acpi_status status;
> + u32 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
> + struct acpi_pptt_processor *cpu_node = NULL;
> + int ret = -ENOENT;
> +
> + status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
> + if (ACPI_FAILURE(status)) {
> + acpi_pptt_warn_missing();
> + return ret;
> + }
> +
> + if (table->revision >= rev)
> + cpu_node = acpi_find_processor_node(table, acpi_cpu_id);
> +
> + if (cpu_node)
> + ret = (cpu_node->flags & flag) != 0;
> +
> + acpi_put_table(table);
> +
> + return ret;
> +}
> +
> /**
> * acpi_find_last_cache_level() - Determines the number of cache levels for a PE
> * @cpu: Kernel logical CPU number
> @@ -604,6 +642,21 @@ int cache_setup_acpi(unsigned int cpu)
> return status;
> }
>
> +/**
> + * acpi_pptt_cpu_is_thread() - Determine if CPU is a thread
> + * @cpu: Kernel logical CPU number
> + *
[nit] If you spin the patch again, you can drop extra line space here.
--
Regards,
Sudeep
next prev parent reply other threads:[~2019-08-01 16:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 3:46 [PATCH v4 0/2] arm64/PPTT ACPI 6.3 thread flag support Jeremy Linton
2019-08-01 3:46 ` [PATCH v4 1/2] ACPI/PPTT: Add support for ACPI 6.3 thread flag Jeremy Linton
2019-08-01 15:57 ` Sudeep Holla [this message]
2019-08-01 16:10 ` Jeremy Linton
2019-08-02 13:05 ` Robert Richter
2019-08-02 15:36 ` Jeremy Linton
2019-08-01 3:46 ` [PATCH v4 2/2] arm64: topology: Use PPTT to determine if PE is a thread Jeremy Linton
2019-08-01 15:58 ` Sudeep Holla
2019-08-02 13:44 ` Robert Richter
2019-08-02 16:04 ` Jeremy Linton
-- strict thread matches above, loose matches on Subject: below --
2019-08-08 20:40 [PATCH v4 0/2] arm64/PPTT ACPI 6.3 thread flag support Jeremy Linton
2019-08-08 20:40 ` [PATCH v4 1/2] ACPI/PPTT: Add support for ACPI 6.3 thread flag Jeremy Linton
2019-08-08 22:25 ` Robert Richter
2019-08-12 9:06 ` Rafael J. Wysocki
2019-08-12 11:59 ` Will Deacon
2019-08-20 9:01 ` John Garry
2019-08-21 13:20 ` Jeremy Linton
2019-08-21 13:25 ` John Garry
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=20190801155736.GD23424@e107155-lin \
--to=sudeep.holla@arm.com \
--cc=catalin.marinas@arm.com \
--cc=jeremy.linton@arm.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=rjw@rjwysocki.net \
--cc=will@kernel.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