Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp6107754rdb; Mon, 18 Sep 2023 04:41:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7lXYyVYiMriOEA4e70AYPoby3qEJ4DfVwvytkyeKRvkLey9vkELV7mXreR8PDa10G/Dar X-Received: by 2002:a54:4886:0:b0:3ab:81e4:4da0 with SMTP id r6-20020a544886000000b003ab81e44da0mr9168609oic.42.1695037287979; Mon, 18 Sep 2023 04:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695037287; cv=none; d=google.com; s=arc-20160816; b=ZJdlVYr75/kA7S7o8PNIiRX0seqVNVkp/w+fF055alT4tboL0f7d/Ij5h7x0QZCtXC HoWaa11gMdD3JnxMCZALhQpPoUxBa1Oo4CFf2r3nKffTEH4V+obOsyiknXsy9vbD3225 LAE0+pe4+tX0oS3SPp/P9kXRBrs+E2a++gdAq1lDCK6cp/fwRimk5E6Ashn01FYiycOc ikOywQ1qOFuwGclMe1bzz0KXY93tSOVBtpl3RP00fznsrtTyCY/xmvEsxEw/xoolJG30 V+NlXAIajkU/6nh9Ts5bquzochWyKUGrg0D2tbUgZ+PnOUznpEoM+j0QLo1245HXz1oH Fgsg== 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; bh=s9Bv1e6ZiubbQ0mMO9JWU3imvGVyGwWiHQ0ZeE5wSvo=; fh=2+hAO6wYFqioejjqsoG/mMbu4dMrUyd8Al+CTAjDpnQ=; b=dpGVGqx7kX2V/1SA6OcMlYR+VeroA2kQCMjpNQMbjYwnWnBeBCjZx78KFW1OfRTlkW FuwENCNGxQoZEag5mfAI8CuSwH4GzQfu3M2gqf13p9kxT2QKk0+/1DoUTHoJLeMifwJI bZdrzA49xbjDARpLfs5Ej/tGi6vsUVy6hO1l9UaQB5VGEbTfR/YRoSz2JPTzwty0O3Ji rEcbw4rgGkvf2wvOiyjVzSfm3Dg6XrmugrgSDllFm7UDhSXuyvQtn0nO7rmuCP0bpukn SoI1RjTRQKVcRthIMbRdaGhg4Gq0ZPfJKucSXEAaL4lQnfbGPQxY91vFzIjihz2Wc8/F d+gA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id t17-20020a63d251000000b0056c55eb251csi7761525pgi.123.2023.09.18.04.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 04:41:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 76E5A820D5D9; Mon, 18 Sep 2023 04:32:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241733AbjIRLcV (ORCPT + 99 others); Mon, 18 Sep 2023 07:32:21 -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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 04:32:44 -0700 (PDT) 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) -- 2.25.1