1. 08 7月, 2008 6 次提交
    • R
      PCI ACPI: Rework PCI handling of wake-up · eb9d0fe4
      Rafael J. Wysocki 提交于
      * Introduce function acpi_pm_device_sleep_wake() for enabling and
        disabling the system wake-up capability of devices that are power
        manageable by ACPI.
      
      * Introduce function acpi_bus_can_wakeup() allowing other (dependent)
        subsystems to check if ACPI is able to enable the system wake-up
        capability of given device.
      
      * Introduce callback .sleep_wake() in struct pci_platform_pm_ops and
        for the ACPI PCI 'driver' make it use acpi_pm_device_sleep_wake().
      
      * Introduce callback .can_wakeup() in struct pci_platform_pm_ops and
        for the ACPI 'driver' make it use acpi_bus_can_wakeup().
      
      * Move the PME# handlig code out of pci_enable_wake() and split it
        into two functions, pci_pme_capable() and pci_pme_active(),
        allowing the caller to check if given device is capable of
        generating PME# from given power state and to enable/disable the
        device's PME# functionality, respectively.
      
      * Modify pci_enable_wake() to use the new ACPI callbacks and the new
        PME#-related functions.
      
      * Drop the generic .platform_enable_wakeup() callback that is not
        used any more.
      
      * Introduce device_set_wakeup_capable() that will set the
        power.can_wakeup flag of given device.
      
      * Rework PCI device PM initialization so that, if given device is
        capable of generating wake-up events, either natively through the
        PME# mechanism, or with the help of the platform, its
        power.can_wakeup flag is set and its power.should_wakeup flag is
        unset as appropriate.
      
      * Make ACPI set the power.can_wakeup flag for devices found to be
        wake-up capable by it.
      
      * Make the ACPI wake-up code enable/disable GPEs for devices that
        have the wakeup.flags.prepared flag set (which means that their
        wake-up power has been enabled).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      eb9d0fe4
    • R
      ACPI: Introduce new device wakeup flag 'prepared' · 0af4b8c4
      Rafael J. Wysocki 提交于
      Introduce additional flag 'prepared' in struct acpi_device_wakeup_flags
      and use it to prevent devices from being enable/disabled do wake up the
      system multiple times in a row (this does not happen currently, but will
      be possible after some of the following patches).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      0af4b8c4
    • R
      ACPI: Introduce acpi_device_sleep_wake function · 77e76609
      Rafael J. Wysocki 提交于
      The currect ACPI code attempts to execute _PSW at three different
      places and in one of them only it tries to execute _DSW before _PSW,
      which is inconsistent with the other two cases.
      
      Move the execution of _DSW and _PSW into a separate function called
      acpi_device_sleep_wake() and call it wherever appropriate instead of
      executing _DSW and/or _PSW directly.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@suse.cz>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      77e76609
    • R
      PCI: rework pci_set_power_state function to call platform first · 44e4e66e
      Rafael J. Wysocki 提交于
      Rework pci_set_power_state() so that the platform callback is
      invoked before the native mechanism, if necessary.  Also, make
      the function check if the device is power manageable by the
      platform before invoking the platform callback.
      
      This may matter if the device dependent on additional power
      resources controlled by the platform is being put into D0, in which
      case those power resources must be turned on before we attempt to
      handle the device itself.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@suse.cz>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      44e4e66e
    • R
      PCI: Introduce platform_pci_power_manageable function · 961d9120
      Rafael J. Wysocki 提交于
      Introduce function pointer platform_pci_power_manageable to be used
      by the platform-related code to point to a function allowing us to
      check if given device is power manageable by the platform.
      
      Introduce acpi_pci_power_manageable() playing that role for ACPI.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      961d9120
    • R
      ACPI: Introduce acpi_bus_power_manageable function · 3737b2b1
      Rafael J. Wysocki 提交于
      Introduce function acpi_bus_power_manageable() allowing other
      (dependent) subsystems to check if ACPI is able to power manage given
      device.  This may be useful, for example, for PCI device power
      management.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@suse.cz>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      3737b2b1
  2. 04 7月, 2008 1 次提交
  3. 28 6月, 2008 4 次提交
    • D
      PCI: fix pci_setup_device()'s sprinting into a const buffer · 8b285ce8
      David Howells 提交于
      Make pci_setup_device() write the bus ID directly into the allotted storage,
      rather than using pci_name() as the address as that now returns a const
      pointer.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      8b285ce8
    • K
      pciehp: use get_service_data · b9708940
      Kenji Kaneshige 提交于
      Current pciehp driver saves its private data pointer into pci_dev
      structure using pci_set_drvdata()/pci_get_drvdata(). But because
      pciehp is not a pci device driver but a PCI Express service driver, it
      should save its private data pointer into pcie_device structure using
      set_service_data()/get_service_data().
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b9708940
    • K
      pciehp: remove needless command completed interrupt setting · 3aa50c44
      Kenji Kaneshige 提交于
      Currently, pciehp driver enables command completed interrupt as follows.
      
      (1) Don't enable at initialization.
      (2) Enable command completed interrupt whenever pciehp issues a
          command, if the command doesn't attempt to disable the interrupt.
      (3) Disable command completed interrupt at driver unloading.
      
      Once we enable command completed interrupt, we don't need to re-enable
      it for every command. So we can simplify above steps as follows:
      
      (1) Enable command completed interrupt at initialization.
      (2) No special sequence for command completed interrupt.
      (3) Disable command completed interrupt at driver unloading.
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      3aa50c44
    • K
      pciehp: fix interrupt initialization · c4635eb0
      Kenji Kaneshige 提交于
      Current pciehp driver's intialization sequence is as follows:
      
      (1) initialize controller data structure
      (2) install interrupt handler
      (3) enable software notification
      (4) initialize controller specific slot data structure
      (5) initialize generic slot data structure and register it to pci hotplug core
      
      The interrupt handler of pciehp assumes that controller specific slot
      data structure is already initialized. However, it is installed at (2)
      before initializing controller specific slot data structure at
      (4). Because of this, pciehp driver cannot handle the following cases
      properly.
      
      - If devices that shares IRQ with pciehp raise interrupts between (2) and (4).
      - If hotplug events (e.g. MRL open) happen between (3) and (4).
      
      We already have a workaround for this problem ("pciehp: fix NULL
      dereference in interrupt handler: dbd79aed).
      But we still need fundamental fix.
      
      This patch fix the problem by changing the initilization sequence as follows:
      
      (1) initialize controller data structure
      (2) initialize controller specific slot data structure
      (3) install interrupt handler
      (4) enable software notification
      (5) initialize generic slot data structure and register it to pci hotplug core
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Acked-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      c4635eb0
  4. 26 6月, 2008 10 次提交
  5. 13 6月, 2008 1 次提交
    • R
      Suspend-related patches for 2.6.27 · d8f3de0d
      Rafael J. Wysocki 提交于
      ACPI PM: Add possibility to change suspend sequence
      
      There are some systems out there that don't work correctly with
      our current suspend/hibernation code ordering.  Provide a workaround
      for these systems allowing them to pass 'acpi_sleep=old_ordering' in
      the kernel command line so that it will use the pre-ACPI 2.0 ("old")
      suspend code ordering.
      
      Unfortunately, this requires us to add a platform hook to the
      resuming of devices for recovering the platform in case one of the
      device drivers' .suspend() routines returns error code.  Namely,
      ACPI 1.0 specifies that _PTS should be called before suspending
      devices, but _WAK still should be called before resuming them in
      order to undo the changes made by _PTS.  However, if there is an
      error during suspending devices, they are automatically resumed
      without returning control to the PM core, so the _WAK has to be
      called from within device_resume() in that cases.
      
      The patch also reorders and refactors the ACPI suspend/hibernation
      code to avoid duplication as far as reasonably possible.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@suse.cz>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      d8f3de0d
  6. 12 6月, 2008 3 次提交
  7. 11 6月, 2008 15 次提交