Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 770824bd authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Linus Torvalds
Browse files

PM: Split up sysdev_[suspend|resume] from device_power_[down|up]



Move the sysdev_suspend/resume from the callee to the callers, with
no real change in semantics, so that we can rework the disabling of
interrupts during suspend/hibernation.

This is based on an earlier patch from Linus.

Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 936577c6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1192,6 +1192,7 @@ static int suspend(int vetoable)
	device_suspend(PMSG_SUSPEND);
	local_irq_disable();
	device_power_down(PMSG_SUSPEND);
	sysdev_suspend(PMSG_SUSPEND);

	local_irq_enable();

@@ -1208,6 +1209,7 @@ static int suspend(int vetoable)
	if (err != APM_SUCCESS)
		apm_error("suspend", err);
	err = (err == APM_SUCCESS) ? 0 : -EIO;
	sysdev_resume();
	device_power_up(PMSG_RESUME);
	local_irq_enable();
	device_resume(PMSG_RESUME);
@@ -1228,6 +1230,7 @@ static void standby(void)

	local_irq_disable();
	device_power_down(PMSG_SUSPEND);
	sysdev_suspend(PMSG_SUSPEND);
	local_irq_enable();

	err = set_system_power_state(APM_STATE_STANDBY);
@@ -1235,6 +1238,7 @@ static void standby(void)
		apm_error("standby", err);

	local_irq_disable();
	sysdev_resume();
	device_power_up(PMSG_RESUME);
	local_irq_enable();
}
+0 −2
Original line number Diff line number Diff line
@@ -88,8 +88,6 @@ extern void driver_detach(struct device_driver *drv);
extern int driver_probe_device(struct device_driver *drv, struct device *dev);

extern void sysdev_shutdown(void);
extern int sysdev_suspend(pm_message_t state);
extern int sysdev_resume(void);

extern char *make_class_name(const char *name, struct kobject *kobj);

+0 −3
Original line number Diff line number Diff line
@@ -333,7 +333,6 @@ static void dpm_power_up(pm_message_t state)
 */
void device_power_up(pm_message_t state)
{
	sysdev_resume();
	dpm_power_up(state);
}
EXPORT_SYMBOL_GPL(device_power_up);
@@ -577,8 +576,6 @@ int device_power_down(pm_message_t state)
		}
		dev->power.status = DPM_OFF_IRQ;
	}
	if (!error)
		error = sysdev_suspend(state);
	if (error)
		dpm_power_up(resume_event(state));
	return error;
+8 −0
Original line number Diff line number Diff line
@@ -45,6 +45,13 @@ static int xen_suspend(void *data)
		       err);
		return err;
	}
	err = sysdev_suspend(PMSG_SUSPEND);
	if (err) {
		printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n",
			err);
		device_power_up(PMSG_RESUME);
		return err;
	}

	xen_mm_pin_all();
	gnttab_suspend();
@@ -61,6 +68,7 @@ static int xen_suspend(void *data)
	gnttab_resume();
	xen_mm_unpin_all();

	sysdev_resume();
	device_power_up(PMSG_RESUME);

	if (!*cancelled) {
+2 −0
Original line number Diff line number Diff line
@@ -381,10 +381,12 @@ struct dev_pm_info {

#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(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(pm_message_t state);
extern int device_prepare_suspend(pm_message_t state);
Loading