Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3416697pxf; Mon, 29 Mar 2021 01:24:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOfh3laaVGV7c4ytj+7IJA0zeg3OuqMyIWZFoBehmz8/36C2rMSvz9Zzxg60hQnlb/wjed X-Received: by 2002:aa7:c804:: with SMTP id a4mr26839190edt.251.1617006289027; Mon, 29 Mar 2021 01:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006289; cv=none; d=google.com; s=arc-20160816; b=FpWaVgH+GUY/TFjN3cUPL4AYZy+XgWcA89NzjUvOaa6iNVzoZBnVcFffZWNbVNkNFg LD2iQeZJtQ7X9L6qMnl6gFrkl0PnTPBaJaJM572WwC4FNrwPOAt2rexLVzArNN/OKbvr 5TAliuKqvD3W1/YwkdpC58xPqr0JeXZJvJk3ro63ZAALUi97G9oOJUxUCcSvDefOA6Cb C8rn1srcStIGBUMccEwhh+AFsyg74ty3Wd8MhFWYt/Ru/aYpPHfzawjDsO/9etZX3G2v Y2b2T43BG9eYL3qYtPyPHiRhVL02MRq/z3KXy8oo26H9wMlo3kV9fekqvcTpVG2BgxQ7 2GPg== 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=xCCLU1jDplp5EQu1I2mEBLW1C9tQYgFfNCS9aJuyoe4=; b=L0KSFjRREiq4klUfkSpHjaN8DvQHzyiwNTDU79FZdLGcSkRTyLnTVl2+EEKqMblrBM PjDc85QCtxilzQlKQS/FaS3HUApIUhXsURlp4D0uyuq1r1La8oWsXp07yHcKAsHp1B8P cfMBcKf/qT4XaJLp4bUkTjRD4GNlJQnM7L8Y4r66UYiKCvCyqFJI7F4dGvOzETj2iKXJ 6HqkLz44mbkXo5bB71lr5y6wLIBH+8AoxEbnAdb1/agrjIK0qGiQ/uhhNq6woSza7rLA hd7vfMdGPlPmWhTBccajCvefSLK8ldYdLjVsqE9QVLlbzS9MyBLPWw+ALoaFB1qbGDJG evTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l5hWHAPQ; 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 w10si11667529edd.483.2021.03.29.01.24.26; Mon, 29 Mar 2021 01:24:49 -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=l5hWHAPQ; 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 S231756AbhC2IXk (ORCPT + 99 others); Mon, 29 Mar 2021 04:23:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:57716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232966AbhC2IP1 (ORCPT ); Mon, 29 Mar 2021 04:15:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B3352619A0; Mon, 29 Mar 2021 08:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005716; bh=WNK3rGVTrtO9otSoe+n1TMu4uX/bbLFza7ZJFLP2WII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l5hWHAPQVy2c3k2WOx9oStyvIc6vdEQa+/OodL9Pz0/cObwpCHbp5wBeSm3zOLUXc fvDVA5gkC1CjCXplXx446zz4BSrMDUoyOB+9RyLw7qx0Qn9wFbJhH1JfinpQAiqwoL Lw2BUyxaW6DttNWhLTpc18Wq/o8MgDrej5W6R8Ng= 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.4 091/111] PM: EM: postpone creating the debugfs dir till fs_initcall Date: Mon, 29 Mar 2021 09:58:39 +0200 Message-Id: <20210329075618.252474746@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075615.186199980@linuxfoundation.org> References: <20210329075615.186199980@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 0a9326f5f421..8dac32bd9089 100644 --- a/kernel/power/energy_model.c +++ b/kernel/power/energy_model.c @@ -74,7 +74,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 em_perf_domain *pd, int cpu) {} #endif -- 2.30.1