intel_ips -- ensure we do not enable gpu turbo mode without driver linkage
PATCH 1/1 intel_ips -- ensure we do not enable gpu turbo mode without driver linkage
Both when polling the current turbo status (in poll_turbo_status mode) and when handling thermal events (in ips_irq_handler) the current status of GPU turbo is updated to match the hardware status. However if during driver initialisation we were unable aquire linkage to the i915 driver enabling GPU turbo will lead to an oops on the first attempt to determine GPU busy status.
Ensure that we do not enable GPU turbo unless we have driver linkage.
--- drivers/platform/x86/intel_ips.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/platform/x86/intel_ips.c +4 -2
@@ -680,7 +680,8 @@ static void update_turbo_limits(struct ips_driver *ips)u32 hts =thm_readl (THM_HTS ); ips->cpu_turbo_enabled = !(hts &HTS_PCTD_DIS ); - ips->gpu_turbo_enabled = !(hts &HTS_GTD_DIS ); +if (ips->gpu_busy) + ips->gpu_turbo_enabled = !(hts &HTS_GTD_DIS ); ips->core_power_limit =thm_readw (THM_MPCPC ); ips->mch_power_limit =thm_readw (THM_MMGPC ); ips->mcp_temp_limit =thm_readw (THM_PTL );
@@ -1150,7 +1151,8 @@ static irqreturn_t ips_irq_handler(int irq, void *arg)STS_GPL_SHIFT ;/* ignore EC CPU vs GPU pref */ ips->cpu_turbo_enabled = !(sts &STS_PCTD_DIS ); - ips->gpu_turbo_enabled = !(sts &STS_GTD_DIS ); +if (ips->gpu_busy) + ips->gpu_turbo_enabled = !(sts &STS_GTD_DIS ); ips->mcp_temp_limit = (sts &STS_PTL_MASK ) >>STS_PTL_SHIFT ; ips->mcp_power_limit = (tc1 & STS_PPL_MASK) >>
Signature · 1 line
1.7.1
Quoted 31 lines · On Tue, 5 Oct 2010 09:48:42 +0100 Andy Whitcroft <[email protected]> wrote:
Both when polling the current turbo status (in
poll_turbo_statusmode) and when handling thermal events (inips_irq_handler) the current status of GPU turbo is updated to match the hardware status. However if during driver initialisation we were unable aquire linkage to the i915 driver enabling GPU turbo will lead to an oops on the first attempt to determine GPU busy status.Ensure that we do not enable GPU turbo unless we have driver linkage.
Signed-off-by Andy Whitcroft <[email protected]>--- drivers/platform/x86/intel_ips.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)drivers/platform/x86/intel_ips.c +2
-1@@ -680,7 +680,8 @@ static void update_turbo_limits(struct ips_driver *ips)u32 hts =thm_readl (THM_HTS ); ips->cpu_turbo_enabled = !(hts &HTS_PCTD_DIS ); - ips->gpu_turbo_enabled = !(hts &HTS_GTD_DIS ); +if (ips->gpu_busy) + ips->gpu_turbo_enabled = !(hts &HTS_GTD_DIS ); ips->core_power_limit =thm_readw (THM_MPCPC ); ips->mch_power_limit =thm_readw (THM_MMGPC ); ips->mcp_temp_limit =thm_readw (THM_PTL );
drivers/platform/x86/intel_ips.c static irqreturn_t ips_irq_handler(int irq, void *arg) · line 1158
Quoted 9 lines
drivers/platform/x86/intel_ips.c +2
-1@@ -1150,7 +1151,8 @@ static irqreturn_t ips_irq_handler(int irq, void *arg)STS_GPL_SHIFT ;/* ignore EC CPU vs GPU pref */ ips->cpu_turbo_enabled = !(sts &STS_PCTD_DIS ); - ips->gpu_turbo_enabled = !(sts &STS_GTD_DIS ); +if (ips->gpu_busy) + ips->gpu_turbo_enabled = !(sts &STS_GTD_DIS ); ips->mcp_temp_limit = (sts &STS_PTL_MASK ) >>STS_PTL_SHIFT ; ips->mcp_power_limit = (tc1 & STS_PPL_MASK) >>
Looks good, thanks. Most of the performance upside is on the GPU, so running without i915 is a shame, but we definitely shouldn't oops, so this patch looks fine.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center