08 Mar, 2010

40 commits

  • 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
    Acked-by: WANG Cong
    Cc: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • 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
    Acked-by: WANG Cong
    Cc: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • 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
    Acked-by: WANG Cong
    Cc: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • 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
    Cc: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • The function name must be followed by a space, hypen, space, and a
    short description.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     
  • 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
    Acked-by: Ben Nizette
    Signed-off-by: Greg Kroah-Hartman

    Hans J. Koch
     
  • 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
    Signed-off-by: Hans J. Koch
    Signed-off-by: Greg Kroah-Hartman

    John Ogness
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Hans J. Koch
     
  • 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
    Acked-by: Miguel Ojeda
    Cc: Andrew Morton
    Cc: Avuton Olrich
    Cc: Antonino Daplas
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     
  • 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
    Acked-by: Sakari Ailus
    Acked-by: Trilok Soni
    Cc: Hans Verkuil
    Cc: Mauro Carvalho Chehab
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     
  • 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
    Cc: Stanley.Miao
    Acked-by: Evgeniy Polyakov
    Cc: Andrew Morton
    Cc: Madhusudhan Chikkature
    Cc: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     
  • 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
    Cc: Kalle Jokiniemi
    Cc: Tony Lindgren
    Cc: Paul Walmsley
    Cc: Richard Woodruff
    Cc: chandra shekhar
    Cc: Jason P Marini
    Cc: Syed Mohammed Khasim
    Cc: Jarkko Nikula
    Cc: Juha Yrjola
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     
  • 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
    Cc: Frans Pop
    Cc: Larry Finger
    Cc: Len Brown
    Cc: Helge Deller
    Cc: Andrew Morton
    Acked-by: Matthew Garrett
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     
  • 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
    Cc: Adrian Bunk
    Cc: Alberto Mardegan
    Cc: Andrew Morton
    Cc: Andriy Skulysh
    Cc: Antonino Daplas
    Cc: Anton Vorontsov
    Cc: Ben Dooks
    Cc: Chandramouli Narayanan
    Cc: Christoph Hellwig
    Cc: Frans Pop
    Cc: Geert Uytterhoeven
    Cc: Greg Kroah-Hartman
    Cc: Helge Deller
    Cc: Huang Ying
    Cc: Ian Molton
    Cc: Joshua Kinard
    Cc: Kaj-Michael Lang
    Cc: Krzysztof Helt
    Cc: linux-fbdev-devel@lists.sourceforge.net
    Cc: Maciej W. Rozycki
    Cc: Magnus Damm
    Cc: Martin Michlmayr
    Cc: Matthias Kaehlcke
    Cc: Paul Mundt
    Cc: Pavel Machek
    Cc: Philipp Zabel
    Cc: Richard Purdie
    Cc: Roel Kluin
    Cc: Roland Stigge
    Cc: Russell King
    Cc: Thomas Bogendoerfer
    Cc: Vincent Sanders
    Cc: Yoichi Yuasa
    Acked-by: Ralf Baechle
    Acked-by: Arnaud Patard
    Acked-by: James Simmons
    Acked-by: Peter Jones
    Acked-by: Jaya Kumar
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     
  • 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
    Cc: Andrew Morton
    Cc: David Brownell
    Cc: Dmitri Vorobiev
    Cc: Henrik Kretzschmar
    Cc: James Bottomley
    Cc: Kay Sievers
    Cc: peter fuerst
    Cc: Thomas Bogendoerfer
    Acked-by: Ralf Baechle
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     
  • 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
    Cc: Andrew Morton
    Cc: Ben Dooks
    Cc: Dmitry Baryshkov
    Cc: Eric Miao
    Cc: Liam Girdwood
    Cc: Paul Sokolovsky
    Cc: Richard Purdie
    Cc: Russell King
    Acked-by: Arnaud Patard
    Acked-by: Dmitry Eremin-Solenikov
    Acked-by: Kristoffer Ericson
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     
  • 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
    Acked-by: Vikram Dhillon
    Acked-by: Eric Miao
    Signed-off-by: Greg Kroah-Hartman

    Uwe Kleine-König
     
  • 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
    Acked-by: David Teigland
    Acked-by: Matt Domsch
    Acked-by: Maciej Sosnowski
    Acked-by: Hans J. Koch
    Acked-by: Pekka Enberg
    Acked-by: Jens Axboe
    Acked-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Emese Revfy
     
  • 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
    Cc: Andi Kleen
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • 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
    Signed-off-by: Stefan Richter
    Signed-off-by: Greg Kroah-Hartman

    Stefan Richter
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Emese Revfy
     
  • 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
    Signed-off-by: Luis R. Rodriguez
    Acked-by: Marcel Holtmann
    Signed-off-by: Greg Kroah-Hartman

    Luis R. Rodriguez
     
  • 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
    Cc: Linus Torvalds
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • 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
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Cc: Martin Schwidefsky
    Signed-off-by: Heiko Carstens
    Signed-off-by: Greg Kroah-Hartman

    Heiko Carstens
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen