Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp813143pxu; Wed, 2 Dec 2020 04:13:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2aH8zlPILexoUmOYWfTTbY4FMmZexuvhe1VMpc5IcAEm3vri/oYf0Br1YNZ3Bi0jchk2V X-Received: by 2002:a05:6402:513:: with SMTP id m19mr2297661edv.244.1606911183766; Wed, 02 Dec 2020 04:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606911183; cv=none; d=google.com; s=arc-20160816; b=P7icfvEm/uvq31krHM6BSYkJBgAfSrVtnQ3JSPVkJjVBW+F43lGhhxtd/L5f2PD7Y1 xGCazOrrUlI4szWcRwUR8tNxPRkbHNNjRy/nZgiPlTu2tPixpJw1tprIoXsZbYdvy2XW ThIxHCUIRU/DYdG9ITl7czcdN355vZ2mHCTysqWSa479LuvH0tPU6PI0Zu0US9jDe15a 2IXEjJyFDt6O8aBGIjix0ltl3npBvtkxfV+RyCuaX7uC33fXREjGsAP2ngsFamlibaeo wfUAOL2gDTpe5XlQzVK2uwMv8StC0eNWYXZYjrVOrYKpxA19VWY1dTnm2mosHBCSwWoK c6OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=tJ0R6+v3eDzrBmGIX3GXY/fGfGw8OCjkiLlbM8B6B9o=; b=TJKgUGb+7qJ+Tp5HmvJZbzap+s3GJDlPvsgei6zapdK7yrfGGRj71f9ckk4KMosBZm BpbosEK4j/Y46kVacPT6FmaMelwQqYD4pBCB7QaYG9dxWFckA5UAkomn6QNqfJ1I8mdO /LfkGREBdcPzX20UmOEq2NVnA+PVVhC9wBeJXXnV/4JCqFLji8mw9YCL/pnGVFNFCkqj Sm8i8BfrJ09+2/OEOVOSBMbicKHkx445SSWO05n0vlQnedEYBuZK0VXrL1urGdI+vvss 7dPtfuupHx/XvTgMN3GAXRHdcqiVNmDf7wf9fIK6dqufXWKtcYGCE9zRGCLWwfhXRJWc 3ncg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vfptUf5I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb20si742162ejc.685.2020.12.02.04.12.40; Wed, 02 Dec 2020 04:13:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vfptUf5I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388266AbgLBMIt (ORCPT + 99 others); Wed, 2 Dec 2020 07:08:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727366AbgLBMIp (ORCPT ); Wed, 2 Dec 2020 07:08:45 -0500 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1ECCC061A47 for ; Wed, 2 Dec 2020 04:07:20 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id p8so3623175wrx.5 for ; Wed, 02 Dec 2020 04:07:20 -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=tJ0R6+v3eDzrBmGIX3GXY/fGfGw8OCjkiLlbM8B6B9o=; b=vfptUf5IkKYkxbzItlOYECG9qv59hYSXmZBoOJ1La3FcAa+KmxnKb0RRyMxspcne3P 6LtxeQPXbBqX+5s3Fm/YX/MGoyEeCjd+O7PJGRAsvgYrnM+gWB+PzZ5wN7kMEJ/Rhvod 2SEY/egivugsKPlbzLmhFPq4fp4a1TGbLJZt9E7WkOjVj82EWZcNLnV2FtYmVRX2vXK2 ybE+H/yE2+pyfnhoWld1fzl1B+JAgG3BnCgvnyj81iLuvanxO088MyTg8lfh3SGWgNdq Knca8rrlRIMNTBxmUUs9wwy9XCZ2Anwl+crFlPbZwhFqhc52uJY0QGR0ZeawyJnq2aaV AhUA== 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=tJ0R6+v3eDzrBmGIX3GXY/fGfGw8OCjkiLlbM8B6B9o=; b=C+ZCpA06VM/dsfh5M0EpCsXK3tfXn5OPgB508VxSaimi5T1eEXPNltVKZmA2gAAqd6 aXcG4KfXTan3A8igFLnP28Hz7cnibErGRiWaCKRvOI06MgGNeIy3I5gm85cJJcgsF5o/ O0bgwFaoodZTuW0+BMbMPNDndVkP4IclQKAoR91DM6c4vqSdV2GLDqHWTlxgNxUf55aL j0yvoZD4u7E9OcAGIdfqJQ3mi1kjmHYsaHAx6Ecs6J/OfjI8DOBeDji8cvJKskaMUmzP z/CNWgueFpVsfUrUpMSR+pG+4fqyJ7f7a91K59cefdJBM8GapeTXMdaS8ruNr52WLtxL sisg== X-Gm-Message-State: AOAM530nqbfKe215tlXn9P+qvvw9clxuWZIg05qgCBBY7qkfehLjxpx9 bsxsenwI8Mt9wTh4b3akRfx/OItm26dibQ== X-Received: by 2002:adf:e481:: with SMTP id i1mr2969550wrm.282.1606910839458; Wed, 02 Dec 2020 04:07:19 -0800 (PST) Received: from localhost.localdomain (lns-bzn-59-82-252-140-184.adsl.proxad.net. [82.252.140.184]) by smtp.gmail.com with ESMTPSA id c1sm1755132wml.8.2020.12.02.04.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 04:07:18 -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 3/4] thermal/core: Use precomputed jiffies for the polling Date: Wed, 2 Dec 2020 13:06:56 +0100 Message-Id: <20201202120657.1969-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201202120657.1969-1-daniel.lezcano@linaro.org> References: <20201202120657.1969-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 3111ca2c87a1..237480429ba9 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