1. 13 7月, 2011 3 次提交
  2. 12 7月, 2011 1 次提交
  3. 09 7月, 2011 1 次提交
  4. 06 7月, 2011 5 次提交
    • A
      PM / Runtime: Prevent runtime_resume from racing with probe · 69c843b4
      Alan Stern 提交于
      This patch (as1475) adds device_lock() and device_unlock() calls to
      the store methods for the power/control and power/autosuspend_delay_ms
      sysfs attribute files.  We don't want badly timed writes to these
      files to cause runtime_resume callbacks to occur while a driver is
      being probed for a device.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      69c843b4
    • R
      PM / Runtime: Replace "run-time" with "runtime" in documentation · 62052ab1
      Rafael J. Wysocki 提交于
      The runtime PM documentation and kerneldoc comments sometimes spell
      "runtime" with a dash (i.e. "run-time").  Replace all of those
      instances with "runtime" to make the naming consistent.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      62052ab1
    • R
      PM / Runtime: Improve documentation of enable, disable and barrier · e358bad7
      Rafael J. Wysocki 提交于
      The runtime PM documentation in Documentation/power/runtime_pm.txt
      doesn't say that pm_runtime_enable() and pm_runtime_disable() work by
      operating on power.disable_depth, which is wrong, because the
      possibility of nesting disables doesn't follow from the description
      of these functions.  Also, there is no description of
      pm_runtime_barrier() at all in the document, which is confusing.
      Improve the documentation by fixing those issues.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      e358bad7
    • R
      PM: Limit race conditions between runtime PM and system sleep (v2) · 1e2ef05b
      Rafael J. Wysocki 提交于
      One of the roles of the PM core is to prevent different PM callbacks
      executed for the same device object from racing with each other.
      Unfortunately, after commit e8665002
      (PM: Allow pm_runtime_suspend() to succeed during system suspend)
      runtime PM callbacks may be executed concurrently with system
      suspend/resume callbacks for the same device.
      
      The main reason for commit e8665002
      was that some subsystems and device drivers wanted to use runtime PM
      helpers, pm_runtime_suspend() and pm_runtime_put_sync() in
      particular, for carrying out the suspend of devices in their
      .suspend() callbacks.  However, as it's been determined recently,
      there are multiple reasons not to do so, inlcuding:
      
       * The caller really doesn't control the runtime PM usage counters,
         because user space can access them through sysfs and effectively
         block runtime PM.  That means using pm_runtime_suspend() or
         pm_runtime_get_sync() to suspend devices during system suspend
         may or may not work.
      
       * If a driver calls pm_runtime_suspend() from its .suspend()
         callback, it causes the subsystem's .runtime_suspend() callback to
         be executed, which leads to the call sequence:
      
         subsys->suspend(dev)
            driver->suspend(dev)
               pm_runtime_suspend(dev)
                  subsys->runtime_suspend(dev)
      
         recursive from the subsystem's point of view.  For some subsystems
         that may actually work (e.g. the platform bus type), but for some
         it will fail in a rather spectacular fashion (e.g. PCI).  In each
         case it means a layering violation.
      
       * Both the subsystem and the driver can provide .suspend_noirq()
         callbacks for system suspend that can do whatever the
         .runtime_suspend() callbacks do just fine, so it really isn't
         necessary to call pm_runtime_suspend() during system suspend.
      
       * The runtime PM's handling of wakeup devices is usually different
         from the system suspend's one, so .runtime_suspend() may simply be
         inappropriate for system suspend.
      
       * System suspend is supposed to work even if CONFIG_PM_RUNTIME is
         unset.
      
       * The runtime PM workqueue is frozen before system suspend, so if
         whatever the driver is going to do during system suspend depends
         on it, that simply won't work.
      
      Still, there is a good reason to allow pm_runtime_resume() to
      succeed during system suspend and resume (for instance, some
      subsystems and device drivers may legitimately use it to ensure that
      their devices are in full-power states before suspending them).
      Moreover, there is no reason to prevent runtime PM callbacks from
      being executed in parallel with the system suspend/resume .prepare()
      and .complete() callbacks and the code removed by commit
      e8665002 went too far in this
      respect.  On the other hand, runtime PM callbacks, including
      .runtime_resume(), must not be executed during system suspend's
      "late" stage of suspending devices and during system resume's "early"
      device resume stage.
      
      Taking all of the above into consideration, make the PM core
      acquire a runtime PM reference to every device and resume it if
      there's a runtime PM resume request pending right before executing
      the subsystem-level .suspend() callback for it.  Make the PM core
      drop references to all devices right after executing the
      subsystem-level .resume() callbacks for them.  Additionally,
      make the PM core disable the runtime PM framework for all devices
      during system suspend, after executing the subsystem-level .suspend()
      callbacks for them, and enable the runtime PM framework for all
      devices during system resume, right before executing the
      subsystem-level .resume() callbacks for them.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NKevin Hilman <khilman@ti.com>
      1e2ef05b
    • R
      PCI / PM: Detect early wakeup in pci_pm_prepare() · eea3fc03
      Rafael J. Wysocki 提交于
      A subsequent patch is going to move the invocation of
      pm_runtime_barrier() from dpm_prepare() to __device_suspend().
      Consequently, early wakeup events resulting from runtime resume
      requests for wakeup devices queued up right before system suspend
      will only be detected after all of the subsystem-level .prepare()
      callbacks have run.  However, the PCI bus type calls
      pm_runtime_get_sync() from its pci_pm_prepare() callback routine,
      so it would destroy the early wakeup events information regarding PCI
      devices.  To prevent this from happening add an early wakeup
      detection mechanism, analogous to the one currently in dpm_prepare(),
      to pci_pm_prepare().
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      eea3fc03
  5. 02 7月, 2011 22 次提交
  6. 01 7月, 2011 7 次提交
  7. 30 6月, 2011 1 次提交
    • K
      xen/pci: Use the INT_SRC_OVR IRQ (instead of GSI) to preset the ACPI SCI IRQ. · 155a16f2
      Konrad Rzeszutek Wilk 提交于
      In the past we would use the GSI value to preset the ACPI SCI
      IRQ which worked great as GSI == IRQ:
      
      ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
      
      While that is most often seen, there are some oddities:
      
      ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 20 low level)
      
      which means that GSI 20 (or pin 20) is to be overriden for IRQ 9.
      Our code that presets the interrupt for ACPI SCI however would
      use the GSI 20 instead of IRQ 9 ending up with:
      
      xen: sci override: global_irq=20 trigger=0 polarity=1
      xen: registering gsi 20 triggering 0 polarity 1
      xen: --> pirq=20 -> irq=20
      xen: acpi sci 20
      .. snip..
      calling  acpi_init+0x0/0xbc @ 1
      ACPI: SCI (IRQ9) allocation failed
      ACPI Exception: AE_NOT_ACQUIRED, Unable to install System Control Interrupt handler (20110413/evevent-119)
      ACPI: Unable to start the ACPI Interpreter
      
      as the ACPI interpreter made a call to 'acpi_gsi_to_irq' which got nine.
      It used that value to request an IRQ (request_irq) and since that was not
      present it failed.
      
      The fix is to recognize that for interrupts that are overriden (in our
      case we only care about the ACPI SCI) we should use the IRQ number
      to present the IRQ instead of the using GSI. End result is that we get:
      
      xen: sci override: global_irq=20 trigger=0 polarity=1
      xen: registering gsi 20 triggering 0 polarity 1
      xen: --> pirq=20 -> irq=9 (gsi=9)
      xen: acpi sci 9
      
      which fixes the ACPI interpreter failing on startup.
      
      CC: stable@kernel.org
      Reported-by: NLiwei <xieliwei@gmail.com>
      Tested-by: NLiwei <xieliwei@gmail.com>
      [http://lists.xensource.com/archives/html/xen-devel/2011-06/msg01727.html]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      155a16f2