Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211445
b: refs/heads/master
c: eceab27
h: refs/heads/master
i:
  211443: ef9e192
v: v3
  • Loading branch information
Jesse Barnes authored and Matthew Garrett committed Oct 5, 2010
1 parent a1dd2f8 commit 2306ec7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 354aeeb1ca8f82ea133ede21987034addc75057a
refs/heads/master: eceab272fb895148f6293b5c0644fc2dd36d3aff
23 changes: 23 additions & 0 deletions trunk/drivers/platform/x86/intel_ips.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,27 @@ static bool mch_exceeded(struct ips_driver *ips)
return ret;
}

/**
* verify_limits - verify BIOS provided limits
* @ips: IPS structure
*
* BIOS can optionally provide non-default limits for power and temp. Check
* them here and use the defaults if the BIOS values are not provided or
* are otherwise unusable.
*/
static void verify_limits(struct ips_driver *ips)
{
if (ips->mcp_power_limit < ips->limits->mcp_power_limit ||
ips->mcp_power_limit > 35000)
ips->mcp_power_limit = ips->limits->mcp_power_limit;

if (ips->mcp_temp_limit < ips->limits->core_temp_limit ||
ips->mcp_temp_limit < ips->limits->mch_temp_limit ||
ips->mcp_temp_limit > 150)
ips->mcp_temp_limit = min(ips->limits->core_temp_limit,
ips->limits->mch_temp_limit);
}

/**
* update_turbo_limits - get various limits & settings from regs
* @ips: IPS driver struct
Expand All @@ -688,6 +709,7 @@ static void update_turbo_limits(struct ips_driver *ips)
ips->mcp_temp_limit = thm_readw(THM_PTL);
ips->mcp_power_limit = thm_readw(THM_MPPC);

verify_limits(ips);
/* Ignore BIOS CPU vs GPU pref */
}

Expand Down Expand Up @@ -1156,6 +1178,7 @@ static irqreturn_t ips_irq_handler(int irq, void *arg)
STS_PTL_SHIFT;
ips->mcp_power_limit = (tc1 & STS_PPL_MASK) >>
STS_PPL_SHIFT;
verify_limits(ips);
spin_unlock(&ips->turbo_status_lock);

thm_writeb(THM_SEC, SEC_ACK);
Expand Down

0 comments on commit 2306ec7

Please sign in to comment.