All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org
Cc: Len Brown <len.brown@intel.com>
Subject: [PATCH 16/30] ACPI: remove BM_RLD access from idle entry path
Date: Sat, 07 Feb 2009 01:41:24 -0500	[thread overview]
Message-ID: <31878dd86b7df9a147f5e6cc6e07092b4308782b.1233988825.git.len.brown@intel.com> (raw)
In-Reply-To: <091d71e023557136e96f0e54f301497a3fc95dc3.1233988822.git.len.brown@intel.com>
In-Reply-To: <091d71e023557136e96f0e54f301497a3fc95dc3.1233988822.git.len.brown@intel.com>

From: Len Brown <len.brown@intel.com>

It is true that BM_RLD needs to be set to enable
bus master activity to wake an older chipset (eg PIIX4) from C3.

This is contrary to the erroneous wording the ACPI 2.0, 3.0
specifications that suggests that BM_RLD is an indicator
rather than a control bit.

ACPI 1.0's correct wording should be restored in ACPI 4.0:
http://www.acpica.org/bugzilla/show_bug.cgi?id=689

But the kernel should not have to clear BM_RLD
when entering a non C3-type state just to set
it again when entering a C3-type C-state.

We should be able to set BM_RLD at boot time
and leave it alone -- removing the overhead of
accessing this IO register from the idle entry path.

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/processor_idle.c |   57 ++++++----------------------------------
 1 files changed, 9 insertions(+), 48 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index ae00108..7eab733 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -241,26 +241,6 @@ acpi_processor_power_activate(struct acpi_processor *pr,
 		old->promotion.count = 0;
 	new->demotion.count = 0;
 
-	/* Cleanup from old state. */
-	if (old) {
-		switch (old->type) {
-		case ACPI_STATE_C3:
-			/* Disable bus master reload */
-			if (new->type != ACPI_STATE_C3 && pr->flags.bm_check)
-				acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
-			break;
-		}
-	}
-
-	/* Prepare to use new state. */
-	switch (new->type) {
-	case ACPI_STATE_C3:
-		/* Enable bus master reload */
-		if (old->type != ACPI_STATE_C3 && pr->flags.bm_check)
-			acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1);
-		break;
-	}
-
 	pr->power.state = new;
 
 	return;
@@ -1121,7 +1101,6 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
 					  " for C3 to be enabled on SMP systems\n"));
 			return;
 		}
-		acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
 	}
 
 	/*
@@ -1137,6 +1116,15 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
 #else
 	cx->latency_ticks = cx->latency;
 #endif
+	/*
+	 * On older chipsets, BM_RLD needs to be set
+	 * in order for Bus Master activity to wake the
+	 * system from C3.  Newer chipsets handle DMA
+	 * during C3 automatically and BM_RLD is a NOP.
+	 * In either case, the proper way to
+	 * handle BM_RLD is to set it and leave it set.
+	 */
+	acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1);
 
 	return;
 }
@@ -1400,25 +1388,6 @@ static int acpi_idle_bm_check(void)
 }
 
 /**
- * acpi_idle_update_bm_rld - updates the BM_RLD bit depending on target state
- * @pr: the processor
- * @target: the new target state
- */
-static inline void acpi_idle_update_bm_rld(struct acpi_processor *pr,
-					   struct acpi_processor_cx *target)
-{
-	if (pr->flags.bm_rld_set && target->type != ACPI_STATE_C3) {
-		acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
-		pr->flags.bm_rld_set = 0;
-	}
-
-	if (!pr->flags.bm_rld_set && target->type == ACPI_STATE_C3) {
-		acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1);
-		pr->flags.bm_rld_set = 1;
-	}
-}
-
-/**
  * acpi_idle_do_entry - a helper function that does C2 and C3 type entry
  * @cx: cstate data
  *
@@ -1473,9 +1442,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
 		return 0;
 	}
 
-	if (pr->flags.bm_check)
-		acpi_idle_update_bm_rld(pr, cx);
-
 	t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
 	acpi_idle_do_entry(cx);
 	t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
@@ -1527,9 +1493,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
 	 */
 	acpi_state_timer_broadcast(pr, cx, 1);
 
-	if (pr->flags.bm_check)
-		acpi_idle_update_bm_rld(pr, cx);
-
 	if (cx->type == ACPI_STATE_C3)
 		ACPI_FLUSH_CPU_CACHE();
 
@@ -1621,8 +1584,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
 	 */
 	acpi_state_timer_broadcast(pr, cx, 1);
 
-	acpi_idle_update_bm_rld(pr, cx);
-
 	/*
 	 * disable bus master
 	 * bm_check implies we need ARB_DIS
-- 
1.5.6.6


  parent reply	other threads:[~2009-02-07  6:41 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-07  6:41 [PATCH 01/30] PM: Fix compilation warning in kernel/power/main.c Len Brown
2009-02-07  6:41 ` [PATCH 02/30] ACPI suspend: Fix compilation warnings in drivers/acpi/sleep.c Len Brown
2009-02-07  6:41 ` [PATCH 03/30] ACPI: Fix crash on ASUS laptops Len Brown
2009-02-07  6:41 ` [PATCH 04/30] panasonic-laptop: fix X[ ARRAY_SIZE(X) ] Len Brown
2009-02-07  6:41 ` [PATCH 05/30] eeepc-laptop: split eeepc_backlight_exit() Len Brown
2009-02-07  6:41 ` [PATCH 06/30] asus_acpi: Add R1F support Len Brown
2009-02-07  6:41 ` [PATCH 07/30] asus-laptop: use generic netlink interface Len Brown
2009-02-07  6:41 ` [PATCH 08/30] asus-laptop: hotkeys via the generic input interface Len Brown
2009-02-07  6:41 ` [PATCH 09/30] asus-laptop: update Kconfig for input layer Len Brown
2009-02-07  6:41 ` [PATCH 10/30] asus-laptop: fix label indentation Len Brown
2009-02-07  6:41 ` [PATCH 11/30] eeepc-laptop: Add support for extended hotkeys Len Brown
2009-02-07  6:41 ` [PATCH 12/30] eeepc-laptop: Check return values from rfkill_register Len Brown
2009-02-07  6:41 ` [PATCH 13/30] eeepc-laptop: Implement rfkill hotplugging in eeepc-laptop Len Brown
2009-02-07  6:41 ` [PATCH 14/30] eeepc-laptop: use netlink interface Len Brown
2009-02-07  6:41 ` [PATCH 15/30] ACPI: remove locking from PM1x_STS register reads Len Brown
2009-02-07  6:41 ` Len Brown [this message]
2009-02-07  6:41 ` [PATCH 17/30] ACPI: Skip the first two elements in the _BCL package Len Brown
2009-02-07  6:41 ` [PATCH 18/30] ACPI: proc_dir_entry 'video/VGA' already registered Len Brown
2009-02-07  6:41 ` [PATCH 19/30] ACPICA: add debug dump of BIOS _OSI strings Len Brown
2009-02-07  6:41 ` [PATCH 20/30] ACPI: make some IO ports off-limits to AML Len Brown
2009-02-07  6:41 ` [PATCH 21/30] ACPI: cpufreq: Remove deprecated /proc/acpi/processor/../performance proc entries Len Brown
2009-02-07  6:41 ` [PATCH 22/30] ACPI: delete CPU_IDLE=n code Len Brown
2009-02-07  6:41 ` [PATCH 23/30] ACPI: disable ACPI cleanly when bad RSDP found Len Brown
2009-02-07  6:41 ` [PATCH 24/30] ACPI: dock: Don't eval _STA on every show_docked sysfs read Len Brown
2009-02-07  6:41 ` [PATCH 25/30] ACPI: add missing KERN_* constants to printks Len Brown
2009-02-07  6:41 ` [PATCH 26/30] ACPI: struct device - replace bus_id with dev_name(), dev_set_name() Len Brown
2009-02-07  6:41 ` [PATCH 27/30] ACPI: Enable bit 11 in _PDC to advertise hw coord Len Brown
2009-02-07  6:41 ` [PATCH 28/30] ACPICA: Fix table entry truncation calculation Len Brown
2009-02-07  6:41 ` [PATCH 29/30] eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init Len Brown
2009-02-07  6:41 ` [PATCH 30/30] ACPI: Kconfig text - Fix the ACPI_CONTAINER module name according to the real module name Len Brown

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=31878dd86b7df9a147f5e6cc6e07092b4308782b.1233988825.git.len.brown@intel.com \
    --to=lenb@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.