From patchwork Mon Sep 18 11:29:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Gondois X-Patchwork-Id: 724348 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B39A1C46CA1 for ; Mon, 18 Sep 2023 11:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240086AbjIRLcN (ORCPT ); Mon, 18 Sep 2023 07:32:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241728AbjIRLbu (ORCPT ); Mon, 18 Sep 2023 07:31:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1EA491B0; Mon, 18 Sep 2023 04:30:36 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 24050C15; Mon, 18 Sep 2023 04:31:13 -0700 (PDT) Received: from cam-smtp0.cambridge.arm.com (e126645.nice.arm.com [10.34.100.121]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 942F13F67D; Mon, 18 Sep 2023 04:30:34 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Shrikanth Hegde , vschneid@redhat.com, Pierre Gondois , "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org Subject: [PATCH] cpufreq: Rebuild sched-domains when removing cpufreq driver Date: Mon, 18 Sep 2023 13:29:36 +0200 Message-Id: <20230918112937.493352-2-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230918112937.493352-1-pierre.gondois@arm.com> References: <20230918112937.493352-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The Energy Aware Scheduler (EAS) relies on the schedutil governor. When moving to/from the schedutil governor, sched domains must be rebuilt to allow re-evaluating the enablement conditions of EAS. This is done through sched_cpufreq_governor_change(). Having a cpufreq governor assumes having a cpufreq driver running. Inserting/removing a cpufreq driver should trigger a re-evaluation of EAS enablement conditions, avoiding to see EAS enabled when removing a running cpufreq driver. Add a sched_cpufreq_governor_change() call in cpufreq driver removal path. Signed-off-by: Pierre Gondois --- drivers/cpufreq/cpufreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 60ed89000e82..0a4979c34fd1 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1673,6 +1673,8 @@ static void __cpufreq_offline(unsigned int cpu, struct cpufreq_policy *policy) cpufreq_driver->exit(policy); policy->freq_table = NULL; } + + sched_cpufreq_governor_change(policy, policy->governor); } static int cpufreq_offline(unsigned int cpu)