mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: blondquirk <blondquirk@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: PROBLEM:
Date: Tue, 5 Oct 2010 15:27:12 +0400	[thread overview]
Message-ID: <AANLkTimLUKvo9DiwhfXvOg32NN7TaJCXJXKPyCF1PmWj@mail.gmail.com> (raw)

intel_ips: 1. Integer overflow in update_average_power; 2. Value
returned by i915_read_mch_val is too high to be used as power in mW

Kernel version: linux-2.6.36-rc6 x64

I have Core i3 laptop y460 with dual intel/ati graphics (ati card is
powered off via acpi).
When I modprobe intel_ips (laptop is nearly idle), I get annoying messages:
 [  903.188705] intel ips 0000:00:1f.6: Warning: CPU TDP doesn't match
expected value (found 25, expected 35)
 [  903.188739] intel ips 0000:00:1f.6: PCI INT C -> GSI 18 (level,
low) -> IRQ 18
 [  903.190255] intel ips 0000:00:1f.6: IPS driver initialized, MCP
temp limit 65535
 [  908.382790] intel ips 0000:00:1f.6: MCP power or thermal limit exceeded
 [  913.381288] intel ips 0000:00:1f.6: CPU power or thermal limit exceeded
 [  918.379786] intel ips 0000:00:1f.6: MCP power or thermal limit exceeded
 [  923.378302] intel ips 0000:00:1f.6: CPU power or thermal limit exceeded
 [  928.376823] intel ips 0000:00:1f.6: CPU power or thermal limit exceeded
 [  933.375314] intel ips 0000:00:1f.6: CPU power or thermal limit exceeded
 [  938.373857] intel ips 0000:00:1f.6: CPU power or thermal limit exceeded
 [  943.372346] intel ips 0000:00:1f.6: CPU power or thermal limit exceeded
 [  948.370891] intel ips 0000:00:1f.6: CPU power or thermal limit exceeded
 [  953.369370] intel ips 0000:00:1f.6: MCP power or thermal limit exceeded

Then if do
$ modprobe -r intel_ips
$ modprobe intel_ips
I get only
 [ 1097.310896] intel ips 0000:00:1f.6: Warning: CPU TDP doesn't match
expected value (found 25, expected 35)
 [ 1097.312321] intel ips 0000:00:1f.6: IPS driver initialized, MCP
temp limit 65535
 [ 1102.505240] intel ips 0000:00:1f.6: MCP power or thermal limit exceeded
 [ 1132.496265] intel ips 0000:00:1f.6: MCP power or thermal limit exceeded
 [ 1212.472556] intel ips 0000:00:1f.6: MCP power or thermal limit exceeded

Then I added debug output when calling read_mch_val() and noticed
possible integer overflow

diff -urN intel_ips.c.orig intel_ips.c
--- intel_ips.c.orig    2010-10-04 11:11:42.513203000 +0400
+++ intel_ips.c    2010-10-05 14:23:52.357869000 +0400
@@ -873,7 +873,7 @@
 }

 static const u16 power_decay_factor = 2;
-static u16 update_average_power(u32 avg, u32 val)
+static u32 update_average_power(u32 avg, u32 val)
 {
     u32 ret;

@@ -1039,6 +1039,7 @@
         /* Power */
         if (ips->read_mch_val) {
             mch_val = ips->read_mch_val();
+           dev_info(&ips->dev->dev, "mch_val is %u\n", mch_val);
             ips->mch_avg_power =
                 update_average_power(ips->mch_avg_power,
                              mch_val);

And now mch_power doesn't fluctuate, but it's unexpectedly huge, which
might indicate problem related to i915 :
$ while true; do cat /sys/kernel/debug/ips/mch_power; sleep 1; done;
8886864mW
11704782mW
5017037mW
7487929mW
5988348mW
6001705mW
4132710mW

Also there is possible overflow when converting from unsigned long to
u32, but it should not occur if i915_read_mch_val returns power in mW

Keywords: modules
---
blondquirk

             reply	other threads:[~2010-10-05 11:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05 11:27 blondquirk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-12-27 13:36 PROBLEM: Philip Miller
2009-01-19  8:10 PROBLEM: Vincent Chapman
2006-08-31  6:54 PROBLEM: 董董侃
2004-05-22 15:30 PROBLEM: Cybermario
2004-05-16 19:33 PROBLEM: roger@msn
2004-04-24 18:55 PROBLEM: Harry
2004-02-19 14:53 PROBLEM: Art Tevs
2004-02-19 15:26 ` PROBLEM: Bartlomiej Zolnierkiewicz
2003-11-23  2:10 Problem: taylordl
2003-11-23  2:54 ` Problem: Matt H.
2003-10-20  0:03 PROBLEM: Teemu Sohlman
2003-06-10 14:15 PROBLEM: BOVARD JAY D
2003-03-03 11:07 PROBLEM: roman duka
2003-03-03 11:38 ` PROBLEM: Russell King
2002-06-12 23:48 PROBLEM: James Drabb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimLUKvo9DiwhfXvOg32NN7TaJCXJXKPyCF1PmWj@mail.gmail.com \
    --to=blondquirk@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®