ia64/xen-unstable

changeset 19316:658b7ca5d4ed

cpuidle: remove BM_RLD access from idle entry path

Port below linux patch into xen to reduce overhead from idle entry path.

commit 31878dd86b7df9a147f5e6cc6e07092b4308782b
Author: Len Brown <len.brown@intel.com>
Date: Wed Jan 28 18:28:09 2009 -0500

ACPI: remove BM_RLD access from idle entry path

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=3D689

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>

Signed-off-by: Wei Gang <gang.wei@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 11 10:15:06 2009 +0000 (2009-03-11)
parents 57a67b02e448
children a4274d1e85a3
files xen/arch/x86/acpi/cpu_idle.c
line diff
     1.1 --- a/xen/arch/x86/acpi/cpu_idle.c	Wed Mar 11 10:14:33 2009 +0000
     1.2 +++ b/xen/arch/x86/acpi/cpu_idle.c	Wed Mar 11 10:15:06 2009 +0000
     1.3 @@ -167,25 +167,6 @@ static void acpi_idle_do_entry(struct ac
     1.4      }
     1.5  }
     1.6  
     1.7 -static inline void acpi_idle_update_bm_rld(struct acpi_processor_power *power,
     1.8 -                                           struct acpi_processor_cx *target)
     1.9 -{
    1.10 -    if ( !power->flags.bm_check )
    1.11 -        return;
    1.12 -
    1.13 -    if ( power->flags.bm_rld_set && target->type != ACPI_STATE_C3 )
    1.14 -    {
    1.15 -        acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
    1.16 -        power->flags.bm_rld_set = 0;
    1.17 -    }
    1.18 -
    1.19 -    if ( !power->flags.bm_rld_set && target->type == ACPI_STATE_C3 )
    1.20 -    {
    1.21 -        acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1);
    1.22 -        power->flags.bm_rld_set = 1;
    1.23 -    }
    1.24 -}
    1.25 -
    1.26  static int acpi_idle_bm_check(void)
    1.27  {
    1.28      u32 bm_status = 0;
    1.29 @@ -258,8 +239,6 @@ static void acpi_processor_idle(void)
    1.30       * ------
    1.31       * Invoke the current Cx state to put the processor to sleep.
    1.32       */
    1.33 -    acpi_idle_update_bm_rld(power, cx);
    1.34 -
    1.35      switch ( cx->type )
    1.36      {
    1.37      case ACPI_STATE_C1:
    1.38 @@ -579,6 +558,15 @@ static int check_cx(struct acpi_processo
    1.39                          "C3 support without BM control\n"));
    1.40                  }
    1.41              }
    1.42 +            /*
    1.43 +             * On older chipsets, BM_RLD needs to be set
    1.44 +             * in order for Bus Master activity to wake the
    1.45 +             * system from C3.  Newer chipsets handle DMA
    1.46 +             * during C3 automatically and BM_RLD is a NOP.
    1.47 +             * In either case, the proper way to
    1.48 +             * handle BM_RLD is to set it and leave it set.
    1.49 +             */
    1.50 +            acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1);
    1.51          }
    1.52          else
    1.53          {