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.deacon@arm.com, rjw@rjwysocki.net,
lenb@kernel.org, mark.rutland@arm.com, lorenzo.pieralisi@arm.com,
linuxarm@huawei.com, john.garry@huawei.com,
Sudeep Holla <sudeep.holla@arm.com>
Subject: Re: [PATCH v3 3/5] ACPI/PPTT: Modify node flag detection to find last IDENTICAL
Date: Fri, 7 Jun 2019 14:47:58 +0100 [thread overview]
Message-ID: <20190607134758.GB15577@e107155-lin> (raw)
In-Reply-To: <1db40fa0-9834-5607-ec1c-794480e5c514@arm.com>
On Fri, Jun 07, 2019 at 08:15:50AM -0500, Jeremy Linton wrote:
> Hi,
>
> Thanks for taking a look at this.
>
> On 6/7/19 4:53 AM, Sudeep Holla wrote:
> > On Fri, May 03, 2019 at 06:24:05PM -0500, Jeremy Linton 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.
> > >
> > > Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
> > > ---
> > > drivers/acpi/pptt.c | 28 +++++++++++++++++++++++++---
> > > 1 file changed, 25 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
> > > index 1865515297ca..456e1c0a35ae 100644
> > > --- a/drivers/acpi/pptt.c
> > > +++ b/drivers/acpi/pptt.c
> > > @@ -432,17 +432,39 @@ 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)
> >
> > Not sure if it's email client problem, but I see quite a few mis-alignment
> > with parenthesis like above one.
>
> It looks fine in the original editor/text patch, but yes in my email client
> I see it off by one (or two/three now that i'm replying). Its a mix of
> tabs/spaces and I've seen this happen before in my email client due to the
> leading "[>+]"?
>
No I have configured(hopefully correctly) my client, but if you not seeing
issue with patch, that's fine.
>
> >
> > > +{
> > > + 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,
> > > +static struct acpi_pptt_processor *acpi_find_processor_tag_id(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)
> > > + if (flag == ACPI_PPTT_ACPI_IDENTICAL) {
> >
> > flag_identical anyways check the flag, so I assume you can drop the above
> > check.
>
> ? I think that would be a bug because then we would always be returning the
> value of the IDENTICAL flag rather than the other flags passed into this
> routine. This is the special case I think Raphael was asking for rather than
> the function pointer/callback interface.
>
Ah OK, got it. Worth a comment ? I am sure I will forget next time I see this.
--
Regards,
Sudeep
next prev parent reply other threads:[~2019-06-07 13:48 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 23:24 [PATCH v3 0/5] arm64: SPE ACPI enablement Jeremy Linton
2019-05-03 23:24 ` Jeremy Linton
2019-05-03 23:24 ` [PATCH v3 1/5] ACPI/PPTT: Trivial, change the capitalization of CPU Jeremy Linton
2019-05-03 23:24 ` Jeremy Linton
2019-05-07 18:12 ` Jeremy Linton
2019-05-07 18:12 ` Jeremy Linton
2019-05-03 23:24 ` [PATCH v3 2/5] ACPI/PPTT: Add function to return ACPI 6.3 Identical tokens Jeremy Linton
2019-05-03 23:24 ` Jeremy Linton
2019-05-05 7:09 ` Kefeng Wang
2019-05-05 7:09 ` Kefeng Wang
2019-05-07 18:26 ` Jeremy Linton
2019-05-07 18:26 ` Jeremy Linton
2019-06-07 9:49 ` Sudeep Holla
2019-05-03 23:24 ` [PATCH v3 3/5] ACPI/PPTT: Modify node flag detection to find last IDENTICAL Jeremy Linton
2019-05-03 23:24 ` Jeremy Linton
2019-06-07 9:53 ` Sudeep Holla
2019-06-07 13:15 ` Jeremy Linton
2019-06-07 13:47 ` Sudeep Holla [this message]
2019-05-03 23:24 ` [PATCH v3 4/5] arm_pmu: acpi: spe: Add initial MADT/SPE probing Jeremy Linton
2019-05-03 23:24 ` Jeremy Linton
2019-05-08 11:18 ` John Garry
2019-05-08 20:04 ` Jeremy Linton
2019-06-07 9:57 ` Sudeep Holla
2019-06-07 13:28 ` Jeremy Linton
2019-06-07 13:37 ` Sudeep Holla
2019-05-03 23:24 ` [PATCH v3 5/5] perf: arm_spe: Enable ACPI/Platform automatic module loading Jeremy Linton
2019-05-03 23:24 ` Jeremy Linton
2019-05-04 11:06 ` [PATCH v3 0/5] arm64: SPE ACPI enablement Hanjun Guo
2019-05-04 11:06 ` Hanjun Guo
2019-05-07 17:58 ` Jeremy Linton
2019-05-07 17:58 ` Jeremy Linton
2019-05-08 9:35 ` Hanjun Guo
2019-05-08 16:51 ` Sudeep Holla
2019-05-09 9:28 ` Will Deacon
2019-05-09 10:35 ` Sudeep Holla
2019-05-09 14:13 ` Sudeep Holla
2019-05-13 10:56 ` Will Deacon
2019-05-13 11:31 ` Sudeep Holla
2019-05-13 11:10 ` Hanjun Guo
2019-05-08 16:45 ` Sudeep Holla
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=20190607134758.GB15577@e107155-lin \
--to=sudeep.holla@arm.com \
--cc=catalin.marinas@arm.com \
--cc=jeremy.linton@arm.com \
--cc=john.garry@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linuxarm@huawei.com \
--cc=lorenzo.pieralisi@arm.com \
--cc=mark.rutland@arm.com \
--cc=rjw@rjwysocki.net \
--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).