linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: ppc-dev <linuxppc-dev@ozlabs.org>, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] powerpc: New cpu type shows up as "unknown" even when logical PVR is recognized
Date: Sun, 15 Feb 2009 01:00:07 +1100	[thread overview]
Message-ID: <1234620007.10265.7.camel@localhost> (raw)
In-Reply-To: <1234557928.10378.8.camel@norville.austin.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 2132 bytes --]

On Fri, 2009-02-13 at 14:45 -0600, Dave Kleikamp wrote:
> When identify_cpu() is called a second time with a logical PVR, it only
> copies a subset of the cpu_spec structure to avoid overwriting the
> performance monitor fields that were initialized based on the real PVR.
> 
> If the real PVR is not recognized, the structure is initialized with
> default data in which the pvr_mask field is zero.  Overriding the default
> definition with the one based on the logical PVR does not update the
> pvr_mask field.  Since the pvr_mask field remains zero, show_cpuinfo()
> reports the cpu as "unknown".
> 
> identify_cpu() should update the pvr_mask, so that show_cpuinfo() reports
> the logical cpu name, as it would if the kernel recognized the real PVR.
> 
> For completeness, this patch also updates pvr_value, although its only
> use appears to be in booke_wdt_init() setting ident.firmware_version.  I'm
> not sure which value (the real or logical) is the most useful here, if it
> matters at all.
> 
> Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
> 
> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> index 923f87a..a216fad 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -1780,6 +1780,8 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
>  			 * performance monitor fields.
>  			 */
>  			if (t->num_pmcs && !s->num_pmcs) {
> +				t->pvr_mask = s->pvr_mask;
> +				t->pvr_value = s->pvr_value;
>  				t->cpu_name = s->cpu_name;
>  				t->cpu_features = s->cpu_features;
>  				t->cpu_user_features = s->cpu_user_features;

Seems like we'd be better off copying the whole structure, and then
putting back the performance monitor fields. So we don't end up with
another bug if something's added to struct cpu_spec.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-02-14 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-13 20:45 [PATCH] powerpc: New cpu type shows up as "unknown" even when logical PVR is recognized Dave Kleikamp
2009-02-14 14:00 ` Michael Ellerman [this message]
2009-02-19 15:07   ` Dave Kleikamp

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=1234620007.10265.7.camel@localhost \
    --to=michael@ellerman.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=shaggy@linux.vnet.ibm.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).