Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754666AbcC0B1Q (ORCPT ); Sat, 26 Mar 2016 21:27:16 -0400 Received: from mail-lb0-f195.google.com ([209.85.217.195]:33799 "EHLO mail-lb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753924AbcC0B1N (ORCPT ); Sat, 26 Mar 2016 21:27:13 -0400 MIME-Version: 1.0 In-Reply-To: References: <7262976.zPkLj56ATU@vostro.rjw.lan> <25154681.B5BGJ94JlQ@vostro.rjw.lan> <56F5E1EB.1050702@linaro.org> Date: Sun, 27 Mar 2016 03:27:11 +0200 X-Google-Sender-Auth: cxHSHuSJtE_AzqjfusCwWpWSW7I Message-ID: Subject: Re: [PATCH v6 6/7][Resend] cpufreq: Support for fast frequency switching From: "Rafael J. Wysocki" To: "Rafael J. Wysocki" Cc: Steve Muckle , "Rafael J. Wysocki" , Linux PM list , Juri Lelli , ACPI Devel Maling List , Linux Kernel Mailing List , Peter Zijlstra , Srinivas Pandruvada , Viresh Kumar , Vincent Guittot , Michael Turquette , Ingo Molnar Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1568 Lines: 36 On Sat, Mar 26, 2016 at 2:46 AM, Rafael J. Wysocki wrote: > On Sat, Mar 26, 2016 at 2:12 AM, Steve Muckle wrote: >> Hi Rafael, >> >> On 03/21/2016 06:53 PM, Rafael J. Wysocki wrote: >>> Add two new policy flags, fast_switch_possible, to be set by the >>> cpufreq driver if fast frequency switching can be used for the >>> given policy and fast_switch_enabled, to be set by the governor >>> if it is going to use fast frequency switching for the given >>> policy. Also add a helper for setting the latter. >> ... >>> @@ -740,6 +777,9 @@ static int acpi_cpufreq_cpu_init(struct >>> goto err_unreg; >>> } >>> >>> + policy->fast_switch_possible = !acpi_pstate_strict && >>> + !(policy_is_shared(policy) && policy->shared_type != CPUFREQ_SHARED_TYPE_ANY); >> >> Could the policy->fast_switch_possible flag be avoided by just checking >> whether a driver has registered the .fast_switch callback? > > No, it couldn't. > > As in this case, the driver has the ->fast_switch callback, but it > can't be used for policies that don't satisfy the above condition. At > the same time it may be possible to use it for other policies on the > same system in principle. In fact, for fast switching to be useful, the driver has to guarantee that frequency can be updated on any of the policy CPUs (and it doesn't matter which of them updates the frequency) and that's what the fast_switch_possible flag is really for. I guess I should add a comment to that effect to its definition. Thanks, Rafael