22 Aug, 2008

3 commits

  • This gives us a way to handle both the bus_id and init_name values being
    used for a while during the transition period.

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

    Greg Kroah-Hartman
     
  • This patch (as1124) fixes a couple of bugs in the PM core. The new
    dev->power.status field should be initialized regardless of whether
    CONFIG_PM_SLEEP is enabled, and similarly dpm_sysfs_add() should be
    called whenever CONFIG_PM is enabled.

    The patch separates out the call to dpm_sysfs_add() from the call to
    device_pm_add(). As a result device_pm_add() can no longer return an
    error, so its return type is changed to void.

    Signed-off-by: Alan Stern
    Tested-by: Romit Dasgupta
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Add const markings to dev_name and dev_driver_string to make it clear that
    dev_printk doesn't modify dev. This is a prerequisite to adding more
    const markings to other functions make it clearer, which functions can
    modify dev and which can't.

    Signed-off-by: Jean Delvare
    Cc: Kay Sievers
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Jean Delvare
     

27 Jul, 2008

1 commit

  • Use WARN() instead of a printk+WARN_ON() pair; this way the message
    becomes part of the warning section for better reporting/collection.

    Signed-off-by: Arjan van de Ven
    Cc: Greg KH
    Cc: Kay Sievers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

22 Jul, 2008

11 commits


12 Jun, 2008

1 commit


30 May, 2008

1 commit


21 May, 2008

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (27 commits)
    pktgen: make sure that pktgen_thread_worker has been executed
    [VLAN]: Propagate selected feature bits to VLAN devices
    drivers/atm/: remove CVS keywords
    vlan: Correctly handle device notifications for layered VLAN devices
    net: Fix call to ->change_rx_flags(dev, IFF_MULTICAST) in dev_change_flags()
    net_sched: cls_api: fix return value for non-existant classifiers
    ipsec: Use the correct ip_local_out function
    ipv6 addrconf: Allow infinite prefix lifetime.
    ipv6 route: Fix lifetime in netlink.
    ipv6 addrconf: Fix route lifetime setting in corner case.
    ndisc: Add missing strategies for per-device retrans timer/reachable time settings.
    ipv6: Move from header-y to unifdef-y.
    l2tp: avoid skb truesize bug if headroom is increased
    wireless: Create 'device' symlink in sysfs
    wireless, airo: waitbusy() won't delay
    libertas: fix command timeout after firmware failure
    mac80211: Add RTNL version of ieee80211_iterate_active_interfaces
    mac80211 : Association with 11n hidden ssid ap.
    hostap: fix "registers" registration in procfs
    isdn/capi: Return proper errnos on module init.
    ...

    Linus Torvalds
     
  • We want to have the drvdata field set properly when creating the device
    as sysfs callbacks can assume it is present and it can race the later
    setting of this field.

    So, create two new functions, deviec_create_vargs() and
    device_create_drvdata() that take this new field.

    device_create_drvdata() will go away in 2.6.27 as the drvdata field will
    just be moved to the device_create() call as it should be.

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

    Greg Kroah-Hartman
     

15 May, 2008

1 commit

  • It is possible that the entry in sysfs already exists, one case of this is
    when a network device is renamed to bonding_masters. Anyway, in this case
    the proper error path is for device_rename to return an error code, not to
    generate bogus backtrace and errors.

    Also, to avoid possible races, the create link should be done before the
    remove link. This makes a device rename atomic operation like other renames.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

27 Apr, 2008

1 commit


22 Apr, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits)
    SCSI: convert struct class_device to struct device
    DRM: remove unused dev_class
    IB: rename "dev" to "srp_dev" in srp_host structure
    IB: convert struct class_device to struct device
    memstick: convert struct class_device to struct device
    driver core: replace remaining __FUNCTION__ occurrences
    sysfs: refill attribute buffer when reading from offset 0
    PM: Remove destroy_suspended_device()
    Firmware: add iSCSI iBFT Support
    PM: Remove legacy PM (fix)
    Kobject: Replace list_for_each() with list_for_each_entry().
    SYSFS: Explicitly include required header file slab.h.
    Driver core: make device_is_registered() work for class devices
    PM: Convert wakeup flag accessors to inline functions
    PM: Make wakeup flags available whenever CONFIG_PM is set
    PM: Fix misuse of wakeup flag accessors in serial core
    Driver core: Call device_pm_add() after bus_add_device() in device_add()
    PM: Handle device registrations during suspend/resume
    block: send disk "change" event for rescan_partitions()
    sysdev: detect multiple driver registrations
    ...

    Fixed trivial conflict in include/linux/memory.h due to semaphore header
    file change (made irrelevant by the change to mutex).

    Linus Torvalds
     

20 Apr, 2008

4 commits

  • __FUNCTION__ is gcc-specific, use __func__

    Signed-off-by: Harvey Harrison
    Signed-off-by: Greg Kroah-Hartman

    Harvey Harrison
     
  • After 2.6.24 there was a plan to make the PM core acquire all device
    semaphores during a suspend/hibernation to protect itself from
    concurrent operations involving device objects. That proved to be
    too heavy-handed and we found a better way to achieve the goal, but
    before it happened, we had introduced the functions
    device_pm_schedule_removal() and destroy_suspended_device() to allow
    drivers to "safely" destroy a suspended device and we had adapted some
    drivers to use them. Now that these functions are no longer necessary,
    it seems reasonable to remove them and modify their users to use the
    normal device unregistration instead.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     
  • Include dpm_sysfs_add() into device_pm_add(), in analogy with
    device_pm_remove(), and modify device_add() to call the latter after
    bus_add_device(), to avoid situations in which the PM core may
    attempt to suspend a device the registration of which has not been
    successful.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     
  • Modify the PM core to protect its data structures, specifically the
    dpm_active list, from being corrupted if a child of the currently
    suspending device is registered concurrently with its ->suspend()
    callback. In that case, since the new device (the child) is added
    to dpm_active after its parent, the PM core will attempt to
    suspend it after the parent, which is wrong.

    Introduce a new member of struct dev_pm_info, called 'sleeping',
    and use it to check if the parent of the device being added to
    dpm_active has been suspended, in which case the device registration
    fails. Also, use 'sleeping' for checking if the ordering of devices
    on dpm_active is correct.

    Introduce variable 'all_sleeping' that will be set to 'true' once all
    devices have been suspended and make new device registrations fail
    until 'all_sleeping' is reset to 'false', in order to avoid having
    unsuspended devices around while the system is going into a sleep state.

    Remove pm_sleep_rwsem which is not necessary any more.

    Special thanks to Alan Stern for discussions and suggestions that
    lead to the creation of this patch.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     

19 Apr, 2008

1 commit


25 Mar, 2008

1 commit


05 Mar, 2008

3 commits

  • Driver core: Fix cleanup when failing device_add().

    - Don't call cleanup_device_parent() if we didn't call setup_parent().
    - dev->kobj.parent may be NULL when cleanup_device_parent() is called,
    so we need to handle glue_dir == NULL in cleanup_glue_dir().

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

    Cornelia Huck
     
  • Since device_pm_remove(dev) calls dpm_sysfs_remove(dev), it's
    incorrect to call the latter after the former in the device_add()
    error path.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     
  • Remove the code that acquires all device semaphores from the suspend
    code path as it causes multiple problems to appear (most notably,
    http://bugzilla.kernel.org/show_bug.cgi?id=10030) and revert the
    change introduced by commit 4145ed6dc597a9bea5f6ae8c574653b2de10620f
    depending on the code being removed.

    Remove pm_sleep_lock()/pm_sleep_unlock() from device_add() to avoid
    the issue reported at http://bugzilla.kernel.org/show_bug.cgi?id=9874.

    It should fix the regreesions reported at:
    http://bugzilla.kernel.org/show_bug.cgi?id=9874
    http://bugzilla.kernel.org/show_bug.cgi?id=10030

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     

03 Feb, 2008

2 commits


28 Jan, 2008

1 commit


25 Jan, 2008

6 commits

  • Fix up a number of coding style issues in the drivers/base/ directory
    that have annoyed me over the years. checkpatch.pl is now very happy.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Make setup_parent() void as get_device_parent() will always return
    either a valid kobject or NULL.
    Introduce cleanup_glue_dir() to drop reference grabbed on "glue"
    directory by get_device_parent(). Use it for cleanup in device_move()
    and device_add() on errors.

    This should fix the refcounting problem reported in
    http://marc.info/?l=linux-kernel&m=120052487909200&w=2

    Signed-off-by: Cornelia Huck
    Cc: Dave Young
    Cc: Gabor Gombas
    Cc: Tejun Heo
    Cc: Al Viro
    Cc: Marcel Holtmann
    Cc: David Miller
    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Cornelia Huck
     
  • We save the current state in the object itself, so we can do proper
    cleanup when the last reference is dropped.

    If the initial reference is dropped, the object will be removed from
    sysfs if needed, if an "add" event was sent, "remove" will be send, and
    the allocated resources are released.

    This allows us to clean up some driver core usage as well as allowing us
    to do other such changes to the rest of the kernel.

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

    Kay Sievers
     
  • Now that the old kobject_init() function is gone, rename
    kobject_init_ng() to kobject_init() to clean up the namespace.

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

    Greg Kroah-Hartman
     
  • Now that the old kobject_add() function is gone, rename kobject_add_ng()
    to kobject_add() to clean up the namespace.

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

    Greg Kroah-Hartman
     
  • This moves the block devices to /sys/class/block. It will create a
    flat list of all block devices, with the disks and partitions in one
    directory. For compatibility /sys/block is created and contains symlinks
    to the disks.

    /sys/class/block
    |-- sda -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
    |-- sda1 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1
    |-- sda10 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10
    |-- sda5 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5
    |-- sda6 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6
    |-- sda7 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7
    |-- sda8 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8
    |-- sda9 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9
    `-- sr0 -> ../../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0

    /sys/block/
    |-- sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
    `-- sr0 -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0

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

    Kay Sievers