Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2170599pxu; Fri, 18 Dec 2020 07:08:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTCiCHGamkQTqd2amfQTCx61ySh3Pvy3G4RBlBMYZhd/MoodPz40ZFTdqoaBSeoEF85s6f X-Received: by 2002:a17:906:ae41:: with SMTP id lf1mr4454226ejb.369.1608304117914; Fri, 18 Dec 2020 07:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608304117; cv=none; d=google.com; s=arc-20160816; b=UBJSzplBPzfWkwhbrVwnNq8EBsu9RtjwcTOoav7kQPGmYiPdl+1IZYklTtWkXN/BNj DhH3JN66udqjuMY+V/MAhc4ikhDSioZwPJiFNO7VORenBOgl/wdLCYivLo4tMDCtmjIM cTOV6yPVNBmA+3K7VZA5yPjJ98fFReWFtYZcd2Ocq08zB1DLM0buKLvqcX4GfUiuL3+w Jojtu6211hTort64W9oHnkitkeyu6xk+Nlj/NHxChW++Aq6f2SrnWtoemhaFfk9cB1hu x809JXZGhq54tOxlUQRVYHm/L/hs9nuJm+oSZgSLGJP3c2xho/PYB83hKcGYYOJdN0sy zmlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2CcsUdMD1whnXsjk2gFq/XTzje6TrL9HXX+Dsx/aRsw=; b=m5MoIloSmhM7gm4KP2EOLMENyNT9Wd9L9iGbVnY8/PbgeoK7bLzsrDm0aDC0wXcKkG QiCSOYMu70xy7FQmgThW5EeTblVbc82M+6y5I5ozmzpACX/pGfqBXVyAMW1E531GIXnO w/IKwFEaBuRSGbP1obb8zdDWLPMFKO4/I8Wik94CLlWkCMht18pdmyzbXDnTXp/EdZuf 0107Xx7UW1W/7eaa6XHq4vnUj0rgJeucovGv1xboRXGbv3mItQyPwRnEHO0bGFshChHX d4hh7XkyYYrlp2KE9bwTtPpcyvo0+x3jjra6+TVq5GVqQsKenxRB/5OV+OHcsEQYZnWL qZaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cNicNfds; 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 q10si6334091eds.293.2020.12.18.07.08.14; Fri, 18 Dec 2020 07:08:37 -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=cNicNfds; 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 S1727741AbgLRPHC (ORCPT + 99 others); Fri, 18 Dec 2020 10:07:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728067AbgLRPHC (ORCPT ); Fri, 18 Dec 2020 10:07:02 -0500 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0616BC061282 for ; Fri, 18 Dec 2020 07:06:22 -0800 (PST) Received: by mail-qt1-x82a.google.com with SMTP id 7so1471761qtp.1 for ; Fri, 18 Dec 2020 07:06:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2CcsUdMD1whnXsjk2gFq/XTzje6TrL9HXX+Dsx/aRsw=; b=cNicNfds/t27C2UfSITX5nGY21ceNUiFsWvRAaN8vtIER/ZYd22saTqqkr8TI87Cdr EU1gx64LRI+c7p7XwX7HJzmUMyQoYQbKX+ea2ssKhSzLkJ39zeb43MaJpPcdFob9/jw8 wdEizFFEbpalBDjYY2Drx337F8elliULrgjMP0uYhsyZQAALPGH9bcxAaAJBfoY1JOpY 37a6FoBhXGm0CeYsm6tRHedNx3OB1InPXnQN3mIlmfa1x+SsGq2srVNcTvayqqZ/R9jK GelgicSA4gopWGgEoxXYBQx65fZ4EXO1XI7ksAZaLc+JQWIbnt9N2M8imKWdFly0G4pr LZ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2CcsUdMD1whnXsjk2gFq/XTzje6TrL9HXX+Dsx/aRsw=; b=eV4EvtIgMNmHq31sT7PjkKEtSde/zkO/owVRBNvuKDR/94lb9klZqRacj0V1Z18f2i DNvQjDk/QKjdltlfNbYbDBgInf6iVw8yMXRUs/wY8t0DfdhSY7FDPV1yt9UD2h+fOaUN 68wipOhzMDvhpL8LslT8pr0nMOHJwL/f1jNcH51o99dRdvOyWAOJH46+IOh66Xpbo77c RGe70aJVQy/QhTHuu92QGKOaNEMQ/cTylXPazhwFpEtyHyu2ONo5pWK0qqecgQkju6VD Kjv1WOhUwxYcmET/Yukacixz2ZG4+/E9h1xYp8d1bTekW0ied+xUQ8H4e1rujmZ+wT6w 2B0g== X-Gm-Message-State: AOAM532qKTVJxCW0CgjNjtxVLNCGxhQ2bu/dsTOTLCkEGWDc4EDGBx7r LM6KBk1JTa19MhCFbi8OgUtquA== X-Received: by 2002:ac8:4e87:: with SMTP id 7mr4374637qtp.310.1608303981233; Fri, 18 Dec 2020 07:06:21 -0800 (PST) Received: from [192.168.1.93] (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.gmail.com with ESMTPSA id n188sm5995681qke.17.2020.12.18.07.06.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Dec 2020 07:06:20 -0800 (PST) Subject: Re: [PATCH v2 2/3] thermal/core: Use precomputed jiffies for the polling To: Daniel Lezcano , rui.zhang@intel.com Cc: amitk@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Lukasz Luba References: <20201216220337.839878-1-daniel.lezcano@linaro.org> <20201216220337.839878-2-daniel.lezcano@linaro.org> From: Thara Gopinath Message-ID: Date: Fri, 18 Dec 2020 10:06:19 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201216220337.839878-2-daniel.lezcano@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/16/20 5:03 PM, Daniel Lezcano wrote: > 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(-) 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); > > -- Warm Regards Thara