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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 4ACF4C433DF for ; Wed, 20 May 2020 10:37:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13C67207C4 for ; Wed, 20 May 2020 10:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589971033; bh=Oo3xlhQdYRP4Yd1SWyPtq0/KwRwIIgwp5fuGu65Qmns=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=i+vhtwC1902FZ3c1d6HNStuVwY43cPVQDyZqFVQTBMMeko12ZOGUG6/rIs/dBbkTi IfQrvE3Z6DH2IoKzkVeDJ4NzKYBmkWUhJhD3lKg/UXNxFTUOEHaHQwJmuBq6wXmQzw 5v64ZbymObdeM4k63qrB4vXPkw9HpIhcVW5cTgPI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726789AbgETKhM (ORCPT ); Wed, 20 May 2020 06:37:12 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:42242 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbgETKhM (ORCPT ); Wed, 20 May 2020 06:37:12 -0400 Received: by mail-ot1-f66.google.com with SMTP id z3so2032660otp.9; Wed, 20 May 2020 03:37:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ASonDY+95FDMvdOqz32QoR73PCQHkHwqQypKyt3/bUg=; b=BpBpi6fSGZvuvozYgvzG0Gz82yTPNiwHcT1UOAn++ZM0RRk9PZuWUogHvY44ClAT0c oLbfXYuG08miJlCgmtVQJljjR/xnqlyxpJDsOQ0URB3pIHrWkDwRdb7KV8EkZB7IBmig OKmsKavI9QGFK89MtSjTJTXx3vPrCXf1yzx1TXE83hSS7msyQHYfWEX+tsPU6gOGOfhz zVi24MjSW1cMI4TyRCDakLo5XgYsbINzIOGI208upXdRltkagpkOEH0JZfwYTAje478t GPM6NxnAh7AA9TTIxAt+YWXZ53tVP6oOtfu4QXIzQ1tMgf35V9enlKoHGf/MMd586plp nmZg== X-Gm-Message-State: AOAM532mLx7dckhQB9qtn0zgmfoH0txqLngUdzKhyjd0Jo697NBQ3g1V MmVirUUHjoClw9hP3k2WQxfKUVDWtKmZ+7MLO+j8FQ== X-Google-Smtp-Source: ABdhPJxXsufqRfsn8f7DdgrN2DBEOfH/qeFjz5PQh3uG73UqCy4IWc4dkzco8x6WEZbwndUpu/3ez3HRP6WO3LqRzkw= X-Received: by 2002:a9d:3d05:: with SMTP id a5mr2701651otc.262.1589971031340; Wed, 20 May 2020 03:37:11 -0700 (PDT) MIME-Version: 1.0 References: <1589888489-13828-1-git-send-email-wangxiongfeng2@huawei.com> <1589888489-13828-2-git-send-email-wangxiongfeng2@huawei.com> <20200520045911.amww3nm3e7cezcbf@vireshk-i7> In-Reply-To: <20200520045911.amww3nm3e7cezcbf@vireshk-i7> From: "Rafael J. Wysocki" Date: Wed, 20 May 2020 12:36:59 +0200 Message-ID: Subject: Re: [RFC PATCH v3 1/2] cpufreq: change '.set_boost' to act on only one policy To: Viresh Kumar Cc: Xiongfeng Wang , "Rafael J. Wysocki" , Souvik Chakravarty , Thanu.Rangarajan@arm.com, Sudeep Holla , Hanjun Guo , John Garry , Jonathan Cameron , Linux PM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Wed, May 20, 2020 at 6:59 AM Viresh Kumar wrote: > > On 19-05-20, 19:41, Xiongfeng Wang wrote: > > Macro 'for_each_active_policy()' is defined internally. To avoid some > > cpufreq driver needing this macro to iterate over all the policies in > > '.set_boost' callback, we redefine '.set_boost' to act on only one > > policy and pass the policy as an argument. > > 'cpufreq_boost_trigger_state()' iterate over all the policies to set > > boost for the system. This is preparation for adding SW BOOST support > > for CPPC. > > > > Signed-off-by: Xiongfeng Wang > > --- > > drivers/cpufreq/acpi-cpufreq.c | 4 ++-- > > drivers/cpufreq/cpufreq.c | 53 +++++++++++++++++++++--------------------- > > include/linux/cpufreq.h | 2 +- > > 3 files changed, 30 insertions(+), 29 deletions(-) > > > > diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c > > index 289e8ce..b0a9eb5 100644 > > --- a/drivers/cpufreq/acpi-cpufreq.c > > +++ b/drivers/cpufreq/acpi-cpufreq.c > > @@ -126,7 +126,7 @@ static void boost_set_msr_each(void *p_en) > > boost_set_msr(enable); > > } > > > > -static int set_boost(int val) > > +static int set_boost(struct cpufreq_policy *policy, int val) > > { > > get_online_cpus(); > > on_each_cpu(boost_set_msr_each, (void *)(long)val, 1); > > I think (Rafael can confirm), that you need to update this as well. You don't > need to run for each cpu now, but for each CPU in the policy. Right, the caller will iterate over policies. Accordingly, the CPU hotplug locking needs to go to the caller too.