diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-05-09 16:27:58 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-05-09 16:27:58 -0700 |
commit | fbbd5ef9fa373ca30e5a302a432e5482aafff7fd (patch) | |
tree | 457e8c2580133c9204095f3fbbe079e05accf8c0 /driver | |
parent | f628fa265a01b8223d60715906b86cffdc72d5f4 (diff) | |
download | patches-fbbd5ef9fa373ca30e5a302a432e5482aafff7fd.tar.gz |
more patches
Diffstat (limited to 'driver')
4 files changed, 290 insertions, 0 deletions
diff --git a/driver/driver-core-add-sys-hypervisor-when-needed.patch b/driver/driver-core-add-sys-hypervisor-when-needed.patch new file mode 100644 index 0000000000000..97420eb6770f8 --- /dev/null +++ b/driver/driver-core-add-sys-hypervisor-when-needed.patch @@ -0,0 +1,103 @@ +From holzheu@de.ibm.com Tue May 9 03:53:55 2006 +Date: Tue, 9 May 2006 12:53:49 +0200 +From: Michael Holzheu <holzheu@de.ibm.com> +To: greg@kroah.com, akpm@osdl.org +Cc: <ioe-lkml@rameria.de>, <joern@wohnheim.fh-wedel.de>, <mschwid2@de.ibm.com>, <penberg@cs.helsinki.fi> +Subject: Driver Core: Add /sys/hypervisor when needed +Message-Id: <20060509125349.72c974b2.holzheu@de.ibm.com> + +To have a home for all hypervisors, this patch creates /sys/hypervisor. +A new config option SYS_HYPERVISOR is introduced, which should to be set +by architecture dependent hypervisors (e.g. s390 or Xen). + +Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> +Signed-off-by: Michael Holzheu <holzheu@de.ibm.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/base/Kconfig | 4 ++++ + drivers/base/Makefile | 1 + + drivers/base/base.h | 5 +++++ + drivers/base/hypervisor.c | 19 +++++++++++++++++++ + drivers/base/init.c | 1 + + include/linux/kobject.h | 2 ++ + 6 files changed, 32 insertions(+) + +--- gregkh-2.6.orig/drivers/base/Kconfig ++++ gregkh-2.6/drivers/base/Kconfig +@@ -38,3 +38,7 @@ config DEBUG_DRIVER + If you are unsure about this, say N here. + + endmenu ++ ++config SYS_HYPERVISOR ++ bool ++ default n +--- gregkh-2.6.orig/drivers/base/Makefile ++++ gregkh-2.6/drivers/base/Makefile +@@ -9,6 +9,7 @@ obj-$(CONFIG_FW_LOADER) += firmware_clas + obj-$(CONFIG_NUMA) += node.o + obj-$(CONFIG_MEMORY_HOTPLUG) += memory.o + obj-$(CONFIG_SMP) += topology.o ++obj-$(CONFIG_SYS_HYPERVISOR) += hypervisor.o + + ifeq ($(CONFIG_DEBUG_DRIVER),y) + EXTRA_CFLAGS += -DDEBUG +--- gregkh-2.6.orig/drivers/base/base.h ++++ gregkh-2.6/drivers/base/base.h +@@ -5,6 +5,11 @@ extern int devices_init(void); + extern int buses_init(void); + extern int classes_init(void); + extern int firmware_init(void); ++#ifdef CONFIG_SYS_HYPERVISOR ++extern int hypervisor_init(void); ++#else ++static inline int hypervisor_init(void) { return 0; } ++#endif + extern int platform_bus_init(void); + extern int system_bus_init(void); + extern int cpu_dev_init(void); +--- /dev/null ++++ gregkh-2.6/drivers/base/hypervisor.c +@@ -0,0 +1,19 @@ ++/* ++ * hypervisor.c - /sys/hypervisor subsystem. ++ * ++ * This file is released under the GPLv2 ++ * ++ */ ++ ++#include <linux/kobject.h> ++#include <linux/device.h> ++ ++#include "base.h" ++ ++decl_subsys(hypervisor, NULL, NULL); ++EXPORT_SYMBOL_GPL(hypervisor_subsys); ++ ++int __init hypervisor_init(void) ++{ ++ return subsystem_register(&hypervisor_subsys); ++} +--- gregkh-2.6.orig/drivers/base/init.c ++++ gregkh-2.6/drivers/base/init.c +@@ -27,6 +27,7 @@ void __init driver_init(void) + buses_init(); + classes_init(); + firmware_init(); ++ hypervisor_init(); + + /* These are also core pieces, but must come after the + * core core pieces. +--- gregkh-2.6.orig/include/linux/kobject.h ++++ gregkh-2.6/include/linux/kobject.h +@@ -192,6 +192,8 @@ struct subsystem _varname##_subsys = { \ + + /* The global /sys/kernel/ subsystem for people to chain off of */ + extern struct subsystem kernel_subsys; ++/* The global /sys/hypervisor/ subsystem */ ++extern struct subsystem hypervisor_subsys; + + /** + * Helpers for setting the kset of registered objects. diff --git a/driver/driver-core-allow-sysdev_class-have-attributes.patch b/driver/driver-core-allow-sysdev_class-have-attributes.patch new file mode 100644 index 0000000000000..690886816fe46 --- /dev/null +++ b/driver/driver-core-allow-sysdev_class-have-attributes.patch @@ -0,0 +1,113 @@ +From shaohua.li@intel.com Sun May 7 22:47:29 2006 +Subject: Driver Core: Allow sysdev_class have attributes +From: Shaohua Li <shaohua.li@intel.com> +Cc: Greg <greg@kroah.com>, Patrick Mochel <mochel@linux.intel.com>, Ashok Raj <ashok.raj@intel.com>, Andrew Morton <akpm@osdl.org> +Date: Mon, 08 May 2006 13:45:57 +0800 +Message-Id: <1147067157.2760.89.camel@sli10-desk.sh.intel.com> + + +allow sysdev_class adding attribute. Next patch will use the new API to +add an attribute under /sys/device/system/cpu/. + +Signed-off-by: Shaohua Li <shaohua.li@intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/base/sys.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++- + include/linux/sysdev.h | 18 ++++++++++++++++- + 2 files changed, 67 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/drivers/base/sys.c ++++ gregkh-2.6/drivers/base/sys.c +@@ -80,10 +80,59 @@ void sysdev_remove_file(struct sys_devic + EXPORT_SYMBOL_GPL(sysdev_create_file); + EXPORT_SYMBOL_GPL(sysdev_remove_file); + ++#define to_sysdev_class(k) container_of(k, struct sysdev_class, kset.kobj) ++#define to_sysdev_class_attr(a) container_of(a, \ ++ struct sysdev_class_attribute, attr) ++ ++static ssize_t sysdev_class_show(struct kobject *kobj, struct attribute *attr, ++ char *buffer) ++{ ++ struct sysdev_class * class = to_sysdev_class(kobj); ++ struct sysdev_class_attribute *class_attr = to_sysdev_class_attr(attr); ++ ++ if (class_attr->show) ++ return class_attr->show(class, buffer); ++ return -EIO; ++} ++ ++static ssize_t sysdev_class_store(struct kobject *kobj, struct attribute *attr, ++ const char *buffer, size_t count) ++{ ++ struct sysdev_class * class = to_sysdev_class(kobj); ++ struct sysdev_class_attribute * class_attr = to_sysdev_class_attr(attr); ++ ++ if (class_attr->store) ++ return class_attr->store(class, buffer, count); ++ return -EIO; ++} ++ ++static struct sysfs_ops sysfs_class_ops = { ++ .show = sysdev_class_show, ++ .store = sysdev_class_store, ++}; ++ ++static struct kobj_type ktype_sysdev_class = { ++ .sysfs_ops = &sysfs_class_ops, ++}; ++ ++int sysdev_class_create_file(struct sysdev_class *c, ++ struct sysdev_class_attribute *a) ++{ ++ return sysfs_create_file(&c->kset.kobj, &a->attr); ++} ++EXPORT_SYMBOL_GPL(sysdev_class_create_file); ++ ++void sysdev_class_remove_file(struct sysdev_class *c, ++ struct sysdev_class_attribute *a) ++{ ++ sysfs_remove_file(&c->kset.kobj, &a->attr); ++} ++EXPORT_SYMBOL_GPL(sysdev_class_remove_file); ++ + /* + * declare system_subsys + */ +-static decl_subsys(system, &ktype_sysdev, NULL); ++static decl_subsys(system, &ktype_sysdev_class, NULL); + + int sysdev_class_register(struct sysdev_class * cls) + { +--- gregkh-2.6.orig/include/linux/sysdev.h ++++ gregkh-2.6/include/linux/sysdev.h +@@ -37,11 +37,27 @@ struct sysdev_class { + struct kset kset; + }; + ++struct sysdev_class_attribute { ++ struct attribute attr; ++ ssize_t (*show)(struct sysdev_class *, char *); ++ ssize_t (*store)(struct sysdev_class *, const char *, size_t); ++}; ++ ++#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ ++struct sysdev_class_attribute attr_##_name = { \ ++ .attr = {.name = __stringify(_name), .mode = _mode }, \ ++ .show = _show, \ ++ .store = _store, \ ++}; ++ + + extern int sysdev_class_register(struct sysdev_class *); + extern void sysdev_class_unregister(struct sysdev_class *); + +- ++extern int sysdev_class_create_file(struct sysdev_class *, ++ struct sysdev_class_attribute *); ++extern void sysdev_class_remove_file(struct sysdev_class *, ++ struct sysdev_class_attribute *); + /** + * Auxillary system device drivers. + */ diff --git a/driver/driver-core-fix-platform_device_add-to-use-device_add.patch b/driver/driver-core-fix-platform_device_add-to-use-device_add.patch new file mode 100644 index 0000000000000..5b134d9a44734 --- /dev/null +++ b/driver/driver-core-fix-platform_device_add-to-use-device_add.patch @@ -0,0 +1,31 @@ +From rmk+gregkh=suse.de@arm.linux.org.uk Sat May 6 00:15:45 2006 +Date: Sat, 6 May 2006 08:15:26 +0100 +From: Russell King <rmk+lkml@arm.linux.org.uk> +To: Andrew Morton <akpm@osdl.org>, Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>, gregkh@suse.de +Subject: Driver Core: Fix platform_device_add to use device_add +Message-ID: <20060506071526.GC18829@flint.arm.linux.org.uk> +Content-Disposition: inline + +platform_device_add() should be using device_add() rather +than device_register() - any platform device passed to +platform_device_add() should have already been initialised, +either by platform_device_alloc() or platform_device_register(). + +Signed-off-by: Russell King <rmk@arm.linux.org.uk> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/base/platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- gregkh-2.6.orig/drivers/base/platform.c ++++ gregkh-2.6/drivers/base/platform.c +@@ -275,7 +275,7 @@ int platform_device_add(struct platform_ + pr_debug("Registering platform device '%s'. Parent at %s\n", + pdev->dev.bus_id, pdev->dev.parent->bus_id); + +- ret = device_register(&pdev->dev); ++ ret = device_add(&pdev->dev); + if (ret == 0) + return ret; + diff --git a/driver/kevent-add-new-uevent.patch b/driver/kevent-add-new-uevent.patch new file mode 100644 index 0000000000000..30be67bae7de1 --- /dev/null +++ b/driver/kevent-add-new-uevent.patch @@ -0,0 +1,43 @@ +From kristen.c.accardi@intel.com Fri May 5 15:04:09 2006 +Subject: KEVENT: add new uevent +From: Kristen Accardi <kristen.c.accardi@intel.com> +Cc: <arjan@linux.intel.com> +Date: Fri, 05 May 2006 15:13:36 -0700 +Message-Id: <1146867216.21633.6.camel@whizzy> + +Add dock uevents so that userspace can be notified of dock and undock +events. + +Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + include/linux/kobject.h | 2 ++ + lib/kobject_uevent.c | 4 ++++ + 2 files changed, 6 insertions(+) + +--- gregkh-2.6.orig/include/linux/kobject.h ++++ gregkh-2.6/include/linux/kobject.h +@@ -46,6 +46,8 @@ enum kobject_action { + KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ + KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ + KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ ++ KOBJ_UNDOCK = (__force kobject_action_t) 0x08, /* undocking */ ++ KOBJ_DOCK = (__force kobject_action_t) 0x09, /* dock */ + }; + + struct kobject { +--- gregkh-2.6.orig/lib/kobject_uevent.c ++++ gregkh-2.6/lib/kobject_uevent.c +@@ -50,6 +50,10 @@ static char *action_to_string(enum kobje + return "offline"; + case KOBJ_ONLINE: + return "online"; ++ case KOBJ_DOCK: ++ return "dock"; ++ case KOBJ_UNDOCK: ++ return "undock"; + default: + return NULL; + } |