[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YJz7fp17T1cyed4j@gmail.com>
Date: Thu, 13 May 2021 12:12:14 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Huang Rui <ray.huang@....com>
Cc: Alexander Monakov <amonakov@...ras.ru>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Deucher, Alexander" <Alexander.Deucher@....com>,
Jason Bagavatsingham <jason.bagavatsingham@...il.com>,
"Pierre-Loup A . Griffais" <pgriffais@...vesoftware.com>,
"Fontenot, Nathan" <Nathan.Fontenot@....com>,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Borislav Petkov <bp@...e.de>,
"x86@...nel.org" <x86@...nel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH v4] x86, sched: Fix the AMD CPPC maximum perf on some
specific generations
* Huang Rui <ray.huang@....com> wrote:
> On Thu, May 13, 2021 at 06:59:02AM +0800, Ingo Molnar wrote:
> >
> > * Alexander Monakov <amonakov@...ras.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,
Ingo
Powered by blists - more mailing lists