linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang@amd.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Alexander Monakov <amonakov@ispras.ru>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>,
	Jason Bagavatsingham <jason.bagavatsingham@gmail.com>,
	"Pierre-Loup A . Griffais" <pgriffais@valvesoftware.com>,
	"Fontenot, Nathan" <Nathan.Fontenot@amd.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Borislav Petkov <bp@suse.de>, "x86@kernel.org" <x86@kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v4] x86, sched: Fix the AMD CPPC maximum perf on some specific generations
Date: Thu, 13 May 2021 18:27:46 +0800	[thread overview]
Message-ID: <20210513102746.GB1621127@hr-amd> (raw)
In-Reply-To: <YJz7fp17T1cyed4j@gmail.com>

On Thu, May 13, 2021 at 06:12:14PM +0800, Ingo Molnar wrote:
> 
> * Huang Rui <ray.huang@amd.com> wrote:
> 
> > On Thu, May 13, 2021 at 06:59:02AM +0800, Ingo Molnar wrote:
> > > 
> > > * Alexander Monakov <amonakov@ispras.ru> wrote:
> > > 
> > > > On Sun, 25 Apr 2021, Huang Rui wrote:
> > > > 
> > > > > Some AMD Ryzen generations has different calculation method on maximum
> > > > > perf. 255 is not for all asics, some specific generations should use 166
> > > > > as the maximum perf. Otherwise, it will report incorrect frequency value
> > > > > like below:
> > > > 
> > > > The commit message says '255', but the code:
> > > > 
> > > > > --- a/arch/x86/kernel/cpu/amd.c
> > > > > +++ b/arch/x86/kernel/cpu/amd.c
> > > > > @@ -1170,3 +1170,19 @@ void set_dr_addr_mask(unsigned long mask, int dr)
> > > > >  		break;
> > > > >  	}
> > > > >  }
> > > > > +
> > > > > +u32 amd_get_highest_perf(void)
> > > > > +{
> > > > > +	struct cpuinfo_x86 *c = &boot_cpu_data;
> > > > > +
> > > > > +	if (c->x86 == 0x17 && ((c->x86_model >= 0x30 && c->x86_model < 0x40) ||
> > > > > +			       (c->x86_model >= 0x70 && c->x86_model < 0x80)))
> > > > > +	    return 166;
> > > > > +
> > > > > +	if (c->x86 == 0x19 && ((c->x86_model >= 0x20 && c->x86_model < 0x30) ||
> > > > > +			       (c->x86_model >= 0x40 && c->x86_model < 0x70)))
> > > > > +	    return 166;
> > > > > +
> > > > > +	return 225;
> > > > > +}
> > > > 
> > > > says 225? This is probably a typo? In any case they are out of sync.
> > > > 
> > > > Alexander
> > > 
> > > Ugh - that's indeed a good question ...
> > > 
> > 
> > Ah sorry! It's my typo. It should be 255 (confirmed in the ucode).
> > 
> > Alexander, thanks a lot to catch this!
> > 
> > Ingo, would you mind to update it from 225 -> 255 while you apply this
> > patch or let me know if you want me to send v5?
> 
> No need to send v5, done!
> 
> I have a system that appears to be affected by this bug:
> 
>   kepler:~> lscpu | grep -i mhz
>   CPU MHz:                         4000.000
>   CPU max MHz:                     7140.6250
>   CPU min MHz:                     2200.0000
> 
> So I should be able to confirm after a reboot.
> 

Thanks! Please feel free to let me know whether it's able to fix your
machine. :-)

Thanks,
Ray

  reply	other threads:[~2021-05-13 10:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-25  7:34 [PATCH v4] x86, sched: Fix the AMD CPPC maximum perf on some specific generations Huang Rui
2021-04-28 17:08 ` Rafael J. Wysocki
2021-05-12 19:15 ` Ingo Molnar
2021-05-12 19:20 ` [tip: sched/urgent] x86, sched: Fix the AMD CPPC maximum performance value on certain AMD Ryzen generations tip-bot2 for Huang Rui
2021-05-12 22:34 ` [PATCH v4] x86, sched: Fix the AMD CPPC maximum perf on some specific generations Alexander Monakov
2021-05-12 22:59   ` Ingo Molnar
2021-05-13  4:24     ` Huang Rui
2021-05-13 10:12       ` Ingo Molnar
2021-05-13 10:27         ` Huang Rui [this message]
2021-05-13 10:39         ` Ingo Molnar
2021-05-13 10:45           ` Huang Rui
2021-05-13 10:43 ` [tip: sched/urgent] x86, sched: Fix the AMD CPPC maximum performance value on certain AMD Ryzen generations tip-bot2 for Huang Rui

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=20210513102746.GB1621127@hr-amd \
    --to=ray.huang@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Nathan.Fontenot@amd.com \
    --cc=amonakov@ispras.ru \
    --cc=bp@suse.de \
    --cc=jason.bagavatsingham@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pgriffais@valvesoftware.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).