mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	"Sudeep Holla" <sudeep.holla@arm.com>,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: [PATCH] Revert "cpuidle: Make drivers initialize polling state"
Date: Mon, 22 Jan 2018 18:27:47 +0200	[thread overview]
Message-ID: <20180122162747.19103-1-ville.syrjala@linux.intel.com> (raw)

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

This reverts commit 1b39e3f813b4685c7a30ae964d5529a1b0e3a286.

Makes my P3 machine oops somewhere in cpuidle. I suspect
CONFIG_ACPI=n may have something to do with this.

Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/acpi/processor_idle.c | 9 +--------
 drivers/cpuidle/driver.c      | 2 ++
 drivers/cpuidle/poll_state.c  | 3 +--
 drivers/idle/intel_idle.c     | 1 -
 include/linux/cpuidle.h       | 4 ++--
 5 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index d50a7b6ccddd..cb1c7634e2ca 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -842,7 +842,7 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
 
 static int acpi_processor_setup_cstates(struct acpi_processor *pr)
 {
-	int i, count;
+	int i, count = ACPI_IDLE_STATE_START;
 	struct acpi_processor_cx *cx;
 	struct cpuidle_state *state;
 	struct cpuidle_driver *drv = &acpi_idle_driver;
@@ -850,13 +850,6 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr)
 	if (max_cstate == 0)
 		max_cstate = 1;
 
-	if (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX)) {
-		cpuidle_poll_state_init(drv);
-		count = 1;
-	} else {
-		count = 0;
-	}
-
 	for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
 		cx = &pr->power.states[i];
 
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
index dc32f34e68d9..6f694c86f3fa 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
@@ -216,6 +216,8 @@ static int __cpuidle_register_driver(struct cpuidle_driver *drv)
 		on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer,
 				 (void *)1, 1);
 
+	poll_idle_init(drv);
+
 	return 0;
 }
 
diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c
index 7416b16287de..0db4f7273952 100644
--- a/drivers/cpuidle/poll_state.c
+++ b/drivers/cpuidle/poll_state.c
@@ -21,7 +21,7 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
 	return index;
 }
 
-void cpuidle_poll_state_init(struct cpuidle_driver *drv)
+void poll_idle_init(struct cpuidle_driver *drv)
 {
 	struct cpuidle_state *state = &drv->states[0];
 
@@ -34,4 +34,3 @@ void cpuidle_poll_state_init(struct cpuidle_driver *drv)
 	state->disabled = false;
 	state->flags = CPUIDLE_FLAG_POLLING;
 }
-EXPORT_SYMBOL_GPL(cpuidle_poll_state_init);
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index b2ccce5fb071..6d8a4b87e4d5 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1342,7 +1342,6 @@ static void __init intel_idle_cpuidle_driver_init(void)
 
 	intel_idle_state_table_update();
 
-	cpuidle_poll_state_init(drv);
 	drv->state_count = 1;
 
 	for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) {
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 8f7788d23b57..bc9f2603fe10 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -226,9 +226,9 @@ static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev,
 #endif
 
 #ifdef CONFIG_ARCH_HAS_CPU_RELAX
-void cpuidle_poll_state_init(struct cpuidle_driver *drv);
+void poll_idle_init(struct cpuidle_driver *drv);
 #else
-static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {}
+static void poll_idle_init(struct cpuidle_driver *drv) {}
 #endif
 
 /******************************
-- 
2.13.6

             reply	other threads:[~2018-01-22 16:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22 16:27 Ville Syrjala [this message]
2018-02-04  9:12 ` Rafael J. Wysocki
2018-02-04  9:18   ` Rafael J. Wysocki
2018-02-05 14:04     ` Ville Syrjälä
2018-02-05 17:56       ` Rafael J. Wysocki
2018-02-06 16:31         ` Ville Syrjälä
2018-02-06 18:00           ` Rafael J. Wysocki
2018-02-06 18:02           ` [PATCH] x86: PM: Make APM idle driver initialize polling state Rafael J. Wysocki
2018-02-06 18:26             ` Ville Syrjälä
2018-02-07  9:20               ` Rafael J. Wysocki
2018-02-07 14:00                 ` Ville Syrjälä
2018-02-12  9:21             ` [PATCH] PM: cpuidle: Fix cpuidle_poll_state_init() prototype 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=20180122162747.19103-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sudeep.holla@arm.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

all inboxes | Powered by JetHome®