summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * sysfs: Use one lockdep class per sysfs attribute.Eric W. Biederman2010-03-082-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * sysfs: Only take active references on attributes.Eric W. Biederman2010-03-083-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we exclude directories and symlinks from the set of sysfs dirents where we need active references we are left with sysfs attributes (binary or not). - Tweak sysfs_deactivate to only do something on attributes - Move lockdep initialization into sysfs_file_add_mode to limit it to just attributes. 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>
| | * sysfs: Remove sysfs_get/put_active_twoEric W. Biederman2010-03-084-77/+38Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that holding an active reference on a directory is pointless. The purpose of the active references are to allows us to block when removing sysfs entries that have custom methods so we don't remove modules while running modular code and to keep those custom methods from accessing data structures after the files have been removed. Further sysfs_remove_dir remove all elements in the directory before removing the directory itself, so there is no chance we will remove a directory with active children. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * Driver core: Fix first line of kernel-doc for a few functionsBen Hutchings2010-03-082-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | The function name must be followed by a space, hypen, space, and a short description. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * UIO: Remove SMX Cryptengine driverHans J. Koch2010-03-083-152/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ben Nizette, the author of this driver, told me in a private mail that this project has been cancelled. He suggested to remove the driver for now, and will come back with a new version should the hardware really exist. This patch completely removes the driver. Signed-off-by: Hans J. Koch <hjk@linutronix.de> Acked-by: Ben Nizette <bn@niasdigital.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * UIO: minor Kconfig fixesJohn Ogness2010-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * UIO: Add a driver for Hilscher netX-based fieldbus cardsHans J. Koch2010-03-083-0/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a Userspace IO driver for netX-based fieldbus cards by Hilscher (see http://www.hilscher.com). ATM, cifX and comX cards are supported. The userspace part for this driver is provided by Hilscher and should come with the card. The driver is in use for several months now and has been tested by people at Hilscher and Linutronix. Signed-off-by: Hans J. Koch <hjk@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * auxdisplay: move cfag12864bfb's probe function to .devinit.textUwe Kleine-König2010-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pointer to cfag12864bfb_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> Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Avuton Olrich <avuton@gmail.com> Cc: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * media: move omap24xxcam's probe function to .devinit.textUwe Kleine-König2010-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pointer to omap24xxcam_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> Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> Acked-by: Trilok Soni <soni.trilok@gmail.com> Cc: Hans Verkuil <hverkuil@xs4all.nl> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * w1: move omap_hdq's probe function to .devinit.textUwe Kleine-König2010-03-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * i2c: move i2c_omap's probe function to .devinit.textUwe Kleine-König2010-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pointer to omap_i2c_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: Kalle Jokiniemi <ext-kalle.jokiniemi@nokia.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Richard Woodruff <r-woodruff2@ti.com> Cc: chandra shekhar <x0044955@ti.com> Cc: Jason P Marini <jason.marini@gmail.com> Cc: Syed Mohammed Khasim <x0khasim@ti.com> Cc: Jarkko Nikula <jarkko.nikula@nokia.com> Cc: Juha Yrjola <juha.yrjola@solidboot.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * x86: move hp-wmi's probe function to .devinit.textUwe Kleine-König2010-03-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pointer to hp_wmi_bios_setup 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: Frans Pop <elendil@planet.nl> Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Len Brown <lenb@kernel.org> Cc: Helge Deller <deller@gmx.de> Cc: Andrew Morton <akpm@linux-foundation.org> Acked-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * platform-drivers: move probe to .devinit.text in drivers/videoUwe Kleine-König2010-03-0817-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pointer to a probe callback 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: Adrian Bunk <bunk@stusta.de> Cc: Alberto Mardegan <mardy@users.sourceforge.net> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andriy Skulysh <askulysh@gmail.com> Cc: Antonino Daplas <adaplas@gmail.com> Cc: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Chandramouli Narayanan <mouli@linux.intel.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Frans Pop <elendil@planet.nl> Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Helge Deller <deller@gmx.de> Cc: Huang Ying <ying.huang@intel.com> Cc: Ian Molton <spyro@f2s.com> Cc: Joshua Kinard <kumba@gentoo.org> Cc: Kaj-Michael Lang <milang@tal.org> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: linux-fbdev-devel@lists.sourceforge.net Cc: Maciej W. Rozycki <macro@linux-mips.org> Cc: Magnus Damm <damm@igel.co.jp> Cc: Martin Michlmayr <tbm@cyrius.com> Cc: Matthias Kaehlcke <matthias@kaehlcke.net> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Pavel Machek <pavel@suse.cz> Cc: Philipp Zabel <philipp.zabel@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Roel Kluin <roel.kluin@gmail.com> Cc: Roland Stigge <stigge@antcom.de> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Vincent Sanders <vince@simtec.co.uk> Cc: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Acked-by: Ralf Baechle <ralf@linux-mips.org> Acked-by: Arnaud Patard <arnaud.patard@rtp-net.org> Acked-by: James Simmons <jsimmons@infradead.org> Acked-by: Peter Jones <pjones@redhat.com> Acked-by: Jaya Kumar <jayakumar.lkml@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * platform-drivers: move probe to .devinit.text in drivers/scsiUwe Kleine-König2010-03-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pointer to a probe callback 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: Andrew Morton <akpm@linux-foundation.org> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Dmitri Vorobiev <dmitri.vorobiev@movial.fi> Cc: Henrik Kretzschmar <henne@nachtwindheim.de> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: peter fuerst <post@pfrst.de> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * platform-drivers: move probe to .devinit.text in arch/armUwe Kleine-König2010-03-084-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pointer to a probe callback 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: Andrew Morton <akpm@linux-foundation.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Dmitry Baryshkov <dbaryshkov@gmail.com> Cc: Eric Miao <eric.miao@marvell.com> Cc: Liam Girdwood <liam.girdwood@wolfsonmicro.com> Cc: Paul Sokolovsky <pmiscml@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Arnaud Patard <arnaud.patard@rtp-net.org> Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Acked-by: Kristoffer Ericson <kristoffer.ericson@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * Driver core: make struct platform_driver.id_table constUwe Kleine-König2010-03-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a warning on several pxa based machines: arch/arm/mach-pxa/ssp.c:475: warning: initialization discards qualifiers from pointer target type Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Vikram Dhillon <dhillonv10@gmail.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * Driver core: Constify struct sysfs_ops in struct kobj_typeEmese Revfy2010-03-0854-70/+69Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Constify struct sysfs_ops. This is part of the ops structure constification effort started by Arjan van de Ven et al. Benefits of this constification: * prevents modification of data that is shared (referenced) by many other structure instances at runtime * detects/prevents accidental (but not intentional) modification attempts on archs that enforce read-only kernel data at runtime * potentially better optimized code as the compiler can assume that the const data cannot be changed * the compiler/linker move const data into .rodata and therefore exclude them from false sharing Signed-off-by: Emese Revfy <re.emese@gmail.com> Acked-by: David Teigland <teigland@redhat.com> Acked-by: Matt Domsch <Matt_Domsch@dell.com> Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com> Acked-by: Hans J. Koch <hjk@linutronix.de> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Acked-by: Jens Axboe <jens.axboe@oracle.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * sysdev: fix up the probe/release attributesGreg Kroah-Hartman2010-03-081-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These should be sysdev attributes, not class attributes. This patch should resolve the problem. Thanks to Stephen Rothwell for pointing out the problem. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Andi Kleen <andi@firstfloor.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * HOWTO: Updates on subsystem trees, patchwork, -next (vs. -mm)Stefan Richter2010-03-081-77/+36Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the roles which -mm fulfilled some time ago (to offer an integration testing ground) has been taken over by -next. This is still news to Documentation/HOWTO, so mention it there. Also add a word on how patchwork is used to track patches as they make their way into subsystem trees. Remove some arbitrary links to subsystem repositories; they can all be found in the MAINTAINERS database. Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * kobject: Constify struct kset_uevent_opsEmese Revfy2010-03-089-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Constify struct kset_uevent_ops. This is part of the ops structure constification effort started by Arjan van de Ven et al. Benefits of this constification: * prevents modification of data that is shared (referenced) by many other structure instances at runtime * detects/prevents accidental (but not intentional) modification attempts on archs that enforce read-only kernel data at runtime * potentially better optimized code as the compiler can assume that the const data cannot be changed * the compiler/linker move const data into .rodata and therefore exclude them from false sharing Signed-off-by: Emese Revfy <re.emese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * driver-core: firmware_class: remove base.h header inclusionLuis R. Rodriguez2010-03-081-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | base.h is used by base drivers for sharing internal structures. Turns out firmware_class does not depend on it at all so remove it. Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * sysfs: Cache the last sysfs_dirent to improve readdir scalability v2Eric W. Biederman2010-03-081-22/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When sysfs_readdir stops short we now cache the next sysfs_dirent to return to user space in filp->private_data. There is no impact on the rest of sysfs by doing this and in the common case it allows us to pick up exactly where we left off with no seeking. Additionally I drop and regrab the sysfs_mutex around filldir to avoid a page fault abritrarily increasing the hold time on the sysfs_mutex. v2: Returned to using INT_MAX as the EOF condition. seekdir is ambiguous unless all directory entries have a unique f_pos value. Fixes http://bugzilla.kernel.org/show_bug.cgi?id=14949 Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * Driver-Core: require valid action string in uevent triggerKay Sievers2010-03-081-8/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | No longer fall back to "add" and warn, but always require a valid action-string written to the "uevent" file. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * Driver-Core: disable /sbin/hotplug by defaultKay Sievers2010-03-081-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | No recent mainstream system uses the /sbin/hotplug fork-bomb any more. Disable it by default to reflect how it is used these days. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * Driver-Core: devtmpfs - remove EXPERIMENTAL and flush out the descriptionKay Sievers2010-03-081-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | All major distros enable devtmpfs on recent systems, so remove the EXPERIMENTAL flag, and make the description a bit more instructive. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * Driver-Core: devtmpfs - reset inode permissions before unlinkingKay Sievers2010-03-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before unlinking the inode, reset the current permissions of possible references like hardlinks, so granted permissions can not be retained across the device lifetime by creating hardlinks, in the unusual case that there is a user-writable directory on the same filesystem. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * driver core: Convert some drivers to CLASS_ATTR_STRINGAndi Kleen2010-03-086-57/+27Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert some drivers who export a single string as class attribute to the new class_attr_string functions. This removes redundant code all over. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * driver core: Add class_attr_string for simple read-only stringAndi Kleen2010-03-082-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several drivers just export a static string as class attributes. Use the new extensible attribute support to define a simple CLASS_ATTR_STRING() macro for this. This will allow to remove code from drivers in followon patches. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * driver-core: Add attribute argument to class_attribute show/storeAndi Kleen2010-03-0821-32/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing the attribute to the low level IO functions allows all kinds of cleanups, by sharing low level IO code without requiring an own function for every piece of data. Also drivers can extend the attributes with own data fields and use that in the low level function. This makes the class attributes the same as sysdev_class attributes and plain attributes. This will allow further cleanups in drivers. Full tree sweep converting all users. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * sysdev: fix missing s390 conversionHeiko Carstens2010-03-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In linux-next "sysdev: Pass attribute in sysdev_class attributes show/store" forgot to convert one place in s390 code. Here is the missing part. Cc: Andi Kleen <ak@linux.intel.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * sysdev: Fix type of sysdev class attribute in memory driverAndi Kleen2010-03-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This attribute is really a sysdev_class attribute, not a plain class attribute. They are identical in layout currently, but this might not always be the case. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * sysdev: Add sysdev_create/remove_filesAndi Kleen2010-03-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to create/remove arrays of sysdev attributes Just wrappers around sysfs_create/move_files Will be used later to clean up some drivers. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * sysdev: Use sysdev_class attribute arrays in node driverAndi Kleen2010-03-081-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the node driver to sysdev_class attribute arrays. This greatly cleans up the code and remove a lot of code. Saves ~150 bytes of code on x86-64. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * sysdev: Convert node driverAndi Kleen2010-03-081-40/+17Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use sysdev_class attribute arrays in node driver Convert the node driver to sysdev_class attribute arrays. This greatly cleans up the code and remove a lot of code. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * sysfs: Add attribute array to sysdev classesAndi Kleen2010-03-082-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a attribute array that is automatically registered and unregistered to struct sysdev_class. This is similar to what struct class has. A lot of drivers add list of attributes, so it's better to do this easily in the common sysdev layer. This adds a new field to struct sysdev_class. I audited the whole tree and there are no dynamically allocated sysdev classes, so this is fully compatible. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * sysfs: Add sysfs_add/remove_files utility functionsAndi Kleen2010-03-082-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * sysdev: Convert cpu driver sysdev class attributesAndi Kleen2010-03-081-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * sysdev: Convert node driver class attributes to be data drivenAndi Kleen2010-03-081-47/+18Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the new attribute argument convert the node driver class attributes to carry the node state. Then use a shared function to do what a lot of individual functions did before. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * sysdev: Pass attribute in sysdev_class attributes show/storeAndi Kleen2010-03-0810-30/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing the attribute to the low level IO functions allows all kinds of cleanups, by sharing low level IO code without requiring an own function for every piece of data. Also drivers can extend the attributes with own data fields and use that in the low level function. Similar to sysdev_attributes and normal attributes. This is a tree-wide sweep, converting everything in one go. No functional changes in this patch other than passing the new argument everywhere. Tested on x86, the non x86 parts are uncompiled. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * driver core: make platform_device_id table constEric Miao2010-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The platform ID table is normally const, force that by adding the attribute. Signed-off-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * Driver core: add platform_create_bundle() helperDmitry Torokhov2010-03-082-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many legacy-style module create singleton platform devices themselves, along with corresponding platform driver. Instead of replicating error handling code in all such drivers, provide a helper that allocates and registers a single platform device and a driver and binds them together. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * kset-example: Spelling fixes.Radu Voicilas2010-03-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | No change in functionality. Signed-off-by: Radu Voicilas <rvoicilas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * kobject-example: Spelling fixes.Radu Voicilas2010-03-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | No change in functionality. Signed-off-by: Radu Voicilas <rvoicilas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| | * driver-core: fix race condition in get_device_parent()Tejun Heo2010-03-081-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sysfs is creating several devices in cuse class concurrently and with CONFIG_SYSFS_DEPRECATED turned off, it triggers the following oops. BUG: unable to handle kernel NULL pointer dereference at 0000000000000038 IP: [<ffffffff81158b0a>] sysfs_addrm_start+0x4a/0xf0 PGD 75bb067 PUD 75be067 PMD 0 Oops: 0000 [#1] PREEMPT SMP last sysfs file: /sys/devices/system/cpu/cpu7/topology/core_siblings CPU 1 Modules linked in: cuse fuse Pid: 4737, comm: osspd Not tainted 2.6.31-work #77 RIP: 0010:[<ffffffff81158b0a>] [<ffffffff81158b0a>] sysfs_addrm_start+0x4a/0xf0 RSP: 0018:ffff88000042f8f8 EFLAGS: 00010296 RAX: ffff88000042ffd8 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff880007eef660 RDI: 0000000000000001 RBP: ffff88000042f918 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: ffffffff81158b0a R12: ffff88000042f928 R13: 00000000fffffff4 R14: 0000000000000000 R15: ffff88000042f9a0 FS: 00007fe93905a950(0000) GS:ffff880008600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000038 CR3: 00000000077c9000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process osspd (pid: 4737, threadinfo ffff88000042e000, task ffff880007eef040) Stack: ffff880005da10e8 0000000011cc8d6e ffff88000042f928 ffff880003d28a28 <0> ffff88000042f988 ffffffff811592d7 0000000000000000 0000000000000000 <0> 0000000000000000 0000000000000000 ffff88000042f958 0000000011cc8d6e Call Trace: [<ffffffff811592d7>] create_dir+0x67/0xe0 [<ffffffff811593a8>] sysfs_create_dir+0x58/0xb0 [<ffffffff8128ca7c>] ? kobject_add_internal+0xcc/0x220 [<ffffffff812942e1>] ? vsnprintf+0x3c1/0xb90 [<ffffffff8128cab7>] kobject_add_internal+0x107/0x220 [<ffffffff8128cd37>] kobject_add_varg+0x47/0x80 [<ffffffff8128ce53>] kobject_add+0x53/0x90 [<ffffffff81357d84>] device_add+0xd4/0x690 [<ffffffff81356c2b>] ? dev_set_name+0x4b/0x70 [<ffffffffa001a884>] cuse_process_init_reply+0x2b4/0x420 [cuse] ... The problem is that kobject_add_internal() first adds a kobject to the kset and then try to create sysfs directory for it. If the creation fails, it remove the kobject from the kset. get_device_parent() accesses class_dirs kset while only holding class_dirs.list_lock to see whether the cuse class dir exists. But when it exists, it may not have finished initialization yet or may fail and get removed soon. In the above case, the former happened so the second one ends up trying to create subdirectory under NULL sysfs_dirent. Fix it by grabbing a mutex in get_device_parent(). Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Colin Guthrie <cguthrie@mandriva.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdogLinus Torvalds2010-03-0861-193/+1088
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog: [WATCHDOG] i6300esb.c: change platform_driver to pci_driver [WATCHDOG] i6300esb: fix unlock register with [WATCHDOG] drivers/watchdog/wdt.c:wdt_ioctl(): make `ident' non-static [WATCHDOG] change reboot_notifier to platform-shutdown method. [WATCHDOG] watchdog_info constify [WATCHDOG] gef_wdt: Author corrections following split of GE Fanuc joint venture [WATCHDOG] iTCO_wdt: clean up probe(), modify err msg [WATCHDOG] ep93xx: watchdog timer driver for TS-72xx SBCs cleanup [WATCHDOG] support for max63xx watchdog timer chips [WATCHDOG] ep93xx: added platform side support for TS-72xx WDT driver [WATCHDOG] ep93xx: implemented watchdog timer driver for TS-72xx SBCs
| | * | [WATCHDOG] i6300esb.c: change platform_driver to pci_driverWim Van Sebroeck2010-03-081-60/+33Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the intel 6300esb platform uses a dedicated PCI ID for it's watchdog timer (00:1d.4), it's better and easier to have this as a pci_driver. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| | * | [WATCHDOG] i6300esb: fix unlock register withWim Van Sebroeck2010-03-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before you can read or write from the i6300esb memeory mapped registers, you need to unlock these. This is done by writing the magic numbers 0x80 and 0x86 to the reload register. The size of the reload register is 32bit though. Also binary 11 is hex 0x03 and not 0x11. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| | * | [WATCHDOG] drivers/watchdog/wdt.c:wdt_ioctl(): make `ident' non-staticAndrew Morton2010-03-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Making this instance static exposes the code to SMP races, etc. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| | * | [WATCHDOG] change reboot_notifier to platform-shutdown method.Wim Van Sebroeck2010-03-072-56/+21Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Platform device drivers can use the .shutdown method to handle soft shutdown's instead of reboot_notifier's. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| | * | [WATCHDOG] watchdog_info constifyWim Van Sebroeck2010-03-0752-53/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | make the watchdog_info struct const where possible. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>