22 Aug, 2008

6 commits

  • PM: Remove WARN_ON from device_pm_add

    Fix message in device_pm_add() saying that the device will not be
    added to dpm_list, although in fact the device is going to be added
    to the list regardless of the ordering violation.

    Remove the WARN_ON(true) triggered in that situation, because it is
    hit by USB very often and spams the users' logs.

    This patch fixes bug #11263

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

    Rafael J. Wysocki
     
  • 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
     
  • Anti-oops medicine for the class iterators ... the oops was
    observed when a class was implicitly referenced before it
    was initialized.

    [Modified by Greg to spit a warning back so someone knows to fix their code]

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

    David Brownell
     
  • 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
     
  • Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Joe Perches
     

02 Aug, 2008

1 commit


29 Jul, 2008

1 commit


28 Jul, 2008

1 commit


27 Jul, 2008

2 commits

  • 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
     
  • dma_alloc_coherent() on x86 currently takes a passed in NULL device
    pointer to mean that it should allocate an ISA compatible (24-bit) buffer
    which is a bit of a hack.

    The ALSA ISA drivers are the main consumers of this but have a struct
    device in fact readily available.

    For the legacy drivers, this sets the device dma_mask in preparation for
    using the actual device with the DMA API so as to eventually not need the
    NULL hack in dma_alloc_coherent().

    This does not fix a current bug -- 2.6.26-rc1 stumbled over the NULL hack
    in dma_alloc_coherent() but this has already been fixed in commit
    4a367f3a9dbf2e7ffcee4702203479809236ee6e by Takashi Iwai.

    Signed-off-by: Rene Herman
    Cc: Bjorn Helgaas
    Acked-by: Takashi Iwai
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rene Herman
     

26 Jul, 2008

1 commit


25 Jul, 2008

1 commit

  • Memory may be hot-removed on a per-memory-block basis, particularly on
    POWER where the SPARSEMEM section size often matches the memory-block
    size. A user-level agent must be able to identify which sections of
    memory are likely to be removable before attempting the potentially
    expensive operation. This patch adds a file called "removable" to the
    memory directory in sysfs to help such an agent. In this patch, a memory
    block is considered removable if;

    o It contains only MOVABLE pageblocks
    o It contains only pageblocks with free pages regardless of pageblock type

    On the other hand, a memory block starting with a PageReserved() page will
    never be considered removable. Without this patch, the user-agent is
    forced to choose a memory block to remove randomly.

    Sample output of the sysfs files:

    ./memory/memory0/removable: 0
    ./memory/memory1/removable: 0
    ./memory/memory2/removable: 0
    ./memory/memory3/removable: 0
    ./memory/memory4/removable: 0
    ./memory/memory5/removable: 0
    ./memory/memory6/removable: 0
    ./memory/memory7/removable: 1
    ./memory/memory8/removable: 0
    ./memory/memory9/removable: 0
    ./memory/memory10/removable: 0
    ./memory/memory11/removable: 0
    ./memory/memory12/removable: 0
    ./memory/memory13/removable: 0
    ./memory/memory14/removable: 0
    ./memory/memory15/removable: 0
    ./memory/memory16/removable: 0
    ./memory/memory17/removable: 1
    ./memory/memory18/removable: 1
    ./memory/memory19/removable: 1
    ./memory/memory20/removable: 1
    ./memory/memory21/removable: 1
    ./memory/memory22/removable: 1

    Signed-off-by: Badari Pulavarty
    Signed-off-by: Mel Gorman
    Acked-by: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Badari Pulavarty
     

24 Jul, 2008

1 commit

  • * 'cpus4096-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (31 commits)
    NR_CPUS: Replace NR_CPUS in speedstep-centrino.c
    cpumask: Provide a generic set of CPUMASK_ALLOC macros, FIXUP
    NR_CPUS: Replace NR_CPUS in cpufreq userspace routines
    NR_CPUS: Replace per_cpu(..., smp_processor_id()) with __get_cpu_var
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genapic_flat_64.c
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genx2apic_uv_x.c
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/proc.c
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/mcheck/mce_64.c
    cpumask: Optimize cpumask_of_cpu in lib/smp_processor_id.c, fix
    cpumask: Use optimized CPUMASK_ALLOC macros in the centrino_target
    cpumask: Provide a generic set of CPUMASK_ALLOC macros
    cpumask: Optimize cpumask_of_cpu in lib/smp_processor_id.c
    cpumask: Optimize cpumask_of_cpu in kernel/time/tick-common.c
    cpumask: Optimize cpumask_of_cpu in drivers/misc/sgi-xp/xpc_main.c
    cpumask: Optimize cpumask_of_cpu in arch/x86/kernel/ldt.c
    cpumask: Optimize cpumask_of_cpu in arch/x86/kernel/io_apic_64.c
    cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr
    Revert "cpumask: introduce new APIs"
    cpumask: make for_each_cpu_mask a bit smaller
    net: Pass reference to cpumask variable in net/sunrpc/svc.c
    ...

    Fix up trivial conflicts in drivers/cpufreq/cpufreq.c manually

    Linus Torvalds
     

22 Jul, 2008

19 commits

  • This adds a new sysdev_ext_attribute that stores a pointer to the variable
    it manages and some utility functions/macro to easily use them.

    Previously all users wrote custom macros to generate show/store
    functions for each variable, with this it is possible to avoid
    that in many cases.

    Signed-off-by: Andi Kleen
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • This allow to dynamically generate attributes and share show/store
    functions between attributes. Right now most attributes are generated
    by special macros and lots of duplicated code. With the attribute
    passed it's instead possible to attach some data to the attribute
    and then use that in shared low level functions to do different things.

    I need this for the dynamically generated bank attributes in the x86
    machine check code, but it'll allow some further cleanups.

    I converted all users in tree to the new show/store prototype. It's a single
    huge patch to avoid unbisectable sections.

    Runtime tested: x86-32, x86-64
    Compiled only: ia64, powerpc
    Not compile tested/only grep converted: sh, arm, avr32

    Signed-off-by: Andi Kleen
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • driver core: Suppress sysfs warnings for device_rename().

    Renaming network devices to an already existing name is not
    something we want sysfs to print a scary warning for, since the
    callers can deal with this correctly. So let's introduce
    sysfs_create_link_nowarn() which gets rid of the common warning.

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

    Cornelia Huck
     
  • James Bottomley recently discovered that we have
    {request,release}_firmware() dummies for the case of the actual
    functions not being available and has a fix for the bug that was
    actually causing build errors for built-in users with
    CONFIG_FW_LOADER=m.

    But now missing selects on FW_LOADER are no longer visible at
    compile-time at all and can become runtime problems.

    FW_LOADER is infrastructure with relatively small codesize we can safely
    enable for everyone, and only for people who really need small kernels
    (and can be expected to know what they are doing) it matters being able
    to disable it.

    This patch therefore always sets FW_LOADER=y and allows users only to
    disable it with EMBEDDED=y.

    As a bonus, we can then get rid of all "select FW_LOADER" plus the due
    to it required "depends on HOTPLUG" which removes some complexity from
    our Kconfig files.

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

    Adrian Bunk
     
  • The systdev_class_register() and sysdev_register() functions have
    pr_debug() statements which are enabled when the user selects the
    driver core debug. Both of these routines do not produce the
    correct output, as they make assumptions about data which has not
    been initialised.

    In sysdev_class_register() the code uses the kobject_name(&cls->kset.kobj)
    at the start of the function, but this is not setup until later in the
    same call. Change this to use cls->name which is passed in from the caller.

    The sysdev_register() function tries to get the name of the sysdev by
    kobject_name(&sysdev->kobj), but that isn't setup until later in the same
    function so change this message to use the name of the sysdev's class and
    add another message once the name is initialised.

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

    Ben Dooks
     
  • We have the dev_printk() variants for this kind of thing, use them
    instead of directly trying to access the bus_id field of struct device.

    This is done in order to remove bus_id entirely.

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

    Greg Kroah-Hartman
     
  • Now that the lockdep infrastructure in the class core is in place, we
    should be able to properly change the internal class semaphore to be a
    mutex.

    David wrote the original patch, and Greg fixed it up to apply properly
    due to all of the recent changes in this area.

    From: Dave Young
    Cc: Matthew Wilcox
    Cc: Kay Sievers
    Cc: Andrew Morton
    Cc: James Bottomley
    Signed-off-by: Greg Kroah-Hartman

    Dave Young
     
  • This adds the infrastructure to properly handle lockdep issues when the
    internal class semaphore is changed to a mutex.

    Matthew wrote the original patch, and Greg fixed it up to work properly
    with the class_create() function.

    From: Matthew Wilcox
    Cc: Kay Sievers
    Cc: Dave Young
    Cc: Andrew Morton
    Cc: James Bottomley
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    Matthew Wilcox
     
  • Removes a field that has been deleted, and adds a description fo the
    class_dirs field which was previously undocumented.

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

    Greg Kroah-Hartman
     
  • This renames the struct class "sem" field to be "class_sem" to make
    things easier when struct bus_type and struct class merge in the future.
    It also makes grepping for fields easier as well.

    Based on an idea from Kay.

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

    Greg Kroah-Hartman
     
  • This renames the struct class "subsys" field to be "class_subsys" to
    make things easier when struct bus_type and struct class merge in the
    future. It also makes grepping for fields easier as well.

    Based on an idea from Kay.

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

    Greg Kroah-Hartman
     
  • This renames the struct class "interfaces" field to be
    "class_interfaces" to make things easier when struct bus_type and struct
    class merge in the future. It also makes grepping for fields easier as
    well.

    Based on an idea from Kay.

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

    Greg Kroah-Hartman
     
  • This renames the struct class "devices" field to be "class_devices" to
    make things easier when struct bus_type and struct class merge in the
    future. It also makes grepping for fields easier as well.

    Based on an idea from Kay.

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

    Greg Kroah-Hartman
     
  • This moves the portions of struct class that are dynamic (kobject and
    lock and lists) out of the main structure and into a dynamic, private,
    structure.

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

    Greg Kroah-Hartman
     
  • This mirrors the functionality that driver_find_device has as well.

    We add a start variable, and all callers of the function are fixed up at
    the same time.

    The block layer will be using this new functionality in a follow-on
    patch.

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

    Greg Kroah-Hartman
     
  • This mirrors the functionality that driver_for_each_device has as well.

    We add a start variable, and all callers of the function are fixed up at
    the same time.

    The block layer will be using this new functionality in a follow-on
    patch.

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

    Greg Kroah-Hartman
     
  • Now that device_create() has been audited, rename things back to the
    original call to be sane.

    Keep the device_create_drvdata macro around to make merges easier.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • There are no more users of this, and it is racy. Use
    device_create_drvdata() or device_create_vargs() instead.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Why?:
    There are occasions where userspace would like to access sysfs
    attributes for a device but it may not know how sysfs has named the
    device or the path. For example what is the sysfs path for
    /dev/disk/by-id/ata-ST3160827AS_5MT004CK? With this change a call to
    stat(2) returns the major:minor then userspace can see that
    /sys/dev/block/8:32 links to /sys/block/sdc.

    What are the alternatives?:
    1/ Add an ioctl to return the path: Doable, but sysfs is meant to reduce
    the need to proliferate ioctl interfaces into the kernel, so this
    seems counter productive.

    2/ Use udev to create these symlinks: Also doable, but it adds a
    udev dependency to utilities that might be running in a limited
    environment like an initramfs.

    3/ Do a full-tree search of sysfs.

    [kay.sievers@vrfy.org: fix duplicate registrations]
    [kay.sievers@vrfy.org: cleanup suggestions]

    Cc: Neil Brown
    Cc: Tejun Heo
    Acked-by: Kay Sievers
    Reviewed-by: SL Baur
    Acked-by: Kay Sievers
    Acked-by: Mark Lord
    Acked-by: H. Peter Anvin
    Signed-off-by: Dan Williams
    Signed-off-by: Greg Kroah-Hartman

    Dan Williams
     

19 Jul, 2008

1 commit


17 Jul, 2008

1 commit

  • * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (72 commits)
    Revert "x86/PCI: ACPI based PCI gap calculation"
    PCI: remove unnecessary volatile in PCIe hotplug struct controller
    x86/PCI: ACPI based PCI gap calculation
    PCI: include linux/pm_wakeup.h for device_set_wakeup_capable
    PCI PM: Fix pci_prepare_to_sleep
    x86/PCI: Fix PCI config space for domains > 0
    Fix acpi_pm_device_sleep_wake() by providing a stub for CONFIG_PM_SLEEP=n
    PCI: Simplify PCI device PM code
    PCI PM: Introduce pci_prepare_to_sleep and pci_back_from_sleep
    PCI ACPI: Rework PCI handling of wake-up
    ACPI: Introduce new device wakeup flag 'prepared'
    ACPI: Introduce acpi_device_sleep_wake function
    PCI: rework pci_set_power_state function to call platform first
    PCI: Introduce platform_pci_power_manageable function
    ACPI: Introduce acpi_bus_power_manageable function
    PCI: make pci_name use dev_name
    PCI: handle pci_name() being const
    PCI: add stub for pci_set_consistent_dma_mask()
    PCI: remove unused arch pcibios_update_resource() functions
    PCI: fix pci_setup_device()'s sprinting into a const buffer
    ...

    Fixed up conflicts in various files (arch/x86/kernel/setup_64.c,
    arch/x86/pci/irq.c, arch/x86/pci/pci.h, drivers/acpi/sleep/main.c,
    drivers/pci/pci.c, drivers/pci/pci.h, include/acpi/acpi_bus.h) from x86
    and ACPI updates manually.

    Linus Torvalds
     

16 Jul, 2008

2 commits


15 Jul, 2008

1 commit


10 Jul, 2008

2 commits

  • This will control whether we build firmware into the kernel image for
    _every_ driver which we convert to request_firmware(), to avoid a
    proliferation of 'CONFIG_XXX_FIRMWARE' options for each one.

    Default to 'y' for now, which is the wrong thing to do but people seem
    to be insisting on it and refusing to even review patches until it's
    done. And it does preserve the existing behaviour for built-in drivers.

    Signed-off-by: David Woodhouse

    David Woodhouse
     
  • This allows arbitrary firmware files to be included in the static kernel
    where the firmware loader can find them without requiring userspace to
    be alive.

    (Updated and CONFIG_EXTRA_FIRMWARE_DIR added with lots of help from
    Johannes Berg).

    Signed-off-by: David Woodhouse
    Signed-off-by: Johannes Berg

    David Woodhouse