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
     

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

3 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
     
  • Most device_attributes are const, and are begging to be
    put in a ro section. However, the create and remove
    file interfaces were failing to propagate the const promise
    which the only functions they call offer.

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

    Phil Carmody
     

12 Dec, 2009

3 commits


20 Sep, 2009

1 commit

  • This allows subsytems to provide devtmpfs with non-default permissions
    for the device node. Instead of the default mode of 0600, null, zero,
    random, urandom, full, tty, ptmx now have a mode of 0666, which allows
    non-privileged processes to access standard device nodes in case no
    other userspace process applies the expected permissions.

    This also fixes a wrong assignment in pktcdvd and a checkpatch.pl complain.

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

    Kay Sievers
     

16 Sep, 2009

4 commits

  • Devtmpfs lets the kernel create a tmpfs instance called devtmpfs
    very early at kernel initialization, before any driver-core device
    is registered. Every device with a major/minor will provide a
    device node in devtmpfs.

    Devtmpfs can be changed and altered by userspace at any time,
    and in any way needed - just like today's udev-mounted tmpfs.
    Unmodified udev versions will run just fine on top of it, and will
    recognize an already existing kernel-created device node and use it.
    The default node permissions are root:root 0600. Proper permissions
    and user/group ownership, meaningful symlinks, all other policy still
    needs to be applied by userspace.

    If a node is created by devtmps, devtmpfs will remove the device node
    when the device goes away. If the device node was created by
    userspace, or the devtmpfs created node was replaced by userspace, it
    will no longer be removed by devtmpfs.

    If it is requested to auto-mount it, it makes init=/bin/sh work
    without any further userspace support. /dev will be fully populated
    and dynamic, and always reflect the current device state of the kernel.
    With the commonly used dynamic device numbers, it solves the problem
    where static devices nodes may point to the wrong devices.

    It is intended to make the initial bootup logic simpler and more robust,
    by de-coupling the creation of the inital environment, to reliably run
    userspace processes, from a complex userspace bootstrap logic to provide
    a working /dev.

    Signed-off-by: Kay Sievers
    Signed-off-by: Jan Blunck
    Tested-By: Harald Hoyer
    Tested-By: Scott James Remnant
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     
  • Let attribute group vectors be declared "const". We'd
    like to let most attribute metadata live in read-only
    sections... this is a start.

    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     
  • No one should directly access the driver_data field, so remove the field
    and make it private. We dynamically create the private field now if it
    is needed, to handle drivers that call get/set before they are
    registered with the driver core.

    Also update the copyright notices on these files while we are there.

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

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

16 Jun, 2009

3 commits

  • This adds the nodename callback for struct class, struct device_type and
    struct device, to allow drivers to send userspace hints on the device
    name and subdirectory that should be used for it.

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

    Kay Sievers
     
  • This removes the
    warning: format not a string literal and no format arguments
    warnings in the driver core that gcc 4.3.3 complains about.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • A patch series to make .shutdown execute asynchronously. Some drivers's
    shutdown can take a lot of time. The patches can help save some shutdown
    time. The patches use Arjan's async API.

    This patch:

    synchronize all tasks submitted by .shutdown

    Signed-off-by: Shaohua Li
    Cc: Arjan van de Ven
    Cc: Dmitry Torokhov
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Shaohua Li
     

29 May, 2009

1 commit


20 Apr, 2009

1 commit

  • notice one system /proc/iomem some entries missed the name for pci_devices

    it turns that dev->dev.kobj name is changed after device_add.

    for pci code: via acpi_pci_root_driver.ops.add (aka acpi_pci_root_add)
    ==> pci_acpi_scan_root is used to scan pci bus/device, and at the same
    time we read the resource for pci_dev in the pci_read_bases, we have
    res->name = pci_name(pci_dev); pci_name is calling dev_name.

    later via acpi_pci_root_driver.ops.start (aka acpi_pci_root_start) ==>
    pci_bus_add_device to add all pci_dev in kobj tree. pci_bus_add_device
    will call device_add.

    actually in device_add

    /* first, register with generic layer. */
    error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev_name(dev));
    if (error)
    goto Error;

    will get one new name for that kobj, old name is freed.

    [Impact: fix corrupted names in /proc/iomem ]

    Signed-off-by: Yinghai Lu
    Signed-off-by: Linus Torvalds

    Kay Sievers
     

17 Apr, 2009

1 commit


25 Mar, 2009

5 commits

  • dpm_list currently relies on the fact that child devices will
    be registered after their parents to get a correct suspend
    order. Using device_move() however destroys this assumption, as
    an already registered device may be moved under a newly registered
    one.

    This patch adds a new argument to device_move(), allowing callers
    to specify how dpm_list should be adapted.

    Signed-off-by: Cornelia Huck
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Cornelia Huck
     
  • This patch implements uevent suppress in kobject and removes it
    from struct device, based on the following ideas:

    1,Uevent sending should be one attribute of kobject, so suppressing it
    in kobject layer is more natural than in device layer. By this way,
    we can do it for other objects embedded with kobject.

    2,It may save several bytes for each instance of struct device.(On my
    omap3(32bit ARM) based box, can save 8bytes per device object)

    This patch also introduces dev_set|get_uevent_suppress() helpers to
    set and query uevent_suppress attribute in case to help kobject
    as private part of struct device in future.

    [This version is against the latest driver-core patch set of Greg,please
    ignore the last version.]

    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • Nothing outside of the driver core should ever touch klist_children, or
    knode_parent, so move them out of the public eye.

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

    Greg Kroah-Hartman
     
  • This is to be used to move things out of struct device that no code
    outside of the driver core should ever touch.

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

    Greg Kroah-Hartman
     
  • Now that all users of bus_id is gone, we can remove it from struct
    device.

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

    Kay Sievers
     

29 Jan, 2009

1 commit

  • Fix function parameter name in kernel-doc:

    Warning(linux-next-20090120//drivers/base/core.c:1289): No description found for parameter 'dev'
    Warning(linux-next-20090120//drivers/base/core.c:1289): Excess function parameter 'root' description in 'root_device_unregister'

    Signed-off-by: Randy Dunlap
    Acked-by: Mark McLoughlin
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap