device_suspend(PMSG_SUSPEND);
- device_power_down(PMSG_SUSPEND);
+ device_suspend_noirq(PMSG_SUSPEND);
local_irq_disable();
sysdev_suspend(PMSG_SUSPEND);
sysdev_resume();
local_irq_enable();
- device_power_up(PMSG_RESUME);
+ device_resume_noirq(PMSG_RESUME);
device_resume(PMSG_RESUME);
queue_event(APM_NORMAL_RESUME, NULL);
{
int err;
- device_power_down(PMSG_SUSPEND);
+ device_suspend_noirq(PMSG_SUSPEND);
local_irq_disable();
sysdev_suspend(PMSG_SUSPEND);
sysdev_resume();
local_irq_enable();
- device_power_up(PMSG_RESUME);
+ device_resume_noirq(PMSG_RESUME);
}
static apm_event_t get_event(void)
/*------------------------- Resume routines -------------------------*/
/**
- * resume_device_noirq - Power on one device (early resume).
+ * __device_resume_noirq - Power on one device (early resume).
* @dev: Device.
* @state: PM transition of the system being carried out.
*
* Must be called with interrupts disabled.
*/
-static int resume_device_noirq(struct device *dev, pm_message_t state)
+static int __device_resume_noirq(struct device *dev, pm_message_t state)
{
int error = 0;
int error;
dev->power.status = DPM_OFF;
- error = resume_device_noirq(dev, state);
+ error = __device_resume_noirq(dev, state);
if (error)
pm_dev_err(dev, state, " early", error);
}
}
/**
- * device_power_up - Turn on all devices that need special attention.
+ * device_resume_noirq - Turn on all devices that need special attention.
* @state: PM transition of the system being carried out.
*
* Call the "early" resume handlers and enable device drivers to receive
* interrupts.
*/
-void device_power_up(pm_message_t state)
+void device_resume_noirq(pm_message_t state)
{
dpm_power_up(state);
resume_device_irqs();
}
-EXPORT_SYMBOL_GPL(device_power_up);
+EXPORT_SYMBOL_GPL(device_resume_noirq);
/**
* resume_device - Restore state for one device.
}
/**
- * suspend_device_noirq - Shut down one device (late suspend).
+ * __device_suspend_noirq - Shut down one device (late suspend).
* @dev: Device.
* @state: PM transition of the system being carried out.
*
* This is called with interrupts off and only a single CPU running.
*/
-static int suspend_device_noirq(struct device *dev, pm_message_t state)
+static int __device_suspend_noirq(struct device *dev, pm_message_t state)
{
int error = 0;
}
/**
- * device_power_down - Shut down special devices.
+ * device_suspend_noirq - Shut down special devices.
* @state: PM transition of the system being carried out.
*
* Prevent device drivers from receiving interrupts and call the "late"
*
* Must be called under dpm_list_mtx.
*/
-int device_power_down(pm_message_t state)
+int device_suspend_noirq(pm_message_t state)
{
struct device *dev;
int error = 0;
suspend_device_irqs();
mutex_lock(&dpm_list_mtx);
list_for_each_entry_reverse(dev, &dpm_list, power.entry) {
- error = suspend_device_noirq(dev, state);
+ error = __device_suspend_noirq(dev, state);
if (error) {
pm_dev_err(dev, state, " late", error);
break;
}
mutex_unlock(&dpm_list_mtx);
if (error)
- device_power_up(resume_event(state));
+ device_resume_noirq(resume_event(state));
return error;
}
-EXPORT_SYMBOL_GPL(device_power_down);
+EXPORT_SYMBOL_GPL(device_suspend_noirq);
/**
* suspend_device - Save state of one device.
if (err) {
printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n",
err);
- device_power_up(PMSG_RESUME);
+ device_resume_noirq(PMSG_RESUME);
return err;
}
}
sysdev_resume();
- device_power_up(PMSG_RESUME);
+ device_resume_noirq(PMSG_RESUME);
return 0;
}
printk(KERN_DEBUG "suspending xenstore...\n");
xs_suspend();
- err = device_power_down(PMSG_SUSPEND);
+ err = device_suspend_noirq(PMSG_SUSPEND);
if (err) {
- printk(KERN_ERR "device_power_down failed: %d\n", err);
+ printk(KERN_ERR "device_suspend_noirq failed: %d\n", err);
goto resume_devices;
}
} else
xs_suspend_cancel();
- device_power_up(PMSG_RESUME);
+ device_resume_noirq(PMSG_RESUME);
resume_devices:
device_resume(PMSG_RESUME);
#ifdef CONFIG_PM_SLEEP
extern void device_pm_lock(void);
extern int sysdev_resume(void);
-extern void device_power_up(pm_message_t state);
+extern void device_resume_noirq(pm_message_t state);
extern void device_resume(pm_message_t state);
extern void device_pm_unlock(void);
extern int sysdev_suspend(pm_message_t state);
-extern int device_power_down(pm_message_t state);
+extern int device_suspend_noirq(pm_message_t state);
extern int device_suspend(pm_message_t state);
extern int device_prepare_suspend(pm_message_t state);
if (error)
goto Resume_console;
/* At this point, device_suspend() has been called,
- * but *not* device_power_down(). We *must*
- * device_power_down() now. Otherwise, drivers for
+ * but *not* device_suspend_noirq(). We *must* call
+ * device_suspend_noirq() now. Otherwise, drivers for
* some devices (e.g. interrupt controllers) become
* desynchronized with the actual state of the
* hardware at resume time, and evil weirdness ensues.
*/
- error = device_power_down(PMSG_FREEZE);
+ error = device_suspend_noirq(PMSG_FREEZE);
if (error)
goto Resume_devices;
error = disable_nonboot_cpus();
local_irq_enable();
Enable_cpus:
enable_nonboot_cpus();
- device_power_up(PMSG_RESTORE);
+ device_resume_noirq(PMSG_RESTORE);
Resume_devices:
device_resume(PMSG_RESTORE);
Resume_console:
return error;
/* At this point, device_suspend() has been called, but *not*
- * device_power_down(). We *must* call device_power_down() now.
+ * device_suspend_noirq(). We *must* call device_suspend_noirq() now.
* Otherwise, drivers for some devices (e.g. interrupt controllers)
* become desynchronized with the actual state of the hardware
* at resume time, and evil weirdness ensues.
*/
- error = device_power_down(PMSG_FREEZE);
+ error = device_suspend_noirq(PMSG_FREEZE);
if (error) {
printk(KERN_ERR "PM: Some devices failed to power down, "
"aborting hibernation\n");
Power_up:
sysdev_resume();
- /* NOTE: device_power_up() is just a resume() for devices
+ /* NOTE: device_resume_noirq() is just a resume() for devices
* that suspended with irqs off ... no overall powerup.
*/
Platform_finish:
platform_finish(platform_mode);
- device_power_up(in_suspend ?
+ device_resume_noirq(in_suspend ?
(error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
return error;
{
int error;
- error = device_power_down(PMSG_QUIESCE);
+ error = device_suspend_noirq(PMSG_QUIESCE);
if (error) {
printk(KERN_ERR "PM: Some devices failed to power down, "
"aborting resume\n");
Cleanup:
platform_restore_cleanup(platform_mode);
- device_power_up(PMSG_RECOVER);
+ device_resume_noirq(PMSG_RECOVER);
return error;
}
goto Resume_devices;
}
- error = device_power_down(PMSG_HIBERNATE);
+ error = device_suspend_noirq(PMSG_HIBERNATE);
if (error)
goto Resume_devices;
Platofrm_finish:
hibernation_ops->finish();
- device_power_up(PMSG_RESTORE);
+ device_suspend_noirq(PMSG_RESTORE);
Resume_devices:
entering_platform_hibernation = false;
return error;
}
- error = device_power_down(PMSG_SUSPEND);
+ error = device_suspend_noirq(PMSG_SUSPEND);
if (error) {
printk(KERN_ERR "PM: Some devices failed to power down\n");
goto Platfrom_finish;
suspend_ops->wake();
Power_up_devices:
- device_power_up(PMSG_RESUME);
+ device_resume_noirq(PMSG_RESUME);
Platfrom_finish:
if (suspend_ops->finish)