Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1622542ybg; Wed, 29 Jul 2020 20:42:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3Y7A2OB1kp003Mfa1REh70kpnaISwqAX9dvk3jpfxTBjLAAmFEu+90980H1W8JwXsRLfv X-Received: by 2002:a50:fc97:: with SMTP id f23mr770257edq.255.1596080550273; Wed, 29 Jul 2020 20:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596080550; cv=none; d=google.com; s=arc-20160816; b=eOTsaAsCcvQGtV+VKLOjbl0x9esJOLL4S5EvyPYHbur779tzs/iFhe7QA23Dl9mgg1 I3SniTJnSzuBuoZdApguV7Bz04TWmEsycLa12donwwx4neOYOJalIImDVsS/SlvWzfZH q+EhskSZx6Kl79+PizHRZzvi1OSR0DsTlIzyJUKJCHfCB0j0U3yxZ0vim//s9pMWEzVH 5Y8nA7VvP2MVoYBQUjJmfzrysZwsSjizb7dYSjipngyjdAzZqxoFpqAXJXpKOd0/NBSk RRuOJ74y6+YoXIvL0DKLinORkEKpUXxt4DoYBJ+1gxL1UtdX4VnqIVUgTHBWh4/UBl4C AJcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rwTsd3u9TKrgBcA6Qz/hEukqNQY4MFVBnr/oej/t/jY=; b=DbV0TBoTTEdblk+XrsqUsjea6rGYpqCiK8PKYLezvza7YLn//Z/NAwAEHbrxejeA9c WeYLHVXU6kH8ZFyUjByjQJiTpq4vwD/Efvz0Z2jeFoY+jkPf8rUN/ozbqyR97KPuvJQS JeuEitMGWaLhSM51pMZOeYytgLCtQeGnO86n282tTrHP7OJCyvDOrbCylDOBqc5Jwzb0 2pxx2cOnQ3Q7P7u/L9i7bAymiw9MmWSfH67vhmIJntZhanGRXyiffUJ3+kjkS1Os1/vc hbqWslJnwjF/ivwr4dSc2UIcYG/E7aLJcT0zGQR0+GKgKPHyzq+ifpFO3CyoXS2+XJ1t VDkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZJ8AcR0w; 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 m23si2427081eji.400.2020.07.29.20.42.07; Wed, 29 Jul 2020 20:42:30 -0700 (PDT) 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=ZJ8AcR0w; 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 S1728195AbgG3Dlf (ORCPT + 99 others); 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-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