09 May, 2009

3 commits

  • This reverts commit 006f4571a15fae3a0575f2a0f9e9b63b3d1012f8:

    This patch moves platform_data from struct device into
    struct platform_device, based on the two ideas:

    1. Now all platform_driver is registered by platform_driver_register,
    which makes probe()/release()/... of platform_driver passed parameter
    of platform_device *, so platform driver can get platform_data from
    platform_device;

    2. Other kind of devices do not need to use platform_data, we can
    decrease size of device if moving it to platform_device.

    Taking into consideration of thousands of files to be fixed and they
    can't be finished in one night(maybe it will take a long time), so we
    keep platform_data in device to allow two kind of cases coexist until
    all platform devices pass its platfrom data from
    platform_device->platform_data.

    All patches to do this kind of conversion are welcome.

    As we don't really want to do it, it was a bad idea.

    Cc: David Brownell
    Cc: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This reverts commit ce21c7bcd796fc4f45d48781b7e85f493cc55ee5:
    We will remove platform_data field from struct device until
    all platform devices pass its specific data from platfom_device
    and all platform drivers use platform specific data passed by
    platform_device->platform_data. This kind of conversion will
    need a long time, for thousands of files is affected.

    To make the conversion easily, we allow platform specific data
    passed by struct device or struct platform_device and platform
    driver may use it from struct device or struct platform_device.

    As we really don't want to do this at all.

    Cc: David Brownell
    Cc: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • Fix function parameter notation in platform.c;
    fixes kernel-doc warnings.

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

    Randy Dunlap
     

07 May, 2009

1 commit


22 Apr, 2009

1 commit

  • There is currently only one way for userspace to say "wait for my storage
    device to get ready for the modules I just loaded": to load the
    scsi_wait_scan module. Expectations of userspace are that once this
    module is loaded, all the (storage) devices for which the drivers
    were loaded before the module load are present.

    Now, there are some issues with the implementation, and the async
    stuff got caught in the middle of this: The existing code only
    waits for the scsy async probing to finish, but it did not take
    into account at all that probing might not have begun yet.
    (Russell ran into this problem on his computer and the fix works for him)

    This patch fixes this more thoroughly than the previous "fix", which
    had some bad side effects (namely, for kernel code that wanted to wait for
    the scsi scan it would also do an async sync, which would deadlock if you did
    it from async context already.. there's a report about that on lkml):
    The patch makes the module first wait for all device driver probes, and then it
    will wait for the scsi parallel scan to finish.

    Signed-off-by: Arjan van de Ven
    Tested-by: Russell King
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

20 Apr, 2009

1 commit

  • notice one system /proc/iomem some entries missed the name for pci_devices

    it turns that dev->dev.kobj name is changed after device_add.

    for pci code: via acpi_pci_root_driver.ops.add (aka acpi_pci_root_add)
    ==> pci_acpi_scan_root is used to scan pci bus/device, and at the same
    time we read the resource for pci_dev in the pci_read_bases, we have
    res->name = pci_name(pci_dev); pci_name is calling dev_name.

    later via acpi_pci_root_driver.ops.start (aka acpi_pci_root_start) ==>
    pci_bus_add_device to add all pci_dev in kobj tree. pci_bus_add_device
    will call device_add.

    actually in device_add

    /* first, register with generic layer. */
    error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev_name(dev));
    if (error)
    goto Error;

    will get one new name for that kobj, old name is freed.

    [Impact: fix corrupted names in /proc/iomem ]

    Signed-off-by: Yinghai Lu
    Signed-off-by: Linus Torvalds

    Kay Sievers
     

17 Apr, 2009

3 commits

  • David Vrabel noticed that the wireless usb stack likes to call
    device_for_each_chile() with an empty bus. This used to work fine, but
    now oopses. This patch fixes the oops and makes the code behave like it
    used to.

    Reported-by: David Vrabel
    Tested-by: David Vrabel
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • V3 of the early platform driver implementation.

    Platform drivers are great for embedded platforms because we can separate
    driver configuration from the actual driver. So base addresses,
    interrupts and other configuration can be kept with the processor or board
    code, and the platform driver can be reused by many different platforms.

    For early devices we have nothing today. For instance, to configure early
    timers and early serial ports we cannot use platform devices. This
    because the setup order during boot. Timers are needed before the
    platform driver core code is available. The same goes for early printk
    support. Early in this case means before initcalls.

    These early drivers today have their configuration either hard coded or
    they receive it using some special configuration method. This is working
    quite well, but if we want to support both regular kernel modules and
    early devices then we need to have two ways of configuring the same
    driver. A single way would be better.

    The early platform driver patch is basically a set of functions that allow
    drivers to register themselves and architecture code to locate them and
    probe. Registration happens through early_param(). The time for the
    probe is decided by the architecture code.

    See Documentation/driver-model/platform.txt for more details.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Magnus Damm
    Cc: Paul Mundt
    Cc: Kay Sievers
    Cc: David Brownell
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Magnus Damm
     
  • 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
     

07 Apr, 2009

1 commit


06 Apr, 2009

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask: (36 commits)
    cpumask: remove cpumask allocation from idle_balance, fix
    numa, cpumask: move numa_node_id default implementation to topology.h, fix
    cpumask: remove cpumask allocation from idle_balance
    x86: cpumask: x86 mmio-mod.c use cpumask_var_t for downed_cpus
    x86: cpumask: update 32-bit APM not to mug current->cpus_allowed
    x86: microcode: cleanup
    x86: cpumask: use work_on_cpu in arch/x86/kernel/microcode_core.c
    cpumask: fix CONFIG_CPUMASK_OFFSTACK=y cpu hotunplug crash
    numa, cpumask: move numa_node_id default implementation to topology.h
    cpumask: convert node_to_cpumask_map[] to cpumask_var_t
    cpumask: remove x86 cpumask_t uses.
    cpumask: use cpumask_var_t in uv_flush_tlb_others.
    cpumask: remove cpumask_t assignment from vector_allocation_domain()
    cpumask: make Xen use the new operators.
    cpumask: clean up summit's send_IPI functions
    cpumask: use new cpumask functions throughout x86
    x86: unify cpu_callin_mask/cpu_callout_mask/cpu_initialized_mask/cpu_sibling_setup_mask
    cpumask: convert struct cpuinfo_x86's llc_shared_map to cpumask_var_t
    cpumask: convert node_to_cpumask_map[] to cpumask_var_t
    x86: unify 32 and 64-bit node_to_cpumask_map
    ...

    Linus Torvalds
     

04 Apr, 2009

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (28 commits)
    trivial: Update my email address
    trivial: NULL noise: drivers/mtd/tests/mtd_*test.c
    trivial: NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h
    trivial: Fix misspelling of "Celsius".
    trivial: remove unused variable 'path' in alloc_file()
    trivial: fix a pdlfush -> pdflush typo in comment
    trivial: jbd header comment typo fix for JBD_PARANOID_IOFAIL
    trivial: wusb: Storage class should be before const qualifier
    trivial: drivers/char/bsr.c: Storage class should be before const qualifier
    trivial: h8300: Storage class should be before const qualifier
    trivial: fix where cgroup documentation is not correctly referred to
    trivial: Give the right path in Documentation example
    trivial: MTD: remove EOL from MODULE_DESCRIPTION
    trivial: Fix typo in bio_split()'s documentation
    trivial: PWM: fix of #endif comment
    trivial: fix typos/grammar errors in Kconfig texts
    trivial: Fix misspelling of firmware
    trivial: cgroups: documentation typo and spelling corrections
    trivial: Update contact info for Jochen Hein
    trivial: fix typo "resgister" -> "register"
    ...

    Linus Torvalds
     
  • * git://git.infradead.org/iommu-2.6:
    intel-iommu: Fix address wrap on 32-bit kernel.
    intel-iommu: Enable DMAR on 32-bit kernel.
    intel-iommu: fix PCI device detach from virtual machine
    intel-iommu: VT-d page table to support snooping control bit
    iommu: Add domain_has_cap iommu_ops
    intel-iommu: Snooping control support

    Fixed trivial conflicts in arch/x86/Kconfig and drivers/pci/intel-iommu.c

    Linus Torvalds
     

31 Mar, 2009

5 commits

  • Conflicts:

    arch/x86/include/asm/topology.h
    drivers/oprofile/buffer_sync.c
    (Both cases: changed in Linus' tree, removed in Ingo's).

    Rusty Russell
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask:
    oprofile: Thou shalt not call __exit functions from __init functions
    cpumask: remove the now-obsoleted pcibus_to_cpumask(): generic
    cpumask: remove cpumask_t from core
    cpumask: convert rcutorture.c
    cpumask: use new cpumask_ functions in core code.
    cpumask: remove references to struct irqaction's mask field.
    cpumask: use mm_cpumask() wrapper: kernel/fork.c
    cpumask: use set_cpu_active in init/main.c
    cpumask: remove node_to_first_cpu
    cpumask: fix seq_bitmap_*() functions.
    cpumask: remove dangerous CPU_MASK_ALL_PTR, &CPU_MASK_ALL

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
    PCI PM: Make pci_prepare_to_sleep() disable wake-up if needed
    radeonfb: Use __pci_complete_power_transition()
    PCI PM: Introduce __pci_[start|complete]_power_transition() (rev. 2)
    PCI PM: Restore config spaces of all devices during early resume
    PCI PM: Make pci_set_power_state() handle devices with no PM support
    PCI PM: Put devices into low power states during late suspend (rev. 2)
    PCI PM: Move pci_restore_standard_config to pci-driver.c
    PCI PM: Use pci_set_power_state during early resume
    PCI PM: Consistently use variable name "error" for pm call return values
    kexec: Change kexec jump code ordering
    PM: Change hibernation code ordering
    PM: Change suspend code ordering
    PM: Rework handling of interrupts during suspend-resume
    PM: Introduce functions for suspending and resuming device interrupts

    Linus Torvalds
     
  • Conflicts:
    arch/x86/kernel/cpu/common.c

    Ingo Molnar
     
  • Use the functions introduced in by the previous patch,
    suspend_device_irqs(), resume_device_irqs() and check_wakeup_irqs(),
    to rework the handling of interrupts during suspend (hibernation) and
    resume. Namely, interrupts will only be disabled on the CPU right
    before suspending sysdevs, while device drivers will be prevented
    from receiving interrupts, with the help of the new helper function,
    before their "late" suspend callbacks run (and analogously during
    resume).

    In addition, since the device interrups are now disabled before the
    CPU has turned all interrupts off and the CPU will ACK the interrupts
    setting the IRQ_PENDING bit for them, check in sysdev_suspend() if
    any wake-up interrupts are pending and abort suspend if that's the
    case.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Ingo Molnar

    Rafael J. Wysocki
     

30 Mar, 2009

2 commits


29 Mar, 2009

1 commit


28 Mar, 2009

1 commit


25 Mar, 2009

15 commits

  • dpm_list currently relies on the fact that child devices will
    be registered after their parents to get a correct suspend
    order. Using device_move() however destroys this assumption, as
    an already registered device may be moved under a newly registered
    one.

    This patch adds a new argument to device_move(), allowing callers
    to specify how dpm_list should be adapted.

    Signed-off-by: Cornelia Huck
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Cornelia Huck
     
  • do some cleanup on drivers/base/sys.c

    Signed-off-by: Zhenwen Xu
    Signed-off-by: Greg Kroah-Hartman

    Zhenwen Xu
     
  • This patch implements uevent suppress in kobject and removes it
    from struct device, based on the following ideas:

    1,Uevent sending should be one attribute of kobject, so suppressing it
    in kobject layer is more natural than in device layer. By this way,
    we can do it for other objects embedded with kobject.

    2,It may save several bytes for each instance of struct device.(On my
    omap3(32bit ARM) based box, can save 8bytes per device object)

    This patch also introduces dev_set|get_uevent_suppress() helpers to
    set and query uevent_suppress attribute in case to help kobject
    as private part of struct device in future.

    [This version is against the latest driver-core patch set of Greg,please
    ignore the last version.]

    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • We will remove platform_data field from struct device until
    all platform devices pass its specific data from platfom_device
    and all platform drivers use platform specific data passed by
    platform_device->platform_data. This kind of conversion will
    need a long time, for thousands of files is affected.

    To make the conversion easily, we allow platform specific data
    passed by struct device or struct platform_device and platform
    driver may use it from struct device or struct platform_device.

    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • This patch moves platform_data from struct device into
    struct platform_device, based on the two ideas:

    1. Now all platform_driver is registered by platform_driver_register,
    which makes probe()/release()/... of platform_driver passed parameter
    of platform_device *, so platform driver can get platform_data from
    platform_device;

    2. Other kind of devices do not need to use platform_data, we can
    decrease size of device if moving it to platform_device.

    Taking into consideration of thousands of files to be fixed and they
    can't be finished in one night(maybe it will take a long time), so we
    keep platform_data in device to allow two kind of cases coexist until
    all platform devices pass its platfrom data from
    platform_device->platform_data.

    All patches to do this kind of conversion are welcome.

    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • Nothing outside of the driver core should ever touch knode_bus, so
    move it out of the public eye.

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

    Greg Kroah-Hartman
     
  • Nothing outside of the driver core should ever touch knode_driver, so
    move it out of the public eye.

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

    Greg Kroah-Hartman
     
  • Nothing outside of the driver core should ever touch klist_children, or
    knode_parent, so move them out of the public eye.

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

    Greg Kroah-Hartman
     
  • This is to be used to move things out of struct device that no code
    outside of the driver core should ever touch.

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

    Greg Kroah-Hartman
     
  • This patch removes 100ms polling for driver_probe_done in
    wait_for_device_probe(), and uses wait_event() instead.
    Removing polling in fs initialization may lead to
    a faster boot.

    This patch also changes the return type of wait_for_device_done()
    from int to void.

    This patch is against Arjan's patch in linux-next tree.

    Signed-off-by: Ming Lei
    Acked-by: Cornelia Huck
    Reviewed-by: Arjan van de Ven
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • If the bus_type is not registerd, driver_register to that bus will cause oops.

    I found this bug when test built-in usb serial drivers (ie. aircable driver)
    with 'nousb' cmdline params.

    In this patch:
    1. set the bus->p=NULL when bus_register failed and unregisterd.
    2. if bus->p is NULL, driver_register BUG_ON will be triggered.

    Signed-off-by: Dave Young
    Signed-off-by: Greg Kroah-Hartman

    Dave Young
     
  • Now platform_device is being widely used on SoC processors where the
    peripherals are attached to the system bus, which is simple enough.

    However, silicon IPs for these SoCs are usually shared heavily across
    a family of processors, even products from different companies. This
    makes the original simple driver name based matching insufficient, or
    simply not straight-forward.

    Introduce a module id table for platform devices, and makes it clear
    that a platform driver is able to support some shared IP and handle
    slight differences across different platforms (by 'driver_data').
    Module alias is handled automatically when a MODULE_DEVICE_TABLE()
    is defined.

    To not disturb the current platform drivers too much, the matched id
    entry is recorded and can be retrieved by platform_get_device_id().

    Signed-off-by: Eric Miao
    Cc: Kay Sievers
    Cc: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Eric Miao
     
  • This helps the code look more consistent and cleaner.

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

    Eric Miao
     
  • This patch moves bus->match out from driver_probe_device and
    does not hold device lock to check the match between a device
    and a driver.

    The idea has been verified by the commit 6cd495860901,
    which leads to a faster boot. But the commit 6cd495860901 has
    the following drawbacks: 1),only does the quick check in
    the path of __driver_attach->driver_probe_device, not in other
    paths; 2),for a matched device and driver, check the same match
    twice. It is a waste of cpu ,especially for some drivers with long
    device id table (eg. usb-storage driver).

    This patch adds a helper of driver_match_device to check the match
    in all paths, and testes the match only once.

    Signed-off-by: Ming Lei
    Acked-by: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • Now that all users of bus_id is gone, we can remove it from struct
    device.

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

    Kay Sievers
     

24 Mar, 2009

1 commit

  • This iommu_op can tell if domain have a specific capability, like snooping
    control for Intel IOMMU, which can be used by other components of kernel to
    adjust the behaviour.

    Signed-off-by: Sheng Yang
    Signed-off-by: David Woodhouse

    Sheng Yang
     

18 Mar, 2009

1 commit


13 Mar, 2009

1 commit