aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/intel_ips.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index c402cc417108..07a1a4aac609 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -600,17 +600,29 @@ static bool mcp_exceeded(struct ips_driver *ips)
600{ 600{
601 unsigned long flags; 601 unsigned long flags;
602 bool ret = false; 602 bool ret = false;
603 u32 temp_limit;
604 u32 avg_power;
605 const char *msg = "MCP limit exceeded: ";
603 606
604 spin_lock_irqsave(&ips->turbo_status_lock, flags); 607 spin_lock_irqsave(&ips->turbo_status_lock, flags);
605 if (ips->mcp_avg_temp > (ips->mcp_temp_limit * 100)) 608
606 ret = true; 609 temp_limit = ips->mcp_temp_limit * 100;
607 if (ips->cpu_avg_power + ips->mch_avg_power > ips->mcp_power_limit) 610 if (ips->mcp_avg_temp > temp_limit) {
611 dev_info(&ips->dev->dev,
612 "%sAvg temp %u, limit %u\n", msg, ips->mcp_avg_temp,
613 temp_limit);
608 ret = true; 614 ret = true;
609 spin_unlock_irqrestore(&ips->turbo_status_lock, flags); 615 }
610 616
611 if (ret) 617 avg_power = ips->cpu_avg_power + ips->mch_avg_power;
618 if (avg_power > ips->mcp_power_limit) {
612 dev_info(&ips->dev->dev, 619 dev_info(&ips->dev->dev,
613 "MCP power or thermal limit exceeded\n"); 620 "%sAvg power %u, limit %u\n", msg, avg_power,
621 ips->mcp_power_limit);
622 ret = true;
623 }
624
625 spin_unlock_irqrestore(&ips->turbo_status_lock, flags);
614 626
615 return ret; 627 return ret;
616} 628}