diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-02 13:56:25 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-02 13:56:25 -0700 |
commit | 3cd3ea192e0e049ed3a2be94a04f4601e6918ffd (patch) | |
tree | 61d49263346951b04a62af30eb0ad2c5ad586d2f /pending | |
parent | 16114f6ed4350f902c94305f772d2a0f7b6b2992 (diff) | |
download | patches-3cd3ea192e0e049ed3a2be94a04f4601e6918ffd.tar.gz |
create pending directory for things that are currently under work
Diffstat (limited to 'pending')
-rw-r--r-- | pending/f999.patch | 75 | ||||
-rw-r--r-- | pending/kset-kill-subsys-attr.patch | 172 | ||||
-rw-r--r-- | pending/sysfs-crash-debugging.patch | 123 |
3 files changed, 370 insertions, 0 deletions
diff --git a/pending/f999.patch b/pending/f999.patch new file mode 100644 index 00000000000000..91f3423065abf1 --- /dev/null +++ b/pending/f999.patch @@ -0,0 +1,75 @@ +--- + drivers/base/firmware.c | 22 ++++------------------ + drivers/firmware/edd.c | 1 + + include/linux/device.h | 4 +--- + 3 files changed, 6 insertions(+), 21 deletions(-) + +--- a/drivers/base/firmware.c ++++ b/drivers/base/firmware.c +@@ -3,11 +3,11 @@ + * + * Copyright (c) 2002-3 Patrick Mochel + * Copyright (c) 2002-3 Open Source Development Labs ++ * Copyright (c) 2007 Greg Kroah-Hartman <gregkh@suse.de> ++ * Copyright (c) 2007 Novell Inc. + * + * This file is released under the GPLv2 +- * + */ +- + #include <linux/kobject.h> + #include <linux/module.h> + #include <linux/init.h> +@@ -16,19 +16,8 @@ + + #include "base.h" + +-static struct kset *firmware_kset; +- +-int firmware_register(struct kset *s) +-{ +- s->kobj.kset = firmware_kset; +- s->kobj.ktype = NULL; +- return subsystem_register(s); +-} +- +-void firmware_unregister(struct kset *s) +-{ +- subsystem_unregister(s); +-} ++struct kset *firmware_kset; ++EXPORT_SYMBOL(firmware_kset); + + int __init firmware_init(void) + { +@@ -37,6 +26,3 @@ int __init firmware_init(void) + return PTR_ERR(firmware_kset); + return 0; + } +- +-EXPORT_SYMBOL_GPL(firmware_register); +-EXPORT_SYMBOL_GPL(firmware_unregister); +--- a/drivers/firmware/edd.c ++++ b/drivers/firmware/edd.c +@@ -756,6 +756,7 @@ edd_init(void) + return 1; + } + ++ edd_subsys-> + rc = firmware_register(&edd_subsys); + if (rc) + return rc; +--- a/include/linux/device.h ++++ b/include/linux/device.h +@@ -543,10 +543,8 @@ extern void device_shutdown(void); + /* drivers/base/sys.c */ + extern void sysdev_shutdown(void); + +- + /* drivers/base/firmware.c */ +-extern int __must_check firmware_register(struct kset *); +-extern void firmware_unregister(struct kset *); ++struct kset *firmware_kset; + + /* debugging and troubleshooting/diagnostic helpers. */ + extern const char *dev_driver_string(struct device *dev); diff --git a/pending/kset-kill-subsys-attr.patch b/pending/kset-kill-subsys-attr.patch new file mode 100644 index 00000000000000..1fb71c9ff758e3 --- /dev/null +++ b/pending/kset-kill-subsys-attr.patch @@ -0,0 +1,172 @@ +From kay.sievers@vrfy.org Fri Nov 2 08:38:35 2007 +From: Kay Sievers <kay.sievers@vrfy.org> +Subject: Driver Core: kill subsys_attribute and default sysfs ops +Date: Fri, 02 Nov 2007 13:47:53 +0100 +Message-Id: <1194007673.2194.12.camel@lov.site> +Mime-Version: 1.0 +Content-Transfer-Encoding: 7bit +Status: RO +Content-Length: 4503 + +Remove the no longer needed subsys_attributes, they are all converted to +the more sensical kobj_attributes. + +There is no longer a magic fallback in sysfs attribute operations, all +kobjects which create simple attributes need explicitely a ktype assigned, +which thells the core what was intended here. + +!!! DO NOT APPLY !!!! + Until this is converted: + arch/s390/kernel/ipl.c + arch/arm/mach-omap1/pm.c + arch/powerpc/platforms/pseries/power.c + drivers/firmware/efivars.c + drivers/parisc/pdc_stable.c +!!! DO NOT APPLY !!!! + +Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> +--- + fs/sysfs/file.c | 63 +++++++----------------------------------------- + include/linux/kobject.h | 9 ------ + lib/kobject.c | 21 ---------------- + 3 files changed, 10 insertions(+), 83 deletions(-) + +--- a/fs/sysfs/file.c ++++ b/fs/sysfs/file.c +@@ -20,43 +20,6 @@ + + #include "sysfs.h" + +-#define to_sattr(a) container_of(a,struct subsys_attribute, attr) +- +-/* +- * Subsystem file operations. +- * These operations allow subsystems to have files that can be +- * read/written. +- */ +-static ssize_t +-subsys_attr_show(struct kobject * kobj, struct attribute * attr, char * page) +-{ +- struct kset *kset = to_kset(kobj); +- struct subsys_attribute * sattr = to_sattr(attr); +- ssize_t ret = -EIO; +- +- if (sattr->show) +- ret = sattr->show(kset, page); +- return ret; +-} +- +-static ssize_t +-subsys_attr_store(struct kobject * kobj, struct attribute * attr, +- const char * page, size_t count) +-{ +- struct kset *kset = to_kset(kobj); +- struct subsys_attribute * sattr = to_sattr(attr); +- ssize_t ret = -EIO; +- +- if (sattr->store) +- ret = sattr->store(kset, page, count); +- return ret; +-} +- +-static struct sysfs_ops subsys_sysfs_ops = { +- .show = subsys_attr_show, +- .store = subsys_attr_store, +-}; +- + /* + * There's one sysfs_buffer for each open file and one + * sysfs_open_dirent for each sysfs_dirent with one or more open +@@ -350,29 +313,23 @@ static int sysfs_open_file(struct inode + { + struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata; + struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; +- struct sysfs_buffer * buffer; +- struct sysfs_ops * ops = NULL; +- int error; ++ struct sysfs_buffer *buffer; ++ struct sysfs_ops *ops; ++ int error = -EACCES; + + /* need attr_sd for attr and ops, its parent for kobj */ + if (!sysfs_get_active_two(attr_sd)) + return -ENODEV; + +- /* if the kobject has no ktype, then we assume that it is a subsystem +- * itself, and use ops for it. +- */ +- if (kobj->ktype) ++ /* every kobject with an attribute needs a ktype assigned */ ++ if (kobj->ktype && kobj->ktype->sysfs_ops) + ops = kobj->ktype->sysfs_ops; +- else +- ops = &subsys_sysfs_ops; +- +- error = -EACCES; +- +- /* No sysfs operations, either from having no subsystem, +- * or the subsystem have no operations. +- */ +- if (!ops) ++ else { ++ printk(KERN_ERR "missing sysfs attribute operations for " ++ "kobject: %s\n", kobject_name(kobj)); ++ WARN_ON(1); + goto err_out; ++ } + + /* File needs write support. + * The inode's perms must say it's ok, +--- a/include/linux/kobject.h ++++ b/include/linux/kobject.h +@@ -208,15 +208,6 @@ extern struct kset *power_kset; + extern int __must_check subsystem_register(struct kset *); + extern void subsystem_unregister(struct kset *); + +-struct subsys_attribute { +- struct attribute attr; +- ssize_t (*show)(struct kset *, char *); +- ssize_t (*store)(struct kset *, const char *, size_t); +-}; +- +-extern int __must_check subsys_create_file(struct kset *, +- struct subsys_attribute *); +- + #if defined(CONFIG_HOTPLUG) + int kobject_uevent(struct kobject *kobj, enum kobject_action action); + int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, +--- a/lib/kobject.c ++++ b/lib/kobject.c +@@ -669,26 +669,6 @@ void subsystem_unregister(struct kset *s + kset_unregister(s); + } + +-/** +- * subsystem_create_file - export sysfs attribute file. +- * @s: subsystem. +- * @a: subsystem attribute descriptor. +- */ +- +-int subsys_create_file(struct kset *s, struct subsys_attribute *a) +-{ +- int error = 0; +- +- if (!s || !a) +- return -EINVAL; +- +- if (kset_get(s)) { +- error = sysfs_create_file(&s->kobj, &a->attr); +- kset_put(s); +- } +- return error; +-} +- + static void kset_release(struct kobject *kobj) + { + struct kset *kset = container_of(kobj, struct kset, kobj); +@@ -793,4 +773,3 @@ EXPORT_SYMBOL(kset_unregister); + + EXPORT_SYMBOL(subsystem_register); + EXPORT_SYMBOL(subsystem_unregister); +-EXPORT_SYMBOL(subsys_create_file); + diff --git a/pending/sysfs-crash-debugging.patch b/pending/sysfs-crash-debugging.patch new file mode 100644 index 00000000000000..1562a82ffea600 --- /dev/null +++ b/pending/sysfs-crash-debugging.patch @@ -0,0 +1,123 @@ +From akpm@linux-foundation.org Fri Aug 24 16:12:31 2007 +From: Andrew Morton <akpm@linux-foundation.org> +Date: Fri, 24 Aug 2007 16:11:54 -0700 +Subject: sysfs: crash debugging +To: mm-commits@vger.kernel.org +Cc: akpm@linux-foundation.org, greg@kroah.com, kay.sievers@vrfy.org, mathieu.desnoyers@polymtl.ca +Message-ID: <200708242311.l7ONBsvq019579@imap1.linux-foundation.org> + + +Print the name of the last-accessed sysfs file when we oops, to help track +down oopses which occur in sysfs store/read handlers. Because these oopses +tend to not leave any trace of the offending code in the stack traces. + +Cc: Kay Sievers <kay.sievers@vrfy.org> +Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + arch/x86/kernel/traps_32.c | 1 + + arch/x86/kernel/traps_64.c | 1 + + fs/sysfs/file.c | 14 ++++++++++++++ + fs/sysfs/mount.c | 2 +- + fs/sysfs/sysfs.h | 1 + + include/linux/sysfs.h | 5 +++++ + 6 files changed, 23 insertions(+), 1 deletion(-) + +--- a/arch/x86/kernel/traps_32.c ++++ b/arch/x86/kernel/traps_32.c +@@ -396,6 +396,7 @@ void die(const char * str, struct pt_reg + #endif + printk("\n"); + ++ sysfs_printk_last_file(); + if (notify_die(DIE_OOPS, str, regs, err, + current->thread.trap_no, SIGSEGV) != + NOTIFY_STOP) { +--- a/arch/x86/kernel/traps_64.c ++++ b/arch/x86/kernel/traps_64.c +@@ -517,6 +517,7 @@ void __kprobes __die(const char * str, s + printk("DEBUG_PAGEALLOC"); + #endif + printk("\n"); ++ sysfs_printk_last_file(); + notify_die(DIE_OOPS, str, regs, err, current->thread.trap_no, SIGSEGV); + show_registers(regs); + add_taint(TAINT_DIE); +--- a/fs/sysfs/file.c ++++ b/fs/sysfs/file.c +@@ -16,10 +16,18 @@ + #include <linux/poll.h> + #include <linux/list.h> + #include <linux/mutex.h> ++#include <linux/limits.h> + #include <asm/uaccess.h> + + #include "sysfs.h" + ++/* used in crash dumps to help with debugging */ ++static char last_sysfs_file[PATH_MAX]; ++void sysfs_printk_last_file(void) ++{ ++ printk(KERN_EMERG "last sysfs file: %s\n", last_sysfs_file); ++} ++ + /* + * There's one sysfs_buffer for each open file and one + * sysfs_open_dirent for each sysfs_dirent with one or more open +@@ -316,6 +324,12 @@ static int sysfs_open_file(struct inode + struct sysfs_buffer *buffer; + struct sysfs_ops *ops; + int error = -EACCES; ++ char *p; ++ ++ p = d_path(file->f_dentry, sysfs_mount, last_sysfs_file, ++ sizeof(last_sysfs_file)); ++ if (p) ++ memmove(last_sysfs_file, p, strlen(p) + 1); + + /* need attr_sd for attr and ops, its parent for kobj */ + if (!sysfs_get_active_two(attr_sd)) +--- a/fs/sysfs/mount.c ++++ b/fs/sysfs/mount.c +@@ -22,7 +22,7 @@ + /* Random magic number */ + #define SYSFS_MAGIC 0x62656572 + +-static struct vfsmount *sysfs_mount; ++struct vfsmount *sysfs_mount; + struct super_block * sysfs_sb = NULL; + struct kmem_cache *sysfs_dir_cachep; + +--- a/fs/sysfs/sysfs.h ++++ b/fs/sysfs/sysfs.h +@@ -91,6 +91,7 @@ struct sysfs_addrm_cxt { + extern struct sysfs_dirent sysfs_root; + extern struct super_block *sysfs_sb; + extern struct kmem_cache *sysfs_dir_cachep; ++extern struct vfsmount *sysfs_mount; + + /* + * dir.c +--- a/include/linux/sysfs.h ++++ b/include/linux/sysfs.h +@@ -111,6 +111,7 @@ void sysfs_remove_file_from_group(struct + const struct attribute *attr, const char *group); + + void sysfs_notify(struct kobject *kobj, char *dir, char *attr); ++void sysfs_printk_last_file(void); + + extern int __must_check sysfs_init(void); + +@@ -216,6 +217,10 @@ static inline int __must_check sysfs_ini + return 0; + } + ++static inline void sysfs_printk_last_file(void) ++{ ++} ++ + #endif /* CONFIG_SYSFS */ + + #endif /* _SYSFS_H_ */ |