28 Apr, 2007

40 commits

  • After some more discussion this patch replaces it:

    From: Johannes Berg
    Subject: suspend: add arch irq disable/enable hooks

    For powermac, we need to do some things between suspending devices and
    device_power_off, for example setting the decrementer. This patch
    allows architectures to define arch_s2ram_{en,dis}able_irqs in their
    asm/suspend.h to have control over this step.

    Signed-off-by: Johannes Berg
    Acked-by: Pavel Machek
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     
  • This defines a platform hook to enable/disable a device as a wakeup event
    source. It's initially for use with ACPI, but more generally it could be used
    whenever enable_irq_wake()/disable_irq_wake() don't suffice.

    The hook is called -- if available -- inside pci_enable_wake(); and the
    semantics of that call are enhanced so that support for PCI PME# is no longer
    needed. It can now work for devices with "legacy PCI PM", when platform
    support allows it. (That support would use some board-specific signal for for
    the same purpose as PME#.)

    [akpm@linux-foundation.org: Make it compile with CONFIG_PM=n]
    Signed-off-by: David Brownell
    Signed-off-by: Zhang Rui
    Cc: Len Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     
  • Prevent permission checking from being performed when the kernel wants to
    unconditionally remove a sysfs group, by introducing an kernel-only variant
    of lookup_one_len(), lookup_one_len_kern().

    Additionally, as sysfs_remove_group() does not check the return value of
    the lookup before using it, a BUG_ON has been added to pinpoint the cause
    of any problems potentially caused by this (and as a form of annotation).

    Signed-off-by: James Morris
    Cc: Nagendra Singh Tomar
    Cc: Tejun Heo
    Cc: Stephen Smalley
    Cc: Eric Paris
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    James Morris
     
  • This patch (as896b) fixes an oversight in the design of
    device_schedule_callback(). It is necessary to acquire a reference to the
    module owning the callback routine, to prevent the module from being
    unloaded before the callback can run.

    Signed-off-by: Alan Stern
    Cc: Satyam Sharma
    Cc: Neil Brown
    Cc: Cornelia Huck
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • We often have the situation that we register a subchannel and start device
    recognition, only to find out that the device is not usable after all, which
    triggers an unregister of the subchannel. This often happens on hundreds of
    subchannels on a LPAR, leading to a storm of events which aren't of any use.
    Therefore, use uevent_suppress to delay the KOBJ_ADD uevent for a subchannel
    until we know that its ccw_device is to be registered.

    Signed-off-by: Cornelia Huck
    Cc: Kay Sievers
    Cc: Eric Rannaud
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Cornelia Huck
     
  • fs/sysfs/bin.c: In function 'read':
    fs/sysfs/bin.c:77: warning: format '%zd' expects type 'signed size_t', but argument 4 has type 'int'

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

    Andrew Morton
     
  • the DMA pool handler uses a semaphore as mutex. use the mutex API
    instead of the (binary) semaphore

    Signed-off-by: Matthias Kaehlcke
    Signed-off-by: Greg Kroah-Hartman

    Matthias Kaehlcke
     
  • As pointed out by Dave Jones.

    Cc: Dave Jones
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • I went to use this the other day, only to find it didn't exist.

    It's a straight copy of the debugfs u32 code, then s/u32/u64/. A quick
    test shows it seems to be working.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Michael Ellerman
     
  • This patch contains the overdue removal of the mount/umount uevents.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Greg Kroah-Hartman

    Adrian Bunk
     
  • This dots some i's and crosses some t's after left over from when
    kobject_kset_add_dir was built from kobject_add_dir.

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

    Eric W. Biederman
     
  • In the future we will allow the uevent type to be written to the uevent
    file to trigger the different types of uevents. But for now, as we only
    support the ADD event, warn if userspace tries to write anything else to
    this file.

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

    Kay Sievers
     
  • This allows sysfs to show the environment variables that are available
    if the uevent happens. This lets userspace not have to cache all of
    this information as the kernel already knows it.

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

    Kay Sievers
     
  • It isn't used at all by the driver core anymore, and the few usages of
    it within the kernel have now all been fixed as most of them were using
    it incorrectly. So remove it.

    Now the whole struct subsys can be removed from the system, but that's
    for a later patch...

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

    Greg Kroah-Hartman
     
  • the current driver tree contains the removal of subsys.rwsem.
    Unfortunately, this breaks qeth. However, it should be no problem to
    fix the walking of the devices for /proc/qeth:

    No need to take subsys.rwsem during walking the devices,
    driver_find_devices() should already suffice.

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

    Cornelia Huck
     
  • The subsystem rwsem is not used by the driver core at all, so the use of
    it in the phy code doesn't make any sense. They might possibly
    want to use a local lock, but I am unsure about that.

    Cc: netdev
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • The subsystem rwsem is not used by the driver core at all, so the use of
    it in the ieee1394 code doesn't make any sense. They might possibly
    want to use a local lock, but as most of these operations are already
    protected by a local lock, it really doesn't look like it would be
    needed.

    Cc: Ben Collins
    Cc: Stefan Richter
    Cc: linux1394-devel
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • The subsystem rwsem is not used by the driver core at all, so the use of
    it in the ide-proc code of it doesn't make any sense. Perhaps a local
    lock might be needed, but I do not really think so.

    Cc: Bartlomiej Zolnierkiewicz
    Cc: linux ide
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • The subsystem rwsem is not used by the driver core at all, so there is
    no point in trying to access it.

    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     
  • The subsystem rwsem is not used by the driver core at all, so there is
    no point in trying to access it.

    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     
  • The rwsem is not used to protect anything, so the use of it by the PNP
    subsystem isn't really useful, and it's doubtful if it really did anything or
    not. So I've removed it.

    Cc: Adam Belay
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • The driver core stopped using the rwsem a long time ago, yet the USB
    core still grabbed the lock, thinking it protected something. This
    patch removes that useless use.

    Cc: Alan Stern
    Cc: Oliver Neukum
    Cc: David Brownell
    Cc: linux-usb-devel
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • SCSI was using the incorrect lock to protect walking the list of all
    devices in the class. This patch fixes this.

    Cc: James Bottomley
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This lock is never used by the rest of the driver core, so the fact that
    we are grabbing it here means it isn't correct...

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • We leak a reference if we attempt to add a kobject with no name.

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

    Cornelia Huck
     
  • Collapses a do..while() loop within an if() to a simple while() loop for
    simplicity and readability.

    Signed-off-by: John Anthony Kazos Jr.
    Signed-off-by: Greg Kroah-Hartman

    John Anthony Kazos Jr
     
  • Driver core: add suspend() and resume() to struct device_type

    In cases when there are devices of different types in the same class
    we can't use class's implementation of suspend and resume methods and
    we need to add them to struct device_type instead.

    Also fix error handling in resume code (we should not try to call
    class's resume method iof bus's resume method for the device failed.

    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     
  • Make use of add_uevent_var() instead of (often incorrectly) open coding it.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Eric Rannaud
    Cc: Kay Sievers
    Cc: Cornelia Huck
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Eric Rannaud
     
  • Use uevent_suppress instead of returning an error code in
    firmware_uevent(). Get rid of the now unneeded FW_STATUS_READY
    and FW_STATUS_READY_NOHOTPLUG.

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

    Cornelia Huck
     
  • Suppress uevents for devices if uevent_suppress is set via
    dev_uevent_filter(). This makes the driver core suppress all device
    uevents, not just the add event in device_add().

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

    Cornelia Huck
     
  • Provide rename event for when we rename network devices.

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

    Jean Tourrilhes
     
  • some atomic operations are only atomic, not ordered. Thus a CPU is allowed
    to reorder memory references to an object to before the reference is
    obtained. This fixes it.

    Signed-off-by: Oliver Neukum
    Signed-off-by: Greg Kroah-Hartman

    Oliver Neukum
     
  • The completion in the driver release path is due to ancient history in
    the _very_ early 2.5 days when we were not tracking the module reference
    count of attributes. It is not needed at all and can be removed.

    Note, we now have an empty release function for the driver structure.
    This is due to the fact that drivers are statically allocated in the
    system at this point in time, something which I want to change in the
    future. But remember, drivers are really code, which is reference
    counted by the module, unlike devices, which are data and _must_ be
    reference counted properly in order to work correctly.

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

    Greg Kroah-Hartman
     
  • 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
     
  • arch/powerpc/kernel/of_platform.c:479: error: unknown field `multithread_probe' specified in initializer

    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Andrew Morton
     
  • Make multithreaded probing work per subsystem instead of per driver.

    It doesn't make much sense to probe the same device for multiple drivers in
    parallel (after all, only one driver can bind to the device). Instead, create
    a probing thread for each device that probes the drivers one after another.
    Also make the decision to use multi-threaded probe per bus instead of per
    device and adapt the pci code.

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

    Cornelia Huck
     
  • - correct function name in comments
    - parrent assignment does metter only inside "if" block,
    so move it inside this block.

    Signed-off-by: Monakhov Dmitriy
    Signed-off-by: Greg Kroah-Hartman

    Dmitriy Monakhov
     
  • If "name" of a device_type is specified, the uevent will
    contain the device_type name in the DEVTYPE variable.
    This helps userspace to distingiush between different types
    of devices, belonging to the same subsystem.

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

    Kay Sievers
     
  • Driver core: use attribute groups in struct device_type

    Attribute groups are more flexible than attribute lists
    (an attribute list can be represented by anonymous group)
    so switch struct device_type to use them.

    Also rework attribute creation for devices so that they all
    cleaned up properly in case of errors.

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

    Dmitry Torokhov
     
  • We get two per-bus sysfs files:
    ls-l /sys/subsystem/usb
    drwxr-xr-x 2 root root 0 2007-02-16 16:42 devices
    drwxr-xr-x 7 root root 0 2007-02-16 14:55 drivers
    -rw-r--r-- 1 root root 4096 2007-02-16 16:42 drivers_autoprobe
    --w------- 1 root root 4096 2007-02-16 16:42 drivers_probe

    The flag "drivers_autoprobe" controls the behavior of the bus to bind
    devices by default, or just initialize the device and leave it alone.

    The command "drivers_probe" accepts a bus_id and the bus tries to bind a
    driver to this device.

    Systems who want to control the driver binding with udev, switch off the
    bus initiated probing:
    echo 0 > /sys/subsystem/usb/drivers_autoprobe
    echo 0 > /sys/subsystem/pcmcia/drivers_autoprobe
    ...

    and initiate the probing with udev rules like:
    ACTION=="add", SUBSYSTEM=="usb", ATTR{subsystem/drivers_probe}="$kernel"
    ACTION=="add", SUBSYSTEM=="pcmcia", ATTR{subsystem/drivers_probe}="$kernel"
    ...

    Custom driver binding can happen in earlier rules by something like:
    ACTION=="add", SUBSYSTEM=="usb", \
    ATTRS{idVendor}=="1234", ATTRS{idProduct}=="5678" \
    ATTR{subsystem/drivers//bind}="$kernel"

    This is intended to solve the modprobe.conf mess with "install-rules", custom
    bind/unbind-scripts and all the weird things people invented over the years.
    It should also provide the functionality "libusual" was supposed to do.

    With udev, one can just write a udev rule to drive all USB-disks at the
    third port of USB-hub by the "ub" driver, and everything else by
    usb-storage. One can also instruct udev to bind different wireless
    drivers to identical cards - just selected by the pcmcia slot-number, and
    whatever ...

    To use the mentioned rules, it needs udev version 106, to be able to
    write ATTR{}="$kernel" to sysfs files.

    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers