Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp485370pxv; Wed, 30 Jun 2021 10:01:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzI2TpFY+rBe5gVpJ5GAEVncphedGRn6ASwIBQkm0WxrN0pMLUjMK03olMwPXvG6oE5zhzv X-Received: by 2002:a02:620a:: with SMTP id d10mr9924576jac.22.1625072511043; Wed, 30 Jun 2021 10:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625072511; cv=none; d=google.com; s=arc-20160816; b=gKEjbURYwuAB9VtMn1a+oznqKCul17eGH8d4vPljUccwpdjPDt0iLoqEZh83lW9IgN az42GPCqafkZJiGquPsKH0JVlizl/F7ahLR1sa+1gZXcRFTiVd7ppKEb5tUV0EZRlbgB pPiMt6zgNqLXw7yktrD0JZpHak/9gO/UenI8VRiQP3Sfu+YVhgiMw51ScILNo35880ca ZLTYfhIM/jhmUV0m2gnssBxrC3QX5+/7vQyW6vBY0ApU7v2nXYfy9+4NlKaN5vG/Qu5i bGY0ymYHrv4072URU7k/DYo48PWwL+oUEUb9gASeb3AKvfz2TTIwEuF64DmJ6yQgyNIA n0vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=8E3SiP4jfFVx6xLQQNrRfMsJfLJy/U2zQlBC/YkWL00=; b=QrNSpNTc6T25SfZ5wtOxeM2k4EmGiKbNgZoxlyb4FZibnec8qYRrprsKt30rVgaYgc hWJjlmwmkeUl+tLY0+4OfnTYKLHudK+7Aoo4BRzGiw4bL3uiucohkp9WlRhIbfNrScD7 mifh6njpu80GbxICJKWe6MHMNisSB7aPll+/NdP7xZl1C+T/UvLSgvU+uou0GHQXOOCh RgFhDwBEQIZc1HwrlZiOaYL4g5SuNsM9NQ5pB+qXHCUFn4LHx1JrxW5gAfGJmNGCx2el kQsyMBjnZBXQ3cviv5UYg/MyVSz0rm4UE291YoO0ULzchKYE/iYCSdSek8+mSlHYoX9V 6OKA== 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 d6si8547057ilr.154.2021.06.30.10.01.33; Wed, 30 Jun 2021 10:01:51 -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 S229852AbhF3RBV (ORCPT + 99 others); Wed, 30 Jun 2021 13:01:21 -0400 Received: from mail-oo1-f41.google.com ([209.85.161.41]:43715 "EHLO mail-oo1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbhF3RBU (ORCPT ); Wed, 30 Jun 2021 13:01:20 -0400 Received: by mail-oo1-f41.google.com with SMTP id b17-20020a4aba110000b029024c219a3d83so793712oop.10; Wed, 30 Jun 2021 09:58:50 -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=8E3SiP4jfFVx6xLQQNrRfMsJfLJy/U2zQlBC/YkWL00=; b=klTSpxYRpFIvQXGWrwwqw9M0gMiM24nSn8MDq5fjfjG8PDTYfOxBHsWVN/HxbA2Yah OuCk14z2oSUrv8HvJ00z3DyivzENx9u233y1aHRY8E/FCbWkhUGKsJXqzW53I3oF70c/ 3omxQIoCLExc17AY9SFintIPs0J+FjI8oBfPetNaBxI3nfQAJIoxBKWMCvD+yj1ZNBhH lstNhP/13Y8R4bilV/zNKamh3h9HvcdWjtj9Xx9hQpV3uslCn7LIqdc2G1OiqY5DGyTe zlbbTSmi9vNJ+K59hoXilCWA54tLDtZBaciqFDBdjB5BCHO8yDknoK3Hd3aZnufNDA5M V53A== X-Gm-Message-State: AOAM5310P0da4B/qiHHT9T3cO1VEzngHRQQCm20SX9AgUthJLtJHOFv6 OOZtvLMe1dDsgqXSqtlJQTLmMeAXdTwZMKht1OM= X-Received: by 2002:a4a:5285:: with SMTP id d127mr9064967oob.2.1625072330298; Wed, 30 Jun 2021 09:58:50 -0700 (PDT) MIME-Version: 1.0 References: <6144911f36d3d1f5faddf81d744bd39946843f6b.1624421816.git.viresh.kumar@linaro.org> <5741915.lOV4Wx5bFT@kreacher> <20210624015138.nzrrgiqyk3hblknv@vireshk-i7> In-Reply-To: <20210624015138.nzrrgiqyk3hblknv@vireshk-i7> From: "Rafael J. Wysocki" Date: Wed, 30 Jun 2021 18:58:39 +0200 Message-ID: Subject: Re: [PATCH V4 2/4] cpufreq: intel_pstate: Migrate to ->offline() instead of ->stop_cpu() To: Viresh Kumar Cc: "Rafael J. Wysocki" , Srinivas Pandruvada , Len Brown , Linux PM , Vincent Guittot , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 24, 2021 at 3:52 AM Viresh Kumar wrote: > > On 23-06-21, 17:13, Rafael J. Wysocki wrote: > > As mentioned already in > > > > https://lore.kernel.org/linux-pm/CAJZ5v0g2tCZptcqh+c55YYiO7rDHmZivMLsmpq_7005zNPN1xg@mail.gmail.com/ > > Sorry about failing to reply over that, I got confused somehow.. > > > this isn't particularly clean, because intel_pstate_cpu_offline() is > > also used in the passive mode where the above call is not needed. > > intel_pstate_clear_update_util_hook() returns early if the hook was never > registered, and so calling it was safe, but yes not very clean. > > > From: Rafael J. Wysocki > > Subject: [PATCH] cpufreq: intel_pstate: Combine ->stop_cpu() and ->offline() > > > > Combine the ->stop_cpu() and ->offline() callback routines for the > > active mode of intel_pstate so as to avoid setting the ->stop_cpu > > callback pointer which is going to be dropped from the framework. > > > > Signed-off-by: Rafael J. Wysocki > > --- > > drivers/cpufreq/intel_pstate.c | 7 ++++--- > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > Index: linux-pm/drivers/cpufreq/intel_pstate.c > > =================================================================== > > --- linux-pm.orig/drivers/cpufreq/intel_pstate.c > > +++ linux-pm/drivers/cpufreq/intel_pstate.c > > @@ -2577,11 +2577,13 @@ static int intel_pstate_cpu_online(struc > > return 0; > > } > > > > -static void intel_pstate_stop_cpu(struct cpufreq_policy *policy) > > +static int intel_pstate_stop_cpu(struct cpufreq_policy *policy) > > { > > pr_debug("CPU %d stopping\n", policy->cpu); > > > > intel_pstate_clear_update_util_hook(policy->cpu); > > + > > + return intel_pstate_cpu_offline(policy); > > } > > > > static int intel_pstate_cpu_exit(struct cpufreq_policy *policy) > > @@ -2654,8 +2656,7 @@ static struct cpufreq_driver intel_pstat > > .resume = intel_pstate_resume, > > .init = intel_pstate_cpu_init, > > .exit = intel_pstate_cpu_exit, > > - .stop_cpu = intel_pstate_stop_cpu, > > - .offline = intel_pstate_cpu_offline, > > + .offline = intel_pstate_stop_cpu, > > I would suggest to rename intel_pstate_cpu_offline() as > intel_cpufreq_cpu_offline() and intel_pstate_stop_cpu() as > intel_pstate_cpu_offline(), so we remove the stop-cpu terminology completely. I have followed the above suggestion and applied the modified patch along with the rest of this series. > Either way: > Acked-by: Viresh Kumar Thanks! > > .online = intel_pstate_cpu_online, > > .update_limits = intel_pstate_update_limits, > > .name = "intel_pstate",