From patchwork Wed Dec 16 22:03:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 344525 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp642454jai; Wed, 16 Dec 2020 14:05:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpJD1AFM0BBKn0QAdN9ADBDFtUsjd1+ujEBGnqqIUa/U/JbNEMCvVJK2QU3wL3nXrqk3De X-Received: by 2002:a50:fe8d:: with SMTP id d13mr34320377edt.132.1608156354884; Wed, 16 Dec 2020 14:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608156354; cv=none; d=google.com; s=arc-20160816; b=NQ5SHD/vw4EZdjlKGPXvxLGqn4sQ1tZAWeCqj45JPwgHFoS5oz/dWXKaXmNvYUTvzH FU7QOaTsGHrfJgjtoZcJmRSPjUeMCl57gvtaIjZT2kloqeHSsFUfZynopJKgcy628TXo ipPsYLx1hpkWt4S34+S8T1L2WRt3WTMGcxZZYCgJkNWIks1ilpZzEzi1/Oysvznzfz9L COf0w2FD4wA/PSHdEtozQvh13mWVFh/Bwiolzy5y5fePErgWVKIhX1UUqcJApl4gWOi5 BUlFq3+MpaewlKYFlaYit2mPHu6ENdQc7DImzDUs8pJMGQ1r00hAzzbjWDO1ToDghJTA 7E1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jgs8r4lXT96VdPjv2ZhhWufDRA2IuacaLllCLFcigSg=; b=EuajJfOFD5ugFc3jFN6Kk/9DuB+pHDJSRIRe7tRAu7HZ5DQaO7Gdc2jHckbFV8qQAE YjCTqUSQQZ7ppS1iH2CLSaXAKoMdLmaAbbvbWgwKIwGMBRJ1FoVQu0noZ6Coh7puXygo ouLb4TtVTR1ui9+aS0TDdYuuY+PiOBoocg8/9DPNCkitKpy6hGSIr9HuuGCihL0j+8sU As1DSIhy9BT31/T3bz7LHzHUsgYkzl90hoBqgPBc5xTEztThF8rU+TobvCa1EQ9UG9En amwxre+rBY0SudYYnEVtxRtXKpS1DLYvQU85NhGiefuyioY9Z2qhjgRyY0DIg2v7RwFk 5OMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oz2cHKMu; 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 k15si1574944ejp.554.2020.12.16.14.05.54; Wed, 16 Dec 2020 14:05:54 -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=oz2cHKMu; 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 S1730038AbgLPWEi (ORCPT + 8 others); Wed, 16 Dec 2020 17:04:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730041AbgLPWEi (ORCPT ); Wed, 16 Dec 2020 17:04:38 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86FE8C0617A6 for ; Wed, 16 Dec 2020 14:03:57 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id w5so20887185wrm.11 for ; Wed, 16 Dec 2020 14:03:57 -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 :mime-version:content-transfer-encoding; bh=jgs8r4lXT96VdPjv2ZhhWufDRA2IuacaLllCLFcigSg=; b=oz2cHKMuCn8EHihsUlyEe0vEqvX9ES021uVO0KXuO0CB9kq/cdxWmcIBPqTm8Bva6F s24w5WaAXXv2mNckrnstFZtffAV9hHgH1oMyAxW4GBDP0rfwWNycxN3l8TZBHMpRsN9d RO04oRMI0dfot6v0wNYbjSwsvRO7NSicVNMj/r9CevwHbgNR8KRsEhvZeqAyHUTe5Lqp Xt4RqVMtllwOgLYuAJQTVCVfxFqruXrcWeer5iLNOtQ0O2KSUYFeqmB2OItffGRhFLVV OUckMgaQJhJx6z0fny2OdlzoyiovpRB869e0whI1Nt6xugslbiE+y+V+7GeRXHCTxJ/l kfgw== 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:mime-version:content-transfer-encoding; bh=jgs8r4lXT96VdPjv2ZhhWufDRA2IuacaLllCLFcigSg=; b=sz5N/aIJ7KMX0BAe04+07qmJsPLoh/vcn6+chy4eQVzLjjQEENR40rkIXv+xBAHNtR wkT7AXLshB9YwQySdrO0SGXaND68N41ZkCCJvmrS0k0pJOHXsGJYKtfzwsg23y7XY2ub TQ3dGlt48tkIyMr5OGp6NlrBMgcIUXhkdFqIFh2RKTQ7VOK12M70McwL6ahyYuez2iDN zbpYZOnpKKVWIj4mEtno8rcyNQDpJ0QPmOetFp5Oit0SpboJyV5tDklKVw5e5/22dcuq PhUqSOHSGWrn8DIRriFSRyAa2EnVLeg8vepIDwSL38YohWI/m00V/fkBI7HiHVCAfwzT rAzQ== X-Gm-Message-State: AOAM5334+z0HeROE+0mXYbCgE581GR0syg1gpHaYLM0W3o8EelFhFoe+ eNXAfllqU60ceNx6PPKPIc6ntA== X-Received: by 2002:adf:ab4b:: with SMTP id r11mr23937497wrc.282.1608156236012; Wed, 16 Dec 2020 14:03:56 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:601a:58a2:ee98:f8a1]) by smtp.gmail.com with ESMTPSA id a17sm5277933wrs.20.2020.12.16.14.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 14:03:55 -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, Thara Gopinath , Lukasz Luba Subject: [PATCH v2 2/3] thermal/core: Use precomputed jiffies for the polling Date: Wed, 16 Dec 2020 23:03:36 +0100 Message-Id: <20201216220337.839878-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201216220337.839878-1-daniel.lezcano@linaro.org> References: <20201216220337.839878-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 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. Cc: Thara Gopinath Signed-off-by: Daniel Lezcano Reviewed-by: Lukasz Luba --- drivers/thermal/thermal_core.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) -- 2.25.1 Reviewed-by: Thara Gopinath 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);