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

Commit 6a454f71 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6

* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: (33 commits)
  [S390] s390: hibernation support for s390
  [S390] pm: dcssblk power management callbacks.
  [S390] pm: monreader power management callbacks.
  [S390] pm: monwriter power management callbacks.
  [S390] pm: memory hotplug power management callbacks
  [S390] pm: con3270 power management callbacks.
  [S390] pm: smsgiucv power management callbacks.
  [S390] pm: hvc_iucv power management callbacks
  [S390] PM: af_iucv power management callbacks.
  [S390] pm: netiucv power management callbacks.
  [S390] pm: iucv power management callbacks.
  [S390] iucv: establish reboot notifier
  [S390] pm: power management support for SCLP drivers.
  [S390] pm: tape power management callbacks
  [S390] pm: vmlogrdr power management callbacks
  [S390] pm: vmur driver power management callbacks
  [S390] pm: appldata power management callbacks
  [S390] pm: vmwatchdog power management callbacks.
  [S390] pm: zfcp driver power management callbacks
  [S390] pm: claw driver power management callbacks
  ...
parents d613839e 155af2f9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -348,6 +348,9 @@ config ARCH_ENABLE_MEMORY_HOTPLUG
config ARCH_ENABLE_MEMORY_HOTREMOVE
	def_bool y

config ARCH_HIBERNATION_POSSIBLE
       def_bool y if 64BIT

source "mm/Kconfig"

comment "I/O subsystem configuration"
@@ -592,6 +595,12 @@ config SECCOMP

endmenu

menu "Power Management"

source "kernel/power/Kconfig"

endmenu

source "net/Kconfig"

config PCMCIA
+3 −1
Original line number Diff line number Diff line
@@ -88,7 +88,9 @@ LDFLAGS_vmlinux := -e start
head-y		:= arch/s390/kernel/head.o arch/s390/kernel/init_task.o

core-y		+= arch/s390/mm/ arch/s390/kernel/ arch/s390/crypto/ \
		   arch/s390/appldata/ arch/s390/hypfs/ arch/s390/kvm/
		   arch/s390/appldata/ arch/s390/hypfs/ arch/s390/kvm/ \
		   arch/s390/power/

libs-y		+= arch/s390/lib/
drivers-y	+= drivers/s390/
drivers-$(CONFIG_MATHEMU) += arch/s390/math-emu/
+115 −4
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 * Exports appldata_register_ops() and appldata_unregister_ops() for the
 * data gathering modules.
 *
 * Copyright IBM Corp. 2003, 2008
 * Copyright IBM Corp. 2003, 2009
 *
 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
 */
@@ -26,6 +26,8 @@
#include <linux/notifier.h>
#include <linux/cpu.h>
#include <linux/workqueue.h>
#include <linux/suspend.h>
#include <linux/platform_device.h>
#include <asm/appldata.h>
#include <asm/timer.h>
#include <asm/uaccess.h>
@@ -41,6 +43,9 @@

#define TOD_MICRO	0x01000			/* nr. of TOD clock units
						   for 1 microsecond */

static struct platform_device *appldata_pdev;

/*
 * /proc entries (sysctl)
 */
@@ -86,6 +91,7 @@ static atomic_t appldata_expire_count = ATOMIC_INIT(0);
static DEFINE_SPINLOCK(appldata_timer_lock);
static int appldata_interval = APPLDATA_CPU_INTERVAL;
static int appldata_timer_active;
static int appldata_timer_suspended = 0;

/*
 * Work queue
@@ -475,6 +481,93 @@ void appldata_unregister_ops(struct appldata_ops *ops)
/********************** module-ops management <END> **************************/


/**************************** suspend / resume *******************************/
static int appldata_freeze(struct device *dev)
{
	struct appldata_ops *ops;
	int rc;
	struct list_head *lh;

	get_online_cpus();
	spin_lock(&appldata_timer_lock);
	if (appldata_timer_active) {
		__appldata_vtimer_setup(APPLDATA_DEL_TIMER);
		appldata_timer_suspended = 1;
	}
	spin_unlock(&appldata_timer_lock);
	put_online_cpus();

	mutex_lock(&appldata_ops_mutex);
	list_for_each(lh, &appldata_ops_list) {
		ops = list_entry(lh, struct appldata_ops, list);
		if (ops->active == 1) {
			rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
					(unsigned long) ops->data, ops->size,
					ops->mod_lvl);
			if (rc != 0)
				pr_err("Stopping the data collection for %s "
				       "failed with rc=%d\n", ops->name, rc);
		}
	}
	mutex_unlock(&appldata_ops_mutex);
	return 0;
}

static int appldata_restore(struct device *dev)
{
	struct appldata_ops *ops;
	int rc;
	struct list_head *lh;

	get_online_cpus();
	spin_lock(&appldata_timer_lock);
	if (appldata_timer_suspended) {
		__appldata_vtimer_setup(APPLDATA_ADD_TIMER);
		appldata_timer_suspended = 0;
	}
	spin_unlock(&appldata_timer_lock);
	put_online_cpus();

	mutex_lock(&appldata_ops_mutex);
	list_for_each(lh, &appldata_ops_list) {
		ops = list_entry(lh, struct appldata_ops, list);
		if (ops->active == 1) {
			ops->callback(ops->data);	// init record
			rc = appldata_diag(ops->record_nr,
					APPLDATA_START_INTERVAL_REC,
					(unsigned long) ops->data, ops->size,
					ops->mod_lvl);
			if (rc != 0) {
				pr_err("Starting the data collection for %s "
				       "failed with rc=%d\n", ops->name, rc);
			}
		}
	}
	mutex_unlock(&appldata_ops_mutex);
	return 0;
}

static int appldata_thaw(struct device *dev)
{
	return appldata_restore(dev);
}

static struct dev_pm_ops appldata_pm_ops = {
	.freeze		= appldata_freeze,
	.thaw		= appldata_thaw,
	.restore	= appldata_restore,
};

static struct platform_driver appldata_pdrv = {
	.driver = {
		.name	= "appldata",
		.owner	= THIS_MODULE,
		.pm	= &appldata_pm_ops,
	},
};
/************************* suspend / resume <END> ****************************/


/******************************* init / exit *********************************/

static void __cpuinit appldata_online_cpu(int cpu)
@@ -531,11 +624,23 @@ static struct notifier_block __cpuinitdata appldata_nb = {
 */
static int __init appldata_init(void)
{
	int i;
	int i, rc;

	rc = platform_driver_register(&appldata_pdrv);
	if (rc)
		return rc;

	appldata_pdev = platform_device_register_simple("appldata", -1, NULL,
							0);
	if (IS_ERR(appldata_pdev)) {
		rc = PTR_ERR(appldata_pdev);
		goto out_driver;
	}
	appldata_wq = create_singlethread_workqueue("appldata");
	if (!appldata_wq)
		return -ENOMEM;
	if (!appldata_wq) {
		rc = -ENOMEM;
		goto out_device;
	}

	get_online_cpus();
	for_each_online_cpu(i)
@@ -547,6 +652,12 @@ static int __init appldata_init(void)

	appldata_sysctl_header = register_sysctl_table(appldata_dir_table);
	return 0;

out_device:
	platform_device_unregister(appldata_pdev);
out_driver:
	platform_driver_unregister(&appldata_pdrv);
	return rc;
}

__initcall(appldata_init);
+14 −5
Original line number Diff line number Diff line
/*
 *  include/asm-s390/ccwdev.h
 *  include/asm-s390x/ccwdev.h
 * Copyright  IBM Corp. 2002, 2009
 *
 *    Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, IBM Corporation
 * Author(s): Arnd Bergmann <arndb@de.ibm.com>
 *
 * Interface for CCW device drivers
@@ -104,6 +102,11 @@ struct ccw_device {
 * @set_offline: called when setting device offline
 * @notify: notify driver of device state changes
 * @shutdown: called at device shutdown
 * @prepare: prepare for pm state transition
 * @complete: undo work done in @prepare
 * @freeze: callback for freezing during hibernation snapshotting
 * @thaw: undo work done in @freeze
 * @restore: callback for restoring after hibernation
 * @driver: embedded device driver structure
 * @name: device driver name
 */
@@ -116,6 +119,11 @@ struct ccw_driver {
	int (*set_offline) (struct ccw_device *);
	int (*notify) (struct ccw_device *, int);
	void (*shutdown) (struct ccw_device *);
	int (*prepare) (struct ccw_device *);
	void (*complete) (struct ccw_device *);
	int (*freeze)(struct ccw_device *);
	int (*thaw) (struct ccw_device *);
	int (*restore)(struct ccw_device *);
	struct device_driver driver;
	char *name;
};
@@ -184,6 +192,7 @@ extern void ccw_device_get_id(struct ccw_device *, struct ccw_dev_id *);
#define to_ccwdrv(n) container_of(n, struct ccw_driver, driver)

extern struct ccw_device *ccw_device_probe_console(void);
extern int ccw_device_force_console(void);

// FIXME: these have to go
extern int _ccw_device_get_subchannel_number(struct ccw_device *);
+10 −0
Original line number Diff line number Diff line
@@ -38,6 +38,11 @@ struct ccwgroup_device {
 * @set_online: function called when device is set online
 * @set_offline: function called when device is set offline
 * @shutdown: function called when device is shut down
 * @prepare: prepare for pm state transition
 * @complete: undo work done in @prepare
 * @freeze: callback for freezing during hibernation snapshotting
 * @thaw: undo work done in @freeze
 * @restore: callback for restoring after hibernation
 * @driver: embedded driver structure
 */
struct ccwgroup_driver {
@@ -51,6 +56,11 @@ struct ccwgroup_driver {
	int (*set_online) (struct ccwgroup_device *);
	int (*set_offline) (struct ccwgroup_device *);
	void (*shutdown)(struct ccwgroup_device *);
	int (*prepare) (struct ccwgroup_device *);
	void (*complete) (struct ccwgroup_device *);
	int (*freeze)(struct ccwgroup_device *);
	int (*thaw) (struct ccwgroup_device *);
	int (*restore)(struct ccwgroup_device *);

	struct device_driver driver;
};
Loading