From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Jeremy Linton <jeremy.linton@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Will Deacon <will.deacon@arm.com>,
Sudeep Holla <sudeep.holla@arm.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Hanjun Gou <gouhanjun@huawei.com>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH v5 1/4] ACPI/PPTT: Modify node flag detection to find last IDENTICAL
Date: Thu, 27 Jun 2019 13:15:00 +0200 [thread overview]
Message-ID: <CAJZ5v0hqDwEAuJ6rk5yBd7_OCW71Y5ihHHNDUUiW6a3wvWOuGg@mail.gmail.com> (raw)
In-Reply-To: <20190626213718.39423-2-jeremy.linton@arm.com>
On Wed, Jun 26, 2019 at 11:37 PM Jeremy Linton <jeremy.linton@arm.com> wrote:
>
> The ACPI specification implies that the IDENTICAL flag should be
> set on all non leaf nodes where the children are identical.
> This means that we need to be searching for the last node with
> the identical flag set rather than the first one.
>
> Since this flag is also dependent on the table revision, we
> need to add a bit of extra code to verify the table revision,
> and the next node's state in the traversal. Since we want to
> avoid function pointers here, lets just special case
> the IDENTICAL flag.
>
> Tested-by: Hanjun Gou <gouhanjun@huawei.com>
> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Assuming that the Tested-by tag will be fixed:
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/acpi/pptt.c | 35 +++++++++++++++++++++++++++++------
> 1 file changed, 29 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
> index b72e6afaa8fb..05344413f199 100644
> --- a/drivers/acpi/pptt.c
> +++ b/drivers/acpi/pptt.c
> @@ -432,17 +432,40 @@ static void cache_setup_acpi_cpu(struct acpi_table_header *table,
> }
> }
>
> +static bool flag_identical(struct acpi_table_header *table_hdr,
> + struct acpi_pptt_processor *cpu)
> +{
> + struct acpi_pptt_processor *next;
> +
> + /* heterogeneous machines must use PPTT revision > 1 */
> + if (table_hdr->revision < 2)
> + return false;
> +
> + /* Locate the last node in the tree with IDENTICAL set */
> + if (cpu->flags & ACPI_PPTT_ACPI_IDENTICAL) {
> + next = fetch_pptt_node(table_hdr, cpu->parent);
> + if (!(next && next->flags & ACPI_PPTT_ACPI_IDENTICAL))
> + return true;
> + }
> +
> + return false;
> +}
> +
> /* Passing level values greater than this will result in search termination */
> #define PPTT_ABORT_PACKAGE 0xFF
>
> -static struct acpi_pptt_processor *acpi_find_processor_package_id(struct acpi_table_header *table_hdr,
> - struct acpi_pptt_processor *cpu,
> - int level, int flag)
> +static struct acpi_pptt_processor *acpi_find_processor_tag(struct acpi_table_header *table_hdr,
> + struct acpi_pptt_processor *cpu,
> + int level, int flag)
> {
> struct acpi_pptt_processor *prev_node;
>
> while (cpu && level) {
> - if (cpu->flags & flag)
> + /* special case the identical flag to find last identical */
> + if (flag == ACPI_PPTT_ACPI_IDENTICAL) {
> + if (flag_identical(table_hdr, cpu))
> + break;
> + } else if (cpu->flags & flag)
> break;
> pr_debug("level %d\n", level);
> prev_node = fetch_pptt_node(table_hdr, cpu->parent);
> @@ -480,8 +503,8 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
>
> cpu_node = acpi_find_processor_node(table, acpi_cpu_id);
> if (cpu_node) {
> - cpu_node = acpi_find_processor_package_id(table, cpu_node,
> - level, flag);
> + cpu_node = acpi_find_processor_tag(table, cpu_node,
> + level, flag);
> /*
> * As per specification if the processor structure represents
> * an actual processor, then ACPI processor ID must be valid.
> --
> 2.21.0
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-06-27 11:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 21:37 [PATCH v5 0/4] arm64: SPE ACPI enablement Jeremy Linton
2019-06-26 21:37 ` [PATCH v5 1/4] ACPI/PPTT: Modify node flag detection to find last IDENTICAL Jeremy Linton
2019-06-27 2:10 ` Hanjun Guo
2019-06-27 11:15 ` Rafael J. Wysocki [this message]
2019-06-26 21:37 ` [PATCH v5 2/4] ACPI/PPTT: Add function to return ACPI 6.3 Identical tokens Jeremy Linton
2019-06-27 11:15 ` Rafael J. Wysocki
2019-06-26 21:37 ` [PATCH v5 3/4] arm_pmu: acpi: spe: Add initial MADT/SPE probing Jeremy Linton
2019-06-26 21:37 ` [PATCH v5 4/4] perf: arm_spe: Enable ACPI/Platform automatic module loading Jeremy Linton
2019-06-27 16:47 ` [PATCH v5 0/4] arm64: SPE ACPI enablement Will Deacon
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=CAJZ5v0hqDwEAuJ6rk5yBd7_OCW71Y5ihHHNDUUiW6a3wvWOuGg@mail.gmail.com \
--to=rafael@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=gouhanjun@huawei.com \
--cc=jeremy.linton@arm.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mark.rutland@arm.com \
--cc=rjw@rjwysocki.net \
--cc=sudeep.holla@arm.com \
--cc=will.deacon@arm.com \
/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).