10 May, 2007

3 commits

  • Signed-off-by: Len Brown

    Len Brown
     
  • This reverts commit 5f7748cf91558a5026ded5be93c5bf6c1ac34edf.

    While that change fixed the HP
    http://bugzilla.kernel.org/show_bug.cgi?id=5534

    it broke the ACER:
    http://bugzilla.kernel.org/show_bug.cgi?id=8385
    which as AML that caused Linux go recursive
    and stack fault.

    So this commit by itself will restore the ACER
    and again break the HP, which we'll fix another way.

    Signed-off-by: Len Brown

    Len Brown
     
  • This reverts commit a8f4af6dc6600980885c594f52eecd60edd62013.
    Thus restoring ACPICA's new acpi_serialize code.

    This commit by itself may cause a regression, but
    it is reverted in this order so that subsequent
    reverts reverts under this one can be made
    without conflict.

    Signed-off-by: Len Brown

    Len Brown
     

15 Mar, 2007

2 commits


07 Mar, 2007

1 commit

  • patch "Delete recursive feature of ACPI Global Lock"
    broke re-entrancy of the Global Lock.
    The common routine to acquire GL is acpi_ev_acquire_global_lock,
    so check for re-entrancy _must_ be there, and not anywhere else.

    http://bugzilla.kernel.org/show_bug.cgi?id=8066#c9

    Signed-off-by: Alexey Starikovskiy
    Signed-off-by: Len Brown

    Alexey Starikovskiy
     

17 Feb, 2007

1 commit


16 Feb, 2007

1 commit

  • HP nx6125/nx6325/... machines have a _GPE handler with an infinite
    loop sending Notify() events to different ACPI subsystems.

    The notify handler in the ACPI thermal driver is a C-routine,
    which may invoke the ACPI interpreter again to get access
    to some ACPI variables such as temperature. (acpi_evaluate_xxx)
    On these HP machines such an evaluation changes state of an ASL variable
    and lets the loop above break.

    In the current ACPI implementation, Notify requests are being deferred
    to the same kacpid workqueue on which the above GPE handler with
    infinite loop is executing. Thus we have a deadlock -- loop will
    continue to spin, sending notify events, and at the same time
    preventing these notify events from being run on a workqueue. All
    notify events are deferred, thus we see explosion in memory consumption.

    Also as GPE handling is blocked, machines overheat because ACPI-based
    fan control is stalled. Eventually by external poll of the same
    acpi_evaluate, kacpid is released and all the queued notify events are
    free to run, thus 100% CPU utilization by kacpid for several seconds
    or more.

    To prevent this failure, Linux must not send notify events to the
    kacpid workqueue -- either executing them immediately or putting them
    on some other thread.

    The first attempt to create a new thread was done by Peter Wainwright
    He created a bunch of threads, which were stealing work from a kacpid
    workqueue.
    This patch appeared in 2.6.15-based kernel shipped with Ubuntu 6.06 LTS.

    Second attempt was done by Alexey Starikovskiy, who created a new thread
    for each Notify event. This worked OK on HP nx machines,
    but broke Linus' Compaq n620c, by producing threads with a speed what
    they stopped the machine completely.
    Thus this patch was reverted from 2.6.18-rc2.

    Alexey re-made the patch to create second workqueue just for notify events,
    thus hopping it will not break Linus' machine. Patch was tested on the
    same HP nx machines in #5534 and #7122, but this broke Linus' machine
    also and was reverted from 2.6.19-rc with much fanfair.

    The 4th patch inserted schedule_timeout(1) into deferred
    execution of kacpid, if we had any notify requests pending, but Linus
    decided that it was too complex (involved either changes to workqueue
    to see if it's empty or atomic inc/dec). Then a 5th attempt did a
    yield() to every GPE execution.

    Finally, this 6th generation patch simply executes the notify handler
    on the stack. Previous attempts to do this simple solution failed
    because of issues in AML mutex re-entrancy which are now fixed
    by the previous patch in this series.

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

    Signed-off-by: Alexey Starikovskiy
    Signed-off-by: Len Brown

    Alexey Starikovskiy
     

13 Feb, 2007

1 commit


03 Feb, 2007

17 commits


07 Nov, 2006

1 commit


14 Oct, 2006

3 commits


10 Jul, 2006

1 commit

  • Added the ACPI_PACKED_POINTERS_NOT_SUPPORTED macro to
    support C compilers that do not allow the initialization
    of address pointers within packed structures - even though
    the hardware itself may support misaligned transfers. Some
    of the debug data structures are packed by default to
    minimize size.

    Added an error message for the case where
    acpi_os_get_thread_id() returns zero. A non-zero value is
    required by the core ACPICA code to ensure the proper
    operation of AML mutexes and recursive control methods.

    The DSDT is now the only ACPI table that determines whether
    the AML interpreter is in 32-bit or 64-bit mode. Not really
    a functional change, but the hooks for per-table 32/64
    switching have been removed from the code. A clarification
    to the ACPI specification is forthcoming in ACPI 3.0B.

    Fixed a possible leak of an Owner ID in the error
    path of tbinstal.c acpi_tb_init_table_descriptor() and
    migrated all table OwnerID deletion to a single place in
    acpi_tb_uninstall_table() to correct possible leaks when using
    the acpi_tb_delete_tables_by_type() interface (with assistance
    from Lance Ortiz.)

    Fixed a problem with Serialized control methods where the
    semaphore associated with the method could be over-signaled
    after multiple method invocations.

    Fixed two issues with the locking of the internal
    namespace data structure. Both the Unload() operator and
    acpi_unload_table() interface now lock the namespace during
    the namespace deletion associated with the table unload
    (with assistance from Linn Crosetto.)

    Fixed problem reports (Valery Podrezov) integrated: -
    Eliminate unnecessary memory allocation for CreateXxxxField
    http://bugzilla.kernel.org/show_bug.cgi?id=5426

    Fixed problem reports (Fiodor Suietov) integrated: -
    Incomplete cleanup branches in AcpiTbGetTableRsdt (BZ 369)
    - On Address Space handler deletion, needless deactivation
    call (BZ 374) - AcpiRemoveAddressSpaceHandler: validate
    Device handle parameter (BZ 375) - Possible memory leak,
    Notify sub-objects of Processor, Power, ThermalZone (BZ
    376) - AcpiRemoveAddressSpaceHandler: validate Handler
    parameter (BZ 378) - Minimum Length of RSDT should be
    validated (BZ 379) - AcpiRemoveNotifyHandler: return
    AE_NOT_EXIST if Processor Obj has no Handler (BZ (380)
    - AcpiUnloadTable: return AE_NOT_EXIST if no table of
    specified type loaded (BZ 381)

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

    Bob Moore
     

28 Jun, 2006

1 commit

  • Implemented a new acpi_spinlock type for the OSL lock
    interfaces. This allows the type to be customized to
    the host OS for improved efficiency (since a spinlock is
    usually a very small object.)

    Implemented support for "ignored" bits in the ACPI
    registers. According to the ACPI specification, these
    bits should be preserved when writing the registers via
    a read/modify/write cycle. There are 3 bits preserved
    in this manner: PM1_CONTROL[0] (SCI_EN), PM1_CONTROL[9],
    and PM1_STATUS[11].
    http://bugzilla.kernel.org/show_bug.cgi?id=3691

    Implemented the initial deployment of new OSL mutex
    interfaces. Since some host operating systems have
    separate mutex and semaphore objects, this feature was
    requested. The base code now uses mutexes (and the new
    mutex interfaces) wherever a binary semaphore was used
    previously. However, for the current release, the mutex
    interfaces are defined as macros to map them to the
    existing semaphore interfaces.

    Fixed several problems with the support for the control
    method SyncLevel parameter. The SyncLevel now works
    according to the ACPI specification and in concert with the
    Mutex SyncLevel parameter, since the current SyncLevel is
    a property of the executing thread. Mutual exclusion for
    control methods is now implemented with a mutex instead
    of a semaphore.

    Fixed three instances of the use of the C shift operator
    in the bitfield support code (exfldio.c) to avoid the use
    of a shift value larger than the target data width. The
    behavior of C compilers is undefined in this case and can
    cause unpredictable results, and therefore the case must
    be detected and avoided. (Fiodor Suietov)

    Added an info message whenever an SSDT or OEM table
    is loaded dynamically via the Load() or LoadTable()
    ASL operators. This should improve debugging capability
    since it will show exactly what tables have been loaded
    (beyond the tables present in the RSDT/XSDT.)

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

    Bob Moore
     

27 Jun, 2006

1 commit


14 Jun, 2006

6 commits

  • Converted the locking mutex used for the ACPI hardware
    to a spinlock. This change should eliminate all problems
    caused by attempting to acquire a semaphore at interrupt
    level, and it means that all ACPICA external interfaces
    that directly access the ACPI hardware can be safely
    called from interrupt level.

    Fixed a regression introduced in 20060526 where the ACPI
    device initialization could be prematurely aborted with
    an AE_NOT_FOUND if a device did not have an optional
    _INI method.

    Fixed an IndexField issue where a write to the Data
    Register should be limited in size to the AccessSize
    (width) of the IndexField itself. (BZ 433, Fiodor Suietov)

    Fixed problem reports (Valery Podrezov) integrated: - Allow
    store of ThermalZone objects to Debug object.
    http://bugzilla.kernel.org/show_bug.cgi?id=5369
    http://bugzilla.kernel.org/show_bug.cgi?id=5370

    Fixed problem reports (Fiodor Suietov) integrated: -
    acpi_get_table_header() doesn't handle multiple instances
    correctly (BZ 364)

    Removed four global mutexes that were obsolete and were
    no longer being used.

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

    Bob Moore
     
  • Restructured, flattened, and simplified the internal
    interfaces for namespace object evaluation - resulting
    in smaller code, less CPU stack use, and fewer
    interfaces. (With assistance from Mikhail Kouzmich)

    Fixed a problem with the CopyObject operator where the
    first parameter was not typed correctly for the parser,
    interpreter, compiler, and disassembler. Caused various
    errors and unexpected behavior.

    Fixed a problem where a ShiftLeft or ShiftRight of
    more than 64 bits produced incorrect results with some
    C compilers. Since the behavior of C compilers when
    the shift value is larger than the datatype width is
    apparently not well defined, the interpreter now detects
    this condition and simply returns zero as expected in all
    such cases. (BZ 395)

    Fixed problem reports (Valery Podrezov) integrated: -
    Update String-to-Integer conversion to match ACPI 3.0A spec
    http://bugzilla.kernel.org/show_bug.cgi?id=5329
    Allow interpreter to handle nested method declarations
    http://bugzilla.kernel.org/show_bug.cgi?id=5361

    Fixed problem reports (Fiodor Suietov) integrated: -
    acpi_terminate() doesn't free debug memory allocation
    list objects (BZ 355) - After Core Subsystem
    shutdown, acpi_subsystem_status() returns AE_OK (BZ 356) -
    acpi_os_unmap_memory() for RSDP can be invoked inconsistently
    (BZ 357) - Resource Manager should return AE_TYPE for
    non-device objects (BZ 358) - Incomplete cleanup branch
    in AcpiNsEvaluateRelative (BZ 359) - Use acpi_os_free()
    instead of ACPI_FREE in acpi_rs_set_srs_method_data (BZ 360)
    - Incomplete cleanup branch in acpi_ps_parse_aml (BZ 361) -
    Incomplete cleanup branch in acpi_ds_delete_walk_state (BZ 362)
    - acpi_get_table_header returns AE_NO_ACPI_TABLES until DSDT
    is loaded (BZ 365) - Status of the Global Initialization
    Handler call not used (BZ 366) - Incorrect object parameter
    to Global Initialization Handler (BZ 367)

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

    Bob Moore
     
  • Replaced the acpi_os_queue_for_execution() with a new
    interface named acpi_os_execute(). The major difference is
    that the new interface does not have a Priority parameter,
    this appeared to be useless and has been replaced by
    a Type parameter. The Type tells the OS what type of
    execution is being requested, such as global lock handler,
    notify handler, GPE handler, etc. This allows the host
    to queue and execute the request as appropriate for the
    request type, possibly using different work queues and
    different priorities for the various request types. This
    enables fixes for multithreading deadlock problems such as
    http://bugzilla.kernel.org/show_bug.cgi?id=5534
    (Alexey Starikovskiy and Bob Moore)

    Fixed a possible memory leak associated with the
    support for the so-called "implicit return" ACPI
    extension. Reported by FreeBSD (Fiodor Suietov)
    http://bugzilla.kernel.org/show_bug.cgi?id=6514

    Fixed a problem with the Load() operator where a table
    load from an operation region could overwrite an internal
    table buffer by up to 7 bytes and cause alignment faults
    on IPF systems. (With assistance from Luming Yu)

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

    Bob Moore
     
  • Removed a device initialization optimization introduced in
    20051216 where the _STA method was not run unless an _INI
    was also present for the same device. This optimization
    could cause problems because it could allow _INI methods
    to be run within a not-present device subtree (If a
    not-present device had no _INI, _STA would not be run,
    the not-present status would not be discovered, and the
    children of the device would be incorrectly traversed.)

    Implemented a new _STA optimization where namespace
    subtrees that do not contain _INI are identified and
    ignored during device initialization. Selectively running
    _STA can significantly improve boot time on large machines
    (with assistance from Len Brown.)

    Implemented support for the device initialization case
    where the returned _STA flags indicate a device not-present
    but functioning. In this case, _INI is not run, but the
    device children are examined for presence, as per the
    ACPI specification.

    Implemented an additional change to the IndexField support
    in order to conform to MS behavior. The value written to
    the Index Register is not simply a byte offset, it is a
    byte offset in units of the access width of the parent
    Index Field. (Fiodor Suietov)

    Defined and deployed a new OSL interface,
    acpi_os_validate_address(). This interface is called during
    the creation of all AML operation regions, and allows
    the host OS to exert control over what addresses it will
    allow the AML code to access. Operation Regions whose
    addresses are disallowed will cause a runtime exception
    when they are actually accessed (will not affect or abort
    table loading.)

    Defined and deployed a new OSL interface,
    acpi_os_validate_interface(). This interface allows the host OS
    to match the various "optional" interface/behavior strings
    for the _OSI predefined control method as appropriate
    (with assistance from Bjorn Helgaas.)

    Restructured and corrected various problems in the
    exception handling code paths within DsCallControlMethod
    and DsTerminateControlMethod in dsmethod (with assistance
    from Takayoshi Kochi.)

    Modified the Linux source converter to ignore quoted string
    literals while converting identifiers from mixed to lower
    case. This will correct problems with the disassembler
    and other areas where such strings must not be modified.

    The ACPI_FUNCTION_* macros no longer require quotes around
    the function name. This allows the Linux source converter
    to convert the names, now that the converter ignores
    quoted strings.

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

    Bob Moore
     
  • Implemented header file support for the following
    additional ACPI tables: ASF!, BOOT, CPEP, DBGP, MCFG, SPCR,
    SPMI, TCPA, and WDRT. With this support, all current and
    known ACPI tables are now defined in the ACPICA headers and
    are available for use by device drivers and other software.

    Implemented support to allow tables that contain ACPI
    names with invalid characters to be loaded. Previously,
    this would cause the table load to fail, but since
    there are several known cases of such tables on
    existing machines, this change was made to enable
    ACPI support for them. Also, this matches the
    behavior of the Microsoft ACPI implementation.
    https://bugzilla.novell.com/show_bug.cgi?id=147621

    Fixed a couple regressions introduced during the memory
    optimization in the 20060317 release. The namespace
    node definition required additional reorganization and
    an internal datatype that had been changed to 8-bit was
    restored to 32-bit. (Valery Podrezov)

    Fixed a problem where a null pointer passed to
    acpi_ut_delete_generic_state() could be passed through
    to acpi_os_release_object which is unexpected. Such
    null pointers are now trapped and ignored, matching
    the behavior of the previous implementation before the
    deployment of acpi_os_release_object(). (Valery Podrezov,
    Fiodor Suietov)

    Fixed a memory mapping leak during the deletion of
    a SystemMemory operation region where a cached memory
    mapping was not deleted. This became a noticeable problem
    for operation regions that are defined within frequently
    used control methods. (Dana Meyers)

    Reorganized the ACPI table header files into two main
    files: one for the ACPI tables consumed by the ACPICA core,
    and another for the miscellaneous ACPI tables that are
    consumed by the drivers and other software. The various
    FADT definitions were merged into one common section and
    three different tables (ACPI 1.0, 1.0+, and 2.0)

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

    Bob Moore
     
  • Implemented the use of a cache object for all internal
    namespace nodes. Since there are about 1000 static nodes
    in a typical system, this will decrease memory use for
    cache implementations that minimize per-allocation overhead
    (such as a slab allocator.)

    Removed the reference count mechanism for internal
    namespace nodes, since it was deemed unnecessary. This
    reduces the size of each namespace node by about 5%-10%
    on all platforms. Nodes are now 20 bytes for the 32-bit
    case, and 32 bytes for the 64-bit case.

    Optimized several internal data structures to reduce
    object size on 64-bit platforms by packing data within
    the 64-bit alignment. This includes the frequently used
    ACPI_OPERAND_OBJECT, of which there can be ~1000 static
    instances corresponding to the namespace objects.

    Added two new strings for the predefined _OSI method:
    "Windows 2001.1 SP1" and "Windows 2006".

    Split the allocation tracking mechanism out to a separate
    file, from utalloc.c to uttrack.c. This mechanism appears
    to be only useful for application-level code. Kernels may
    wish to not include uttrack.c in distributions.

    Removed all remnants of the obsolete ACPI_REPORT_* macros
    and the associated code. (These macros have been replaced
    by the ACPI_ERROR and ACPI_WARNING macros.)

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

    Bob Moore
     

01 Apr, 2006

1 commit

  • Tagged all external interfaces to the subsystem with the
    new ACPI_EXPORT_SYMBOL macro. This macro can be defined
    as necessary to assist kernel integration. For Linux,
    the macro resolves to the EXPORT_SYMBOL macro. The default
    definition is NULL.

    Added the ACPI_THREAD_ID type for the return value from
    acpi_os_get_thread_id(). This allows the host to define this
    as necessary to simplify kernel integration. The default
    definition is ACPI_NATIVE_UINT.

    Valery Podrezov fixed two interpreter problems related
    to error processing, the deletion of objects, and placing
    invalid pointers onto the internal operator result stack.
    http://bugzilla.kernel.org/show_bug.cgi?id=6028
    http://bugzilla.kernel.org/show_bug.cgi?id=6151

    Increased the reference count threshold where a warning is
    emitted for large reference counts in order to eliminate
    unnecessary warnings on systems with large namespaces
    (especially 64-bit.) Increased the value from 0x400
    to 0x800.

    Due to universal disagreement as to the meaning of the
    'c' in the calloc() function, the ACPI_MEM_CALLOCATE
    macro has been renamed to ACPI_ALLOCATE_ZEROED so that the
    purpose of the interface is 'clear'. ACPI_MEM_ALLOCATE and
    ACPI_MEM_FREE are renamed to ACPI_ALLOCATE and ACPI_FREE.

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

    Bob Moore