27 Aug, 2013

1 commit

  • * acpi-assorted:
    ACPI / osl: Kill macro INVALID_TABLE().
    earlycpio.c: Fix the confusing comment of find_cpio_data().
    ACPI / x86: Print Hot-Pluggable Field in SRAT.
    ACPI / thermal: Use THERMAL_TRIPS_NONE macro to replace number
    ACPI / thermal: Remove unused macros in the driver/acpi/thermal.c
    ACPI / thermal: Remove the unused lock of struct acpi_thermal
    ACPI / osl: Fix osi_setup_entries[] __initdata attribute location
    ACPI / numa: Fix __init attribute location in slit_valid()
    ACPI / dock: Fix __init attribute location in find_dock_and_bay()
    ACPI / Sleep: Fix incorrect placement of __initdata
    ACPI / processor: Fix incorrect placement of __initdata
    ACPI / EC: Fix incorrect placement of __initdata
    ACPI / scan: Drop unnecessary label from acpi_create_platform_device()
    ACPI: Move acpi_bus_get_device() from bus.c to scan.c
    ACPI / scan: Allow platform device creation without any IO resources
    ACPI: Cleanup sparse warning on acpi_os_initialize1()
    platform / thinkpad: Remove deprecated hotkey_report_mode parameter
    ACPI: Remove the old /proc/acpi/event interface

    Rafael J. Wysocki
     

13 Aug, 2013

1 commit


26 Jul, 2013

1 commit


15 Jul, 2013

13 commits

  • The local variable id in dock_add() is not necessary, so drop it.

    While we're at it, use an initializer to clear the local variable ds
    and drop the memset() used for this purpose.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The only user of the ACPI dock notifier chain is the ACPI-based PCI
    hotplug (acpiphp) driver that uses it to carry out post-dock fixups
    needed by some systems with broken _DCK. However, it is not
    necessary to use a separate notifier chain for that, as it can be
    simply replaced with a new callback in struct acpi_dock_ops.

    For this reason, add a new .fixup() callback to struct acpi_dock_ops
    and make hotplug_dock_devices() execute it for all dock devices with
    hotplug operations registered. Accordingly, make acpiphp point that
    callback to the function carrying out the post-dock fixups and
    do not register a separate dock notifier for each device
    registering dock operations. Finally, drop the ACPI dock notifier
    chain that has no more users.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The function creating and registering dock station objects,
    dock_add(), leaks memory if there's an error after it's walked
    the ACPI namespace calling find_dock_devices(), because it doesn't
    free the list of dependent devices it's just created in those cases.

    Fix that issue by adding the missing code to free the list of
    dependent devices on errors.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The ACPI dock driver uses register_acpi_bus_notifier() which
    installs a notifier triggered globally for all system notifications.
    That first of all is inefficient, because the dock driver is only
    interested in notifications associated with the devices it handles,
    but it has to handle all system notifies for all devices. Moreover,
    it does that even if no docking stations are present in the system
    (CONFIG_ACPI_DOCK set is sufficient for that to happen). Besides,
    that is inconvenient, because it requires the driver to do extra work
    for each notification to find the target dock station object.

    For these reasons, rework the dock driver to install a notify
    handler individually for each dock station in the system using
    acpi_install_notify_handler(). This allows the dock station
    object to be passed directly to the notify handler and makes it
    possible to simplify the dock driver quite a bit. It also
    reduces the overhead related to the handling of all system
    notifies when CONFIG_ACPI_DOCK is set.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu

    Rafael J. Wysocki
     
  • Make dock_init_hotplug() and dock_release_hotplug() slightly simpler
    and move some checks in those functions to the code paths where they
    are needed.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu

    Rafael J. Wysocki
     
  • If there are indirect dependencies between devices in a dock
    station's dependent devices list, they may be broken if the devices
    are removed in the same order in which they have been added.

    For this reason, make the code in handle_eject_request() walk the
    list of dependent devices in reverse order.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu

    Rafael J. Wysocki
     
  • Since acpi_walk_namespace() calls find_dock_devices() during tree
    pre-order visit, the latter doesn't need to add devices whose
    parents have _EJD pointing to the docking station to the list of
    that station's dependent devices, because those parents are going to
    be added to that list anyway and the removal of a parent will take
    care of the removal of its children in those cases.

    For this reason, rework find_dock_devices() to only call
    add_dock_dependent_device() for devices whose _EJD point directy to
    the docking station represented by its context argument and simplify
    it slightly.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu

    Rafael J. Wysocki
     
  • The only existing user of the hp_lock mutex in struct dock_station,
    hotplug_dock_devices(), is always called under acpi_scan_lock and
    cannot race with another instance of itself, so drop the mutex
    which is not necessary.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Use helper functions introduced previously to simplify the ACPI dock
    driver.

    [rjw: Changelog]
    Signed-off-by: Jiang Liu
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     
  • The return value of dock_create_acpi_device() is not used at all,
    so change its signature to return void and simplify the
    implementation of it.

    Signed-off-by: Jiang Liu
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     
  • Mark all initialization functions with __init to reduce runtime
    memory consumption.

    Signed-off-by: Jiang Liu
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     
  • All dock station objects are created during initialization and
    don't change at runtime, so drop the redundant spin lock from
    struct dock_station.

    [rjw: Changelog]
    Signed-off-by: Jiang Liu
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     
  • Function dock_add() will be called multiple times if there are
    multiple dock stations, which causes acpi_dock_notifier_list to be
    initialized multiple times.

    To avoid that, move the initialization of acpi_dock_notifier_list
    from dock_add() to acpi_dock_init().

    [rjw: Changelog]
    Signed-off-by: Jiang Liu
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     

04 Jul, 2013

1 commit

  • Commit 94add0f (ACPI / dock: Initialize ACPI dock subsystem upfront)
    changed the header of acpi_dock_init() in internal.h so that it is
    supposed to be a void function now, but it forgot to update its
    actual definition in dock.c according to which it still is supposed
    to return int.

    Although that didn't cause any visible breakage or even a compiler
    warning to be thrown, which is odd enough, fix it.

    Signed-off-by: Rafael J. Wysocki
    Cc: 3.10+

    Rafael J. Wysocki
     

24 Jun, 2013

1 commit

  • The interactions between the ACPI dock driver and the ACPI-based PCI
    hotplug (acpiphp) are currently problematic because of ordering
    issues during hot-remove operations.

    First of all, the current ACPI glue code expects that physical
    devices will always be deleted before deleting the companion ACPI
    device objects. Otherwise, acpi_unbind_one() will fail with a
    warning message printed to the kernel log, for example:

    [ 185.026073] usb usb5: Oops, 'acpi_handle' corrupt
    [ 185.035150] pci 0000:1b:00.0: Oops, 'acpi_handle' corrupt
    [ 185.035515] pci 0000:18:02.0: Oops, 'acpi_handle' corrupt
    [ 180.013656] port1: Oops, 'acpi_handle' corrupt

    This means, in particular, that struct pci_dev objects have to
    be deleted before the struct acpi_device objects they are "glued"
    with.

    Now, the following happens the during the undocking of an ACPI-based
    dock station:
    1) hotplug_dock_devices() invokes registered hotplug callbacks to
    destroy physical devices associated with the ACPI device objects
    depending on the dock station. It calls dd->ops->handler() for
    each of those device objects.
    2) For PCI devices dd->ops->handler() points to
    handle_hotplug_event_func() that queues up a separate work item
    to execute _handle_hotplug_event_func() for the given device and
    returns immediately. That work item will be executed later.
    3) hotplug_dock_devices() calls dock_remove_acpi_device() for each
    device depending on the dock station. This runs acpi_bus_trim()
    for each of them, which causes the underlying ACPI device object
    to be destroyed, but the work items queued up by
    handle_hotplug_event_func() haven't been started yet.
    4) _handle_hotplug_event_func() queued up in step 2) are executed
    and cause the above failure to happen, because the PCI devices
    they handle do not have the companion ACPI device objects any
    more (those objects have been deleted in step 3).

    The possible breakage doesn't end here, though, because
    hotplug_dock_devices() may return before at least some of the
    _handle_hotplug_event_func() work items spawned by it have a
    chance to complete and then undock() will cause _DCK to be
    evaluated and that will cause the devices handled by the
    _handle_hotplug_event_func() to go away possibly while they are
    being accessed.

    This means that dd->ops->handler() for PCI devices should not point
    to handle_hotplug_event_func(). Instead, it should point to a
    function that will do the work of _handle_hotplug_event_func()
    synchronously. For this reason, introduce such a function,
    hotplug_event_func(), and modity acpiphp_dock_ops to point to
    it as the handler.

    Unfortunately, however, this is not sufficient, because if the dock
    code were not changed further, hotplug_event_func() would now
    deadlock with hotplug_dock_devices() that called it, since it would
    run unregister_hotplug_dock_device() which in turn would attempt to
    acquire the dock station's hp_lock mutex already acquired by
    hotplug_dock_devices().

    To resolve that deadlock use the observation that
    unregister_hotplug_dock_device() won't need to acquire hp_lock
    if PCI bridges the devices on the dock station depend on are
    prevented from being removed prematurely while the first loop in
    hotplug_dock_devices() is in progress.

    To make that possible, introduce a mechanism by which the callers of
    register_hotplug_dock_device() can provide "init" and "release"
    routines that will be executed, respectively, during the addition
    and removal of the physical device object associated with the
    given ACPI device handle. Make acpiphp use two new functions,
    acpiphp_dock_init() and acpiphp_dock_release(), that call
    get_bridge() and put_bridge(), respectively, on the acpiphp bridge
    holding the given device, for this purpose.

    In addition to that, remove the dock station's list of
    "hotplug devices" and make the dock code always walk the whole list
    of "dependent devices" instead in such a way that the loops in
    hotplug_dock_devices() and dock_event() (replacing the loops over
    "hotplug devices") will take references to the list entries that
    register_hotplug_dock_device() has been called for. That prevents
    the "release" routines associated with those entries from being
    called while the given entry is being processed and for PCI
    devices this means that their bridges won't be removed (by a
    concurrent thread) while hotplug_event_func() handling them is
    being executed.

    This change is based on two earlier patches from Jiang Liu.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=59501
    Reported-and-tested-by: Alexander E. Patrakov
    Tracked-down-by: Jiang Liu
    Tested-by: Illya Klymov
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu
    Cc: 3.9+

    Rafael J. Wysocki
     

23 Jun, 2013

1 commit

  • Commit 3b63aaa70e1 (PCI: acpiphp: Do not use ACPI PCI subdriver
    mechanism) introduced an ACPI dock support regression, because it
    changed the relative initialization order of the ACPI dock subsystem
    and the ACPI-based PCI hotplug (acpiphp).

    Namely, the ACPI dock subsystem has to be initialized before
    acpiphp_enumerate_slots() is first run, which after commit
    3b63aaa70e1 happens during the initial enumeration of the PCI
    hierarchy triggered by the initial ACPI namespace scan in
    acpi_scan_init(). For this reason, the dock subsystem has to be
    initialized before the initial ACPI namespace scan in
    acpi_scan_init().

    To make that happen, modify the ACPI dock subsystem to be
    non-modular and add the invocation of its initialization routine,
    acpi_dock_init(), to acpi_scan_init() directly before the initial
    namespace scan.

    [rjw: Changelog, removal of dock_exit().]
    References: https://bugzilla.kernel.org/show_bug.cgi?id=59501
    Reported-and-tested-by: Alexander E. Patrakov
    Tested-by: Illya Klymov
    Signed-off-by: Jiang Liu
    Acked-by: Yinghai Lu
    Cc: 3.9+
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     

20 Jun, 2013

1 commit

  • Since commit 3757b94 (ACPI / hotplug: Fix concurrency issues and
    memory leaks) acpi_bus_scan() and acpi_bus_trim() must always be
    called under acpi_scan_lock, but currently the following scenario
    violating that requirement is possible:

    write_undock()
    handle_eject_request()
    hotplug_dock_devices()
    dock_remove_acpi_device()
    acpi_bus_trim()

    Fix that by making write_undock() acquire acpi_scan_lock before
    calling handle_eject_request() as appropriate (begin_undock() is
    under the lock too in analogy with acpi_dock_deferred_cb()).

    Signed-off-by: Rafael J. Wysocki
    Cc: 3.9+
    Acked-by: Toshi Kani

    Rafael J. Wysocki
     

13 Feb, 2013

1 commit

  • This changeset is aimed at fixing a few different but related
    problems in the ACPI hotplug infrastructure.

    First of all, since notify handlers may be run in parallel with
    acpi_bus_scan(), acpi_bus_trim() and acpi_bus_hot_remove_device()
    and some of them are installed for ACPI handles that have no struct
    acpi_device objects attached (i.e. before those objects are created),
    those notify handlers have to take acpi_scan_lock to prevent races
    from taking place (e.g. a struct acpi_device is found to be present
    for the given ACPI handle, but right after that it is removed by
    acpi_bus_trim() running in parallel to the given notify handler).
    Moreover, since some of them call acpi_bus_scan() and
    acpi_bus_trim(), this leads to the conclusion that acpi_scan_lock
    should be acquired by the callers of these two funtions rather by
    these functions themselves.

    For these reasons, make all notify handlers that can handle device
    addition and eject events take acpi_scan_lock and remove the
    acpi_scan_lock locking from acpi_bus_scan() and acpi_bus_trim().
    Accordingly, update all of their users to make sure that they
    are always called under acpi_scan_lock.

    Furthermore, since eject operations are carried out asynchronously
    with respect to the notify events that trigger them, with the help
    of acpi_bus_hot_remove_device(), even if notify handlers take the
    ACPI scan lock, it still is possible that, for example,
    acpi_bus_trim() will run between acpi_bus_hot_remove_device() and
    the notify handler that scheduled its execution and that
    acpi_bus_trim() will remove the device node passed to
    acpi_bus_hot_remove_device() for ejection. In that case, the struct
    acpi_device object obtained by acpi_bus_hot_remove_device() will be
    invalid and not-so-funny things will ensue. To protect agaist that,
    make the users of acpi_bus_hot_remove_device() run get_device() on
    ACPI device node objects that are about to be passed to it and make
    acpi_bus_hot_remove_device() run put_device() on them and check if
    their ACPI handles are not NULL (make acpi_device_unregister() clear
    the device nodes' ACPI handles for that check to work).

    Finally, observe that acpi_os_hotplug_execute() actually can fail,
    in which case its caller ought to free memory allocated for the
    context object to prevent leaks from happening. It also needs to
    run put_device() on the device node that it ran get_device() on
    previously in that case. Modify the code accordingly.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu

    Rafael J. Wysocki
     

03 Feb, 2013

1 commit


26 Jan, 2013

1 commit


19 Jan, 2013

1 commit

  • The only difference between acpi_bus_scan() and acpi_bus_add() is the
    invocation of acpi_update_all_gpes() in the latter which in fact is
    unnecessary, because acpi_update_all_gpes() has already been called
    by acpi_scan_init() and the way it is implemented guarantees the next
    invocations of it to do nothing.

    For this reason, drop acpi_bus_add() and make all its callers use
    acpi_bus_scan() directly instead of it. Additionally, rearrange the
    code in acpi_scan_init() slightly to improve the visibility of the
    acpi_update_all_gpes() call in there.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu

    Rafael J. Wysocki
     

15 Jan, 2013

1 commit


03 Jan, 2013

2 commits

  • The callers of acpi_bus_add() usually assume that if it has
    succeeded, then a struct acpi_device object has been attached to
    the handle passed as the first argument. Unfortunately, however,
    this assumption is wrong, because acpi_bus_scan(), and acpi_bus_add()
    too as a result, may return a pointer to a different struct
    acpi_device object on success (it may be an object corresponding to
    one of the descendant ACPI nodes in the namespace scope below that
    handle).

    For this reason, the callers of acpi_bus_add() who care about
    whether or not a struct acpi_device object has been created for
    its first argument need to check that using acpi_bus_get_device()
    anyway, so the second argument of acpi_bus_add() is not really
    useful for them. The same observation applies to acpi_bus_scan()
    executed directly from acpi_scan_init().

    Therefore modify the relevant callers of acpi_bus_add() to check the
    existence of the struct acpi_device in question with the help of
    acpi_bus_get_device() and drop the no longer necessary second
    argument of acpi_bus_add(). Accordingly, modify acpi_scan_init() to
    use acpi_bus_get_device() to get acpi_root and drop the no longer
    needed second argument of acpi_bus_scan().

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu
    Acked-by: Toshi Kani

    Rafael J. Wysocki
     
  • Notice that acpi_bus_add() uses only 2 of its 4 arguments and
    redefine its header to match the body. Update all of its callers as
    necessary and observe that this leads to quite a number of removed
    lines of code (Linus will like that).

    Add a kerneldoc comment documenting acpi_bus_add() and wonder how
    its callers make wrong assumptions about the second argument (make
    note to self to take care of that later).

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu
    Acked-by: Toshi Kani

    Rafael J. Wysocki
     

22 Nov, 2012

1 commit


15 Nov, 2012

1 commit


13 Jan, 2012

1 commit


17 Jul, 2011

1 commit

  • Structs battery_file, acpi_dock_ops, file_operations,
    thermal_cooling_device_ops, thermal_zone_device_ops, kernel_param_ops
    are not changed in runtime. It is safe to make them const.
    register_hotplug_dock_device() was altered to take const "ops" argument
    to respect acpi_dock_ops' const notion.

    Signed-off-by: Vasiliy Kulikov
    Acked-by: Jeff Garzik
    Signed-off-by: Len Brown

    Vasiliy Kulikov
     

12 Jan, 2011

1 commit

  • Some function and variable names are renamed to be consistent with
    ACPICA code base.

    acpi_raw_enable_gpe -> acpi_ev_add_gpe_reference
    acpi_raw_disable_gpe -> acpi_ev_remove_gpe_reference
    acpi_gpe_can_wake -> acpi_setup_gpe_for_wake
    acpi_gpe_wakeup -> acpi_set_gpe_wake_mask
    acpi_update_gpes -> acpi_update_all_gpes
    acpi_all_gpes_initialized -> acpi_gbl_all_gpes_initialized
    acpi_handler_info -> acpi_gpe_handler_info
    ...

    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown

    Lin Ming
     

27 Oct, 2010

1 commit


20 Oct, 2010

1 commit

  • find_dock and find_bay are only called by dock_init which lives in
    .init.text dock_add is only called by find_dock and find_bay. So all
    three functions can be moved to .init.text, too.

    This fixes:

    WARNING: vmlinux.o(.text+0x2134b7): Section mismatch in reference from the function dock_add() to the function .init.text:platform_device_register_resndata()
    The function dock_add() references
    the function __init platform_device_register_resndata().
    This is often because dock_add lacks a __init
    annotation or the annotation of platform_device_register_resndata is wrong.

    for a build with unset CONFIG_MODULES.

    Signed-off-by: Uwe Kleine-König
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Len Brown

    Uwe Kleine-König
     

25 Sep, 2010

1 commit

  • The current ACPI GPEs initialization code has a problem that it
    enables some GPEs pointed to by device _PRW methods, generally
    intended for signaling wakeup events (system or device wakeup).
    These GPEs are then almost immediately disabled by the ACPI namespace
    scanning code with the help of acpi_gpe_can_wake(), but it would be
    better not to enable them at all until really necessary.

    Modify the initialization of GPEs so that the ones that have
    associated _Lxx or _Exx methods and are not pointed to by any _PRW
    methods will be enabled after the namespace scan is complete.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     

07 Apr, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

23 Mar, 2010

1 commit


08 Mar, 2010

1 commit


16 Feb, 2010

1 commit

  • Commit fe06fba2 (ACPI: dock: add struct dock_station * directly
    to platform device data) changed dock_add() to use the
    platform_device_register_data() API.

    We passed that interface a stack variable, which is kmemdup'ed
    and assigned to the device's platform_data pointer.

    Unfortunately, whatever random garbage is in the stack variable
    gets coped during the kmemdup, and that leads to broken behavior.

    Explicitly zero out the structure before passing it to the API.

    This fixes the T41 docking button issue:
    http://bugzilla.kernel.org/show_bug.cgi?id=15000

    Cc: stable@kernel.org
    Reported-by: Chris Mason
    Signed-off-by: Alex Chiang
    Signed-off-by: Len Brown

    Alex Chiang