07 Nov, 2011

1 commit

  • ACPI_NO_HARDWARE_INIT is only used by acpi_early_init() and
    acpi_bus_init() when calling acpi_enable_subsystem(), but
    acpi_enable_subsystem() doesn't check that flag, so it can be
    dropped.

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

    Rafael J. Wysocki
     

03 Aug, 2011

1 commit

  • as GHES is optional...

    When # CONFIG_ACPI_APEI_GHES is not set:

    (.init.text+0x4c22): undefined reference to `ghes_disable'

    Reported-by: Randy Dunlap
    Acked-by: Randy Dunlap
    Signed-off-by: Len Brown

    Len Brown
     

14 Jul, 2011

1 commit

  • In APEI firmware first mode, hardware error is reported by hardware to
    firmware firstly, then firmware reports the error to Linux in a GHES
    error record via POLL/SCI/IRQ/NMI etc.

    This may result in some issues if OS has no full APEI support. So
    some firmware implementation will work in a back-compatible mode by
    default. Where firmware will only notify OS in old-fashion, without
    GHES record. For example, for a fatal hardware error, only NMI is
    signaled, no GHES record.

    To gain full APEI power on these machines, APEI bit in generic _OSC
    call can be specified to tell firmware that Linux has full APEI
    support. This patch adds the APEI bit support in generic _OSC call.

    Signed-off-by: Huang Ying
    Reviewed-by: Andi Kleen
    Reviewed-by: Matthew Garrett
    Signed-off-by: Len Brown

    Huang Ying
     

29 May, 2011

1 commit

  • _SxW returns an Integer containing the lowest D-state supported in state
    Sx. If OSPM has not indicated that it supports _PR3, then the value “3”
    corresponds to D3. If it has indicated _PR3 support, the value “3”
    represents D3hot and the value “4” represents D3cold.

    Linux does set _OSC._PR3, so we should fix it to expect that _SxW can
    return 4.

    Signed-off-by: Lin Ming
    Acked-by: Jesse Barnes
    Signed-off-by: Len Brown

    Lin Ming
     

15 Mar, 2011

2 commits

  • The variable pm_flags is used to prevent APM from being enabled
    along with ACPI, which would lead to problems. However, acpi_init()
    is always called before apm_init() and after acpi_init() has
    returned, it is known whether or not ACPI will be used. Namely, if
    acpi_disabled is not set after acpi_init() has returned, this means
    that ACPI is enabled. Thus, it is sufficient to check acpi_disabled
    in apm_init() to prevent APM from being enabled in parallel with
    ACPI.

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

    Rafael J. Wysocki
     
  • If direct references to pm_flags are removed from drivers/acpi/bus.c,
    CONFIG_ACPI will not need to depend on CONFIG_PM any more. Make that
    happen.

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

    Rafael J. Wysocki
     

12 Jan, 2011

8 commits

  • Since acpi_bus_set_power() should not use __acpi_bus_get_power() to
    update the device's device->power.state field before changing its
    power state (this may cause device->power.state to be inconsistent
    with the device power resources' reference counters), remove this
    call from it. In consequence, the acpi_power_nocheck variable is not
    necessary any more, so it can be dropped along with the DMI table
    used for setting that variable for HP Pavilion 05.

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

    Rafael J. Wysocki
     
  • There are no more users of acpi_bus_get_power(), so it can be
    dropped. Moreover, it should be dropped, because it modifies
    the device->power.state field of an ACPI device without updating
    the reference counters of the device's power resources, which is
    wrong.

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

    Rafael J. Wysocki
     
  • Use the new function acpi_bus_update_power() for manipulating power
    resources used by ACPI fan devices, which allows them to be put into
    the right state during initialization and resume. Consequently,
    remove the flags.force_power_state field from struct acpi_device,
    which is not necessary any more.

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

    Rafael J. Wysocki
     
  • The ACPI device driver used for handling power resources,
    acpi_power_driver, creates a struct acpi_power_resource object for
    each ACPI device representing a power resource. These objects are
    then used when setting and reading the power states of devices using
    the corresponding power resources. Unfortunately, acpi_power_driver
    is registered after acpi_scan_init() that may add devices using the
    power resources before acpi_power_driver has a chance to create
    struct acpi_power_resource objects for them (specifically, the power
    resources may be referred to during the scanning process through
    acpi_bus_get_power() before they have been initialized).

    As the first step towards fixing this issue, move the registration
    of acpi_power_driver into acpi_scan_init() so that power resource
    devices can be initialized by it as soon as they have been found in
    the namespace.

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

    Rafael J. Wysocki
     
  • Add function acpi_bus_update_power() for reading the actual power
    state of an ACPI device and updating its device->power.state field
    in such a way that its power resources' reference counters will
    remain consistent with that field.

    For this purpose introduce __acpi_bus_set_power() setting the
    power state of an ACPI device without updating its
    device->power.state field and make acpi_bus_set_power() and
    acpi_bus_update_power() use it (acpi_bus_set_power() retains the
    current behavior for now).

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

    Rafael J. Wysocki
     
  • Add function acpi_bus_init_power() for getting the initial power
    state of an ACPI device and reference counting its power resources
    as appropriate.

    Make acpi_bus_get_power_flags() use the new function instead of
    acpi_bus_get_power() that updates device->power.state without
    reference counting the device's power resources.

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

    Rafael J. Wysocki
     
  • It sometimes is necessary to get the power state of an ACPI device
    without updating its device->power.state field, for example to
    avoid inconsistencies between device->power.state and the reference
    counters of the device's power resources. For this purpose introduce
    __acpi_bus_get_power() that will return the given device's power
    state via a pointer (instead of modifying device->power.state)
    and make acpi_bus_get_power() use it.

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

    Rafael J. Wysocki
     
  • acpi_power_get_inferred_state() should not update
    device->power.state behind the back of its caller, so make it return
    the state via a pointer instead.

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

    Rafael J. Wysocki
     

26 Oct, 2010

1 commit

  • ACPI table sysfs I/F is broken by commit

    78f1699659963fff97975df44db6d5dbe7218e55
    Author: Alex Chiang
    Date: Sun Dec 20 12:19:09 2009 -0700
    ACPI: processor: call _PDC early

    because dynamic SSDT tables may be loaded in _PDC,
    before installing the ACPI table handler.
    As a result, the sysfs I/F of these dynamic tables are
    located at /sys/firmware/acpi/tables instead of
    /sys/firmware/acpi/tables/dynamic, which is not true.

    Invoke acpi_sysfs_init() before acpi_early_processor_set_pdc(),
    so that the table handler is installed before any dynamic tables loaded.

    https://bugzilla.kernel.org/show_bug.cgi?id=21142

    CC: Dennis Jansen
    CC: Alex Chiang
    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown

    Zhang Rui
     

30 Sep, 2010

2 commits


29 Sep, 2010

1 commit


15 Aug, 2010

3 commits

  • Rmove deprecated ACPI procfs I/F, including
    /proc/acpi/debug_layer
    /proc/acpi/debug_level
    /proc/acpi/info
    /proc/acpi/dsdt
    /proc/acpi/fadt
    /proc/acpi/sleep

    because the sysfs I/F is already available
    and has been working well for years.

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown

    Zhang Rui
     
  • Introduce drivers/acpi/sysfs.c.

    code for ACPI sysfs I/F, including
    #ifdef ACPI_DEBUG
    /sys/module/acpi/parameters/debug_layer
    /sys/module/acpi/parameters/debug_level
    /sys/module/acpi/parameters/trace_method_name
    /sys/module/acpi/parameters/trace_debug_layer
    /sys/module/acpi/parameters/trace_debug_level
    /sys/module/acpi/parameters/trace_state
    #endif
    /sys/module/acpi/parameters/acpica_version
    /sys/firmware/acpi/tables/
    /sys/firmware/acpi/interrupts/
    is moved to this file.

    No function change in this patch.

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown

    Zhang Rui
     
  • Introduce drivers/acpi/debugfs.c.

    Code for ACPI debugfs I/F,
    i.e. /sys/kernel/debug/acpi/custom_method,
    is moved to this file.

    And make ACPI debugfs always built in,
    even if CONFIG_ACPI_DEBUG is cleared.

    BTW:this adds about 400bytes code to ACPI, when
    CONFIG_ACPI_DEBUG is cleared.

    [uaccess.h build fix from Andrew Morton ]

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown

    Zhang Rui
     

25 May, 2010

1 commit


21 May, 2010

1 commit

  • * 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (22 commits)
    ACPI: fix early DSDT dmi check warnings on ia64
    ACPICA: Update version to 20100428.
    ACPICA: Update/clarify some parameter names associated with acpi_handle
    ACPICA: Rename acpi_ex_system_do_suspend->acpi_ex_system_do_sleep
    ACPICA: Prevent possible allocation overrun during object copy
    ACPICA: Split large file, evgpeblk
    ACPICA: Add GPE support for dynamically loaded ACPI tables
    ACPICA: Clarify/rename some root table descriptor fields
    ACPICA: Update version to 20100331.
    ACPICA: Minimize the differences between linux GPE code and ACPICA code base
    ACPI: add boot option acpi=copy_dsdt to fix corrupt DSDT
    ACPICA: Update DSDT copy/detection.
    ACPICA: Add subsystem option to force copy of DSDT to local memory
    ACPICA: Add detection of corrupted/replaced DSDT
    ACPICA: Add write support for DataTable operation regions
    ACPICA: Fix for acpi_reallocate_root_table for incorrect root table copy
    ACPICA: Update comments/headers, no functional change
    ACPICA: Update version to 20100304
    ACPICA: Fix for possible fault in acpi_ex_release_mutex
    ACPICA: Standardize integer output for ACPICA warnings/errors
    ...

    Linus Torvalds
     

20 May, 2010

1 commit

  • WARNING: at drivers/firmware/dmi_scan.c:423 dmi_matches+0x70/0x160()
    dmi check: not initialized yet.

    This is caused by commit aa2110c
    (ACPI: add boot option acpi=copy_dsdt to fix corrupt DSDT).
    DMI is not initialized yet in acpi_early_init on ia64.

    The DSDT DMI check table is x86 specific, so make it empty on other archs.
    And this fixes the warnings on ia64.

    Reported-and-tested-by: Tony Luck
    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown

    Lin Ming
     

27 Apr, 2010

1 commit

  • This addresses: https://bugzilla.kernel.org/show_bug.cgi?id=14998

    We copy some strings into "event" but we leave the space after the NULL
    terminators uninitialized. Later in acpi_bus_receive_event() we copy
    the whole struct to another buffer with memcpy(). If the new buffer is
    stored on the stack, kmemcheck prints a warning about the unitialized
    space after the NULL terminators.

    It's true that the space is uninitialized, but it's harmless. The
    buffer is only used in acpi_system_read_event() and we don't read past
    the NULL terminators.

    This patch changes the kmalloc() to kzalloc() so that we initialize the
    memory and silence the kmemcheck warning.

    Reported-by: Christian Casteyde
    Signed-off-by: Dan Carpenter
    Signed-off-by: Len Brown

    Dan Carpenter
     

20 Apr, 2010

1 commit

  • Some BIOS on Toshiba machines corrupt the DSDT, so add a new
    boot option acpi=copy_dsdt to workaround it.
    Add warning message to ask users to use this option if corrupt DSDT detected.

    Also build a DMI blacklist to check it and automatically copy DSDT.

    https://bugzilla.kernel.org/show_bug.cgi?id=14679

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

    Lin Ming
     

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
     

15 Mar, 2010

1 commit


16 Jan, 2010

1 commit

  • If the BIOS pokes the system-wide OSC bits to see if Linux
    supports evaluating _OST after a _PPC change notification,
    answer yes.

    Also, fix an oversight where we neglected to set the OSC
    bit advertising processor aggregator device support
    when acpi-pad is compiled as a module.

    Signed-off-by: Zhao Yakui
    Signed-off-by: Len Brown

    Zhao Yakui
     

29 Dec, 2009

1 commit

  • If the ACPI power state can be got both directly and indirectly,
    we prefer to get it indirectly.

    https://bugzilla.redhat.com/show_bug.cgi?id=531916 describes a
    system with a _PSC method for the fan that always returns "on".
    There's no benefit in us always requesting the state of the fan
    when performing transitions - we want to do everything we can
    to ensure that the fan turns on when it should do, not risk
    hardware damage by believing the hardware when it tells us the
    fan is already on. Given that the Leading Other OS(tm) works fine
    on this machine, it seems likely that it behaves in much this way.

    inspired-by: Matthew Garrett
    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown

    Zhang Rui
     

24 Dec, 2009

2 commits


22 Dec, 2009

1 commit

  • We discovered that at least one machine (HP Envy), methods in the DSDT
    attempt to call external methods defined in a dynamically loaded SSDT.

    Unfortunately, the DSDT methods we are trying to call are part of the
    EC initialization, which happens very early, and the the dynamic SSDT
    is only loaded when a processor _PDC method runs much later.

    This results in namespace lookup errors for the (as of yet) undefined
    methods.

    Since Windows doesn't have any issues with this machine, we take it
    as a hint that they must be evaluating _PDC much earlier than we are.

    Thus, the proper thing for Linux to do should be to match the Windows
    implementation more closely.

    Provide a mechanism to call _PDC before we enable the EC. Doing so loads
    the dynamic tables, and allows the EC to be enabled correctly.

    The ACPI processor driver will still evaluate _PDC in its .add() method
    to cover the hotplug case.

    Resolves: http://bugzilla.kernel.org/show_bug.cgi?id=14824

    Cc: ming.m.lin@intel.com
    Signed-off-by: Alex Chiang
    Signed-off-by: Len Brown

    Alex Chiang
     

17 Dec, 2009

2 commits


26 Sep, 2009

1 commit

  • Add acpi_bus_get_status_handle() so we can get the status of a namespace
    object before building a struct acpi_device.

    This removes a use of "device->flags.dynamic_status", a cached indicator of
    whether _STA exists. It seems simpler and more reliable to just evaluate
    _STA and catch AE_NOT_FOUND errors.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Bjorn Helgaas
     

19 Sep, 2009

2 commits


27 Aug, 2009

1 commit

  • Handler was never invoked. Now invoked if/when host node is deleted.
    Data object was not automatically deleted when host node was deleted.
    Interface to handler had an unused parameter, removed it.
    ACPICA BZ 778.

    http://acpica.org/bugzilla/show_bug.cgi?id=778

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

    Bob Moore
     

18 Jun, 2009

1 commit

  • This patch changes the global system notification path so it uses the
    acpi_handle, not the acpi_device.

    System notifications often deal with device presence and status change.
    In these cases, we may not have an acpi_device. For example, we may
    get a Device Check notification on an object that previously was not
    present. Since the object was not present, we would not have had an
    acpi_device for it.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Bjorn Helgaas