linux.kernel - 26 new messages in 10 topics - digest
linux.kernel
http://groups.google.com/group/linux.kernel?hl=en
Today's topics:
* 2.6.33 staging rt2870 += Belkin F5D8055 Wireless-N USB Dongle - 1 messages,
1 author
http://groups.google.com/group/linux.kernel/t/46c759f6f4b38e5f?hl=en
* x86/mrst: remove X86_MRST dependency on PCI_IOAPIC - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/1b8b95e8c9b33bb1?hl=en
* drm request 2 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/25fd69fb4cbfc733?hl=en
* hid Logitech G13 Driver 0.0.5 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/efb80a4d82dd0b35?hl=en
* kobject-example: Spelling fixes. - 16 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/63818dfc875730b2?hl=en
* LED driver for the Soekris net5501 board. - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/484410bbbfae8034?hl=en
* ocfs2 changes for 2.6.34 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/43c59e68a9836c12?hl=en
* Memory management woes - order 1 allocation failures - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/5fdc2e7e4a505944?hl=en
* USB mass storage and ARM cache coherency - 2 messages, 1 author
http://groups.google.com/group/linux.kernel/t/68938cdf1fa061a9?hl=en
* serial: bfin_5xx: pull in linux/io.h for ioremap prototypes - 1 messages, 1
author
http://groups.google.com/group/linux.kernel/t/08c1b2b68bc4f84b?hl=en
==============================================================================
TOPIC: 2.6.33 staging rt2870 += Belkin F5D8055 Wireless-N USB Dongle
http://groups.google.com/group/linux.kernel/t/46c759f6f4b38e5f?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 3:30 pm
From: Greg KH
On Tue, Mar 02, 2010 at 04:22:28PM -0600, Chris Largret wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hey,
>
> I bought a Belkin F5D8055 Wireless-N USB Dongle recently. The driver
> CD holds files with names like "rt2870.inf."
>
> The current (kernel 2.6.33) Ralink staging module works with it after a
> slight tweak to add the Belkin USB device information. The attached
> patch is designed to do that.
>
> It modifies the rt2860 tree but is targeted at the rt2870 driver.
>
> Feel free to e-mail me if you have any questions.
Next time, please cc: me with any staging patches.
Can you resend this with a "Signed-off-by:" line so that I can apply it?
The kernel file, Documentation/SubmittingPatches describes what this
entails.
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: x86/mrst: remove X86_MRST dependency on PCI_IOAPIC
http://groups.google.com/group/linux.kernel/t/1b8b95e8c9b33bb1?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 3:30 pm
From: Jacob Pan
PCI_IOAPIC is used for PCI hotplug, Moorestown does not have ACPI PCI
hotplug. This unnecessary dependency causes X86_MRST fail to be selected if
ACPI is not selected.
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
---
arch/x86/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b25da64..1ecab88 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -396,7 +396,6 @@ config X86_MRST
bool "Moorestown MID platform"
depends on PCI
depends on PCI_GOANY
- depends on PCI_IOAPIC
depends on X86_32
depends on X86_EXTENDED_PLATFORM
depends on X86_IO_APIC
--
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: drm request 2
http://groups.google.com/group/linux.kernel/t/25fd69fb4cbfc733?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 3:30 pm
From: Dave Airlie
0/3/3 Dave Airlie <airlied@linux.ie>:
>>
>> Never mind. I've unpulled the whole effin' mess since it doesn't even
>> compile:
>>
>> � � � drivers/gpu/drm/nouveau/nouveau_acpi.c:191: error: redefinition of �nouveau_register_dsm_handler�
>> � � � drivers/gpu/drm/nouveau/nouveau_drv.h:859: note: previous definition of �nouveau_register_dsm_handler� was here
>> � � � drivers/gpu/drm/nouveau/nouveau_acpi.c:202: error: redefinition of �nouveau_unregister_dsm_handler�
>> � � � drivers/gpu/drm/nouveau/nouveau_drv.h:860: note: previous definition of �nouveau_unregister_dsm_handler� was here
>>
>> because not only was that VGA_SWITCHEROO Kconfig default the wrong way
>> around, the thing had clearly never ever been tested at all.
>>
>> Why does sh*t like this even make it to me? Was this ever at all in -next?
>> I assume not, since that would have picked up on basic compile failures.
>>
>> Grr. Things like this is what makes me go "Ok, there's always the next
>> merge window, maybe it will have gotten some testing by then".
>
> Linux next didn't pick up this build failure, wierdly neither did the
> powerpc build I did with this turned off, because ACPI was also off on
> ppc, it was in linux-next for at least 2 days, and from what I can see
> that found the ppc problems, it never found the x86 option since it was on
> by default.
>
> I'm going to just rip the nouveau bits out of the patch, btw nouveau is in
> staging, so you are being a bit OTT, calm down.\
Anyways sfr just confirmed linux-next doesn't build CONFIG_STAGING
drivers so again that wouldn't have helped. So you made us pull nouveau
into staging, now you are giving out because staging drivers have issues?
In any case I've fixed the default y and the STAGING build in my tree.
Did I mention that driver is in STAGING?
Dave.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: hid Logitech G13 Driver 0.0.5
http://groups.google.com/group/linux.kernel/t/efb80a4d82dd0b35?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 2 2010 3:30 pm
From: Jaya Kumar
On Wed, Mar 3, 2010 at 2:48 AM, Rick L. Vinyard Jr.
<rvinyard@cs.nmsu.edu> wrote:
> [PATCH] hid Logitech G13 Driver 0.0.5
Hi Rick,
Thanks for posting this. It has improved a lot.
>
> This driver relies on two patches:
> 1. Bruno Prémont's [PATCH 2/3] hid: add suspend/resume hooks for hid drivers
> 2. [PATCH] Add sysfs support for fbdefio delay
Please help me understand in what way does this patch have to have the
global userspace exposure of defio delay in sysfs support. If that
sysfs patch was not accepted, I don't see this patch affected
negatively.
> However, the driver does use the HID feature reports extensively to
> control the backlight, LEDs, et. al.
Ok.
> - Removed the update rate sysfs attribute as it is in the second patch above.
Why? There is no consensus that exposing defio delay for _all_ fb
drivers is a good idea. I would rather you left that in here for now.
> +/*
> + * This is a default logo to be loaded upon driver initialization
> + * replacing the default Logitech G13 image loaded on device
> + * initialization. This is to provide the user a cue that the
> + * Linux driver is loaded and ready.
> + *
> + * This logo contains the text G13 in the center with two penguins
> + * on each side of the text. The penguins are a 33x40 rendition of
> + * the default framebuffer 80x80 monochrome image scaled down and
> + * cleaned up to retain something that looks a little better than
> + * a simple scaling.
> + *
> + * This logo is a simple xbm image created in GIMP and exported.
> + * To view the image copy the following two #defines plus the
> + * g13_lcd_bits to an ASCII text file and save with extension
> + * .xbm, then open with GIMP or any other graphical editor
> + * such as eog that recognizes the .xbm format.
> + */
...
> +static unsigned char g13_lcd_bits[] = {
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
I think you'll agree above is not an elegant solution.
> +
> +static DEVICE_ATTR(rgb, 0666, g13_rgb_show, g13_rgb_store);
Reading above code, it looks like this new userspace sysfs attribute
is for backlight control. Could that be better exposed using the
existing backlight class?
Thanks,
jaya
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: kobject-example: Spelling fixes.
http://groups.google.com/group/linux.kernel/t/63818dfc875730b2?hl=en
==============================================================================
== 1 of 16 ==
Date: Tues, Mar 2 2010 3:30 pm
From: Greg Kroah-Hartman
From: Radu Voicilas <rvoicilas@gmail.com>
No change in functionality.
Signed-off-by: Radu Voicilas <rvoicilas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
samples/kobject/kobject-example.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/samples/kobject/kobject-example.c b/samples/kobject/kobject-example.c
index 8d9b55a..86ea0c3 100644
--- a/samples/kobject/kobject-example.c
+++ b/samples/kobject/kobject-example.c
@@ -44,7 +44,7 @@ static struct kobj_attribute foo_attribute =
__ATTR(foo, 0666, foo_show, foo_store);
/*
- * More complex function where we determine which varible is being accessed by
+ * More complex function where we determine which variable is being accessed by
* looking at the attribute for the "baz" and "bar" files.
*/
static ssize_t b_show(struct kobject *kobj, struct kobj_attribute *attr,
@@ -79,7 +79,7 @@ static struct kobj_attribute bar_attribute =
/*
- * Create a group of attributes so that we can create and destory them all
+ * Create a group of attributes so that we can create and destroy them all
* at once.
*/
static struct attribute *attrs[] = {
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 2 of 16 ==
Date: Tues, Mar 2 2010 3:30 pm
From: Greg Kroah-Hartman
From: Andi Kleen <andi@firstfloor.org>
Adding/Removing a whole array of attributes is very common. Add a standard
utility function to do this with a simple function call, instead of
requiring drivers to open code this.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/sysfs/file.c | 20 ++++++++++++++++++++
include/linux/sysfs.h | 14 ++++++++++++++
2 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index dc30d9e..50b725b 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -542,6 +542,18 @@ int sysfs_create_file(struct kobject * kobj, const struct attribute * attr)
}
+int sysfs_create_files(struct kobject *kobj, const struct attribute **ptr)
+{
+ int err = 0;
+ int i;
+
+ for (i = 0; ptr[i] && !err; i++)
+ err = sysfs_create_file(kobj, ptr[i]);
+ if (err)
+ while (--i >= 0)
+ sysfs_remove_file(kobj, ptr[i]);
+ return err;
+}
/**
* sysfs_add_file_to_group - add an attribute file to a pre-existing group.
@@ -614,6 +626,12 @@ void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr)
sysfs_hash_and_remove(kobj->sd, attr->name);
}
+void sysfs_remove_files(struct kobject * kobj, const struct attribute **ptr)
+{
+ int i;
+ for (i = 0; ptr[i]; i++)
+ sysfs_remove_file(kobj, ptr[i]);
+}
/**
* sysfs_remove_file_from_group - remove an attribute file from a group.
@@ -732,3 +750,5 @@ EXPORT_SYMBOL_GPL(sysfs_schedule_callback);
EXPORT_SYMBOL_GPL(sysfs_create_file);
EXPORT_SYMBOL_GPL(sysfs_remove_file);
+EXPORT_SYMBOL_GPL(sysfs_remove_files);
+EXPORT_SYMBOL_GPL(sysfs_create_files);
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index cfa8308..3e85265 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -94,9 +94,12 @@ int __must_check sysfs_move_dir(struct kobject *kobj,
int __must_check sysfs_create_file(struct kobject *kobj,
const struct attribute *attr);
+int __must_check sysfs_create_files(struct kobject *kobj,
+ const struct attribute **attr);
int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr,
mode_t mode);
void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr);
+void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr);
int __must_check sysfs_create_bin_file(struct kobject *kobj,
const struct bin_attribute *attr);
@@ -164,6 +167,12 @@ static inline int sysfs_create_file(struct kobject *kobj,
return 0;
}
+static inline int sysfs_create_files(struct kobject *kobj,
+ const struct attribute **attr)
+{
+ return 0;
+}
+
static inline int sysfs_chmod_file(struct kobject *kobj,
struct attribute *attr, mode_t mode)
{
@@ -175,6 +184,11 @@ static inline void sysfs_remove_file(struct kobject *kobj,
{
}
+static inline void sysfs_remove_files(struct kobject *kobj,
+ const struct attribute **attr)
+{
+}
+
static inline int sysfs_create_bin_file(struct kobject *kobj,
const struct bin_attribute *attr)
{
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 3 of 16 ==
Date: Tues, Mar 2 2010 3:30 pm
From: Greg Kroah-Hartman
From: Andi Kleen <andi@firstfloor.org>
Using the new attribute argument convert the cpu driver class attributes
to carry the node state. Then use a shared function to do what a lot of
individual functions did before.
This eliminates an ugly macro.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/cpu.c | 37 +++++++++++++++++++++----------------
1 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index fd1b2f9..b04ecfc 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -141,27 +141,32 @@ static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL);
/*
* Print cpu online, possible, present, and system maps
*/
-static ssize_t print_cpus_map(char *buf, const struct cpumask *map)
+
+struct cpu_attr {
+ struct sysdev_class_attribute attr;
+ const struct cpumask *const * const map;
+};
+
+static ssize_t show_cpus_attr(struct sysdev_class *class,
+ struct sysdev_class_attribute *attr,
+ char *buf)
{
- int n = cpulist_scnprintf(buf, PAGE_SIZE-2, map);
+ struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr);
+ int n = cpulist_scnprintf(buf, PAGE_SIZE-2, *(ca->map));
buf[n++] = '\n';
buf[n] = '\0';
return n;
}
-#define print_cpus_func(type) \
-static ssize_t print_cpus_##type(struct sysdev_class *class, \
- struct sysdev_class_attribute *attr, char *buf) \
-{ \
- return print_cpus_map(buf, cpu_##type##_mask); \
-} \
-static struct sysdev_class_attribute attr_##type##_map = \
- _SYSDEV_CLASS_ATTR(type, 0444, print_cpus_##type, NULL)
+#define _CPU_ATTR(name, map) \
+ { _SYSDEV_CLASS_ATTR(name, 0444, show_cpus_attr, NULL), map }
-print_cpus_func(online);
-print_cpus_func(possible);
-print_cpus_func(present);
+static struct cpu_attr cpu_attrs[] = {
+ _CPU_ATTR(online, &cpu_online_mask),
+ _CPU_ATTR(possible, &cpu_possible_mask),
+ _CPU_ATTR(present, &cpu_present_mask),
+};
/*
* Print values for NR_CPUS and offlined cpus
@@ -208,9 +213,9 @@ static ssize_t print_cpus_offline(struct sysdev_class *class,
static SYSDEV_CLASS_ATTR(offline, 0444, print_cpus_offline, NULL);
static struct sysdev_class_attribute *cpu_state_attr[] = {
- &attr_online_map,
- &attr_possible_map,
- &attr_present_map,
+ &cpu_attrs[0].attr,
+ &cpu_attrs[1].attr,
+ &cpu_attrs[2].attr,
&attr_kernel_max,
&attr_offline,
};
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 4 of 16 ==
Date: Tues, Mar 2 2010 3:40 pm
From: Greg Kroah-Hartman
From: John Ogness <john.ogness@linutronix.de>
Two trivial fixes for the Userspace IO Kconfig file:
1) uio_sercos3 is a PCI driver, so let it depend on PCI.
2) "default n" under UIO_PCI_GENERIC is luxury since it is already the default.
Acked-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/uio/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index 069b144..6dd2a29 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -74,6 +74,7 @@ config UIO_AEC
config UIO_SERCOS3
tristate "Automata Sercos III PCI card driver"
+ depends on PCI
help
Userspace I/O interface for the Sercos III PCI card from
Automata GmbH. The userspace part of this driver will be
@@ -87,7 +88,6 @@ config UIO_SERCOS3
config UIO_PCI_GENERIC
tristate "Generic driver for PCI 2.3 and PCI Express cards"
depends on PCI
- default n
help
Generic driver that you can bind, dynamically, to any
PCI 2.3 compliant and PCI Express card. It is useful,
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 5 of 16 ==
Date: Tues, Mar 2 2010 3:40 pm
From: Greg Kroah-Hartman
From: Eric W. Biederman <ebiederm@xmission.com>
These are the non-static sysfs attributes that exist on
my test machine. Fix them to use sysfs_attr_init or
sysfs_bin_attr_init as appropriate. It simply requires
making a sysfs attribute present to see this. So this
is a little bit tedious but otherwise not too bad.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/x86/kernel/cpu/mcheck/mce.c | 1 +
drivers/acpi/system.c | 2 ++
drivers/pci/pci-sysfs.c | 5 +++++
kernel/params.c | 1 +
4 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index a8aacd4..28cba46 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -2044,6 +2044,7 @@ static __init void mce_init_banks(void)
struct mce_bank *b = &mce_banks[i];
struct sysdev_attribute *a = &b->attr;
+ sysfs_attr_init(&a->attr);
a->attr.name = b->attrname;
snprintf(b->attrname, ATTR_LEN, "bank%d", i);
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index a206a12..743f244 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -101,6 +101,7 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
struct acpi_table_header *header = NULL;
struct acpi_table_attr *attr = NULL;
+ sysfs_attr_init(&table_attr->attr.attr);
if (table_header->signature[0] != '\0')
memcpy(table_attr->name, table_header->signature,
ACPI_NAME_SIZE);
@@ -475,6 +476,7 @@ void acpi_irq_stats_init(void)
goto fail;
strncpy(name, buffer, strlen(buffer) + 1);
+ sysfs_attr_init(&counter_attrs[i].attr);
counter_attrs[i].attr.name = name;
counter_attrs[i].attr.mode = 0644;
counter_attrs[i].show = counter_show;
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 807224e..9fa183c 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -642,6 +642,7 @@ void pci_create_legacy_files(struct pci_bus *b)
if (!b->legacy_io)
goto kzalloc_err;
+ sysfs_bin_attr_init(&b->legacy_io);
b->legacy_io->attr.name = "legacy_io";
b->legacy_io->size = 0xffff;
b->legacy_io->attr.mode = S_IRUSR | S_IWUSR;
@@ -654,6 +655,7 @@ void pci_create_legacy_files(struct pci_bus *b)
goto legacy_io_err;
/* Allocated above after the legacy_io struct */
+ sysfs_bin_attr_init(&b->legacy_mem);
b->legacy_mem = b->legacy_io + 1;
b->legacy_mem->attr.name = "legacy_mem";
b->legacy_mem->size = 1024*1024;
@@ -800,6 +802,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine)
if (res_attr) {
char *res_attr_name = (char *)(res_attr + 1);
+ sysfs_bin_attr_init(res_attr);
if (write_combine) {
pdev->res_attr_wc[num] = res_attr;
sprintf(res_attr_name, "resource%d_wc", num);
@@ -972,6 +975,7 @@ static int pci_create_capabilities_sysfs(struct pci_dev *dev)
if (!attr)
return -ENOMEM;
+ sysfs_bin_attr_init(attr);
attr->size = dev->vpd->len;
attr->attr.name = "vpd";
attr->attr.mode = S_IRUSR | S_IWUSR;
@@ -1038,6 +1042,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
retval = -ENOMEM;
goto err_resource_files;
}
+ sysfs_bin_attr_init(attr);
attr->size = rom_size;
attr->attr.name = "rom";
attr->attr.mode = S_IRUSR;
diff --git a/kernel/params.c b/kernel/params.c
index 4e27762..a60ebed 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -517,6 +517,7 @@ static __modinit int add_sysfs_param(struct module_kobject *mk,
new->grp.attrs = attrs;
/* Tack new one on the end. */
+ sysfs_attr_init(&new->attrs[num].mattr.attr);
new->attrs[num].param = kp;
new->attrs[num].mattr.show = param_attr_show;
new->attrs[num].mattr.store = param_attr_store;
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 6 of 16 ==
Date: Tues, Mar 2 2010 3:40 pm
From: Greg Kroah-Hartman
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
A pointer to omap_hdq_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Stanley.Miao <stanley.miao@windriver.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/w1/masters/omap_hdq.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 0d92969..22977d3 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -72,7 +72,7 @@ struct hdq_data {
int init_trans;
};
-static int __init omap_hdq_probe(struct platform_device *pdev);
+static int __devinit omap_hdq_probe(struct platform_device *pdev);
static int omap_hdq_remove(struct platform_device *pdev);
static struct platform_driver omap_hdq_driver = {
@@ -558,7 +558,7 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
return;
}
-static int __init omap_hdq_probe(struct platform_device *pdev)
+static int __devinit omap_hdq_probe(struct platform_device *pdev)
{
struct hdq_data *hdq_data;
struct resource *res;
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 7 of 16 ==
Date: Tues, Mar 2 2010 3:40 pm
From: Greg Kroah-Hartman
From: Eric W. Biederman <ebiederm@xmission.com>
Now that there are no more users we can remove
the sysfs_sb variable.
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/sysfs/mount.c | 2 --
fs/sysfs/sysfs.h | 1 -
2 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 89db07e..0cb1088 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -23,7 +23,6 @@
static struct vfsmount *sysfs_mount;
-struct super_block * sysfs_sb = NULL;
struct kmem_cache *sysfs_dir_cachep;
static const struct super_operations sysfs_ops = {
@@ -50,7 +49,6 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
sb->s_magic = SYSFS_MAGIC;
sb->s_op = &sysfs_ops;
sb->s_time_gran = 1;
- sysfs_sb = sb;
/* get root inode, initialize and unlock it */
mutex_lock(&sysfs_mutex);
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 7593d71..30f5a44 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -115,7 +115,6 @@ struct sysfs_addrm_cxt {
* mount.c
*/
extern struct sysfs_dirent sysfs_root;
-extern struct super_block *sysfs_sb;
extern struct kmem_cache *sysfs_dir_cachep;
/*
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 8 of 16 ==
Date: Tues, Mar 2 2010 3:40 pm
From: Matthew Garrett
On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:
> Add threeg sysfs file for support query 3G state by standard 66/62 ec
> command, the MSI standard ec interface supported this feature.
No. Just use the rfkill interface.
--
Matthew Garrett | mjg59@srcf.ucam.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 9 of 16 ==
Date: Tues, Mar 2 2010 3:40 pm
From: Greg Kroah-Hartman
From: Johannes Berg <johannes@sipsolutions.net>
This is required for lockdep.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/macintosh/windfarm_core.c | 1 +
drivers/macintosh/windfarm_smu_controls.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c
index 437f55c..419795f 100644
--- a/drivers/macintosh/windfarm_core.c
+++ b/drivers/macintosh/windfarm_core.c
@@ -321,6 +321,7 @@ int wf_register_sensor(struct wf_sensor *new_sr)
kref_init(&new_sr->ref);
list_add(&new_sr->link, &wf_sensors);
+ sysfs_attr_init(&new_sr->attr.attr);
new_sr->attr.attr.name = new_sr->name;
new_sr->attr.attr.mode = 0444;
new_sr->attr.show = wf_show_sensor;
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index 6c68b9e..43137b4 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -173,6 +173,7 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
fct->fan_type = pwm_fan;
fct->ctrl.type = pwm_fan ? WF_CONTROL_PWM_FAN : WF_CONTROL_RPM_FAN;
+ sysfs_attr_init(&fct->ctrl.attr.attr);
/* We use the name & location here the same way we do for SMU sensors,
* see the comment in windfarm_smu_sensors.c. The locations are a bit
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 10 of 16 ==
Date: Tues, Mar 2 2010 3:40 pm
From: Greg Kroah-Hartman
From: Eric W. Biederman <ebiederm@xmission.com>
A little more whack-a-mole annotating the dynamic sysfs attributes. I
had everything built into my earlier test kernel, and so I missed
these.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/module.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index f82386b..5ec6b47 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1083,6 +1083,7 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
if (sattr->name == NULL)
goto out;
sect_attrs->nsections++;
+ sysfs_attr_init(&sattr->mattr.attr);
sattr->mattr.show = module_sect_show;
sattr->mattr.store = NULL;
sattr->mattr.attr.name = sattr->name;
@@ -1178,6 +1179,7 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect,
if (sect_empty(&sechdrs[i]))
continue;
if (sechdrs[i].sh_type == SHT_NOTE) {
+ sysfs_bin_attr_init(nattr);
nattr->attr.name = mod->sect_attrs->attrs[loaded].name;
nattr->attr.mode = S_IRUGO;
nattr->size = sechdrs[i].sh_size;
@@ -1250,6 +1252,7 @@ int module_add_modinfo_attrs(struct module *mod)
if (!attr->test ||
(attr->test && attr->test(mod))) {
memcpy(temp_attr, attr, sizeof(*temp_attr));
+ sysfs_attr_init(&temp_attr->attr);
error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr);
++temp_attr;
}
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 11 of 16 ==
Date: Tues, Mar 2 2010 3:40 pm
From: Greg Kroah-Hartman
From: Lee, Chun-Yi <jlee@novell.com>
Add threeg sysfs file for support query 3G state by standard 66/62 ec
command, the MSI standard ec interface supported this feature.
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/platform/x86/msi-laptop.c | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 323e994..1784d55 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -70,6 +70,7 @@
#define MSI_STANDARD_EC_BLUETOOTH_MASK (1 << 0)
#define MSI_STANDARD_EC_WEBCAM_MASK (1 << 1)
#define MSI_STANDARD_EC_WLAN_MASK (1 << 3)
+#define MSI_STANDARD_EC_3G_MASK (1 << 4)
static int force;
module_param(force, bool, 0);
@@ -80,7 +81,7 @@ module_param(auto_brightness, int, 0);
MODULE_PARM_DESC(auto_brightness, "Enable automatic brightness control (0: disabled; 1: enabled; 2: don't touch)");
static bool old_ec_model;
-static int wlan_s, bluetooth_s;
+static int wlan_s, bluetooth_s, threeg_s;
/* Hardware access */
@@ -169,6 +170,8 @@ static int get_wireless_state_ec_standard(void)
bluetooth_s = !!(rdata & MSI_STANDARD_EC_BLUETOOTH_MASK);
+ threeg_s = !!(rdata & MSI_STANDARD_EC_3G_MASK);
+
return 0;
}
@@ -230,6 +233,23 @@ static ssize_t show_bluetooth(struct device *dev,
return sprintf(buf, "%i\n", enabled);
}
+static ssize_t show_threeg(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+
+ int ret;
+
+ /* old msi ec not support 3G */
+ if (old_ec_model)
+ return -1;
+
+ ret = get_wireless_state_ec_standard();
+ if (ret < 0)
+ return ret;
+
+ return sprintf(buf, "%i\n", threeg_s);
+}
+
static ssize_t show_lcd_level(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -292,6 +312,7 @@ static DEVICE_ATTR(lcd_level, 0644, show_lcd_level, store_lcd_level);
static DEVICE_ATTR(auto_brightness, 0644, show_auto_brightness, store_auto_brightness);
static DEVICE_ATTR(bluetooth, 0444, show_bluetooth, NULL);
static DEVICE_ATTR(wlan, 0444, show_wlan, NULL);
+static DEVICE_ATTR(threeg, 0444, show_threeg, NULL);
static struct attribute *msipf_attributes[] = {
&dev_attr_lcd_level.attr,
@@ -412,6 +433,12 @@ static int __init msi_init(void)
if (ret)
goto fail_platform_device2;
+ if (!old_ec_model) {
+ ret = device_create_file(&msipf_device->dev, &dev_attr_threeg);
+ if (ret)
+ goto fail_platform_device2;
+ }
+
/* Disable automatic brightness control by default because
* this module was probably loaded to do brightness control in
* software. */
@@ -446,6 +473,8 @@ static void __exit msi_cleanup(void)
{
sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group);
+ if (!old_ec_model)
+ device_remove_file(&msipf_device->dev, &dev_attr_threeg);
platform_device_unregister(msipf_device);
platform_driver_unregister(&msipf_driver);
backlight_device_unregister(msibl_device);
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 12 of 16 ==
Date: Tues, Mar 2 2010 3:40 pm
From: Greg Kroah-Hartman
From: Eric W. Biederman <ebiederm@xmission.com>
Acknowledge that the logical sysfs rwsem has one instance per
sysfs attribute with different locking depencencies for different
attributes.
There is a sysfs idiom where writing to one sysfs file causes the
addition or removal of other sysfs files. Lumping all of the
sysfs attributes together in one lock class causes lockdep to
generate lots of false positives.
This introduces the requirement that non-static sysfs attributes
need to be initialized with sysfs_attr_init or sysfs_bin_attr_init.
Strictly speaking this requirement only exists when lockdep is
enabled, and when lockdep is enabled we get a bit fat warning
if this requirement is not met.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/sysfs/sysfs.h | 7 +++++--
include/linux/sysfs.h | 18 ++++++++++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 7db6884..37e0e08 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -92,9 +92,12 @@ static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
#ifdef CONFIG_DEBUG_LOCK_ALLOC
#define sysfs_dirent_init_lockdep(sd) \
do { \
- static struct lock_class_key __key; \
+ struct attribute *attr = sd->s_attr.attr; \
+ struct lock_class_key *key = attr->key; \
+ if (!key) \
+ key = &attr->skey; \
\
- lockdep_init_map(&sd->dep_map, "s_active", &__key, 0); \
+ lockdep_init_map(&sd->dep_map, "s_active", key, 0); \
} while(0)
#else
#define sysfs_dirent_init_lockdep(sd) do {} while(0)
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 3e85265..006c359 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -15,6 +15,7 @@
#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/list.h>
+#include <linux/lockdep.h>
#include <asm/atomic.h>
struct kobject;
@@ -29,8 +30,23 @@ struct attribute {
const char *name;
struct module *owner;
mode_t mode;
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+ struct lock_class_key *key;
+ struct lock_class_key skey;
+
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home