Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp6107763rdb; Mon, 18 Sep 2023 04:41:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9q/nMMxlVQKYH16nEh6LJAhECkrgDOi5jzUGERM5a5xE3AfGJ2z76S2ILskMjAqszhhhj X-Received: by 2002:a05:6a20:e10b:b0:155:1221:a3d5 with SMTP id kr11-20020a056a20e10b00b001551221a3d5mr9734263pzb.5.1695037289173; Mon, 18 Sep 2023 04:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695037289; cv=none; d=google.com; s=arc-20160816; b=hJj+zFOdJZOPByClhov1pZOVH/NbyFHtDhuC58yPIHpulOt/0lSa7lwDNvz7O2OHu0 kaCGybmFVYm6aYpUIWM7nuJWxz6VFOIpGCFe61bLutBtwWSymSSvhpsRB8ai+zD0KBam gR2dpZFzfxHSJsBbaJ7PevM2Gou9P781TReeby00RLdeJ0RjD5VQJPp+ZKBqsVE8LZ1s 8ETbQIbQU1HiOcDzoBtP8/lSChoof3g15RenhBz8ilq84vRqNrZfVatuKOoYzsxbm53r BvsBBHQwTv/Tsy8J4I9tf2lS4myfHsULVFWfdtK2/Hyjn4LGcxjIluyERINUNZuo+LDL cU9g== 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 :message-id:date:subject:cc:to:from; bh=s9Bv1e6ZiubbQ0mMO9JWU3imvGVyGwWiHQ0ZeE5wSvo=; fh=2+hAO6wYFqioejjqsoG/mMbu4dMrUyd8Al+CTAjDpnQ=; b=OI/WD/niI2LmoPJTWyegy6ExDwWLGrKspvZhY2HytaSoRQDl6PMYUnrp2zbFpQrcTj gDnCgv9Gsuo5TMIYb6dwdTF3w5dbqRmzcxvDA+JPCsJR14yLPobr2VT8eUL7pwe6j6J7 hUhf1A+Djd2JBH5fcsgosmjxR+xxO+X48P3y9tNRUUhizuT019Fd0OcB9saq+dHmlVv8 fnsQ/hFC1MFHYoJ2Xq435q27spYhPXcKYq5JRWO8TSARbYbkAv+pau2CnclV+NoZ6QoO Jee6bkCGxufDx+QpByOL+EidV4NQ9b9MvpuHwWnk2CC/TXq3zOupc+NovlnrYPPXDzrN XY5Q== 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 o66-20020a634145000000b005440b9f013csi7785141pga.899.2023.09.18.04.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 04:41:29 -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 BDFC881F965D; Mon, 18 Sep 2023 04:32:45 -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 S241756AbjIRLcX (ORCPT + 99 others); Mon, 18 Sep 2023 07:32:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241750AbjIRLbz (ORCPT ); Mon, 18 Sep 2023 07:31:55 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 66800102; Mon, 18 Sep 2023 04:30:34 -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 57B651FB; Mon, 18 Sep 2023 04:31:11 -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 C71583F67D; Mon, 18 Sep 2023 04:30:32 -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:35 +0200 Message-Id: <20230918112937.493352-1-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 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:45 -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