28 May, 2014

5 commits

  • ACPICA doesn't include protections around address space checking, Linux
    build tests always complain increased sparse warnings around ACPICA
    internal acpi_os_map/unmap_memory() invocations. This patch tries to fix
    this issue permanently.

    There are 2 choices left for us to solve this issue:
    1. Add __iomem address space awareness into ACPICA.
    2. Remove sparse checker of __iomem from ACPICA source code.

    This patch chooses solution 2, because:
    1. Most of the acpi_os_map/unmap_memory() invocations are used for ACPICA.
    table mappings, which in fact are not IO addresses.
    2. The only IO addresses usage is for "system memory space" mapping code in:
    drivers/acpi/acpica/exregion.c
    drivers/acpi/acpica/evrgnini.c
    drivers/acpi/acpica/exregion.c
    The mapped address is accessed in the handler of "system memory space"
    - acpi_ex_system_memory_space_handler(). This function in fact can be
    changed to invoke acpi_os_read/write_memory() so that __iomem can
    always be type-casted in the OSL layer.

    According to the above investigation, we drew the following conclusion:
    It is not a good idea to introduce __iomem address space awareness into
    ACPICA mostly in order to protect non-IO addresses.

    We can simply remove __iomem for acpi_os_map/unmap_memory() to remove
    __iomem checker for ACPICA code. Then we need to enforce external usages
    to invoke other APIs that are aware of __iomem address space.
    The external usages are:
    drivers/acpi/apei/einj.c
    drivers/acpi/acpi_extlog.c
    drivers/char/tpm/tpm_acpi.c
    drivers/acpi/nvs.c

    This patch thus performs cleanups in this way:
    1. Add acpi_os_map/unmap_iomem() to be invoked by non-ACPICA code.
    2. Remove __iomem from acpi_os_map/unmap_memory().

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • Since mis-order issues have been solved, we can cleanup redundant
    definitions that already have defaults in .

    This patch removes redudant environments for __KERNEL__ surrounded code.

    Signed-off-by: Lv Zheng
    Cc: Tony Luck
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • There is a mis-order inclusion for .

    As we will enforce including for all Linux ACPI users, we
    can find the inclusion order is as follows:



    (acenv.h before including aclinux.h)

    ...........................................................................
    (aclinux.h before including asm/acpi.h)
    @Redundant@
    (ACPICA specific stuff)
    ...........................................................................
    ...........................................................................
    (Linux ACPI specific stuff) ? - - - - - - - - - - - - +
    (aclinux.h after including asm/acpi.h) @Invisible@ |
    (acenv.h after including aclinux.h) @Invisible@ |
    other ACPICA headers @Invisible@ |
    ............................................................|..............
    |
    |
    (Excluded) |
    (Linux ACPI specific stuff) ! is more like Kconfig
    generated for Linux, it is meant to be included
    before including any ACPICA code.

    In the above figure, there is a question mark for "Linux ACPI specific
    stuff" in which should be included after including all other
    ACPICA header files. Thus they really need to be moved to the position
    marked with exclaimation mark or the definitions in the blocks marked with
    "@Invisible@" will be invisible to such architecture specific "Linux ACPI
    specific stuff" header blocks. This leaves 2 issues:
    1. All environmental definitions in these blocks should have a copy in the
    area marked with "@Redundant@" if they are required by the "Linux ACPI
    specific stuff".
    2. We cannot use any ACPICA defined types in .

    This patch splits architecture specific ACPICA stuff from to
    fix this issue.

    Signed-off-by: Lv Zheng
    Cc: Tony Luck
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • From ACPICA's perspective, should be included after
    inclusion of . But currently in Linux,
    included by has
    included to find ACPICA types for inline functions.

    This causes the following problem:
    1. Redundant code in and :
    Linux must be careful to keep conditions for inclusion
    consistent with the conditions for inclusion.
    Which finally leads to the issue that we have to keep many useless macro
    definitions in or .
    Such conditions include:
    COMPILER_DEPENDENT_UINT64
    COMPILER_DEPENDENT_INT64
    ACPI_INLINE
    ACPI_SYSTEM_XFACE
    ACPI_EXTERNAL_XFACE
    ACPI_INTERNAL_XFACE
    ACPI_INTERNAL_VAR_XFACE
    ACPI_MUTEX_TYPE
    DEBUGGER_THREADING
    ACPI_ACQUIRE_GLOBAL_LOCK
    ACPI_RELEASE_GLOBAL_LOCK
    ACPI_FLUSH_CPU_CACHE
    They have default implementations in
    while Linux need to keep a copy in to avoid build errors.

    This patch introduces to fix this issue by
    splitting conditions and declarations (most of them are inline functions)
    into 2 header files so that the wrong inclusion of can be
    removed from .

    This patch also removes old ACPI_NATIVE_INTERFACE_HEADER mechanism which is
    not preferred by Linux and adds the platform/acenvex.h to be the solution
    to solve this issue.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This patch deletes deprecated ACPI_PREEMPTION_POINT(), there is no user
    for it in Linux kernel now.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

07 May, 2014

1 commit

  • Linux wants to include all header files but leave empty inline
    stub variables for a feature that is not configured during build.

    This patch configures ACPICA external globals/macros/functions out and
    defines them into no-op when CONFIG_ACPI is not enabled. Lv Zheng.

    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

21 Apr, 2014

3 commits


18 Mar, 2014

1 commit


13 Feb, 2014

2 commits

  • Remove translation protection for applications as Linux tools folder will
    start to use such types.

    In Linux kernel source tree, after removing this translation protection,
    the u8/u16/u32/u64/s32/s64 typedefs are exposed for both __KERNEL__ builds
    and !__KERNEL__ builds (tools/power/acpi) and the original definitions of
    ACPI_UINT8/16/32/64_MAX are changed.

    For !__KERNEL__ builds, this kind of defintions should already been tested
    by the distribution vendors that are distributing binary ACPICA package and
    we've achieved the successful built/run test result in the kernel source
    tree.

    For __KERNEL__ builds, there are 2 things affected:
    1. u8/u16/u32/u64/s32/s64 type definitions:
    Since Linux has already type defined u8/u16/u32/u64/s32/s64 in
    include/uapi/asm-generic/int-ll64.h for __KERNEL__. In order not to
    introduce build regressions where the 2 typedefs are differed,
    ACPI_USE_SYSTEM_INTTYPES is introduced to mask out ACPICA's typedefs.
    It must be defined for Linux __KERNEL__ builds.
    2. ACPI_UINT8/16/32/64_MAX definitions:
    Before applying this change:
    ACPI_UINT8_MAX: sizeof (UINT8)
    UINT8: unsigned char
    ACPI_UINT16_MAX: sizeof (UINT16)
    UINT16: unsigned short
    ACPI_UINT32_MAX: sizeof (UINT32)
    INT32: int
    UINT32: unsigned int
    ACPI_UINT64_MAX: sizeof (UINT64)
    INT64: COMPILER_DEPENDENT_INT64
    COMPILER_DEPENDENT_INT64: signed long (IA64) or
    signed long long (IA32)
    UINT64: COMPILER_DEPENDENT_UINT64
    COMPILER_DEPENDENT_UINT64: unsigned long (IA64) or
    unsigned long long (IA32)
    After applying this change:
    ACPI_UINT8_MAX: sizeof (u8)
    u8: unsigned char
    UINT8: (removed from actypes.h)
    ACPI_UINT16_MAX: sizeof (u16)
    u16: unsigned short
    UINT16: (removed from actypes.h)
    ACPI_UINT32_MAX: sizeof (u32)
    INT32/UINT32: (removed from actypes.h)
    s32: signed int
    u32: unsigned int
    ACPI_UINT64_MAX: sizeof (u64)
    INT64/UINT64: (removed from actypes.h)
    u64: unsigned long long
    s64: signed long long
    COMPILER_DEPENDENT_INT64: signed long (IA64) (not used any more)
    signed long long (IA32) (not used any more)
    COMPILER_DEPENDENT_UINT64: unsigned long (IA64) (not used any more)
    unsigned long long (IA32) (not used any more)
    All definitions are equal except ACPI_UINT64_MAX for CONFIG_IA64. It
    is changed from sizeof(unsigned long) to sizeof(unsigned long long).
    By investigation, 64bit Linux kernel build is LP64 compliant, i.e.,
    sizeof(long) and (pointer) are 64. As sizeof(unsigned long) equals to
    sizeof(unsigned long long) on IA64 platform where CONFIG_64BIT cannot be
    disabled, this change actually will not affect the value of
    ACPI_UINT64_MAX on IA64 platforms.

    This patch is necessary for the ACPICA's acpidump tool to build
    correctly. Lv Zheng.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • Linux kernel resident ACPICA headers include some sparse declarators for
    kernel static checkers. This patch adds code to disable them for non
    __KERNEL__ defined code so that it is possible for the ACPICA user space
    tool's source files to be built with Linux kernel ACPICA header files
    included. Lv Zheng.

    Linux kernel build is not affected by this commit.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

11 Feb, 2014

1 commit


05 Feb, 2014

1 commit

  • ACPI hardware reduced mode exists to allow newer platforms to use a
    simpler form of ACPI that does not require supporting legacy versions
    of the specification and their associated hardware. This mode was
    introduced in the ACPI 5.0 specification.

    The ACPI hardware reduced mode is supposed to be used on systems
    having the HW_REDUCED_ACPI flag set in the FADT. ACPICA checks
    that flag to determine whether or not it should work in the HW
    reduced mode and there are pieces of code in it that will never
    be used in that case.

    Since some architecutres will always use the ACPI HW reduced mode,
    it doesn't make sense for them to ever compile support for anything
    else. Thus, they should set the flag ACPI_REDUCED_HARDWARE to TRUE
    in the ACPICA source. To enable them to do that, introduce a new
    kernel configuration option, CONFIG_ACPI_REDUCED_HARDWARE_ONLY, that
    will cause the ACPICA's ACPI_REDUCED_HARDWARE flag to be TRUE when
    set.

    Introducing this configuration item is based on suggestions from Lv
    Zheng saying that this does not belong in ACPICA, but rather to the
    Linux kernel itself.

    References: http://www.spinics.net/lists/linux-acpi/msg46369.html
    Signed-off-by: Hanjun Guo
    Signed-off-by: Al Stone
    [rjw: Subject and changelog]
    Signed-off-by: Rafael J. Wysocki

    Al Stone
     

08 Jan, 2014

3 commits

  • This global is acting as an OSL global variable, implemented in the
    oswinxf.c and osunixxf.c.

    This patch cleans up the definition of this variable so that new utilities
    do not need to define it in order to link.

    Linux kernel behaviour is not affected as the changes only applies to the
    ACPICA userspace utilities which are not shipped in the kernel currently.

    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • Previously, the example code (tools/examples) showed the ACPICA
    init code, but was not an actual working program. Added ACPI tables
    to make it actually function.

    Linux kernel behaviour is not affected as the change only applies
    to the ACPICA userspace utilities which are not shipped in the
    kernel currently.

    Signed-off-by: Bob Moore
    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Bob Moore
     
  • This patch removes 2 useless OSL prototypes as they are not used by Linux now.

    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

08 Nov, 2013

1 commit

  • * acpi-hotplug:
    ACPI / hotplug: Consolidate deferred execution of ACPI hotplug routines
    ACPI / hotplug: Do not execute "insert in progress" _OST
    ACPI / hotplug: Carry out PCI root eject directly
    ACPI / hotplug: Merge device hot-removal routines
    ACPI / hotplug: Make acpi_bus_hot_remove_device() internal
    ACPI / hotplug: Simplify device ejection routines
    ACPI / hotplug: Fix handle_root_bridge_removal()
    ACPI / hotplug: Refuse to hot-remove all objects with disabled hotplug
    ACPI / scan: Start matching drivers after trying scan handlers
    ACPI: Remove acpi_pci_slot_init() headers from internal.h

    Conflicts:
    include/acpi/acpiosxf.h (with the 'acpica' branch)

    Rafael J. Wysocki
     

31 Oct, 2013

5 commits

  • This patch updates header files used by acpidump to reduce the
    source code differences between Linux and ACPICA upstream.

    This patch does not affect the generation of the Linux kernel binary.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This patch updates architecture specific environment settings to reduce
    source differences between Linux and ACPICA upstream.

    This patch does not affect the generation of the Linux kernel binary.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • The new ACPICA OSL override mechanism is used to solve these issues
    for the Linux OSL:
    1. Linux can implement OSL using a macro.
    2. Linux can implement OSL using an inlined function.
    3. Linux can leave OSL not implemented for __KERNEL__ undefined code
    fragments.
    4. Linux can add sparse declarators (__iomem) to OSL.
    5. Linux can add memory tuning declarators (__init/__exit) to OSL.
    This patch also moves Linux specific OSL to aclinux.h which has not been
    maintained in the ACPICA code base. Lv Zheng.

    Known issue:

    From ACPICA's perspective, actypes.h should be included after inclusion
    of acenv.h. But currently in Linux, aclinux.h included by acenv.h has
    included actypes.h to find ACPICA types for inline functions. This is a
    known and existing issue and currently there is no real problem caused
    by this issue for Linux kernel build. Thus this issue is not covered by
    this cleanup commit.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This change enables the host OS to redefine OSL prototypes found in the
    acpiosxf.h file. This allows the host OS to implement OSL interfaces with
    a macro or inlined function. Further, it allows the host OS to add any
    additional required modifiers such as __iomem, __init, __exit, etc.,
    as necessary on a per-interface basis. Enables maximum flexibility
    for the OSL interfaces. Lv Zheng.

    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • For Linux, there are no functional changes/binary generation differences
    introduced by this patch.

    This change adds a new macro to all files that contain external ACPICA
    interfaces. It can be detected and used by the host (via the host-specific
    header) for any special processing required for such modules. Lv Zheng.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

30 Oct, 2013

1 commit

  • In the common case, the ACPI_ALLOCATE and related macros now resolve
    directly to their respective acpi_os* OSL interfaces. Two options:
    1) The ACPI_ALLOCATE_ZEROED macro defaults to a simple local implementation
    by default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define.
    2) For ACPI execution simulation environment (AcpiExec) which is not
    shipped with the Linux kernel, the macros can optionally be resolved to
    the local interfaces that track each allocation (used to immediately
    detect memory leaks).

    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

24 Sep, 2013

1 commit


25 Jan, 2013

1 commit


10 Jan, 2013

5 commits

  • This is a cosmetic patch only. Comparison of the resulting binary showed
    only line number differences.

    This patch does not affect the generation of the Linux binary.
    This patch decreases 210 lines of 20121018 divergence.diff.

    The ACPICA source codes uses a totally different indentation style from the
    Linux to be compatible with other users (operating systems or BIOS).

    Indentation differences are critical to the release automation. There are
    two causes related to the "indentation" that are affecting the release
    automation:
    1. The ACPICA -> Linux release process is:
    ACPICA source -- acpisrc - hierarchy - indent ->
    linuxized ACPICA source -- diff ->
    linuxized ACPICA patch (x) -- human intervention ->
    linuxized ACPICA patch (o)
    Where
    'x' means "cannot be directly applied to the Linux"
    'o' means "can be directly applied to the Linux"
    Different "indent" version or "indent" options used in the "indent"
    step will lead to different divergences.
    The version of "indent" used for the current release process is:
    GNU indent 2.2.11
    The options of "indent" used for the current release process is:
    -npro -kr -i8 -ts8 -sob -l80 -ss -ncs
    2. Manual indentation prettifying work in the Linux side will also harm the
    automatically generated linuxized ACPICA patches, making them impossible
    to apply directly.

    This patch fixes source code differences caused by the two causes so that
    the "human intervention" can be reduced in the future.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This is a cosmetic patch only. Comparison of the resulting binary showed
    only line number differences.

    This patch does not affect the generation of the Linux binary.
    This patch decreases 389 lines of 20121018 divergence.diff.

    This patch reduces source code diff caused by the simple code maintenance
    work:
    1. Deletion of the unused include files.
    2. Deletion of the deprecated codes blocks.
    3. Repositioning of the code blocks.
    4. Replacing the values with the well defined macros.
    5. Replacing the types with the equivalent types.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This is a cosmetic patch only. Comparison of the resulting binary showed
    only line number differences.

    This patch does not affect the generation of the Linux binary.
    This patch decreases 170 lines of 20121018 divergence.diff.

    This patch updates ACPICA codes surrounded by some disabled build options
    so that the source code diff between Linux and ACPICA can be reduced.

    Some of these build options may never be used in the kernel, so they may
    be deleted entirely in future patches.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This patch does not affect the generation of the Linux binary.
    This patch decreases 300 lines of 20121018 divergence.diff.

    This patch updates architecture specific environment settings for compiling
    ACPICA as such enhancement already has been done in ACPICA.

    Note that the appended compiler default settings in the
    will deprecate some of the macros defined in the
    architecture specific . Thus two of the headers
    have been cleaned up in this patch accordingly.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • This is a cosmetic patch only. Comparison of the resulting binary showed
    only line number differences.

    This patch does not affect the generation of the Linux binary.
    This patch decreases 558 lines of 20121018 divergence.diff.

    This patch reduces the source code diff between Linux and ACPICA by
    cleaning the comments that already have been updated in ACPICA.

    There is no extra indentation done in this patch. Even the empty line
    deletions and insertions are also splitted into another cleanup patch so
    that this patch can be easily reviewed, and the binary differences can be
    held to a lowest level.

    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

03 Oct, 2012

1 commit


17 Jul, 2012

1 commit


29 Mar, 2012

1 commit


01 Nov, 2011

1 commit

  • This file had an include of module.h which was probably added
    in relation to this line:

    #define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol);

    However, we really expect symbol exporters to grab export.h
    themselves, and since this is only a define, we can remove
    the module.h include without aclinux.h itself causing any
    compile issues.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

14 Jul, 2011

1 commit

  • All ACPICA locks are allocated by the same function,
    acpi_os_create_lock(), with the help of a local variable called
    "lock". Thus, when lockdep is enabled, it uses "lock" as the
    name of all those locks and regards them as instances of the same
    lock, which causes it to report possible locking problems with them
    when there aren't any.

    To work around this problem, define acpi_os_create_lock() as a macro
    and make it pass its argument to spin_lock_init(), so that lockdep
    uses it as the name of the new lock. Define this macron in a
    Linux-specific file, to minimize the resulting modifications of
    the OS-independent ACPICA parts.

    This change is based on an earlier patch from Andrea Righi and it
    addresses a regression from 2.6.39 tracked as
    https://bugzilla.kernel.org/show_bug.cgi?id=38152

    Signed-off-by: Rafael J. Wysocki
    Reported-and-tested-by: Borislav Petkov
    Tested-by: Andrea Righi
    Reviewed-by: Florian Mickler
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     

19 Jan, 2011

1 commit


01 Oct, 2010

2 commits