Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1743218rwb; Sun, 15 Jan 2023 03:38:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXvrqzVcJi7cLe7P+5VF59NAUm6xOssM56g8P7LNJT9nZJmj5rAvkRTDdoybWoY0832IFDK3 X-Received: by 2002:a17:902:ecc2:b0:194:796b:52d5 with SMTP id a2-20020a170902ecc200b00194796b52d5mr9879270plh.5.1673782713819; Sun, 15 Jan 2023 03:38:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673782713; cv=none; d=google.com; s=arc-20160816; b=yitP1IiXIDvxOUA1NXnDsN6a0ILWH1cSWsm4LYAbO1ctQlzP4nQCxGQAA4oHdRb7fB 5BO0BKHGUTY0CiVYn+iqqOu0HoXDMldo6xYpxp6uDut+8OyRCiooSlYZmv8nydUAcR2f E/gKFk/8sOL5q8nxFxGo7n53cWjMRiVPUj2+OdEkFnP9l2GM6lW/AquSgRhglsAoGxsg p6oAW8lXxtXDPBUdQhs3h25HyOZf15QTJ/YrGhnODj1qmD3hjpyAi59/sASEadPUGMI4 rkoYGMaIYeRCT7/DFx1jc4EtZ0qUpff/8PwicgLYQ/NCl/6E71kaZzX5kecq6+xqKEQO cEzA== 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:dkim-signature; bh=DK8Z1K298wuvVT3Xgrcx1/iJ/VthejW6eAHRqTKV+48=; b=F1zxsVDIkMzFDAyBJG/L9QMAwPfODpsznyC236ztTnwErv5qegFa/nD3Nhym5V+K2G pOsjjp+1JHkKHxFq0vOQuLASQ/WUewy11iMMxEm5huEJxJV+jlCj/bXPDNsbZM0oLeOS VJd28K0GOaTwajX/ZKCmQYwNBWDt0PhMbwYG0TY2hyZr0XvsJCKFPvshgk0kKlluzJ2J 8p1pkuLEpVpwVM/B6RS3r9S1ySV0JjcJKmjcaNu4fMkuKIT0ObRL+UmpWyvz50izrZAZ pzJzWIBeudKpA+W3rlPdCfWCfpp9bVy9rlbQaBHXlwhKrlwIJTM0RNXiC3W8gVK2n8Jy jNfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=EoU4ZmyW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e23-20020a656897000000b00477c217a5eesi5275696pgt.317.2023.01.15.03.38.27; Sun, 15 Jan 2023 03:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=EoU4ZmyW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbjAOLC5 (ORCPT + 52 others); Sun, 15 Jan 2023 06:02:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbjAOLCm (ORCPT ); Sun, 15 Jan 2023 06:02:42 -0500 Received: from m12.mail.163.com (m12.mail.163.com [123.126.96.234]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4A12BC15A; Sun, 15 Jan 2023 03:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=DK8Z1 K298wuvVT3Xgrcx1/iJ/VthejW6eAHRqTKV+48=; b=EoU4ZmyWa7kOrIstSzoI1 uOL9ZQtMMzFZOQ9F9NjqqnrPDDaltDv9vWeP8HVf2lyTt2s9lPPsr2l+t7lA6FTM 3Fmv2YSfOg4VoFHpSYPVTwBEeH+ZpU2GZzBqIuTGzJW9s8QtE+LaqUpJy/QRppqK hp84IfnER3dsKMD+IjRpQc= Received: from ubuntu20.04 (unknown [222.129.34.12]) by smtp17 (Coremail) with SMTP id NdxpCgC3mSg13cNjmGgOAg--.47934S2; Sun, 15 Jan 2023 19:02:14 +0800 (CST) From: Vincent Wang To: rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Wang Subject: [PATCH] cpufreq: Send CPUFREQ_CREATE_POLICY notification after the perf domain creation. Date: Sun, 15 Jan 2023 19:02:08 +0800 Message-Id: <20230115110208.12411-1-bhuwz@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: NdxpCgC3mSg13cNjmGgOAg--.47934S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zr45CFW7WFyrGw1fJr1DJrb_yoW8Gr15pF W2grW8CryxtFZrJa1UAF48ua4Yq3Zruay8G34UGw1FyrnxCF1Sg3WUGF1YkFWfGr4kCrWa yr1Fqa47Ca18CF7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jDvtAUUUUU= X-Originating-IP: [222.129.34.12] X-CM-SenderInfo: pekx46i6rwjhhfrp/xtbBRRb33GI0etetFAAAs6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vincent Wang We found the following issue during kernel boot on android phone: [ 1.325272][ T1] cpu cpu0: EM: created perf domain [ 1.329317][ T1] cpu cpu4: EM: created perf domain [ 1.337597][ T76] pd_init: no EM found for CPU7 [ 1.350849][ T1] cpu cpu7: EM: created perf domain pd init for cluster2 is executed in a kworker thread and is earlier than the perf domain creation for cluster2. pd_init() is called from the cpufreq notification of CPUFREQ_CREATE_POLICY in cpufreq_online(), which is earlier than that cpufreq_driver->register_em() is called. To avoid this issue, cpufreq notification should be sent after the perf domain creation. Signed-off-by: Vincent Wang --- drivers/cpufreq/cpufreq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 7e56a42750ea..9e67df4fc334 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1506,6 +1506,9 @@ static int cpufreq_online(unsigned int cpu) */ if (cpufreq_driver->register_em) cpufreq_driver->register_em(policy); + + blocking_notifier_call_chain(&cpufreq_policy_notifier_list, + CPUFREQ_CREATE_POLICY, policy); } ret = cpufreq_init_policy(policy); -- 2.25.1