07 Nov, 2005

1 commit

  • Fix more include file problems that surfaced since I submitted the previous
    fix-missing-includes.patch. This should now allow not to include sched.h
    from module.h, which is done by a followup patch.

    Signed-off-by: Tim Schmielau
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

06 Nov, 2005

1 commit

  • Re-jig the simple platform device support to allow private data
    to be attached to a platform device, as well as allowing the
    parent device to be set.

    Example usage:

    pdev = platform_device_alloc("mydev", id);
    if (pdev) {
    err = platform_device_add_resources(pdev, &resources,
    ARRAY_SIZE(resources));
    if (err == 0)
    err = platform_device_add_data(pdev, &platform_data,
    sizeof(platform_data));
    if (err == 0)
    err = platform_device_add(pdev);
    } else {
    err = -ENOMEM;
    }
    if (err)
    platform_device_put(pdev);

    Signed-off-by: Russell King
    Acked-by: Greg Kroah-Hartman

    Russell King
     

31 Oct, 2005

4 commits

  • Manual #include fixups for clashes - there may be some unnecessary

    Linus Torvalds
     
  • I recently picked up my older work to remove unnecessary #includes of
    sched.h, starting from a patch by Dave Jones to not include sched.h
    from module.h. This reduces the number of indirect includes of sched.h
    by ~300. Another ~400 pointless direct includes can be removed after
    this disentangling (patch to follow later).
    However, quite a few indirect includes need to be fixed up for this.

    In order to feed the patches through -mm with as little disturbance as
    possible, I've split out the fixes I accumulated up to now (complete for
    i386 and x86_64, more archs to follow later) and post them before the real
    patch. This way this large part of the patch is kept simple with only
    adding #includes, and all hunks are independent of each other. So if any
    hunk rejects or gets in the way of other patches, just drop it. My scripts
    will pick it up again in the next round.

    Signed-off-by: Tim Schmielau
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     
  • Convert existing function docs to kernel-doc format. Eliminate all
    kernel-doc warnings. Fix some doc typos and a little whitespace cleanup.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Some modules creating sysfs entries under /sys/devices/system/cpu/cpuX/
    need to know the parent sysfs entry to make devices under them. This will
    just return the sysfs entry for a given cpu.

    sysfs entries showing under each cpu sysfs can be easily created if such
    entries can be created by registering a sysfs driver for cpuclass. The
    issue is when the entry is created the CPU may not be online, hence we
    would need to defer the creation until the online notification comes.

    Current users: cache entries for Intel CPU's and cpufreq subsystem.

    Signed-off-by: Ashok Raj
    Signed-off-by: Venkatesh Pallipadi
    Cc: Dave Jones
    Cc: Zwane Mwaikambo
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ashok Raj
     

30 Oct, 2005

3 commits

  • This basically keeps up from having to extern __kmalloc_section_memmap().

    The vaddr_in_vmalloc_area() helper could go in a vmalloc header, but that
    header gets hard to work with, because it needs some arch-specific macros.
    Just stick it in here for now, instead of creating another header.

    Signed-off-by: Dave Hansen
    Signed-off-by: Lion Vollnhals
    Signed-off-by: Jiri Slaby
    Signed-off-by: Yasunori Goto
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Hansen
     
  • This adds generic memory add/remove and supporting functions for memory
    hotplug into a new file as well as a memory hotplug kernel config option.

    Individual architecture patches will follow.

    For now, disable memory hotplug when swsusp is enabled. There's a lot of
    churn there right now. We'll fix it up properly once it calms down.

    Signed-off-by: Matt Tolentino
    Signed-off-by: Dave Hansen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Hansen
     
  • Convert everyone who uses platform_bus_type to include
    linux/platform_device.h.

    Signed-off-by: Russell King
    Acked-by: Greg Kroah-Hartman

    Russell King
     

29 Oct, 2005

11 commits

  • With CONFIG_PM=n:

    drivers/built-in.o(.text+0x1098c): In function `hub_thread':
    drivers/usb/core/hub.c:2673: undefined reference to `.dpm_runtime_resume'
    drivers/built-in.o(.text+0x10998):drivers/usb/core/hub.c:2674: undefined reference to `.dpm_runtime_resume'

    Please, never ever ever put extern decls into .c files. Use the darn header
    files :(

    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Andrew Morton
     
  • This patch collects various small updates related to root hubs, to shrink
    later patches which build on them.

    - For root hub suspend/resume support:
    * Make the existing usb_hcd_resume_root_hub() routine respect pmcore
    locking, exporting and using the dpm_runtime_resume() method.
    * Add a new usb_hcd_suspend_root_hub() to pair with that routine.
    (Essential to make OHCI autosuspend behave again...)
    * HC_SUSPENDED by itself only refers to the root hub's downstream ports.
    So let HCDs see root hub URBs unless the parent device is suspended.

    - Remove an assertion we no longer need (and now, also don't want).

    - Generic suspend/resume updates to work better with swsusp.
    * Ignore the FREEZE vs SUSPEND distinction for hardware; trying to
    use it breaks the swsusp snapshots it's supposed to help (sigh).
    * On resume, mark devices as resumed right away, but then
    do nothing else if the device is marked NOTATTACHED.

    These changes shouldn't be very noticable by themselves.

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

    drivers/base/power/runtime.c | 1
    drivers/usb/core/hcd.c | 64 ++++++++++++++++++++++++++++++++++++++-----
    drivers/usb/core/hcd.h | 1
    drivers/usb/core/hub.c | 45 ++++++++++++++++++++++++------
    drivers/usb/core/usb.c | 20 +++++++++----
    drivers/usb/core/usb.h | 1
    6 files changed, 111 insertions(+), 21 deletions(-)

    David Brownell
     
  • This saves a word from "struct device" ... there's a refcounting mechanism
    stub that's rather ineffective (the values are never even tested!), which
    can safely be deleted. With this patch it uses normal device refcounting,
    so any potential users of the pm_parent mechanism will be more correct.
    (That mechanism is actually unusable for now though; it does nothing.)

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

    drivers/base/power/main.c | 26 +++-----------------------
    include/linux/pm.h | 1 -
    2 files changed, 3 insertions(+), 24 deletions(-)

    David Brownell
     
  • driver/base: add missing function parameters; eliminate all warnings.

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

    Randy Dunlap
     
  • In PM v1, all devices were called at SUSPEND_DISABLE level. Then
    all devices were called at SUSPEND_SAVE_STATE level, and finally
    SUSPEND_POWER_DOWN level. However, with PM v2, to maintain
    compatibility for platform devices, I arranged for the PM v2
    suspend/resume callbacks to call the old PM v1 suspend/resume
    callbacks three times with each level in order so that existing
    drivers continued to work.

    Since this is obsolete infrastructure which is no longer necessary,
    we can remove it. Here's an (untested) patch to do exactly that.

    Signed-off-by: Russell King
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     
  • There are a number of sparse warnings from the latest sparse
    snapshot being generated from the drivers/base build. The
    main culprits are due to the initialisation functions not
    being declared in a header file.

    Also, the firmware.c file should include
    to get the prototype of firmware_register() and
    firmware_unregister().

    This patch moves the init function declerations from the
    init.c file to the base.h, and ensures it is included in
    all the relevant c sources. It also adds
    to the included headers for firmware.c.

    The patch does not solve all the sparse errors generated,
    but reduces the count significantly.

    drivers/base/core.c:161:1: warning: symbol 'devices_subsys' was not declared. Should it be static?
    drivers/base/core.c:417:12: warning: symbol 'devices_init' was not declared. Should it be static?
    drivers/base/sys.c:253:6: warning: symbol 'sysdev_shutdown' was not declared. Should it be static?
    drivers/base/sys.c:326:5: warning: symbol 'sysdev_suspend' was not declared. Should it be static?
    drivers/base/sys.c:428:5: warning: symbol 'sysdev_resume' was not declared. Should it be static?
    drivers/base/sys.c:450:12: warning: symbol 'system_bus_init' was not declared. Should it be static?
    drivers/base/bus.c:133:1: warning: symbol 'bus_subsys' was not declared. Should it be static?
    drivers/base/bus.c:667:12: warning: symbol 'buses_init' was not declared. Should it be static?
    drivers/base/class.c:759:12: warning: symbol 'classes_init' was not declared. Should it be static?
    drivers/base/platform.c:313:12: warning: symbol 'platform_bus_init' was not declared. Should it be static?
    drivers/base/cpu.c:110:12: warning: symbol 'cpu_dev_init' was not declared. Should it be static?
    drivers/base/firmware.c:17:5: warning: symbol 'firmware_register' was not declared. Should it be static?
    drivers/base/firmware.c:23:6: warning: symbol 'firmware_unregister' was not declared. Should it be static?
    drivers/base/firmware.c:28:12: warning: symbol 'firmware_init' was not declared. Should it be static?
    drivers/base/init.c:28:13: warning: symbol 'driver_init' was not declared. Should it be static?
    drivers/base/dmapool.c:174:10: warning: implicit cast from nocast type
    drivers/base/attribute_container.c:439:1: warning: symbol 'attribute_container_init' was not declared. Should it be static?
    drivers/base/power/runtime.c:76:6: warning: symbol 'dpm_set_power_state' was not declared. Should it be static?

    Signed-off-by: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Ben Dooks
     
  • This patch allows struct class_device to be nested, so that another
    struct class_device can be the parent of a new one, instead of only
    having the struct class be the parent. This will allow us to
    (hopefully) fix up the input and video class subsystem mess.

    But please people, don't go crazy and start making huge trees of class
    devices, you should only need 2 levels deep to get everything to work
    (remember to use a class_interface to get notification of a new class
    device being added to the system.)

    Oh, this also allows us to have the possibility of potentially, someday,
    moving /sys/block into /sys/class. The main hindrance is that pesky
    /dev numberspace issue...

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • A "coldplug + udevstart" can be simple like this:
    for i in /sys/block/*/*/uevent; do echo 1 > $i; done
    for i in /sys/class/*/*/uevent; do echo 1 > $i; done
    for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done

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

    Kay Sievers
     
  • Driver core: pass interface to class intreface methods

    Pass interface as argument to add() and remove() class interface
    methods. This way a subsystem can implement generic add/remove
    handlers and then call interface-specific ones.

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

    Dmitry Torokhov
     
  • Move call to kobject_hotplug() above code that adds interfaces
    to a class device, otherwise children's hotplug events may reach
    userspace first.

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

    Dmitry Torokhov
     
  • This is a refresh of an earlier patch to add "wakeup" support to the
    PM core model. This provides per-device bus-neutral control of the
    use of wakeup events.

    * "struct device_pm_info" has two bits that are initialized as
    part of setting up the enclosing struct device:
    - "can_wakeup", reflecting hardware capabilities
    - "may_wakeup", the policy setting (when CONFIG_PM)

    * There's a writeable sysfs "wakeup" file, with one of two values:
    - "enabled", when the policy is to allow wakeup
    - "disabled", when the policy is not to allow it
    - "" if the device can't currently issue wakeups

    By default, wakeup is enabled on all devices that support it. If its
    driver doesn't support it ... treat it as a bug. :)

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

    David Brownell
     

09 Oct, 2005

1 commit

  • - added typedef unsigned int __nocast gfp_t;

    - replaced __nocast uses for gfp flags with gfp_t - it gives exactly
    the same warnings as far as sparse is concerned, doesn't change
    generated code (from gcc point of view we replaced unsigned int with
    typedef) and documents what's going on far better.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

22 Sep, 2005

2 commits

  • The class symlinks in sysfs don't properly handle changing device names.

    To demonstrate, rename your network device from eth0 to eth1. Your
    pci (or usb, or whatever) device will still have a 'net:eth0' link,
    except now it points to /sys/class/net/eth1.

    The attached patch makes sure the class symlink name changes when
    the class device name changes. It isn't 100% correct, it should be
    using sysfs_rename_link. Unfortunately, sysfs_rename_link doesn't exist.

    Signed-off-by: Bill Nottingham
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Linus Torvalds

    Bill Nottingham
     
  • bus_rescan_devices_helper() does not hold the dev->sem when it checks for
    !dev->driver(). device_attach() holds the sem, but calls again
    device_bind_driver() even when dev->driver is set.

    What happens is that a first device_attach() call (module insertion time)
    is on the way binding the device to a driver. Another thread calls
    bus_rescan_devices(). Now when bus_rescan_devices_helper() checks for
    dev->driver it is still NULL 'cos the the prior device_attach() is not yet
    finished. But as soon as the first one releases the dev->sem the second
    device_attach() tries to rebind the already bound device again.
    device_bind_driver() does this blindly which leads to a corrupt
    driver->klist_devices list (the device links itself, the head points to the
    device). Later a call to device_release_driver() sets dev->driver to NULL
    and breaks the link it has to itself on knode_driver. Rmmoding the driver
    later calls driver_detach() which leads to an endless loop 'cos the list
    head in klist_devices still points to the device. And since dev->driver is
    NULL it's stuck with the same device forever. Boom. And rmmod hangs.

    Very easy to reproduce with new-style pcmcia and a 16bit card. Just loop
    modprobe ;cardctl eject; rmmod .

    Easiest fix is to check if the device is already bound to a driver in
    device_bind_driver(). This avoids the double binding.

    Signed-off-by: Daniel Ritz
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Linus Torvalds

    Daniel Ritz
     

13 Sep, 2005

1 commit


11 Sep, 2005

1 commit


08 Sep, 2005

5 commits


07 Sep, 2005

1 commit


06 Sep, 2005

5 commits


05 Sep, 2005

2 commits

  • This adds type-checking to pm_message_t, so that people can't confuse it
    with int or u32. It also allows us to fix "disk yoyo" during suspend (disk
    spinning down/up/down).

    [We've tried that before; since that cpufreq problems were fixed and I've
    tried make allyes config and fixed resulting damage.]

    Signed-off-by: Pavel Machek
    Signed-off-by: Alexander Nyberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Machek
     
  • Add page_state info to the per-node meminfo file in sysfs. This is mostly
    just for informational purposes.

    The lack of this information was brought up recently during a discussion
    regarding pagecache clearing, and I put this patch together to test out one
    of the suggestions.

    It seems like interesting info to have, so I'm submitting the patch.

    Signed-off-by: Martin Hicks
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Hicks
     

31 Aug, 2005

2 commits

  • Since the attribute container deletes from a klist while it's walking
    it, it is vulnerable to the problem (and fix) here:

    http://marc.theaimsgroup.com/?l=linux-scsi&m=112485448830217

    The attached fixes this (but won't compile without the above).

    It also fixes the logical reversal in the traversal loop which meant
    that we were never actually traversing the loop to hit this bug in the
    first place.

    Signed-off-by: James Bottomley

    James Bottomley
     
  • One of the changes in the attribute_container code in the scsi-misc tree
    was to add a lock to protect the list of devices per container. This,
    unfortunately, leads to potential scheduling while atomic problems if
    there's a sleep in the function called by a trigger.

    The correct solution is to use the kernel klist infrastructure instead
    which allows lockless traversal of a list.

    Signed-off-by: James Bottomley

    James Bottomley