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
     

06 Jan, 2014

1 commit

  • Include header file internal.h in nvs.c because functions
    suspend_nvs_free(), suspend_nvs_alloc(), suspend_nvs_save() and
    suspend_nvs_restore() have their prototype declaration in internal.h.

    This eliminates the following warnings in nvs.c:
    drivers/acpi/nvs.c:128:6: warning: no previous prototype for ‘suspend_nvs_free’ [-Wmissing-prototypes]
    drivers/acpi/nvs.c:152:5: warning: no previous prototype for ‘suspend_nvs_alloc’ [-Wmissing-prototypes]
    drivers/acpi/nvs.c:169:5: warning: no previous prototype for ‘suspend_nvs_save’ [-Wmissing-prototypes]
    drivers/acpi/nvs.c:201:6: warning: no previous prototype for ‘suspend_nvs_restore’ [-Wmissing-prototypes]

    Signed-off-by: Rashika Kheria
    Reviewed-by: Josh Triplett
    Signed-off-by: Rafael J. Wysocki

    Rashika
     

07 Dec, 2013

2 commits

  • 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
     
  • Since drivers/acpi/nvs.c includes and is only compiled
    for CONFIG_ACPI set, it doesn't need to include
    directly, which is formally incorrect. Remove the
    inclusion from that file.

    Signed-off-by: Lv Zheng
    [rjw: Subject and changelog]
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

30 Mar, 2012

1 commit


17 Jan, 2012

1 commit

  • Some firmware will access memory in ACPI NVS region via APEI. That
    is, instructions in APEI ERST/EINJ table will read/write ACPI NVS
    region. The original resource conflict checking in APEI code will
    check memory/ioport accessed by APEI via general resource management
    mechanism. But ACPI NVS region is marked as busy already, so that the
    false resource conflict will prevent APEI ERST/EINJ to work.

    To fix this, this patch record ACPI NVS regions, so that we can avoid
    request resources for memory region inside it.

    Signed-off-by: Huang Ying
    Signed-off-by: Len Brown

    Huang Ying
     

25 Feb, 2011

1 commit

  • Modify the NVS save/restore code to use acpi_os_get_iomem() and
    acpi_os_unmap_memory() to acquire and release references to ACPI
    iomaps, respectively. If there's no ACPI iomap corresponding to the
    given NVS page, acpi_os_ioremap() is used to map that page and
    iounmap() is used to unmap it during resume. [If the page is not
    present in the ACPI iomaps already, it doesn't make sense to add its
    mapping to the list of ACPI iomaps, because it's going to be thrown
    away during the subsequent resume anyway.]

    Testing on my HP nx6325 shows that approx. 90% of the NVS pages
    have already been mapped by ACPI before suspend and are present in
    the ACPI iomaps, so this change appears to be the right thing to do
    in general.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

21 Jan, 2011

1 commit

  • Commit ca9b600be38c ("ACPI / PM: Make suspend_nvs_save() use
    acpi_os_map_memory()") attempted to prevent the code in osl.c and nvs.c
    from using different ioremap() variants by making the latter use
    acpi_os_map_memory() for mapping the NVS pages. However, that also
    requires acpi_os_unmap_memory() to be used for unmapping them, which
    causes synchronize_rcu() to be executed many times in a row
    unnecessarily and introduces substantial delays during resume on some
    systems.

    Instead of using acpi_os_map_memory() for mapping the NVS pages in nvs.c
    introduce acpi_os_ioremap() calling ioremap_cache() and make the code in
    both osl.c and nvs.c use it.

    Reported-by: Jeff Chua
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

07 Jan, 2011

3 commits