There is no firmware "subsystem" it's just a directory in /sys that
other portions of the kernel want to hook into. So make it a kobject
not a kset to help alivate anyone who tries to do some odd kset-like
things with this.
Kay Sievers [Fri, 2 Nov 2007 12:47:53 +0000 (13:47 +0100)]
Driver Core: kill subsys_attribute and default sysfs ops
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 tells the core what was intended here.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kset: convert parisc/pdc_stable.c to use kset_create
Dynamically create the kset instead of declaring it statically.
This makes the kobject attributes now work properly that I broke in the
previous patch.
Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Thibaut VARENE <varenet@parisc-linux.org> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Grant Grundler <grundler@parisc-linux.org> Cc: Kyle McMartin <kyle@parisc-linux.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Dynamically create the kset instead of declaring it statically.
This makes the kobject attributes now work properly that I broke in the
previous patch.
Kay Sievers [Fri, 2 Nov 2007 12:47:53 +0000 (13:47 +0100)]
fix struct user_info export's sysfs interaction
Clean up the use of ksets and kobjects. Kobjects are instances of
objects (like struct user_info), ksets are collections of objects of a
similar type (like the uids directory containing the user_info directories).
So, use kobjects for the user_info directories, and a kset for the "uids"
directory.
On object cleanup, the final kobject_put() was missing.
Kay Sievers [Fri, 2 Nov 2007 12:47:53 +0000 (13:47 +0100)]
Driver Core: add kobj_attribute handling
Add kobj_sysfs_ops to replace subsys_sysfs_ops. There is no
need for special kset operations, we want to be able to use
simple attribute operations at any kobject, not only ksets.
The whole concept of any default sysfs attribute operations
will go away with the upcoming removal of subsys_sysfs_ops.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kset: convert struct bus_device->drivers to use kset_create
Dynamically create the kset instead of declaring it statically.
Having 3 static kobjects in one structure is not only foolish, but ripe
for nasty race conditions if handled improperly. We also rename the
field to catch any potential users of it (not that there should be
outside of the driver core...)
Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kset: convert struct bus_device->devices to use kset_create
Dynamically create the kset instead of declaring it statically.
Having 3 static kobjects in one structure is not only foolish, but ripe
for nasty race conditions if handled improperly. We also rename the
field to catch any potential users of it (not that there should be
outside of the driver core...)
Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Dynamically create the kset instead of declaring it statically. We also
rename power_subsys to power_kset to catch all users of the variable and
we properly export it so that people don't have to guess that it really
is present in the system.
The pseries code is wierd, why is it createing /sys/power if CONFIG_PM
is disabled? Oh well, stupid big boxes ignoring config options...
Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kset: convert drivers/base/class.c to use kset_create
Dynamically create the kset instead of declaring it statically.
The class_obj subsystem is not yet converted as it is more complex and
should be going away soon with the removal of class_device from the
kernel tree.
Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Dynamically create the kset instead of declaring it statically. We also
rename kernel_subsys to kernel_kset to catch all users of this symbol
with a build error instead of an easy-to-ignore build warning.
Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kset: convert pci hotplug to use kset_create_and_add
This also renames pci_hotplug_slots_subsys to pcis_hotplug_slots_kset
catch all current users with a build error instead of a build warning
which can easily be missed.
Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Now ksets can be dynamically created on the fly, no static definitions
are required. Thanks to Miklos for hints on how to make this work
better for the callers.
And thanks to Kay for finding some stupid bugs in my original version
and pointing out that we need to handle the fact that kobject's can have
a kset as a parent and to handle that properly in kobject_add().
We don't need a "default" ktype for a kset. We should set this
explicitly every time for each kset. This change is needed so that we
can make ksets dynamic, and cleans up one of the odd, undocumented
assumption that the kset/kobject/ktype model has.
This patch is based on a lot of help from Kay Sievers.
Nasty bug in the block code was found by Dave Young
<hidave.darkstar@gmail.com>
Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Dave Young <hidave.darkstar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Also add a kobject_init_and_add function which bundles up what a lot of
the current callers want to do all at once, and it properly handles the
memory usages, unlike kobject_register();
Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kobject: fix up kobject_set_name to use kvasprintf
Kay pointed out that kobject_set_name was being very stupid, doing two
allocations for every call, when it should just be using the kernel
function kvasprintf() instead.
This change adds the internal kobject_set_name_vargs() function, which
other follow-on patches will be using.
Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The IBM icom serial driver is using a kobject only for reference
counting, nothing else. So switch it to use a kref instead, which is
all that is needed, and is much smaller.
Cc: Anton Blanchard <anton@au.ibm.com> Cc: Paul Mackerras <paulus@au.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Ryan S. Arnold <rsa@us.ibm.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
hvcs is using a kobject only for reference counting, nothing else. So
switch it to use a kref instead, which is all that is needed, and is
much smaller.
Cc: Anton Blanchard <anton@au.ibm.com> Cc: Paul Mackerras <paulus@au.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Ryan S. Arnold <rsa@us.ibm.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kobject: convert hvc_console to use kref, not kobject
hvc_console is using a kobject only for reference counting, nothing
else. So switch it to use a kref instead, which is all that is needed,
and is much smaller.
Cc: Anton Blanchard <anton@au.ibm.com> Cc: Paul Mackerras <paulus@au.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Ryan S. Arnold <rsa@us.ibm.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The IBM asm driver is using a kobject only for reference counting,
nothing else. So switch it to use a kref instead, which is all that is
needed, and is much smaller.
Cc: Max Asböck <amax@us.ibm.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
It isn't that hard to add simple kset attributes, so don't go through
all the gyrations of creating your own object type and show and store
functions. Just use the functions that are already present. This makes
things much simpler.
Note, the version_str string violates the "one value per file" rule for
sysfs. I suggest changing this now (individual files per type supported
is one suggested way.)
Cc: Michael A. Halcrow <mahalcro@us.ibm.com> Cc: Michael C. Thompson <mcthomps@us.ibm.com> Cc: Tyler Hicks <tyhicks@ou.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Jones [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
cosa: Convert from class_device to device for cosa sync driver
struct class_device is going away, this converts the code to use struct
device instead.
Signed-off-by: Tony Jones <tonyj@suse.de> Cc: Jan "Yenya" Kasprzak <kas@fi.muni.cz> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Jones [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
tifm: Convert from class_device to device for TI flash media
Signed-off-by: Tony Jones <tonyj@suse.de> Cc: Alex Dubov <oakad@yahoo.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Jones [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
pktcdvd: Convert from class_device to device for block/pktcdvd
struct class_device is going away, this converts the code to use struct
device instead.
Signed-off-by: Tony Jones <tonyj@suse.de> Cc: Peter Osterlund <petero2@telia.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Jones [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
paride: Convert from class_device to device for block/paride
struct class_device is going away, this converts the code to use struct
device instead.
Signed-off-by: Tony Jones <tonyj@suse.de> Cc: Tim Waugh <tim@cyberelk.net> Cc: Jens Axboe <axboe@kernel.dk> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Jones [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
mtd: Convert from class_device to device for MTD/mtdchar
struct class_device is going away, this converts the code to use struct
device instead.
Signed-off-by: Tony Jones <tonyj@suse.de> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Jones [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
MCP_UCB1200: Convert from class_device to device
struct class_device is going away, this converts the code to use struct
device instead.
Signed-off-by: Tony Jones <tonyj@suse.de> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Jones [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
adb: Convert from class_device to device
struct class_device is going away, this converts the code to use struct
device instead.
Signed-off-by: Tony Jones <tonyj@suse.de> Cc: Joshua Thompson <funaho@jurai.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Jones [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
IDE: Convert from class_device to device for ide-tape
Signed-off-by: Tony Jones <tonyj@suse.de> Cc: Gadi Oxman <gadio@netvision.net.il> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Jones [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
DMA: Convert from class_device to device for DMA engine
Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Cc: Shannon Nelson <shannon.nelson@intel.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Kay Sievers [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
coda: convert struct class_device to struct device
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Tony Jones <tonyj@suse.de> Cc: Jan Harkes <jaharkes@cs.cmu.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Jones [Tue, 25 Sep 2007 00:03:03 +0000 (02:03 +0200)]
aoechr: Convert from class_device to device
Signed-off-by: Tony Jones <tonyj@suse.de> Cc: Jens Axboe <axboe@kernel.dk> Cc: Sam Hopkins <sah@coraid.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch reorganizes the way suspend and resume notifications are
sent to drivers. The major changes are that now the PM core acquires
every device semaphore before calling the methods, and calls to
device_add() during suspends will fail, while calls to device_del()
during suspends will block.
It also provides a way to safely remove a suspended device with the
help of the PM core, by using the device_pm_schedule_removal() callback
introduced specifically for this purpose, and updates two drivers (msr
and cpuid) that need to use it.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Frank Seidel [Fri, 9 Nov 2007 13:49:23 +0000 (14:49 +0100)]
nozomi driver
This is a driver to control the cardbus wireless data card that works on
3g networks.
Greg Kroah-Hartman <gregkh@suse.de> did the initial driver cleanup.
Thanks to Arnaud Patard <apatard@mandriva.com> for help with bugfixing.
Thanks to Alan Cox for a lot of tty fixes.
Thanks to Satyam Sharma <satyam@infradead.org> for fixing buildbreakage.
Thanks to Frank Seidel <fseidel@suse.de> for a lot of bugfixes and
rewriting to make it a sane Linux driver
Thanks to Jiri Slaby <jirislaby@gmail.com> for a lot bugfixes, cleanups
and rewrites that make it much more readable.
Kalle Valo [Thu, 24 Jan 2008 22:00:40 +0000 (14:00 -0800)]
spi: omap2_mcspi PIO RX fix
Before transmission of the last word in PIO RX_ONLY mode rx+tx mode
is enabled:
/* prevent last RX_ONLY read from triggering
* more word i/o: switch to rx+tx
*/
if (c == 0 && tx == NULL)
mcspi_write_cs_reg(spi,
OMAP2_MCSPI_CHCONF0, l);
But because c is decremented after the test, c will never be zero and
rx+tx will not be enabled. This breaks RX_ONLY mode PIO transfers.
Fix it by decrementing c in the beginning of the various I/O loops.
Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Thu, 24 Jan 2008 21:35:10 +0000 (13:35 -0800)]
Revert "mac80211: warn when receiving frames with unaligned data"
This reverts commit 81100eb80add328c4d2a377326f15aa0e7236398 for the
release, to avoid the unnecessary warning noise that is only really
relevant to wireless driver developers.
The warning will probably go right back in after I cut the release, but
at least we won't unnecessarily worry users.
Acked-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Mel Gorman [Thu, 24 Jan 2008 13:49:54 +0000 (05:49 -0800)]
slab: partially revert list3 changes
Partial revert the changes made by 04231b3002ac53f8a64a7bd142fde3fa4b6808c6
to the kmem_list3 management. On a machine with a memoryless node, this
BUG_ON was triggering
Larry Woodman [Thu, 24 Jan 2008 13:49:25 +0000 (05:49 -0800)]
fix hugepages leak due to pagetable page sharing
The shared page table code for hugetlb memory on x86 and x86_64
is causing a leak. When a user of hugepages exits using this code
the system leaks some of the hugepages.
-------------------------------------------------------
Part of /proc/meminfo just before database startup:
HugePages_Total: 5500
HugePages_Free: 5500
HugePages_Rsvd: 0
Hugepagesize: 2048 kB
Just before shutdown:
HugePages_Total: 5500
HugePages_Free: 4475
HugePages_Rsvd: 0
Hugepagesize: 2048 kB
The problem occurs durring a fork, in copy_hugetlb_page_range(). It
locates the dst_pte using huge_pte_alloc(). Since huge_pte_alloc() calls
huge_pmd_share() it will share the pmd page if can, yet the main loop in
copy_hugetlb_page_range() does a get_page() on every hugepage. This is a
violation of the shared hugepmd pagetable protocol and creates additional
referenced to the hugepages causing a leak when the unmap of the VMA
occurs. We can skip the entire replication of the ptes when the hugepage
pagetables are shared. The attached patch skips copying the ptes and the
get_page() calls if the hugetlbpage pagetable is shared.
[akpm@linux-foundation.org: coding-style cleanups] Signed-off-by: Larry Woodman <lwoodman@redhat.com> Signed-off-by: Adam Litke <agl@us.ibm.com> Cc: Badari Pulavarty <pbadari@us.ibm.com> Cc: Ken Chen <kenchen@google.com> Cc: David Gibson <david@gibson.dropbear.id.au> Cc: William Lee Irwin III <wli@holomorphy.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>