16 Sep, 2009

3 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
     
  • 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
     

17 Apr, 2009

1 commit

  • This patch fixes a bug introduced in commit
    49b420a13ff95b449947181190b08367348e3e1b.

    If a instance of bus_type doesn't have .match method,
    all .probe of drivers in the bus should be called, or else
    the .probe have not a chance to be called.

    Signed-off-by: Ming Lei
    Reported-by: Guennadi Liakhovetski
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     

25 Mar, 2009

5 commits


23 Feb, 2009

1 commit


10 Jan, 2009

4 commits


07 Jan, 2009

4 commits


09 Oct, 2008

1 commit

  • Iterating over entries using callback usually isn't too fun especially
    when the entry being iterated over can't be manipulated freely. This
    patch converts class->p->class_devices to klist and implements class
    device iterator so that the users can freely build their own control
    structure. The users are also free to call back into class code
    without worrying about locking.

    class_for_each_device() and class_find_device() are converted to use
    the new iterators, so their users don't have to worry about locking
    anymore either.

    Note: This depends on klist-dont-iterate-over-deleted-entries patch
    because class_intf->add/remove_dev() depends on proper synchronization
    with device removal.

    Signed-off-by: Tejun Heo
    Cc: Greg Kroah-Hartman
    Cc: Jens Axboe
    Signed-off-by: Jens Axboe

    Tejun Heo
     

22 Jul, 2008

7 commits


01 May, 2008

1 commit


25 Jan, 2008

7 commits


13 Oct, 2007

2 commits

  • get_bus() should not be globally visable as it is not used by anything
    other than drivers/base/bus.c. This patch removes the visability of it,
    and renames it to match all of the other *_get() functions in the
    kernel.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • put_bus() should not be globally visable as it is not used by anything
    other than drivers/base/bus.c. This patch removes the visability of it,
    and renames it to match all of the other *_put() functions in the
    kernel.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

12 Jul, 2007

1 commit

  • Every file should include the headers containing the prototypes for
    it's global functions.

    Since the GNU C compiler is now able to detect that the function
    prototype of devres_release_all() in the header and the actual function
    disagree regarding the return value, this patch also fixes this bug.

    Signed-off-by: Adrian Bunk
    Acked-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Adrian Bunk
     

03 May, 2007

1 commit


28 Apr, 2007

1 commit

  • Don't fail bus_attach_device() if the device cannot be bound.

    If dev->driver has been specified, reset it to NULL if device_bind_driver()
    failed and add the device as an unbound device. As a result,
    bus_attach_device() now cannot fail, and we can remove some checking from
    device_add().

    Also remove an unneeded check in bus_rescan_devices_helper().

    Signed-off-by: Cornelia Huck
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Cornelia Huck
     

10 Feb, 2007

1 commit

  • Implement device resource management, in short, devres. A device
    driver can allocate arbirary size of devres data which is associated
    with a release function. On driver detach, release function is
    invoked on the devres data, then, devres data is freed.

    devreses are typed by associated release functions. Some devreses are
    better represented by single instance of the type while others need
    multiple instances sharing the same release function. Both usages are
    supported.

    devreses can be grouped using devres group such that a device driver
    can easily release acquired resources halfway through initialization
    or selectively release resources (e.g. resources for port 1 out of 4
    ports).

    This patch adds devres core including documentation and the following
    managed interfaces.

    * alloc/free : devm_kzalloc(), devm_kzfree()
    * IO region : devm_request_region(), devm_release_region()
    * IRQ : devm_request_irq(), devm_free_irq()
    * DMA : dmam_alloc_coherent(), dmam_free_coherent(),
    dmam_declare_coherent_memory(), dmam_pool_create(),
    dmam_pool_destroy()
    * PCI : pcim_enable_device(), pcim_pin_device(), pci_is_managed()
    * iomap : devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(),
    devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(),
    pcim_iomap(), pcim_iounmap()

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo