linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: "Kenneth R. Crudup" <kenny@panix.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Cc: Linux PM list <linux-pm@vger.kernel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [Fwd: Commit 555c45fe0d0 ("int340X/processor_thermal_device: add support for MMIO RAPL") boot failure]
Date: Fri, 19 Jul 2019 23:34:02 +0800	[thread overview]
Message-ID: <1563550442.2455.1.camel@intel.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1907190601580.2769@hp-x360>

On 五, 2019-07-19 at 06:03 -0700, Kenneth R. Crudup wrote:
> On Fri, 19 Jul 2019, Rafael J. Wysocki wrote:
> 
> > 
> > So can you disable PROC_THERMAL_MMIO_RAPL in Kconfig and retest?
> It can't be manually disabled, as it's auto-selected:
> 
> 	Depends on: THERMAL [=y] && (X86 [=y] || X86_INTEL_QUARK [=n]
> ||
> 	COMPILE_TEST [=n]) && INT340X_THERMAL [=y] && 64BIT [=y] &&
> POWERCAP [=y]
> 
> so I just reverted the commit to get going again,
> 
> 	-Kenny
> 
please try the patch below and confirm if it helps or not.

From: Zhang Rui <rui.zhang@intel.com>
Date: Fri, 19 Jul 2019 23:25:14 +0800
Subject: [PATCH] powercap: adjust init order

The MMIO RAPL interface driver depends on both powercap subsystem and
the intel_rapl_common code.
But when all of the are built in, the MMIO RAPL interface driver is loaded
before the later two and this breaks the system during boot.

Fix this by adjusting the init order of powercap subsystem and the
intel_rapl_common code, so that it can be loaded first.

Fixes: 555c45fe0d04 ("int340X/processor_thermal_device: add support for MMIO RAPL")
Reported-by: Kenneth R. Crudup <kenny@panix.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/powercap/intel_rapl_common.c | 2 +-
 drivers/powercap/powercap_sys.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c
index 9fd6dd3..6df4818 100644
--- a/drivers/powercap/intel_rapl_common.c
+++ b/drivers/powercap/intel_rapl_common.c
@@ -1454,7 +1454,7 @@ static void __exit rapl_exit(void)
 	unregister_pm_notifier(&rapl_pm_notifier);
 }
 
-module_init(rapl_init);
+fs_initcall(rapl_init);
 module_exit(rapl_exit);
 
 MODULE_DESCRIPTION("Intel Runtime Average Power Limit (RAPL) common code");
diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c
index 540e8aa..f808c5f 100644
--- a/drivers/powercap/powercap_sys.c
+++ b/drivers/powercap/powercap_sys.c
@@ -671,7 +671,7 @@ static int __init powercap_init(void)
 	return class_register(&powercap_class);
 }
 
-device_initcall(powercap_init);
+fs_initcall(powercap_init);
 
 MODULE_DESCRIPTION("PowerCap sysfs Driver");
 MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
-- 
2.7.4


  reply	other threads:[~2019-07-19 15:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.2.21.1907181955330.2769@hp-x360>
     [not found] ` <1563514893.2433.3.camel@intel.com>
2019-07-19  6:13   ` [Fwd: Commit 555c45fe0d0 ("int340X/processor_thermal_device: add support for MMIO RAPL") boot failure] Kenneth R. Crudup
2019-07-19  7:51     ` Rafael J. Wysocki
2019-07-19 13:03       ` Kenneth R. Crudup
2019-07-19 15:34         ` Zhang Rui [this message]
2019-07-19 17:31           ` Kenneth R. Crudup
2019-07-20  1:25             ` Zhang Rui
2019-07-20 10:18               ` Rafael J. Wysocki
2019-07-20 12:09                 ` Rafael J. Wysocki
2019-07-19  8:30     ` Rafael J. Wysocki
2019-07-19 11:28       ` Zhang, Rui
2019-07-19 12:33         ` Zhang, Rui
2019-07-19 15:35       ` Zhang Rui
2019-07-20 12:11         ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1563550442.2455.1.camel@intel.com \
    --to=rui.zhang@intel.com \
    --cc=kenny@panix.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).