]> git.hungrycats.org Git - linux/commitdiff
ACPI / APEI: Remove ghes_ioremap_area
authorJames Morse <james.morse@arm.com>
Mon, 6 Nov 2017 18:44:25 +0000 (18:44 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:42:17 +0000 (18:42 +0000)
commit 520e18a5080d2c444a03280d99c8a35cb667d321 upstream.

Now that nothing is using the ghes_ioremap_area pages, rip them out.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Tested-by: Tyler Baicar <tbaicar@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[bwh: Backported to 3.16:
 - Delete additional call to ghes_ioremap_exit() from ghes_exit()
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/acpi/apei/ghes.c

index e858ea1ddfdaa4e04f20f46df78ee10197add418..019db73c01fa8c1772905b0535ae4fa4f6b48704 100644 (file)
@@ -112,19 +112,7 @@ static DEFINE_RAW_SPINLOCK(ghes_nmi_lock);
  * from BIOS to Linux can be determined only in NMI, IRQ or timer
  * handler, but general ioremap can not be used in atomic context, so
  * the fixmap is used instead.
- */
-
-/*
- * Two virtual pages are used, one for NMI context, the other for
- * IRQ/PROCESS context
- */
-#define GHES_IOREMAP_PAGES             2
-#define GHES_IOREMAP_NMI_PAGE(base)    (base)
-#define GHES_IOREMAP_IRQ_PAGE(base)    ((base) + PAGE_SIZE)
-
-/* virtual memory area for atomic ioremap */
-static struct vm_struct *ghes_ioremap_area;
-/*
+ *
  * These 2 spinlocks are used to prevent the fixmap entries from being used
  * simultaneously.
  */
@@ -147,23 +135,6 @@ static struct irq_work ghes_proc_irq_work;
 struct ghes_estatus_cache *ghes_estatus_caches[GHES_ESTATUS_CACHES_SIZE];
 static atomic_t ghes_estatus_cache_alloced;
 
-static int ghes_ioremap_init(void)
-{
-       ghes_ioremap_area = __get_vm_area(PAGE_SIZE * GHES_IOREMAP_PAGES,
-               VM_IOREMAP, VMALLOC_START, VMALLOC_END);
-       if (!ghes_ioremap_area) {
-               pr_err(GHES_PFX "Failed to allocate virtual memory area for atomic ioremap.\n");
-               return -ENOMEM;
-       }
-
-       return 0;
-}
-
-static void ghes_ioremap_exit(void)
-{
-       free_vm_area(ghes_ioremap_area);
-}
-
 static void __iomem *ghes_ioremap_pfn_nmi(u64 pfn)
 {
        __set_fixmap(FIX_APEI_GHES_NMI, pfn << PAGE_SHIFT, PAGE_KERNEL);
@@ -1063,13 +1034,9 @@ static int __init ghes_init(void)
 
        init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq);
 
-       rc = ghes_ioremap_init();
-       if (rc)
-               goto err;
-
        rc = ghes_estatus_pool_init();
        if (rc)
-               goto err_ioremap_exit;
+               goto err;
 
        rc = ghes_estatus_pool_expand(GHES_ESTATUS_CACHE_AVG_SIZE *
                                      GHES_ESTATUS_CACHE_ALLOCED_MAX);
@@ -1093,8 +1060,6 @@ static int __init ghes_init(void)
        return 0;
 err_pool_exit:
        ghes_estatus_pool_exit();
-err_ioremap_exit:
-       ghes_ioremap_exit();
 err:
        return rc;
 }
@@ -1103,7 +1068,6 @@ static void __exit ghes_exit(void)
 {
        platform_driver_unregister(&ghes_platform_driver);
        ghes_estatus_pool_exit();
-       ghes_ioremap_exit();
 }
 
 module_init(ghes_init);