[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1471559812-19967-7-git-send-email-srinivas.pandruvada@linux.intel.com>
Date: Thu, 18 Aug 2016 15:36:47 -0700
From: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
To: mingo@...hat.com, tglx@...utronix.de, hpa@...or.com,
rjw@...ysocki.net, peterz@...radead.org
Cc: x86@...nel.org, bp@...e.de, sudeep.holla@....com,
ak@...ux.intel.com, linux-acpi@...r.kernel.org,
linux-pm@...r.kernel.org, alexey.klimov@....com,
viresh.kumar@...aro.org, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, lenb@...nel.org,
tim.c.chen@...ux.intel.com, srinivas.pandruvada@...ux.intel.com,
paul.gortmaker@...driver.com, jpoimboe@...hat.com,
mcgrof@...nel.org, jgross@...e.com, robert.moore@...el.com,
dvyukov@...gle.com, jeyu@...hat.com
Subject: [PATCH 06/11] acpi: cpcc: Add integer read support
The _CPC performance limits can also be simple integer not just buffer
with register information. Add support for integer read via cpc_read.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
---
drivers/acpi/cppc_acpi.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 2e98173..34209f5 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -651,11 +651,18 @@ EXPORT_SYMBOL_GPL(acpi_cppc_processor_exit);
* we can directly write to it.
*/
-static int cpc_read(struct cpc_reg *reg, u64 *val)
+static int cpc_read(struct cpc_register_resource *res, u64 *val)
{
+ struct cpc_reg *reg = &res->cpc_entry.reg;
int ret_val = 0;
*val = 0;
+
+ if (res->type == ACPI_TYPE_INTEGER) {
+ *val = res->cpc_entry.int_value;
+ return 0;
+ }
+
if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM) {
void __iomem *vaddr = GET_PCC_VADDR(reg->address);
@@ -754,16 +761,16 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps)
}
}
- cpc_read(&highest_reg->cpc_entry.reg, &high);
+ cpc_read(highest_reg, &high);
perf_caps->highest_perf = high;
- cpc_read(&lowest_reg->cpc_entry.reg, &low);
+ cpc_read(lowest_reg, &low);
perf_caps->lowest_perf = low;
- cpc_read(&ref_perf->cpc_entry.reg, &ref);
+ cpc_read(ref_perf, &ref);
perf_caps->reference_perf = ref;
- cpc_read(&nom_perf->cpc_entry.reg, &nom);
+ cpc_read(nom_perf, &nom);
perf_caps->nominal_perf = nom;
if (!ref)
@@ -812,8 +819,8 @@ int cppc_get_perf_ctrs(int cpunum, struct cppc_perf_fb_ctrs *perf_fb_ctrs)
}
}
- cpc_read(&delivered_reg->cpc_entry.reg, &delivered);
- cpc_read(&reference_reg->cpc_entry.reg, &reference);
+ cpc_read(delivered_reg, &delivered);
+ cpc_read(reference_reg, &reference);
if (!delivered || !reference) {
ret = -EFAULT;
--
2.7.4
Powered by blists - more mailing lists