25 Mar, 2015

1 commit

  • The acpi_os_ioremap() function may be used to map normal RAM or IO
    regions. The current implementation simply uses ioremap_cache(). This
    will work for some architectures, but arm64 ioremap_cache() cannot be
    used to map IO regions which don't support caching. So for arm64, use
    ioremap() for non-RAM regions.

    CC: Rafael J Wysocki
    CC: Catalin Marinas
    Tested-by: Robert Richter
    Tested-by: Timur Tabi
    Acked-by: Robert Richter
    Acked-by: Rafael J. Wysocki
    Reviewed-by: Grant Likely
    Signed-off-by: Mark Salter
    Signed-off-by: Hanjun Guo
    Signed-off-by: Will Deacon

    Mark Salter
     

28 May, 2014

1 commit

  • 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
     

07 Dec, 2013

1 commit

  • To avoid build problems and breaking dependencies between ACPI header
    files, should not be included directly by code outside
    of the ACPI core subsystem. However, that is possible if
    is included, because that file contains
    a direct inclusion of .

    For this reason, remove the direct inclusion from
    , move that file from include/linux/ to include/acpi/
    and make include it for CONFIG_ACPI set along with the
    other ACPI header files. Accordingly, Remove the inclusions of
    from everywhere.

    Of course, that causes the contents of the new file
    to be available for CONFIG_ACPI set only, so intel_opregion.o that
    depends on it should also depend on CONFIG_ACPI (and it really should
    not be compiled for CONFIG_ACPI unset anyway).

    References: https://01.org/linuxgraphics/sites/default/files/documentation/acpi_igd_opregion_spec.pdf
    Cc: Matthew Garrett
    Signed-off-by: Lv Zheng
    Acked-by: Daniel Vetter
    [rjw: Subject and changelog]
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng