lkml.org 
[lkml]   [2019]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 5/6] acpi/cppc: Add support for optional CPPC registers
Date
On Fri, 2019-03-22 at 20:26 +0000, Natarajan, Janakarajan wrote:
> From: Yazen Ghannam <Yazen.Ghannam@amd.com>
>
> Newer AMD processors support a subset of the optional CPPC registers.
> Create show, store and helper routines for supported CPPC registers.
>
> Signed-off-by: Yazen Ghannam <Yazen.Ghannam@amd.com>
> [ carved out into a patch, cleaned up, productized ]
> Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
>

[..]

> + /* desired_perf is the only mandatory value in perf_ctrls */
> + if (cpc_read(cpu, desired_reg, &desired))
> + ret = -EFAULT;
> +
> + if (CPC_SUPPORTED(max_reg) && cpc_read(cpu, max_reg, &max))
> + ret = -EFAULT;
> +
We should create and use different macro other than CPPC_SUPPORTED.
CPC_SUPPORTED doesn't validate the correctness of object type for a
field. For example "Maximum Performance Register" can only be buffer
not integer. In this way invalid field definitions can be ignored.


> + if (CPC_SUPPORTED(min_reg) && cpc_read(cpu, min_reg, &min))
> + ret = -EFAULT;
> +
> + if (CPC_SUPPORTED(energy_reg) && cpc_read(cpu, energy_reg,
> &energy))
> + ret = -EFAULT;
> +
> + if (CPC_SUPPORTED(auto_sel_enable_reg) &&
> + cpc_read(cpu, auto_sel_enable_reg, &auto_sel_enable))
> + ret = -EFAULT;
> +
Here it is fine to use CPC_SUPPORTED as the "Autonomous Selection
Enable" can be both integer and buffer.

Thanks,
Srinivas

[unhandled content-type:application/x-pkcs7-signature]
\
 
 \ /
  Last update: 2019-03-27 16:48    [W:0.073 / U:8.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site