From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BEFCC19437 for ; Mon, 7 Dec 2020 19:10:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6492823428 for ; Mon, 7 Dec 2020 19:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726765AbgLGTKG (ORCPT ); Mon, 7 Dec 2020 14:10:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbgLGTKF (ORCPT ); Mon, 7 Dec 2020 14:10:05 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 307D9C06138C for ; Mon, 7 Dec 2020 11:09:19 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id k10so226216wmi.3 for ; Mon, 07 Dec 2020 11:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BhPEvjVqwexH1Hle2+ctCV7xDbrLGK3UanoHRddvROg=; b=WukHso3EQRBNv8iqcv+rXMyFp5xa0jSexX3IuFw/1s62AkBakuROjwGPEUQgkpI2Dd P8cyn4AzlwV3MkKqiqtwpW92EhNR8SQiVfDV1bS2NTcK+SZu6l1oLWIkN4WeKZu3xwmA 6miHNlV2QMlyz1OP1r4YiEBsM7+DL9QW0ujTPYOb2evMteLVdt6+LTwyuZUr94P70UsZ fs4Va3s3va5PRXRLxyEhy/ciK0jstMh+nFRyzJ3iG2ZkUUzlqyFtGWRO5QP/s2uhSL4m myMfGJNWq2RN2LCrEaaW/BrSuQ4buOKC72HFSCx8MHSqdQE0RVL6kencjxXH37QF0JI7 nAzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BhPEvjVqwexH1Hle2+ctCV7xDbrLGK3UanoHRddvROg=; b=mbnx1qPVzVa31G//JidECoC68r4+vcNUdeM5q95SsQsnKdj/NBdJ2iIZ55OIfuHn2L SSMJZhg29BiPR1xgyUu72kzz3Sh+1TmINXAqn0Yxs3aGfVRqvwflVs5ob3MiFuKbzDNO x5cFHneB40KpBVQ2rTFoVQvTINiLSINxgkNWugR1DmJPm5bx/XjNiFjVLS4wYT0g0QKM eiuwR0/8fWOul5AckwWCRsdc21pVUisrrBsHXY6+wR4QEo5Kr/aR8arEeRffK9l0pb+T ZvG7F+ASqEu4snvDhBH9Qajd2H+GtKrIxg7wiGYOA6Nw+km426wrbwsQm/RtWNEK2izM myog== X-Gm-Message-State: AOAM530K1GKxdVHX13K1e8GhbFthvq8p5WtJm/KPiEwR8G766LqP59SP jZjFs4kHBvyRKFCzBIr4CRI8Uw== X-Google-Smtp-Source: ABdhPJyfxlGAPdqiFPDwEUccMpP0WTwaWEQ1Wo7185UsZAXNrYmF4pbmpTs18AQ1aoq6wF47gyFnLA== X-Received: by 2002:a1c:c2d4:: with SMTP id s203mr319881wmf.58.1607368157831; Mon, 07 Dec 2020 11:09:17 -0800 (PST) Received: from localhost.localdomain (lns-bzn-59-82-252-158-132.adsl.proxad.net. [82.252.158.132]) by smtp.gmail.com with ESMTPSA id v1sm16335827wrr.48.2020.12.07.11.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 11:09:17 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: amitk@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v2 3/4] thermal/core: Use precomputed jiffies for the polling Date: Mon, 7 Dec 2020 20:09:01 +0100 Message-Id: <20201207190902.30464-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201207190902.30464-1-daniel.lezcano@linaro.org> References: <20201207190902.30464-1-daniel.lezcano@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The delays are also stored in jiffies based unit. Use them instead of the ms. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 08c6e4e36896..16ef5d652d85 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -291,14 +291,9 @@ static int __init thermal_register_governors(void) static void thermal_zone_device_set_polling(struct thermal_zone_device *tz, int 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_ms); + thermal_zone_device_set_polling(tz, tz->passive_delay_jiffies); else if (!stop && tz->polling_delay_ms) - thermal_zone_device_set_polling(tz, tz->polling_delay_ms); + thermal_zone_device_set_polling(tz, tz->polling_delay_jiffies); else thermal_zone_device_set_polling(tz, 0); -- 2.17.1