From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: daniel.lezcano@linaro.org, rui.zhang@intel.com
Cc: amitk@kernel.org, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org,
Thara Gopinath <thara.gopinath@linaro.org>,
Lukasz Luba <lukasz.luba@arm.com>
Subject: [PATCH v2 2/3] thermal/core: Use precomputed jiffies for the polling
Date: Wed, 16 Dec 2020 23:03:36 +0100 [thread overview]
Message-ID: <20201216220337.839878-2-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <20201216220337.839878-1-daniel.lezcano@linaro.org>
The delays are also stored in jiffies based unit. Use them instead of
the ms.
Cc: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
---
drivers/thermal/thermal_core.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 2c41d4a0923f..d96c515af3cb 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -289,16 +289,11 @@ static int __init thermal_register_governors(void)
* - Critical trip point will cause a system shutdown.
*/
static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
- int delay)
+ unsigned long delay)
{
- if (delay > 1000)
+ if (delay)
mod_delayed_work(system_freezable_power_efficient_wq,
- &tz->poll_queue,
- round_jiffies(msecs_to_jiffies(delay)));
- else if (delay)
- mod_delayed_work(system_freezable_power_efficient_wq,
- &tz->poll_queue,
- msecs_to_jiffies(delay));
+ &tz->poll_queue, delay);
else
cancel_delayed_work(&tz->poll_queue);
}
@@ -317,9 +312,9 @@ static void monitor_thermal_zone(struct thermal_zone_device *tz)
mutex_lock(&tz->lock);
if (!stop && tz->passive)
- thermal_zone_device_set_polling(tz, tz->passive_delay);
+ thermal_zone_device_set_polling(tz, tz->passive_delay_jiffies);
else if (!stop && tz->polling_delay)
- thermal_zone_device_set_polling(tz, tz->polling_delay);
+ thermal_zone_device_set_polling(tz, tz->polling_delay_jiffies);
else
thermal_zone_device_set_polling(tz, 0);
--
2.25.1
next prev parent reply other threads:[~2020-12-16 22:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 22:03 [PATCH v2 1/3] thermal/core: Precompute the delays from msecs to jiffies Daniel Lezcano
2020-12-16 22:03 ` Daniel Lezcano [this message]
2020-12-18 15:06 ` [PATCH v2 2/3] thermal/core: Use precomputed jiffies for the polling Thara Gopinath
2021-01-19 21:27 ` [thermal: thermal/next] " thermal-bot for Daniel Lezcano
2020-12-16 22:03 ` [PATCH v2 3/3] thermal/core: Remove ms based delay fields Daniel Lezcano
2020-12-16 22:35 ` Peter Kästle
2020-12-17 6:00 ` Daniel Lezcano
2020-12-17 0:02 ` kernel test robot
2020-12-17 0:02 ` kernel test robot
2020-12-17 0:24 ` kernel test robot
2020-12-17 0:24 ` kernel test robot
2020-12-17 18:32 ` Hans de Goede
2020-12-17 19:25 ` Daniel Lezcano
2020-12-18 10:16 ` Adam Thomson
2020-12-18 10:45 ` Daniel Lezcano
2021-01-19 21:27 ` [thermal: thermal/next] " thermal-bot for Daniel Lezcano
2020-12-18 15:05 ` [PATCH v2 1/3] thermal/core: Precompute the delays from msecs to jiffies Thara Gopinath
2021-01-19 21:27 ` [thermal: thermal/next] " thermal-bot for Daniel Lezcano
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=20201216220337.839878-2-daniel.lezcano@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=amitk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rui.zhang@intel.com \
--cc=thara.gopinath@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.