• Patrick Mochel's avatar
    [power] Improve device suspend/resume sequence. · 9c823fa4
    Patrick Mochel authored
    - Split calls into 
      - device_pm_suspend() [ Saving device state. ]
      - device_pm_power_down() [ Powering devices down. ]
      - device_pm_power_up() [ Powering devices up. ]
      - device_pm_resume() [ Restoring device state. ]
    
    - Walk local dpm_active list when suspending devices, and move devices to 
      dpm_suspended list when ->suspend() is called. 
    - Walk dpm_suspended list to power down devices (with interrrupts enabled.)
      - Try to power down devices with IRQs on. 
      - If they succeed, move them to dpm_off list.
      - If they return -EAGAIN, move them to dpm_off_irq list. 
    - Disable interrupts and suspend devices needed interrupts off. 
    
    - Do converse on resume 
      - power on devices that need interrupts off and move them to 
        dpm_suspended.
      - Enable interrupts.
      - Power on all other devices and move them to dpm_suspended.
      - Restore state of all devices and move them to dpm_active. 
    9c823fa4
main.c 1.81 KB