Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5312804pxj; Tue, 22 Jun 2021 21:25:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhjh6BIybzdzUnc3rjFLXQAkxT//gG36bXJi9KMWqmvNMb7Pk5bm/32CJK/KjxHEzSL1YM X-Received: by 2002:a02:a153:: with SMTP id m19mr7238335jah.105.1624422347251; Tue, 22 Jun 2021 21:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624422347; cv=none; d=google.com; s=arc-20160816; b=loh2/VuQHZSW85odhSYjfBov38DJTa6twEyyXHL4bPEtigkoRSI1qnK4AmlWZlzvHA JSve2TpNPuinfIpXuiHZNSGgsUn9wS4dmQUEpDq9QX+A2K3egrQXzwLcBBFBnwLFQegX kLU9qh80KbaGvRiheArGxsPU0VysetAPKq998kwSERMHwizAKcYTcvZFM6RkexQmaCUK 1/Iwk8a40itIQVRmh8yRaHQ2F5HUWiBzMe3vR5AXUIZtYPrZyDxEHnM5gFkssczWiY0t Yxiv6dsF2l7P5eYwDwu8md0Mx8Hhwv+oaziChkF9JzTA/C38zAXqo8Mp8pRAo6yL7LOW OTHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EPOEQ7pRTnNWs9xaNPcoV7k6Yz2O7yBdc0WvhyMJhVY=; b=PFEagwtG1U/egimgcrA7/drgVLhezXDwGka9mpIaJ6Z+DrQAB0DUe7vvMZ4sPQAsjd j9+yElYGNgceJOJ88ZFH9CugLSL9wh6t9uYSYJVfyU42JpB2O1oPbX2SAa+jypYEMX+v ChRYfunn1BMv8W7fj7MydAvyZv4p132dOlA6Hi/5lxSrJUiTrgXUjCq6FhLBuKv/xFsc V60fe2i5vTCzj08rNQ8jm/Aww8IALfHG0py8up/+tsBzVboFlM5gUPfI+OpW7aim+jnW 67zA/6TkGkzuzRYjhh5q2pcaqMEEuIJmA+kLM4+n7KcjuW4w0g3F5YbtJkBeiFIHyoEi O/ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b8ZR4og0; 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 r4si1885796ioh.93.2021.06.22.21.25.36; Tue, 22 Jun 2021 21:25:47 -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=b8ZR4og0; 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 S230346AbhFWE1U (ORCPT + 99 others); Wed, 23 Jun 2021 00:27:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230163AbhFWE1T (ORCPT ); Wed, 23 Jun 2021 00:27:19 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E219FC061574 for ; Tue, 22 Jun 2021 21:25:01 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id e22so664018pgv.10 for ; Tue, 22 Jun 2021 21:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EPOEQ7pRTnNWs9xaNPcoV7k6Yz2O7yBdc0WvhyMJhVY=; b=b8ZR4og0732gAR3c1QYoPDfJ0QOfR/MZV3Znls5zMiLv1QapescQpW0mD0cXuEw5Y+ 3ryskYMHsIw99NYuadcF4O8zZpYOnknde2t3RqK3gw6O00rMiPD5u6zLv9ZPRTnmPtqS QaibiMZ53wEa0Jnl4UvoisAz+Mq2Sd/rYN+VPqYLh+AeOXqhwxYhgYlhJ/KIAbBLM2u/ RWaqb4dhS1RkSbnBFmzrpXoZteqOa4XE8SvRzjqKDRyngP1oIPE3ybe5u+9TezGMdJET G/83PxfoCv7PcITInYuigzvIk8yHyiE9S5Cp0CbNDM2i6M9FELfdjrys21Wt+7pVpMRy 9m9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EPOEQ7pRTnNWs9xaNPcoV7k6Yz2O7yBdc0WvhyMJhVY=; b=aguD4fahBhjmuK7HQpouB6s/dejP1lFb6CgGGLGwV/8CLx1qlofS/w+iSdspqsrJcr zCGzdkXme2sjnSRAZBJe+80GZT4Uo85CjERtlAdpmWbQ0VGQEH5PjUbf5D9w2aolUq2O VUff3CZy/AWN88yZdwy1O0sIXrdS8cI0a+HAq0CAtPvMTS6L4pbWWsdXeBEiB7q4VSPw v8XL9o59Wzo9ramBoU1HSSB+DVXnEg7hxCqN1hjCNVrOnvE43EVCkEWYneqtgdeO7FYA H+mHhBIfKJ0e7MMq9iQvytSG/GvgvaQrJd6r3VrRLNPmmVcXt17Oj3y4GtCQLyKPeBsi Il6g== X-Gm-Message-State: AOAM531isCQtWg3nahQK7lYRTwbjUfocAJ5YBJehcXz21CANkmeo41el Ej4HG+VcCaN7d4Rt7Hfc9BwbQw== X-Received: by 2002:aa7:954c:0:b029:2f5:33fc:1073 with SMTP id w12-20020aa7954c0000b02902f533fc1073mr6933781pfq.79.1624422301480; Tue, 22 Jun 2021 21:25:01 -0700 (PDT) Received: from localhost ([136.185.134.182]) by smtp.gmail.com with ESMTPSA id v3sm802496pfb.126.2021.06.22.21.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 21:25:01 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Srinivas Pandruvada , Len Brown , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Dirk Brandewie , linux-kernel@vger.kernel.org Subject: [PATCH V4 2/4] cpufreq: intel_pstate: Migrate to ->offline() instead of ->stop_cpu() Date: Wed, 23 Jun 2021 09:54:40 +0530 Message-Id: <6144911f36d3d1f5faddf81d744bd39946843f6b.1624421816.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 367dc4aa932b ("cpufreq: Add stop CPU callback to cpufreq_driver interface") added the stop_cpu() callback to allow the drivers to do clean up before the CPU is completely down and its state can't be modified. At that time the CPU hotplug framework used to call the cpufreq core's registered notifier for different events like CPU_DOWN_PREPARE and CPU_POST_DEAD. The stop_cpu() callback was called during the CPU_DOWN_PREPARE event. This is no longer the case, cpuhp_cpufreq_offline() is called only once by the CPU hotplug core now and we don't really need to separately call stop_cpu() for cpufreq drivers. Migrate to using the offline() callbacks instead of stop_cpu(). Cc: Dirk Brandewie Signed-off-by: Viresh Kumar --- drivers/cpufreq/intel_pstate.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 0e69dffd5a76..b4c0ff7f5b71 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2335,6 +2335,8 @@ static int intel_pstate_cpu_offline(struct cpufreq_policy *policy) pr_debug("CPU %d going offline\n", cpu->cpu); + intel_pstate_clear_update_util_hook(policy->cpu); + if (cpu->suspended) return 0; @@ -2374,13 +2376,6 @@ static int intel_pstate_cpu_online(struct cpufreq_policy *policy) return 0; } -static void intel_pstate_stop_cpu(struct cpufreq_policy *policy) -{ - pr_debug("CPU %d stopping\n", policy->cpu); - - intel_pstate_clear_update_util_hook(policy->cpu); -} - static int intel_pstate_cpu_exit(struct cpufreq_policy *policy) { pr_debug("CPU %d exiting\n", policy->cpu); @@ -2451,7 +2446,6 @@ static struct cpufreq_driver intel_pstate = { .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, .online = intel_pstate_cpu_online, .update_limits = intel_pstate_update_limits, -- 2.31.1.272.g89b43f80a514