Re: [PATCH v3 06/21] cpufreq: amd: introduce a new amd pstate driver to support future processors

From: Huang Rui
Date: Fri Nov 05 2021 - 00:21:23 EST


On Thu, Nov 04, 2021 at 11:10:59PM +0800, Fontenot, Nathan wrote:
> On 11/3/21 2:01 AM, Huang Rui wrote:
>
> >>> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> >>> new file mode 100644
> >>> index 000000000000..a400861c7fdc
> >>> --- /dev/null
> >>> +++ b/drivers/cpufreq/amd-pstate.c
> >>> @@ -0,0 +1,413 @@
> >>> +/*
> >>> + * amd-pstate.c - AMD Processor P-state Frequency Driver
> >>> + *
> >>> + * Copyright (C) 2021 Advanced Micro Devices, Inc. All Rights Reserved.
> >>> + *
> >>> + * This program is free software; you can redistribute it and/or
> >>> + * modify it under the terms of the GNU General Public License
> >>> + * as published by the Free Software Foundation; either version 2
> >>> + * of the License, or (at your option) any later version.
> >>> + *
> >>> + * This program is distributed in the hope that it will be useful,
> >>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> >>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> >>> + * GNU General Public License for more details.
> >>> + *
> >>> + * You should have received a copy of the GNU General Public License along with
> >>> + * this program; if not, write to the Free Software
> >>> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
> >>
> >> You should use a SPDX license identifier instead of copying the GPL text
> >> in the file. See Documentation/process/license-rules.rst
> >
> > The SPDX license identifier is an alternative way to instead of the common
> > way to express the license at the top comment of the file. Acutally it's
> > not mandatory, right?
> >
>
> It's not mandatory but I believe using SPDX identifiers is the preferred method.
>

Yes, indeed, I will change this in V4.

> ...
>
> >>> +static int __init amd_pstate_init(void)
> >>> +{
> >>> + int ret;
> >>> +
> >>> + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
> >>> + return -ENODEV;
> >>> +
> >>> + if (!acpi_cpc_valid()) {
> >>> + pr_debug("%s, the _CPC object is not present in SBIOS\n",
> >>> + __func__);
> >>
> >> Do we need to print the function name here (and below)?
> >
> > It's a soft reminder to tell the user where the message comes from.
> >
>
> True, but you do define pr_fmt at the top of the file so users will know
> this is coming from the amd_pstate driver.
>

Hmm, yes, will clean this in V4.

Thanks,
Ray