Skip to content

ACPI: Fixes and cleanups related to iomaps management

Rafael J. Wysocki linux-acpi linux-pm lkml platform-driver-x86 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 42 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11ACPI: Introduce acpi_os_ioremap()drivers/acpi/nvs.c drivers/acpi/osl.c include/linux/acpi.h +1 more+27 -110 replies
1/11ACPI: Introduce acpi_os_ioremap()drivers/acpi/nvs.c drivers/acpi/osl.c include/linux/acpi.h +1 more+27 -110 replies
2/11ACPI / PM: Call suspend_nvs_free() earlier during resumedrivers/acpi/sleep.c+1 -10 replies
2/11ACPI / PM: Call suspend_nvs_free() earlier during resumedrivers/acpi/sleep.c+1 -10 replies
3/11ACPI: Fix acpi_os_read_memory() and acpi_os_write_memory()drivers/acpi/osl.c+13 -180 replies
3/11ACPI: Fix acpi_os_read_memory() and acpi_os_write_memory()drivers/acpi/osl.c+13 -180 replies
4/11ACPI: Do not export functions that are only used in osl.cdrivers/acpi/osl.c include/linux/acpi_io.h+2 -70 replies
4/11ACPI: Do not export functions that are only used in osl.cdrivers/acpi/osl.c include/linux/acpi_io.h+2 -70 replies
5/11ACPI: Change acpi_ioremap_lock into a mutexdrivers/acpi/osl.c+9 -120 replies
5/11ACPI: Change acpi_ioremap_lock into a mutexdrivers/acpi/osl.c+9 -120 replies
6/11ACPI: Avoid walking the list of iomaps in osl.c twice in a rowdrivers/acpi/osl.c+20 -130 replies
6/11ACPI: Avoid walking the list of iomaps in osl.c twice in a rowdrivers/acpi/osl.c+20 -130 replies
7/11ACPI: Make acpi_os_map_memory() avoid creating unnecessary mappingsdrivers/acpi/osl.c+15 -130 replies
7/11ACPI: Make acpi_os_map_memory() avoid creating unnecessary mappingsdrivers/acpi/osl.c+15 -130 replies
8/11ACPI: Do not use krefs under a mutex in osl.cdrivers/acpi/osl.c+16 -200 replies
8/11ACPI: Do not use krefs under a mutex in osl.cdrivers/acpi/osl.c+16 -200 replies
9/11ACPI: Introduce acpi_os_get_iomem()drivers/acpi/osl.c include/linux/acpi_io.h+18 -00 replies
9/11ACPI: Introduce acpi_os_get_iomem()drivers/acpi/osl.c include/linux/acpi_io.h+18 -00 replies
10/11ACPI / PM: Use existing ACPI iomaps for NVS save/restoredrivers/acpi/nvs.c+16 -30 replies
10/11ACPI / PM: Use existing ACPI iomaps for NVS save/restoredrivers/acpi/nvs.c+16 -30 replies
11/11ACPI / PM: Make NVS save/restore code use slightly less memorydrivers/acpi/nvs.c+28 -170 replies
11/11ACPI / PM: Make NVS save/restore code use slightly less memorydrivers/acpi/nvs.c+28 -170 replies

Reviews trailers per patch

None of the 22 patches has a Reviewed-by or Acked-by.

PatchJeff ChuaRafael J. Wysocki
SeriesNot-signed-off-by Not-signed-off-by
1/11Reported-and-tested-by Reported-and-tested-by
1/11Reported-and-tested-by Reported-and-tested-by
2/11T-b T-b
2/11T-b T-b
3/11
3/11
4/11
4/11
5/11
5/11
6/11
6/11
7/11
7/11
8/11
8/11
9/11
9/11
10/11
10/11
11/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/11] ACPI: Fixes and cleanups related to iomaps management

Hi Len,

The following series of patches implements some fixes of the ACPI iomaps management. I found the problems trying to resolve the issue of creating iomaps of regions that have been mapped already when we save the NVS region.

The first two patches are the same as https://patchwork.kernel.org/patch/490071/
(except for the changelog) and https://patchwork.kernel.org/patch/490061/,
respectively, and they are 2.6.38 regression fix material. The other patches are not that urgent, because the related issues are generally long-standing, but some bugs addressed by them (especially [3/11]) may be actively hurting people right now, so the patches look suitable for .38 to me as well, but this is your call.

[1/11] - Introduce acpi_os_ioremap() to be called by ACPI code creating
iomaps, so that they are mapped in the consistent way.

[2/11] - Move the call to suspend_nvs_free() to acpi_pm_finish() so that it's
executed before device drivers' resume routines to avoid possible iomaps conflicts.

[3/11] - Fix routines for reading and writing iomem (RCU bug and mapping
regions on the fly).

[4/11] - (cleanup) Do not export local functions in osl.c.

[5/11] - Use a mutex (instead of a spinlock) for the locking of iomap
manipulations in osl.c.

[6/11] - Avoid unnecessary walks of the list of iomaps in osl.c.

[7/11] - Avoid creating iomaps for regions that have been mapped already.

[8/11] - Replace krefs used for iomap refcounting with simple reference
counters (they are manipulated under a lock anyway).

[9/11] - Introduce function for getting a reference to an ACPI iomap (to be
used by the NVS save/restore code).

[10/11] - Make the NVS code use existing iomaps if possible.

[11/11] - (cleanup) Remove an unnecessary field from struct nvs_page.

The patches have been tested on HP nx6325, Toshiba Portege R500 and Acer Ferrari One without causing any visible problems to happen. Also Jeff has tested [1/11] and [2/11] and he reports that they fix the synchronize_rcu() problem for him. [Jeff, can you test the whole series, please, and see if it doesn't introduce any new issues, [10/11] in particular?]

Thanks,
Rafael