From: Andrea Arcangeli <aarcange@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Javi Merino <javi.merino@arm.com>,
Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>,
Daniel Kurtz <djkurtz@chromium.org>
Subject: [PATCH] thermal: avoid division by zero in power allocator
Date: Mon, 28 Sep 2015 23:28:34 +0200 [thread overview]
Message-ID: <1443475714-19871-2-git-send-email-aarcange@redhat.com> (raw)
In-Reply-To: <1443475714-19871-1-git-send-email-aarcange@redhat.com>
During boot I get a div by zero Oops regression starting in v4.3-rc3.
Reviewed-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---
drivers/thermal/power_allocator.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c
index 7ff9627..e570ff0 100644
--- a/drivers/thermal/power_allocator.c
+++ b/drivers/thermal/power_allocator.c
@@ -144,6 +144,16 @@ static void estimate_pid_constants(struct thermal_zone_device *tz,
switch_on_temp = 0;
temperature_threshold = control_temp - switch_on_temp;
+ /*
+ * estimate_pid_constants() tries to find appropriate default
+ * values for thermal zones that don't provide them. If a
+ * system integrator has configured a thermal zone with two
+ * passive trip points at the same temperature, that person
+ * hasn't put any effort to set up the thermal zone properly
+ * so just give up.
+ */
+ if (!temperature_threshold)
+ return;
if (!tz->tzp->k_po || force)
tz->tzp->k_po = int_to_frac(sustainable_power) /
next prev parent reply other threads:[~2015-09-28 21:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 21:28 [PATCH] thermal: avoid division by zero in power allocator Andrea Arcangeli
2015-09-28 21:28 ` Andrea Arcangeli [this message]
2015-09-29 20:33 ` Andrew Morton
2015-10-01 10:17 ` Javi Merino
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=1443475714-19871-2-git-send-email-aarcange@redhat.com \
--to=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=djkurtz@chromium.org \
--cc=edubezval@gmail.com \
--cc=javi.merino@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
/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