15 Dec, 2011

1 commit

  • All sysdev classes and sysdev devices will converted to regular devices
    and buses to properly hook userspace into the event processing.

    There is no interesting difference between a 'sysdev' and 'device' which
    would justify to roll an entire own subsystem with different userspace
    export semantics. Userspace relies on events and generic sysfs subsystem
    infrastructure from sysdev devices, which are currently not properly
    available.

    Every converted sysdev class will create a regular device with the class
    name in /sys/devices/system and all registered devices will becom a children
    of theses devices.

    For compatibility reasons, the sysdev class-wide attributes are created
    at this parent device. (Do not copy that logic for anything new, subsystem-
    wide properties belong to the subsystem, not to some fake parent device
    created in /sys/devices.)

    Every sysdev driver is implemented as a simple subsystem interface now,
    and no longer called a driver.

    After all sysdev classes are ported to regular driver core entities, the
    sysdev implementation will be entirely removed from the kernel.

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

14 Jan, 2011

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    Documentation/trace/events.txt: Remove obsolete sched_signal_send.
    writeback: fix global_dirty_limits comment runtime -> real-time
    ppc: fix comment typo singal -> signal
    drivers: fix comment typo diable -> disable.
    m68k: fix comment typo diable -> disable.
    wireless: comment typo fix diable -> disable.
    media: comment typo fix diable -> disable.
    remove doc for obsolete dynamic-printk kernel-parameter
    remove extraneous 'is' from Documentation/iostats.txt
    Fix spelling milisec -> ms in snd_ps3 module parameter description
    Fix spelling mistakes in comments
    Revert conflicting V4L changes
    i7core_edac: fix typos in comments
    mm/rmap.c: fix comment
    sound, ca0106: Fix assignment to 'channel'.
    hrtimer: fix a typo in comment
    init/Kconfig: fix typo
    anon_inodes: fix wrong function name in comment
    fix comment typos concerning "consistent"
    poll: fix a typo in comment
    ...

    Fix up trivial conflicts in:
    - drivers/net/wireless/iwlwifi/iwl-core.c (moved to iwl-legacy.c)
    - fs/ext4/ext4.h

    Also fix missed 'diabled' typo in drivers/net/bnx2x/bnx2x.h while at it.

    Linus Torvalds
     

22 Nov, 2010

1 commit


18 Nov, 2010

1 commit


23 Oct, 2010

1 commit

  • This patch removes the old CONFIG_SYSFS_DEPRECATED_V2 config option,
    but it keeps the logic around to handle block devices in the old manner
    as some people like to run new kernel versions on old (pre 2007/2008)
    distros.

    Signed-off-by: Kay Sievers
    Cc: Jens Axboe
    Cc: Stephen Hemminger
    Cc: "Eric W. Biederman"
    Cc: Alan Stern
    Cc: "James E.J. Bottomley"
    Cc: Andrew Morton
    Cc: Alexey Kuznetsov
    Cc: Randy Dunlap
    Cc: Tejun Heo
    Cc: "David S. Miller"
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: David Howells
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

06 Aug, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

08 Mar, 2010

3 commits

  • In the future, we are going to be changing the lock type for struct
    device (once we get the lockdep infrastructure properly worked out) To
    make that changeover easier, and to possibly burry the lock in a
    different part of struct device, let's create some functions to lock and
    unlock a device so that no out-of-core code needs to be changed in the
    future.

    This patch creates the device_lock/unlock/trylock() functions, and
    converts all in-tree users to them.

    Cc: Thomas Gleixner
    Cc: Jean Delvare
    Cc: Dave Young
    Cc: Ming Lei
    Cc: Jiri Kosina
    Cc: Phil Carmody
    Cc: Arjan van de Ven
    Cc: Cornelia Huck
    Cc: Rafael J. Wysocki
    Cc: Pavel Machek
    Cc: Len Brown
    Cc: Magnus Damm
    Cc: Alan Stern
    Cc: Randy Dunlap
    Cc: Stefan Richter
    Cc: David Brownell
    Cc: Vegard Nossum
    Cc: Jesse Barnes
    Cc: Alex Chiang
    Cc: Kenji Kaneshige
    Cc: Andrew Morton
    Cc: Andrew Patterson
    Cc: Yu Zhao
    Cc: Dominik Brodowski
    Cc: Samuel Ortiz
    Cc: Wolfram Sang
    Cc: CHENG Renquan
    Cc: Oliver Neukum
    Cc: Frans Pop
    Cc: David Vrabel
    Cc: Kay Sievers
    Cc: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • 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
     
  • 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
     

24 Dec, 2009

1 commit


31 Oct, 2009

1 commit

  • Platform drivers registered via platform_driver_probe() can be bound
    to devices only once, upon registration, because discard their probe()
    routines to save memory. Unbinding the driver through sysfs 'unbind'
    leaves the device stranded and confuses users so let's not create
    bind and unbind attributes for such drivers.

    Signed-off-by: Dmitry Torokhov
    Cc: Éric Piel
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     

16 Sep, 2009

1 commit

  • This patch (as1271) affects when new devices get linked into their
    bus's list of devices. Currently this happens after probing, and it
    doesn't happen at all if probing fails. Clearly this is wrong,
    because at that point quite a few symbolic links have already been
    created in sysfs. We are committed to adding the device, so it should
    be linked into the bus's list regardless.

    In addition, this needs to happen before the uevent announcing the new
    device gets issued. Otherwise user programs might try to access the
    device before it has been added to the bus.

    To fix both these problems, the patch moves the call to
    klist_add_tail() forward from bus_attach_device() to bus_add_device().
    Since bus_attach_device() now does nothing but probe for drivers, it
    has been renamed to bus_probe_device(). And lastly, the kerneldoc is
    updated.

    Signed-off-by: Alan Stern
    CC: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

13 Jun, 2009

1 commit


29 May, 2009

1 commit


25 Mar, 2009

3 commits

  • Nothing outside of the driver core should ever touch knode_bus, so
    move it out of the public eye.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • If the bus_type is not registerd, driver_register to that bus will cause oops.

    I found this bug when test built-in usb serial drivers (ie. aircable driver)
    with 'nousb' cmdline params.

    In this patch:
    1. set the bus->p=NULL when bus_register failed and unregisterd.
    2. if bus->p is NULL, driver_register BUG_ON will be triggered.

    Signed-off-by: Dave Young
    Signed-off-by: Greg Kroah-Hartman

    Dave Young
     
  • This patch moves bus->match out from driver_probe_device and
    does not hold device lock to check the match between a device
    and a driver.

    The idea has been verified by the commit 6cd495860901,
    which leads to a faster boot. But the commit 6cd495860901 has
    the following drawbacks: 1),only does the quick check in
    the path of __driver_attach->driver_probe_device, not in other
    paths; 2),for a matched device and driver, check the same match
    twice. It is a waste of cpu ,especially for some drivers with long
    device id table (eg. usb-storage driver).

    This patch adds a helper of driver_match_device to check the match
    in all paths, and testes the match only once.

    Signed-off-by: Ming Lei
    Acked-by: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     

10 Jan, 2009

1 commit


07 Jan, 2009

2 commits


17 Oct, 2008

2 commits


23 Apr, 2008

1 commit


20 Apr, 2008

2 commits


22 Feb, 2008

1 commit


28 Jan, 2008

1 commit

  • The driver core, and some other parts of the kernel just want to find a
    device based on a name for a specific bus. Give them a simple wrapper
    to prevent them from having to always roll their own.

    This will be used in the PPC patch later in this series.

    Cc: Paul Mackerras
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

25 Jan, 2008

12 commits