09 Jan, 2012

1 commit

  • * 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (165 commits)
    reiserfs: Properly display mount options in /proc/mounts
    vfs: prevent remount read-only if pending removes
    vfs: count unlinked inodes
    vfs: protect remounting superblock read-only
    vfs: keep list of mounts for each superblock
    vfs: switch ->show_options() to struct dentry *
    vfs: switch ->show_path() to struct dentry *
    vfs: switch ->show_devname() to struct dentry *
    vfs: switch ->show_stats to struct dentry *
    switch security_path_chmod() to struct path *
    vfs: prefer ->dentry->d_sb to ->mnt->mnt_sb
    vfs: trim includes a bit
    switch mnt_namespace ->root to struct mount
    vfs: take /proc/*/mounts and friends to fs/proc_namespace.c
    vfs: opencode mntget() mnt_set_mountpoint()
    vfs: spread struct mount - remaining argument of next_mnt()
    vfs: move fsnotify junk to struct mount
    vfs: move mnt_devname
    vfs: move mnt_list to struct mount
    vfs: switch pnode.h macros to struct mount *
    ...

    Linus Torvalds
     

07 Jan, 2012

1 commit

  • This resolves the conflict in the arch/arm/mach-s3c64xx/s3c6400.c file,
    and it fixes the build error in the arch/x86/kernel/microcode_core.c
    file, that the merge did not catch.

    The microcode_core.c patch was provided by Stephen Rothwell
    who was invaluable in the merge issues involved
    with the large sysdev removal process in the driver-core tree.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

04 Jan, 2012

1 commit


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
     

08 Dec, 2011

1 commit

  • Disabling all runtime PM during system shutdown turns out not to be a
    good idea, because some devices may need to be woken up from a
    low-power state at that time.

    The whole point of disabling runtime PM for system shutdown was to
    prevent untimely runtime-suspend method calls. This patch (as1504)
    accomplishes the same result by incrementing the usage count for each
    device and waiting for ongoing runtime-PM callbacks to finish. This
    is what we already do during system suspend and hibernation, which
    makes sense since the shutdown method is pretty much a legacy analog
    of the pm->poweroff method.

    This fixes a recent regression on some OMAP systems introduced by
    commit af8db1508f2c9f3b6e633e2d2d906c6557c617f9 (PM / driver core:
    disable device's runtime PM during shutdown).

    Reported-and-tested-by: NeilBrown
    Signed-off-by: Alan Stern
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     

16 Nov, 2011

1 commit

  • There may be an issue when the user issue "reboot/shutdown" command, then
    the device has shut down its hardware, after that, this runtime-pm featured
    device's driver will probably be scheduled to do its suspend routine,
    and at its suspend routine, it may access hardware, but the device has
    already shutdown physically, then the system hang may be occurred.

    I ran out this issue using an auto-suspend supported USB devices, like
    3G modem, keyboard. The usb runtime suspend routine may be scheduled
    after the usb controller has been shut down, and the usb runtime suspend
    routine will try to suspend its roothub(controller), it will access
    register, then the system hang occurs as the controller is shutdown.

    Signed-off-by: Peter Chen
    Acked-by: Ming Lei
    Acked-by: Greg Kroah-Hartman
    Cc: stable@kernel.org
    Signed-off-by: Rafael J. Wysocki

    Peter Chen
     

23 Aug, 2011

1 commit

  • Unlike dynamic_pr_debug, dynamic uses of dev_dbg can not
    currently add task_pid/KBUILD_MODNAME/__func__/__LINE__
    to selected debug output.

    Add a new function similar to dynamic_pr_debug to
    optionally emit these prefixes.

    Cc: Aloisio Almeida
    Noticed-by: Aloisio Almeida
    Signed-off-by: Joe Perches
    Signed-off-by: Jason Baron
    Signed-off-by: Greg Kroah-Hartman

    Joe Perches
     

23 Apr, 2011

1 commit


20 Apr, 2011

1 commit

  • The device_type structure does not contain data that changes
    during usage and should be const. This allows devices to declare
    the struct const.

    I have patches to change all the subsystems, but need the infra
    structure change first.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Stephen Hemminger
     

04 Feb, 2011

2 commits


11 Jan, 2011

1 commit


08 Jan, 2011

1 commit


30 Nov, 2010

1 commit


18 Nov, 2010

1 commit


25 Oct, 2010

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Update broken web addresses in arch directory.
    Update broken web addresses in the kernel.
    Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget
    Revert "Fix typo: configuation => configuration" partially
    ida: document IDA_BITMAP_LONGS calculation
    ext2: fix a typo on comment in ext2/inode.c
    drivers/scsi: Remove unnecessary casts of private_data
    drivers/s390: Remove unnecessary casts of private_data
    net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
    drivers/infiniband: Remove unnecessary casts of private_data
    drivers/gpu/drm: Remove unnecessary casts of private_data
    kernel/pm_qos_params.c: Remove unnecessary casts of private_data
    fs/ecryptfs: Remove unnecessary casts of private_data
    fs/seq_file.c: Remove unnecessary casts of private_data
    arm: uengine.c: remove C99 comments
    arm: scoop.c: remove C99 comments
    Fix typo configue => configure in comments
    Fix typo: configuation => configuration
    Fix typo interrest[ing|ed] => interest[ing|ed]
    Fix various typos of valid in comments
    ...

    Fix up trivial conflicts in:
    drivers/char/ipmi/ipmi_si_intf.c
    drivers/usb/gadget/rndis.c
    net/irda/irnet/irnet_ppp.c

    Linus Torvalds
     

23 Oct, 2010

3 commits

  • Fix build errors when CONFIG_BLOCK is not enabled:

    drivers/base/core.c: In function 'get_device_parent':
    drivers/base/core.c:634: error: 'block_class' undeclared (first use in this function)
    drivers/base/core.c: In function 'device_add_class_symlinks':
    drivers/base/core.c:723: error: 'block_class' undeclared (first use in this function)
    drivers/base/core.c: In function 'device_remove_class_symlinks':
    drivers/base/core.c:751: error: 'block_class' undeclared (first use in this function)

    Signed-off-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • I have some systems which need legacy sysfs due to old tools that are
    making assumptions that a directory can never be a symlink to another
    directory, and it's a big hazzle to compile separate kernels for them.

    This patch turns CONFIG_SYSFS_DEPRECATED into a run time option
    that can be switched on/off the kernel command line. This way
    the same binary can be used in both cases with just a option
    on the command line.

    The old CONFIG_SYSFS_DEPRECATED_V2 option is still there to set
    the default. I kept the weird name to not break existing
    config files.

    Also the compat code can be still completely disabled by undefining
    CONFIG_SYSFS_DEPRECATED_SWITCH -- just the optimizer takes
    care of this now instead of lots of ifdefs. This makes the code
    look nicer.

    v2: This is an updated version on top of Kay's patch to only
    handle the block devices. I tested it on my old systems
    and that seems to work.

    Cc: axboe@kernel.dk
    Signed-off-by: Andi Kleen
    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • 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
     

10 Aug, 2010

1 commit


09 Aug, 2010

1 commit

  • To avoid more patches, I also fixed other spelling
    and grammar bugs when they were in the same or
    following line:

    successfull -> successful
    parse -> parses
    controler -> controller
    controlers -> controllers

    Cc: Jiri Kosina
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Stefan Weil
    Signed-off-by: Jiri Kosina

    Stefan Weil
     

06 Aug, 2010

1 commit


05 Aug, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1443 commits)
    phy/marvell: add 88ec048 support
    igb: Program MDICNFG register prior to PHY init
    e1000e: correct MAC-PHY interconnect register offset for 82579
    hso: Add new product ID
    can: Add driver for esd CAN-USB/2 device
    l2tp: fix export of header file for userspace
    can-raw: Fix skb_orphan_try handling
    Revert "net: remove zap_completion_queue"
    net: cleanup inclusion
    phy/marvell: add 88e1121 interface mode support
    u32: negative offset fix
    net: Fix a typo from "dev" to "ndev"
    igb: Use irq_synchronize per vector when using MSI-X
    ixgbevf: fix null pointer dereference due to filter being set for VLAN 0
    e1000e: Fix irq_synchronize in MSI-X case
    e1000e: register pm_qos request on hardware activation
    ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice
    net: Add getsockopt support for TCP thin-streams
    cxgb4: update driver version
    cxgb4: add new PCI IDs
    ...

    Manually fix up conflicts in:
    - drivers/net/e1000e/netdev.c: due to pm_qos registration
    infrastructure changes
    - drivers/net/phy/marvell.c: conflict between adding 88ec048 support
    and cleaning up the IDs
    - drivers/net/wireless/ipw2x00/ipw2100.c: trivial ipw2100_pm_qos_req
    conflict (registration change vs marking it static)

    Linus Torvalds
     

26 Jul, 2010

1 commit

  • This fixes the regression in 2.6.35-rcX where bluetooth network devices
    would fail to be deleted from sysfs, causing their destruction and
    recreation to fail. In addition this fixes the mac80211_hwsim driver
    where it would leave around sysfs files when the driver was removed.

    This problem is discussed at
    https://bugzilla.kernel.org/show_bug.cgi?id=16257

    The reason for the regression is that the network namespace support
    added to sysfs expects and requires that network devices be put in
    directories that can contain only network devices.

    Today get_device_parent almost provides that guarantee for all class
    devices, except for a specific exception when the parent of a class
    devices is a class device. It would be nice to simply remove that
    arguably incorrect special case, but apparently the input devices depend
    on it being there. So I have only removed it for class devices with
    network namespace support. Which today are the network devices.

    It has been suggested that a better fix would be to change the parent
    device from a class device to a bus device, which in the case of the
    bluetooth driver would change /sys/class/bluetooth to /sys/bus/bluetoth,
    I can not see how we would avoid significant userspace breakage if we
    were to make that change.

    Adding an extra directory in the path to the device will also be
    userspace visible but it is much less likely to break things.
    Everything is still accessible from /sys/class (for example), and it
    fixes two bugs. Adding an extra directory fixes a 3 year old regression
    introduced with the new sysfs layout that makes it impossible to rename
    bnep0 network devices to names that conflict with hci device attributes
    like hci_revsion. Adding an additional directory removes the new
    failure modes introduced by the network namespace code.

    If it weren't for the regession in the renaming of network devices I
    would figure out how to just make the sysfs code deal with this
    configuration of devices.

    In summary this patch fixes regressions by changing:
    "/sys/class/bluetooth/hci0/bnep0" to "/sys/class/bluetooth/hci0/net/bnep0".

    Reported-by: Johannes Berg
    Reported-by: Janusz Krzysztofik
    Signed-off-by: Eric W. Biederman
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

05 Jul, 2010

1 commit

  • Reduces an x86 defconfig text and data ~55k, .6% smaller.

    $ size vmlinux*
    text data bss dec hex filename
    7205273 716016 1366288 9287577 8db799 vmlinux
    7258890 719768 1366288 9344946 8e97b2 vmlinux.master

    Uses %pV and struct va_format
    Format arguments are verified before printk

    The dev_info macro is converted to _dev_info because there are
    existing uses of variables named dev_info in the kernel tree
    like drivers/net/pcmcia/pcnet_cs.c

    A dev_info macro is created to call _dev_info

    Signed-off-by: Joe Perches
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Joe Perches
     

22 May, 2010

7 commits

  • In this code section the final S of CONFIG_MODULES was missed making
    the whole check useless

    Signed-off-by: Christoph Egger
    Cc: Mark McLoughlin
    Signed-off-by: Greg Kroah-Hartman

    Christoph Egger
     
  • device_del and device_rename were modified to use
    sysfs_delete_link and sysfs_rename_link respectively to ensure
    when these operations happen on devices whose classes
    are in namespace directories they work properly.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Benjamin Thery
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • Move complete knowledge of namespaces into the kobject layer
    so we can use that information when reporting kobjects to
    userspace.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • While device_shutdown() walks through devices_kset to shutdown all
    devices, device unplug events may race to shutdown individual devices.
    Specifically, sd_shutdown(), on behalf of fc_starget_delete(), has
    been observed deleting devices during device_shutdown()'s list
    traversal. So we factor out list_for_each_entry_safe_reverse(...) in
    favor of while (!list_empty(...)).

    Signed-off-by: Hugh Daschbach
    Signed-off-by: Greg Kroah-Hartman

    Hugh Daschbach
     
  • The conversion of device->sem to device->mutex resulted in lockdep
    warnings. Create a novalidate class for now until the driver folks
    come up with separate classes. That way we have at least the basic
    mutex debugging coverage.

    Add a checkpatch error so the usage is reserved for device->mutex.

    [ tglx: checkpatch and compile fix for LOCKDEP=n ]

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Peter Zijlstra
     
  • The semaphore is semantically a mutex. Convert it to a real mutex and
    fix up a few places where code was relying on semaphore.h to be included
    by device.h, as well as the users of the trylock function, as that value
    is now reversed.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • This patch (as1351) removes an unnecessary and unwanted assignment
    from device_initialize(). The wakeup flags are set to 0 along with
    everything else when the device structure is allocated, so we don't
    need to do it again. Furthermore, the subsystem might already have
    set these flags to their correct values; we don't want to override it.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

19 Mar, 2010

1 commit


08 Mar, 2010

5 commits

  • Don't open code the renaming of symlinks in sysfs
    instead use the new helper function sysfs_rename_link

    Acked-by: Tejun Heo
    Acked-by: Serge Hallyn
    Signed-off-by: Eric W. Biederman
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • 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
     
  • 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
     
  • 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: [] 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:[] [] 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
    ffff88000042f988 ffffffff811592d7 0000000000000000 0000000000000000
    0000000000000000 0000000000000000 ffff88000042f958 0000000011cc8d6e
    Call Trace:
    [] create_dir+0x67/0xe0
    [] sysfs_create_dir+0x58/0xb0
    [] ? kobject_add_internal+0xcc/0x220
    [] ? vsnprintf+0x3c1/0xb90
    [] kobject_add_internal+0x107/0x220
    [] kobject_add_varg+0x47/0x80
    [] kobject_add+0x53/0x90
    [] device_add+0xd4/0x690
    [] ? dev_set_name+0x4b/0x70
    [] 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
    Reported-by: Colin Guthrie
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

24 Dec, 2009

2 commits

  • If device_add() is called with a device which does not have dev->p set
    up, then device_private_init() is called. If that succeeds, then the
    error variable is set to 0. Now if the dev_name(dev) check further
    down fails, then device_add() correctly terminates, but returns 0.
    That of course lets the driver progress. If later another driver uses
    this half set up device as parent then device_add() of the child
    device explodes and renders sysfs completely unusable.

    Set the error to -EINVAL if dev_name() check fails.

    Signed-off-by: Thomas Gleixner
    Cc: Kay Sievers
    Cc: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Many struct bin_attribute descriptors are purely read-only
    structures, and there's no need to change them. Therefore
    make the promise not to, which will let those descriptors
    be put in a ro section.

    Signed-off-by: Phil Carmody
    Signed-off-by: Greg Kroah-Hartman

    Phil Carmody