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=-8.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 1EBB9C433E1 for ; Thu, 30 Jul 2020 03:41:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E162520FC3 for ; Thu, 30 Jul 2020 03:41:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZJ8AcR0w" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728492AbgG3Dlf (ORCPT ); Wed, 29 Jul 2020 23:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726342AbgG3Dle (ORCPT ); Wed, 29 Jul 2020 23:41:34 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D890C061794 for ; Wed, 29 Jul 2020 20:41:33 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id w19so66129plq.3 for ; Wed, 29 Jul 2020 20:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rwTsd3u9TKrgBcA6Qz/hEukqNQY4MFVBnr/oej/t/jY=; b=ZJ8AcR0wT+TC/a+JqYHcv0gv1nV8vfoW4iv/UpEC/ZTJBVuFOqoHHa7HwpIbs5FnDJ iy6pMxHeC4okSPnbrvgsvfpzMURTn6uadjCYqvKB19w8zvHGDTeGDoahVg9A/Yj+wfQ7 +WgLnaiHd7JLW282RzqxcOU1d/6C+2zSx8m0ci1wdlYkybL/M1jWOrLIg5ZOnZZ3dFAn Tgb5HsY5j3j1UkElntS5xp6e7u/f5ShEG7Vm8EBU4/pWU6NpFRwrdD1rnEOpNFcjKkNM HA025/k3T+9KoNQXWUgrMa1vXhxdIejoHXYckby2Ib81n2ase0Wh+zC0t9qqKUKzTIq9 UIfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rwTsd3u9TKrgBcA6Qz/hEukqNQY4MFVBnr/oej/t/jY=; b=jYjemdW6ZzU3EkreU5LXh29gVT2c7SBLzxvUTJwL9/hr7/mTgfMDXV84Q2LBQvs/MS bfNFViiCqjjMDYhstsujXEGCP5HAma17+VYfmAutK/bo6u0U0ChbjWYDCkksZaUAo5re 9XITuJ//WM8CrB1S5E9jq5CMM5YtcyYqjacT6w/rkFT1rtAHZZNfPdg8jucD5AMZTV9s DhOjYvzuuTQtzscAaQj+33q1FYYuQ9L/BmnaJVY/wyhYY7s+CjQl2EQJpgdlu85hnPtV 6LUKWuMHW20g6mFMtoUzWrahNqQ8ki4QSsO42EjW9yOZH7pEIXd+2RJRLJffpsxK5cvC +OrA== X-Gm-Message-State: AOAM530lEmHc0c6h2dhJhr3+tD7f/f6Ru1zMm5L4Gks051M+/J9y+ds8 x9MQbO6Be45Zv9bRaONaaVDp2Q== X-Google-Smtp-Source: ABdhPJxQQF0rlpXk1DGDtLCYG0sOy3hlhmmFVvQz0dYBui/t3MnyfKQhdZVqeLiAv8MS6n38S5pqgQ== X-Received: by 2002:a17:90b:3685:: with SMTP id mj5mr12980659pjb.123.1596080493101; Wed, 29 Jul 2020 20:41:33 -0700 (PDT) Received: from localhost ([106.201.14.19]) by smtp.gmail.com with ESMTPSA id y17sm4049374pfe.30.2020.07.29.20.41.31 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Jul 2020 20:41:32 -0700 (PDT) Date: Thu, 30 Jul 2020 09:11:28 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Ionela Voinescu , "Rafael J. Wysocki" , Dietmar Eggemann , Catalin Marinas , Sudeep Holla , Will Deacon , Russell King - ARM Linux , Ingo Molnar , Peter Zijlstra , Linux PM , Linux ARM , Linux Kernel Mailing List , Valentin Schneider Subject: Re: [PATCH v2 1/7] cpufreq: move invariance setter calls in cpufreq core Message-ID: <20200730034128.k4fmblfuwjcmqdze@vireshk-mac-ubuntu> References: <20200722093732.14297-1-ionela.voinescu@arm.com> <20200722093732.14297-2-ionela.voinescu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27-07-20, 15:48, Rafael J. Wysocki wrote: > On Wed, Jul 22, 2020 at 11:38 AM Ionela Voinescu > wrote: > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > > index 036f4cc42ede..bac4101546db 100644 > > --- a/drivers/cpufreq/cpufreq.c > > +++ b/drivers/cpufreq/cpufreq.c > > @@ -2058,9 +2058,16 @@ EXPORT_SYMBOL(cpufreq_unregister_notifier); > > unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy, > > unsigned int target_freq) > > { > > + unsigned int freq; > > + > > target_freq = clamp_val(target_freq, policy->min, policy->max); > > + freq = cpufreq_driver->fast_switch(policy, target_freq); > > + > > + if (freq) > > + arch_set_freq_scale(policy->related_cpus, freq, > > + policy->cpuinfo.max_freq); > > Why can't arch_set_freq_scale() handle freq == 0? Actually there is no need to. AFAIU the freq returned by fast_switch can never be 0 (yeah qcom driver does it right now and I am fixing it). And so we can drop this check altogether. -- viresh 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=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 ECEE0C433E0 for ; Thu, 30 Jul 2020 03:43:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B45B7206E6 for ; Thu, 30 Jul 2020 03:43:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hpy85KiM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZJ8AcR0w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B45B7206E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QLu7O0dEFUTIFckyhgYL+ABOTQqb6be1+jZp4s9zzx0=; b=hpy85KiM09f3FplvjFCkr38Qt ZGexfmyQlEVkoorbKUlRbxHTTQbaO7Jn3Xl7ssY+rWrZ/Dx+RKEg9eaaHN+5P16Xo/dXcLSR7gxSL le6sIU/F7Wju6lk99xnI5IlQizksEMxwNiK6rjugkCWdbzSVup7o4jUFYQ1AbqHVdbMuHWD3NZTsg 7u478Culg7NxiqR3GZQKs4veIevINgUd5C8tGxHtbgDTrkpphPl86LI3M3LZUlVXzX1IeXq0I4sLI KpoE7INj/NYNKPzKQkcBwE+QWwxB0SKg71W9zY4CwZErI4wdq9LrRoE+eMyXEG/7iWveIPh7nNjI+ TXioNWR+A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0zRt-0006Zb-2W; Thu, 30 Jul 2020 03:41:41 +0000 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0zRp-0006Yc-4A for linux-arm-kernel@lists.infradead.org; Thu, 30 Jul 2020 03:41:38 +0000 Received: by mail-pj1-x1043.google.com with SMTP id il6so3461309pjb.0 for ; Wed, 29 Jul 2020 20:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rwTsd3u9TKrgBcA6Qz/hEukqNQY4MFVBnr/oej/t/jY=; b=ZJ8AcR0wT+TC/a+JqYHcv0gv1nV8vfoW4iv/UpEC/ZTJBVuFOqoHHa7HwpIbs5FnDJ iy6pMxHeC4okSPnbrvgsvfpzMURTn6uadjCYqvKB19w8zvHGDTeGDoahVg9A/Yj+wfQ7 +WgLnaiHd7JLW282RzqxcOU1d/6C+2zSx8m0ci1wdlYkybL/M1jWOrLIg5ZOnZZ3dFAn Tgb5HsY5j3j1UkElntS5xp6e7u/f5ShEG7Vm8EBU4/pWU6NpFRwrdD1rnEOpNFcjKkNM HA025/k3T+9KoNQXWUgrMa1vXhxdIejoHXYckby2Ib81n2ase0Wh+zC0t9qqKUKzTIq9 UIfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rwTsd3u9TKrgBcA6Qz/hEukqNQY4MFVBnr/oej/t/jY=; b=YwEertKgWND5llNLtCXj1M2ZzunsloPrWWwizJ3oFzunTDLP3HcM2E586NTAILnHjL FSyt80PvnJo2Szgct5ZwB8xT8VcPIlzAiP/HTBrSLxwibsOtlJmYsVRxIoXnZVfS2jH9 gtZ+2nwmvWZTQVM5sodOyOdWIaK3SIljBH+2t1M22OpaWazqJx9tV01eDOA0qHSCsbXb Kq5jeY0OClQdmEPc/5U8DwHKdVEilZXw6xBCKNzC2g0DvMwSD8qLLVjsOS9J4Urj+H+H LhXQDXPgYs0cREjxpr2FtKBnSj3s8ZB5GRyzUXxGtNLnMLc1ZDuQ/gvN/YKCRbYMb0W5 U4/Q== X-Gm-Message-State: AOAM530WoZJsNJxsoKyT5Vai/GIg/Mszjhf9Gf+Nsq69LlgMwwjFc05Z KLoMId/jJr3hw1cvuTkoZTPanQ== X-Google-Smtp-Source: ABdhPJxQQF0rlpXk1DGDtLCYG0sOy3hlhmmFVvQz0dYBui/t3MnyfKQhdZVqeLiAv8MS6n38S5pqgQ== X-Received: by 2002:a17:90b:3685:: with SMTP id mj5mr12980659pjb.123.1596080493101; Wed, 29 Jul 2020 20:41:33 -0700 (PDT) Received: from localhost ([106.201.14.19]) by smtp.gmail.com with ESMTPSA id y17sm4049374pfe.30.2020.07.29.20.41.31 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Jul 2020 20:41:32 -0700 (PDT) Date: Thu, 30 Jul 2020 09:11:28 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Subject: Re: [PATCH v2 1/7] cpufreq: move invariance setter calls in cpufreq core Message-ID: <20200730034128.k4fmblfuwjcmqdze@vireshk-mac-ubuntu> References: <20200722093732.14297-1-ionela.voinescu@arm.com> <20200722093732.14297-2-ionela.voinescu@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200729_234137_186272_61CFCD22 X-CRM114-Status: GOOD ( 17.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Linux PM , Peter Zijlstra , Will Deacon , Valentin Schneider , "Rafael J. Wysocki" , Russell King - ARM Linux , Linux Kernel Mailing List , Ingo Molnar , Sudeep Holla , Ionela Voinescu , Dietmar Eggemann , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 27-07-20, 15:48, Rafael J. Wysocki wrote: > On Wed, Jul 22, 2020 at 11:38 AM Ionela Voinescu > wrote: > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > > index 036f4cc42ede..bac4101546db 100644 > > --- a/drivers/cpufreq/cpufreq.c > > +++ b/drivers/cpufreq/cpufreq.c > > @@ -2058,9 +2058,16 @@ EXPORT_SYMBOL(cpufreq_unregister_notifier); > > unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy, > > unsigned int target_freq) > > { > > + unsigned int freq; > > + > > target_freq = clamp_val(target_freq, policy->min, policy->max); > > + freq = cpufreq_driver->fast_switch(policy, target_freq); > > + > > + if (freq) > > + arch_set_freq_scale(policy->related_cpus, freq, > > + policy->cpuinfo.max_freq); > > Why can't arch_set_freq_scale() handle freq == 0? Actually there is no need to. AFAIU the freq returned by fast_switch can never be 0 (yeah qcom driver does it right now and I am fixing it). And so we can drop this check altogether. -- viresh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel