From patchwork Mon Dec 7 19:09:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 339177 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3066341jai; Mon, 7 Dec 2020 11:10:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGaZKq2WyUPVNy78Pk+2rOMTMNbIzCEYkz0WJCDh81I9QmMFp9yXKdySEAyjAUUibtzOc8 X-Received: by 2002:a17:906:3508:: with SMTP id r8mr9824479eja.137.1607368238923; Mon, 07 Dec 2020 11:10:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607368238; cv=none; d=google.com; s=arc-20160816; b=JhG4iMhQwd2rVGwPZAE+RLmnLWM0CAtIAFuInmE/l2TNK0cLQG73nfsu5809GL4jTv /w3TksH/LYZ2gIyiM8En1LnPCLogDND/pf6M4XUSSLY9XsgzKh0ySe2iDHNUqGitHKK+ pNVS2YxG0LB29D8K0bbXhs1wnkdR/bo4mSyxaj3++1V7hyUyjzDUoHs9eCkSCAxKzmZq 7XT+JB+vUaPbu91jWtSuJrFFSTkcxOehUybZh1Bt9mMIHwc0J7YhEo7Lf5DDi42Z+c17 WEEfKcIZlW6yLz1ff3s2VXOcebTJpPx4Vi+lmG6WthR58GARNqgYi5MndC64KbqzacN+ UCBw== 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=BhPEvjVqwexH1Hle2+ctCV7xDbrLGK3UanoHRddvROg=; b=IpoSNLjNliPkP/lBE8soAovnWU+dzJ5+vYQ+1D99Gjuv5dLDQBdMuvVstiIq+nc8Z+ 6shuOBfdwcZHdzuym31vmujt22A2NEaznh6r4ClodqaUuIf5y9BcKIuUuYzTfuLVK1NM ulSVul0BWjWIFQKmTZSTaAH7bgHnZyVlESz82J9ejCrt1XZAOqKw6JCIgxIxPcIaR69F TgzLY43mbvSRD/g8B/4TN7v74t19gpvrsVPnaiRsRgLevpoYqkR33D5t+M0D4beJgjns K2yCwg/qyNoIQSznjuPM8QApafZC0+wGClIXUwgXim02oJN0I0AvAPVCjH/Syai5DTLB tGzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WukHso3E; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 h14si6936020ejt.198.2020.12.07.11.10.38; Mon, 07 Dec 2020 11:10:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-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=WukHso3E; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S1726867AbgLGTKR (ORCPT + 8 others); Mon, 7 Dec 2020 14:10:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbgLGTKR (ORCPT ); Mon, 7 Dec 2020 14:10:17 -0500 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3213FC061285 for ; Mon, 7 Dec 2020 11:09:19 -0800 (PST) Received: by mail-wm1-x344.google.com with SMTP id a6so232443wmc.2 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=I8UDVzqv2hOb+f0DARtpgCNicow9N9yNE6lvDmrHfkIpG06htyfd3jGLrcYX+KxCcp yC2Wqi6/IYm63PIiNk1VVRzZ+GxmZCX61PUuZa9PrG/8cs/fRkdzl8Mzq13ajDrG3u6R 5ENcCzBBltoOne5c4/MzRKL3MKnhjYoIMiXe7dJb8m99g5/kSrad+bbUmZIWqzG/hxQM /jdTMIQ0jmE2ljI8wOIBs5UsUwn5k/mJwRhBCwqW/1qBRK3mO21whNOAV60xD+uZn55M KUgcMj7MPdkj9R7J3T1kg5lMNkQh9IZ1CNeHN9vVYKwx7r2qgnBF6kDTn4KRkQDOYGUs FlxA== X-Gm-Message-State: AOAM531TvdsLhn1u/4UsfgGnLw4heUHodqWiTGV4XmSeZrnqAxagH6lV ufyoq5QaQYqsISlTe/8greNmPw== 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-pm@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(-) -- 2.17.1 Reviewed-by: Lukasz Luba 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);