linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Balbir Singh <bsingharora@gmail.com>,
	Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org, Chris Smart <chris@distroguy.com>
Subject: Re: [PATCH] Fix "ibm,processor-radix-AP-encodings"
Date: Wed, 28 Sep 2016 08:13:48 +0530	[thread overview]
Message-ID: <877f9wbv6j.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <0612c46e-7e1b-3729-d84f-cefa886abb6d@gmail.com>

Balbir Singh <bsingharora@gmail.com> writes:

> The top 3 bits of the lower order byte should contain the
> AP encoding, we assume the top 3 bits of the MSB.


Are you sure, Power architecture documents always confuse about MSB vs
lowe order bytes. ?

>
> Signed-off-by: Balbir Singh <bsingharora@gmail.com>
> ---
>
>  - Detected while reviewing Chris Smart's patch to add radix-AP-encoding
>    to skiboot
>  - Also fixed typo (sift/shift)
>
>  arch/powerpc/mm/pgtable-radix.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
> index af897d9..d525b0b 100644
> --- a/arch/powerpc/mm/pgtable-radix.c
> +++ b/arch/powerpc/mm/pgtable-radix.c
> @@ -245,10 +245,10 @@ static int __init radix_dt_scan_page_sizes(unsigned long node,
>
>  		struct mmu_psize_def *def;
>
> -		/* top 3 bit is AP encoding */
> -		shift = be32_to_cpu(prop[0]) & ~(0xe << 28);
> -		ap = be32_to_cpu(prop[0]) >> 29;
> -		pr_info("Page size sift = %d AP=0x%x\n", shift, ap);
> +		/* top 3 bits of the lower order byte is AP encoding */
> +		shift = be32_to_cpu(prop[0]) & 0x1f;
> +		ap = (be32_to_cpu(prop[0]) >> 5) & 0x7;
> +		pr_info("Page size shift = %d AP=0x%x\n", shift, ap);
>
>  		idx = get_idx_from_shift(shift);
>  		if (idx < 0)

-aneesh

  reply	other threads:[~2016-09-28  2:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-27 23:13 [PATCH] Fix "ibm,processor-radix-AP-encodings" Balbir Singh
2016-09-28  2:43 ` Aneesh Kumar K.V [this message]
2016-10-10  1:06   ` Oliver O'Halloran
2016-10-11  5:47     ` Michael Ellerman
2016-10-11  7:49       ` Aneesh Kumar K.V

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=877f9wbv6j.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=bsingharora@gmail.com \
    --cc=chris@distroguy.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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).