1. 15 8月, 2010 1 次提交
  2. 07 8月, 2010 1 次提交
    • R
      ACPI / ACPICA: Fix reference counting problems with GPE handlers · 28f4f8a9
      Rafael J. Wysocki 提交于
      If a handler is installed for a GPE associated with an AML method and
      such that it cannot wake up the system from sleep states, the GPE
      remains enabled after the handler has been installed, although it
      should be disabled in that case to avoid spurious execution of the
      handler.
      
      Fix this issue by making acpi_install_gpe_handler() disable GPEs
      that were previously associated with AML methods and cannot wake up
      the system from sleep states.
      
      Analogously, make acpi_remove_gpe_handler() enable the GPEs that
      are associated with AML methods after their handlers have been
      removed and cannot wake up the system from sleep states.  In addition
      to that, fix a code ordering issue in acpi_remove_gpe_handler() that
      renders the locking ineffective (ACPI_MTX_EVENTS is released
      temporarily in the middle of the routine to wait for the completion
      of events already in progress).
      
      For this purpose introduce acpi_raw_disable_gpe() and
      acpi_raw_enable_gpe() to be called with acpi_gbl_gpe_lock held
      and rework acpi_disable_gpe() and acpi_enable_gpe(), respectively, to
      use them.  Also rework acpi_gpe_can_wake() to use
      acpi_raw_disable_gpe() instead of calling acpi_disable_gpe() after
      releasing the lock to avoid the possible theoretical race with
      acpi_install_gpe_handler().
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: "Moore, Robert" <robert.moore@intel.com>
      Cc: Lin Ming <ming.m.lin@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      28f4f8a9
  3. 13 7月, 2010 3 次提交
    • R
      ACPI / ACPICA: Simplify acpi_ev_initialize_gpe_block() · a0d46871
      Rafael J. Wysocki 提交于
      Simplify the main loop in acpi_ev_initialize_gpe_block() by
      rearranging code and removing the "enabled" label that is not
      necessary any more.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      a0d46871
    • R
      ACPI / ACPICA: Fail acpi_gpe_wakeup() if ACPI_GPE_CAN_WAKE is unset · 9ce10df8
      Rafael J. Wysocki 提交于
      Make acpi_gpe_wakeup() return error code for GPEs whose
      ACPI_GPE_CAN_WAKE flag is not set.  This way acpi_gpe_wakeup() will
      only wake for the GPEs reported by the host OS as "wakeup" ones with
      the help of acpi_gpe_can_wake().
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      9ce10df8
    • R
      ACPI / ACPICA: Do not execute _PRW methods during initialization · 9874647b
      Rafael J. Wysocki 提交于
      Currently, during initialization ACPICA walks the entire ACPI
      namespace in search of any device objects with assciated _PRW
      methods.  All of the _PRW methods found are executed in the process
      to extract the GPE information returned by them, so that the GPEs in
      question can be marked as "able to wakeup" (more precisely, the
      ACPI_GPE_CAN_WAKE flag is set for them).  The only purpose of this
      exercise is to avoid enabling the CAN_WAKE GPEs automatically, even
      if there are _Lxx/_Exx methods associated with them.  However, it is
      both costly and unnecessary, because the host OS has to execute the
      _PRW methods anyway to check which devices can wake up the system
      from sleep states.  Moreover, it then uses full information
      returned by _PRW, including the GPE information, so it can take care
      of disabling the GPEs if necessary.
      
      Remove the code that walks the namespace and executes _PRW from
      ACPICA and modify comments to reflect that change.  Make
      acpi_bus_set_run_wake_flags() disable GPEs for wakeup devices
      so that they don't cause spurious wakeup events to be signaled.
      This not only reduces the complexity of the ACPICA initialization
      code, but in some cases it should reduce the kernel boot time as
      well.
      
      Unfortunately, for this purpose we need a new ACPICA function,
      acpi_gpe_can_wake(), to be called by the host OS in order to disable
      the GPEs that can wake up the system and were previously enabled by
      acpi_ev_initialize_gpe_block() or acpi_ev_update_gpes() (such a GPE
      should be disabled only once, because the initialization code enables
      it only once, but it may be pointed to by _PRW for multiple devices
      and that's why the additional function is necessary).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      9874647b
  4. 07 7月, 2010 16 次提交
  5. 29 6月, 2010 1 次提交
  6. 12 6月, 2010 7 次提交
  7. 12 5月, 2010 1 次提交
    • L
      ACPICA: simplify SCI_EN workaround · b430acbd
      Len Brown 提交于
      acpi_hw_set_mode() double checks its effectiveness
      by calling acpi_hw_get_mode() -- polling up to 3 seconds.
      
      It would be more logical for its caller, acpi_enable()
      acpi_enable() to do the double-checking.  (lets assume
      that acpi_disable() isn't interesting)
      
      The ACPI specification is unclear on this point.
      Some parts say that the BIOS sets SCI_EN and then returns to the OS,
      but one part says "OSPM polls the SCI_EN bit until it is sampled SET".
      
      The systems I have on hand do the former,
      SCI_EN is observed to be set upon return from the BIOS.
      
      So we move the check up out of acpi_hw_set_mode()
      up into acpi_enable() where it makes logical sense.
      
      Then we replace the 3-second polling loop
      with a single check.  If this check fails, we'll see:
      
      	"Hardware did not enter ACPI mode"
      
      and the system will bail out of ACPI initialization
      and likely fail to boot.  If we see that in practice,
      we can restore the polling, but put it into acpi_enable.
      
      This patch is important if acpi_enable() is used in
      the resume from S3 path.  Many systems today are seen
      coming back from S3 with SCI_EN off, and then failing
      to set SCI_EN in response to acpi_enable().  Those systems
      will take 3 seconds longer to resume due to this loop.
      
      However, it is possible that we will not use acpi_enable()
      in the S3 resume path, and bang SCI_EN directly, which
      would make the loop harmless, as it would be invisible
      to all systems except those that need it.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      b430acbd
  8. 06 5月, 2010 5 次提交
  9. 20 4月, 2010 5 次提交