Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp443846ybk; Wed, 20 May 2020 03:41:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH5TYlwVuvdYAwG45YksC9Vj8JHxiwUgU+13W1JTqyz6UPR6zEYnjIn7gUb/x5QDar10VI X-Received: by 2002:aa7:d691:: with SMTP id d17mr2833295edr.273.1589971297197; Wed, 20 May 2020 03:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589971297; cv=none; d=google.com; s=arc-20160816; b=Ms1P6TLrVGsgXp6n4OJzjWYjfEWgznkr/pHW9155dvDjqHAUKwf6SEz5lz34BRI0kr AxylweatWUhQHMl/i9urRDO+aiN1EjEV7rxrfazJnWmi6UewwvhI8wQpIsYMR13WSUpc zWUZIxGqFR/A3rvsjJapgrznGYst5gQjfOrHSUBC3Z/wf0gOlJ2NmyoQ8Sj9PWd0ulHy qyNnEqNqRt8mopGjl//UbVR34KXjO9WbxUcd+65xOQNTpMPJ0Fe9hu1kf7qmM2KHAZod R7hPgQFHwaQOLmCoycdmY/akSA9VzQzb09L1dJAjnHg34aHiqGDGdYgPDpGaUxhTZRF7 XQXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=ASonDY+95FDMvdOqz32QoR73PCQHkHwqQypKyt3/bUg=; b=OaG6r8ZJykDWTwar7CR9FxeZyTYZPsvdnQKNgsTWheowdh72HmGhvAQOIHwP4XTFAe 3NpFCcqm39j610+BBlb/k/CH5ShIAwPNN6YSs4R6XpgWs+zpxJa8ud8m54sAuDbLmvU+ AoQqANf7orglMGGR2L6O+j4EqflKY/DV+TvAbzD/KQw/WycY0VKGo50QeL/ACT50YFGA wrDmHMNWdxSCFPBzJ2fToC5uiNtA714DL2BvfqVn3PRoRF4yu2ht5jIjipNCOTwLHibn lG1zIdPu2UwBU8Ax+PHLcy0Hl/10oM9wGcnzkOR9OB8gt4i7mJEWD2tqf9EwaobQEBMN HlCA== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o5si1505889edz.312.2020.05.20.03.41.14; Wed, 20 May 2020 03:41:37 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbgETKhM (ORCPT + 99 others); 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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.