On Thu, 2010-08-26 at 21:11 -0300, Cesar Eduardo Barros wrote:
I was probably a bit hasty in writing that.
Perhaps you might try this patch and get a bit more information.
It seems a sensible patch and perhaps should be applied anyway.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/platform/x86/intel_ips.c | 58 +++++++++++++++++++++++++++++--------
1 files changed, 45 insertions(+), 13 deletions(-)
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index 9024480..73f9ad1 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -598,17 +598,36 @@ static bool mcp_exceeded(struct ips_driver *ips)
{
unsigned long flags;
bool ret = false;
+ u16 mcp_avg_temp;
+ u16 mcp_temp_limit;
+ u16 mcp_power_limit;
+ u32 cpu_avg_power;
+ u32 mch_avg_power;
spin_lock_irqsave(&ips->turbo_status_lock, flags);
- if (ips->mcp_avg_temp > (ips->mcp_temp_limit * 100))
- ret = true;
- if (ips->cpu_avg_power + ips->mch_avg_power > ips->mcp_power_limit)
- ret = true;
+
+ mcp_avg_temp = ips->mcp_avg_temp;
+ mcp_temp_limit = ips->mcp_temp_limit;
+ mcp_power_limit = ips->mcp_power_limit;
+ cpu_avg_power = ips->cpu_avg_power;
+ mch_avg_power = ips->mch_avg_power;
+
spin_unlock_irqrestore(&ips->turbo_status_lock, flags);
- if (ret)
+ if ((cpu_avg_power + mch_avg_power) > mcp_power_limit) {
dev_info(&ips->dev->dev,
- "MCP power or thermal limit exceeded\n");
+ "MCP power limit %d exceeded: %d\n",
+ mcp_power_limit,
+ cpu_avg_power + mch_avg_power);
+ ret = true;
+ }
+ if (mcp_avg_temp > (mcp_temp_limit * 100)) {
+ dev_info(&ips->dev->dev,
+ "MCP thermal limit %d exceeded: %d\n",
+ mcp_temp_limit * 100,
+ mcp_avg_temp);
+ ret = true;
+ }
return ret;
}
@@ -623,20 +642,33 @@ static bool mcp_exceeded(struct ips_driver *ips)
static bool cpu_exceeded(struct ips_driver *ips, int cpu)
{
unsigned long flags;
- int avg;
bool ret = false;
+ int avg;
+ int core_temp_limit;
+ u16 core_power_limit;
+ u32 cpu_avg_power;
spin_lock_irqsave(&ips->turbo_status_lock, flags);
+
avg = cpu ? ips->ctv2_avg_temp : ips->ctv1_avg_temp;
- if (avg > (ips->limits->core_temp_limit * 100))
- ret = true;
- if (ips->cpu_avg_power > ips->core_power_limit * 100)
- ret = true;
+ core_temp_limit = ips->limits->core_temp_limit;
+ core_power_limit = ips->core_power_limit;
+ cpu_avg_power = ips->cpu_avg_power;
+
spin_unlock_irqrestore(&ips->turbo_status_lock, flags);
- if (ret)
+ if (cpu_avg_power > (core_power_limit * 100)) {
+ dev_info(&ips->dev->dev,
+ "CPU power limit %d exceeded: %d\n",
+ cpu_avg_power, core_power_limit * 100);
+ ret = true;
+ }
+ if (avg > (core_temp_limit * 100)) {
dev_info(&ips->dev->dev,
- "CPU power or thermal limit exceeded\n");
+ "CPU thermal limit %d exceeded: %d\n",
+ core_temp_limit * 100, avg);
+ ret = true;
+ }
return ret;
}
--