11 Jun, 2008

1 commit


11 Mar, 2008

1 commit

  • There's a bug in the current implementation of dma_get_required_mask()
    where it ands the returned mask with the current device mask. This
    rather defeats the purpose if you're using the call to determine what
    your mask should be (since you will at that time have the default
    DMA_32BIT_MASK). This bug results in any driver that uses this function
    *always* getting a 32 bit mask, which is wrong.

    Fix by removing the and with dev->dma_mask.

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

    James Bottomley
     

25 Jan, 2008

4 commits


13 Oct, 2007

3 commits

  • While platform_device.id is a u32, platform_device_add() handles "-1"
    as a special id value. This has potential for confusion and bugs.
    Making it an int instead should prevent problems from happening in
    the future.

    Signed-off-by: Jean Delvare
    Signed-off-by: Greg Kroah-Hartman

    Jean Delvare
     
  • This changes the uevent buffer functions to use a struct instead of a
    long list of parameters. It does no longer require the caller to do the
    proper buffer termination and size accounting, which is currently wrong
    in some places. It fixes a known bug where parts of the uevent
    environment are overwritten because of wrong index calculations.

    Many thanks to Mathieu Desnoyers for finding bugs and improving the
    error handling.

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

    Kay Sievers
     
  • Prefix platform modalias strings with "platform:", which
    modprobe config to blacklist alias resolving if userspace
    configures it.

    Send uevents for all platform devices.

    Add MODULE_ALIAS's to: pxa2xx_pcmcia, ds1742 and pcspkr to trigger
    module autoloading by userspace.

    $ modinfo pcspkr
    alias: platform:pcspkr
    license: GPL
    description: PC Speaker beeper driver
    ...

    $ modprobe -n -v platform:pcspkr
    insmod /lib/modules/2.6.23-rc3-g28e8351a-dirty/kernel/drivers/input/misc/pcspkr.ko

    Signed-off-by: Kay Sievers
    Cc: David Brownell
    Cc: Atsushi Nemoto
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

09 May, 2007

2 commits

  • Typo: iwithout -> without.

    Signed-off-by: Márton Németh
    Signed-off-by: Adrian Bunk

    Márton Németh
     
  • We've had various reports of some legacy "probe the hardware" style
    platform drivers having nasty problems with hotplug support.

    The core issue is that those legacy drivers don't fully conform to the
    driver model. They assume a role that should be the responsibility of
    infrastructure code: creating device nodes.

    The "modprobe" step in hotplugging relies on drivers to have split those
    roles into different modules. The lack of this split causes the problems.
    When a driver creates nodes for devices that don't exist (sending a hotplug
    event), then exits (aborting one modprobe) before the "modprobe $MODALIAS"
    step completes (by failing, since it's in the middle of a modprobe), the
    result can be an endless loop of modprobe invocations ... badness.

    This fix uses the newish per-device flag controlling issuance of "add"
    events. (A previous version of this patch used a per-device "driver can
    hotplug" flag, which only scrubbed $MODALIAS from the environment rather
    than suppressing the entire hotplug event.) It also shrinks that flag to
    one bit, saving a word in "struct device".

    So the net of this patch is removing some nasty failures with legacy
    drivers, while retaining hotplug capability for the majority of platform
    drivers.

    Signed-off-by: David Brownell
    Cc: Greg KH
    Cc: Andres Salomon
    Cc: Dominik Brodowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

03 May, 2007

1 commit

  • In platform_device_del(), we currently delete the device resources
    first, then we delete the device itself. This causes a (minor) bug to
    occur when one unregisters a platform device before unregistering its
    platform driver, and the driver is requesting (in .probe()) and
    releasing (in .remove()) a resource of the device. The device
    resources are already gone by the time the driver gets the chance to
    release the resources it had been requesting, causing an error like:
    Trying to free nonexistent resource

    If the platform driver is unregistered first, the problem doesn't
    occur, as the driver will have the opportunity to release the
    resources it had requested before the device resources themselves are
    released. It's a bit odd that unregistering the driver first or the
    device first doesn't lead to the same result.

    So I believe that we should delete the device first in
    platform_device_del(). I've searched the git history and found that it
    used to be the case before 2.6.8, but was changed here:

    http://www.kernel.org/git/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commitdiff;h=96ef7b3689936ee1e64b711511342026a8ce459c

    > 2004/07/14 16:09:44-07:00 dtor_core
    > [PATCH] Driver core: Fix OOPS in device_platform_unregister
    >
    > Driver core: platform_device_unregister should release resources first
    > and only then call device_unregister, otherwise if there
    > are no more references to the device it will be freed and
    > the fucntion will try to access freed memory.

    However we now have an explicit call to put_device() at the end of
    platform_device_unregister() so I guess the original problem no longer
    exists and it is safe to revert that change.

    Signed-off-by: Jean Delvare
    Signed-off-by: Greg Kroah-Hartman

    Jean Delvare
     

08 Feb, 2007

1 commit


14 Dec, 2006

2 commits


02 Dec, 2006

1 commit

  • This defines a new platform_driver_probe() method allowing the driver's
    probe() method, and its support code+data, to safely live in __init
    sections for typical system configurations.

    Many system-on-chip processors could benefit from this API, to the tune
    of recovering hundreds to thousands of bytes per driver. That's memory
    which is currently wasted holding code which can never be called after
    system startup, yet can not be removed. It can't be removed because of
    the linkage requirement that pointers to init section code (like, ideally,
    probe support) must not live in other sections (like driver method tables)
    after those pointers would be invalid.

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

    David Brownell
     

26 Sep, 2006

1 commit

  • Teach platform_bus about the new suspend_late/resume_early PM calls,
    issued with IRQs off. Do we really need sysdev and friends any more,
    or can janitors start switching its users over to platform_device so
    we can do a minor code-ectomy?

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

    David Brownell
     

22 Jun, 2006

2 commits


22 Mar, 2006

1 commit


21 Mar, 2006

1 commit


14 Jan, 2006

1 commit


05 Jan, 2006

3 commits

  • Driver core: rearrange exports in platform.c

    The new way is to specify export right after symbol definition.
    Rearrange exports to follow new style to avoid mixing two styles
    in one file.

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

    Dmitry Torokhov
     
  • Driver core: add platform_device_del function

    Having platform_device_del90 allows more straightforward error
    handling code in drivers registering platform devices.

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

    Dmitry Torokhov
     
  • There are cases in which a device's memory mapped registers overlap
    with another device's memory mapped registers. On several PowerPC
    devices this occurs for the MDIO bus, whose registers tended to overlap
    with one of the ethernet controllers.

    By switching from request_resource to insert_resource we can register
    the MDIO bus as a proper platform device and not hack around how we
    handle its memory mapped registers.

    Signed-off-by: Kumar Gala
    Signed-off-by: Greg Kroah-Hartman

    Kumar Gala
     

10 Nov, 2005

1 commit

  • Introduce struct platform_driver. This allows the platform device
    driver methods to be passed a platform_device structure instead of
    instead of a plain device structure, and therefore requiring casting
    in every platform driver.

    We introduce this in such a way that any existing platform drivers
    registered directly via driver_register continue to work as before,
    thereby allowing a gradual conversion to the new platform_driver
    methods.

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

    Russell King
     

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

2 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
     

30 Oct, 2005

1 commit


29 Oct, 2005

2 commits

  • 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
     

13 Sep, 2005

1 commit


01 May, 2005

1 commit


19 Apr, 2005

1 commit

  • platform_add_devices can be used from within modules, so it should be
    exported. This can for example happen if you have hotpluggable firmware in
    an FPGA on a system on chip processor; in our case the FPGA is probed for
    devices and the FPGA base code registers the devices it has found with the
    kernel.

    (akpm: I think this is reasonable from a licensing POV: it's unlikely that
    anyone would be interested in merging such specialised modules into mainline,
    and it's a GPL export).

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

    Robert Schwebel
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds