Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3426739pxf; Mon, 29 Mar 2021 01:46:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw/febhjFi2UuqcBEUAIr/JDvsvM6xrw+O7cJmxL8AB80wVEc0oKvIaioRkYQbP2eQEwiz X-Received: by 2002:a17:906:4b14:: with SMTP id y20mr10569630eju.26.1617007579687; Mon, 29 Mar 2021 01:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007579; cv=none; d=google.com; s=arc-20160816; b=igwYCGZNFmk13emP+e6A8VnY3TZXxDOtzQcHB8MzbRUnZm9quntXQrPsBhAZ+D9iEn S1/T62ZntHh49kymGfgSM/rqKhxS86dic7Hv8CnB5BzDGhodwHUWnUZo3yW5Og0RK70D 2Hc1miwPVdLqTnH7t8i531YQ/afgXdvPVD/tbhGDmg0uoG6CnL0u9+pbL+GhXonpCGeS mHiRTLl6Mkq6gOpeK2TQslNJsDhAqVzMYyaqDcsVFUhQhi8XM1UWTSDCpYev+LygMM/f nWmZXvIWBuc9AOvcFd3muJA2M0cdiQGHSnkodvqXbEh5dHahwlsJbKJ9EyuWgqknUprQ 8M/A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PPiaTnAY+hl6sVXKcyru8yiaCOpDDnpnPJDlemOTRNA=; b=jh1tUypPe7WddS5x+49zHqlJT8BB+h8askjmIjCIov6nbqPWAsFvbb1at8RjsewLBa MG/01Na4Zl024UDre4izZluWL5dlqlNT0SYs5xvzYoxmlWW1X5QzIzf4u7Nm0CTO+NPL RuUdMTg+EB7DoxJdZik3gqfhG9p5Oxq0pnOXQssxHS5HykFK+rXYsfcnxHJ2ZpXESJcN 286m/TfyTBfjdMJaOJi4jl9f/BZZZo6Yl5U/v8deurQUoWHo+ckcgn9PamrUW23wE3++ 4uRSHh2hEbBGRVjfl0muOIS6hNEJEHDBpy2sDeZpqpqEWlv1/27JcgKhAvqg7sIbGWPQ bBAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XgHIms9i; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si12513010edr.358.2021.03.29.01.45.57; Mon, 29 Mar 2021 01:46:19 -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=@linuxfoundation.org header.s=korg header.b=XgHIms9i; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235329AbhC2Iml (ORCPT + 99 others); Mon, 29 Mar 2021 04:42:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:40836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232860AbhC2IYX (ORCPT ); Mon, 29 Mar 2021 04:24:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3273E6197C; Mon, 29 Mar 2021 08:24:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006257; bh=AuSNW5X8D0kAWPMVJcOtVL3JKRzUloBfjvnmP3U005s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XgHIms9ibiJ8GYKDJ9yTWbrDU3S9TwaslXz6d5xeIRVp4QDpbm1owJdDjmaVh9gpe u6+dSfwkBUx74d8twco4ZW8r+E1VPxnIsHNOVwyVUlNE62FYupEhwDsgneHsgpYZvo rRxpFUF/ZXAkmcoSoobFakVjJiozoi0a0igYef6k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ionela Voinescu , Lukasz Luba , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.10 174/221] PM: EM: postpone creating the debugfs dir till fs_initcall Date: Mon, 29 Mar 2021 09:58:25 +0200 Message-Id: <20210329075634.955897304@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lukasz Luba [ Upstream commit fb9d62b27ab1e07d625591549c314b7d406d21df ] The debugfs directory '/sys/kernel/debug/energy_model' is needed before the Energy Model registration can happen. With the recent change in debugfs subsystem it's not allowed to create this directory at early stage (core_initcall). Thus creating this directory would fail. Postpone the creation of the EM debug dir to later stage: fs_initcall. It should be safe since all clients: CPUFreq drivers, Devfreq drivers will be initialized in later stages. The custom debug log below prints the time of creation the EM debug dir at fs_initcall and successful registration of EMs at later stages. [ 1.505717] energy_model: creating rootdir [ 3.698307] cpu cpu0: EM: created perf domain [ 3.709022] cpu cpu1: EM: created perf domain Fixes: 56348560d495 ("debugfs: do not attempt to create a new file before the filesystem is initalized") Reported-by: Ionela Voinescu Signed-off-by: Lukasz Luba Reviewed-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- kernel/power/energy_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c index c1ff7fa030ab..994ca8353543 100644 --- a/kernel/power/energy_model.c +++ b/kernel/power/energy_model.c @@ -85,7 +85,7 @@ static int __init em_debug_init(void) return 0; } -core_initcall(em_debug_init); +fs_initcall(em_debug_init); #else /* CONFIG_DEBUG_FS */ static void em_debug_create_pd(struct device *dev) {} static void em_debug_remove_pd(struct device *dev) {} -- 2.30.1