Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1336019

RE: [PATCH v3 1/5] ACPI: change __init to __ref for early_acpi_os_unmap_memory()

From "Zheng, Lv" <lv.zheng@intel.com>
Newsgroups linux.kernel
Subject RE: [PATCH v3 1/5] ACPI: change __init to __ref for early_acpi_os_unmap_memory()
Date 2016-02-17 03:50 +0100
Message-ID <r30lI-8gb-3@gated-at.bofh.it> (permalink)
References <r2vUC-4Jg-19@gated-at.bofh.it> <r2vUD-4Jg-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

> -----Original Message-----
> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-
> owner@vger.kernel.org] On Behalf Of Aleksey Makarov
> Sent: Tuesday, February 16, 2016 2:05 AM
> To: linux-acpi@vger.kernel.org
> Cc: linux-serial@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; Aleksey Makarov <aleksey.makarov@linaro.org>;
> Russell King <linux@arm.linux.org.uk>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>; Rafael J . Wysocki <rjw@rjwysocki.net>; Leif
> Lindholm <leif.lindholm@linaro.org>; Graeme Gregory
> <graeme.gregory@linaro.org>; Al Stone <ahs3@redhat.com>; Christopher
> Covington <cov@codeaurora.org>; Len Brown <lenb@kernel.org>
> Subject: [PATCH v3 1/5] ACPI: change __init to __ref for
> early_acpi_os_unmap_memory()
> 
> early_acpi_os_unmap_memory() is marked as __init because it calls
> __acpi_unmap_table(), but only when acpi_gbl_permanent_mmap is not set.
> 
> acpi_gbl_permanent_mmap is set in __init acpi_early_init()
> so it is safe to call early_acpi_os_unmap_memory() from anywhere
> 
> We need this function to be non-__init because we need access to
> some tables at unpredictable time--it may be before or after
> acpi_gbl_permanent_mmap is set.  For example, SPCR (Serial Port Console
> Redirection) table is needed each time a new console is registered.
> It can be quite early (console_initcall) or when a module is inserted.
> When this table accessed before acpi_gbl_permanent_mmap is set,
> the pointer should be unmapped.  This is exactly what this function
> does.
[Lv Zheng] 
Why don't you use another API instead of early_acpi_os_unmap_memory() in case you want to unmap things in any cases.
acpi_os_unmap_memory() should be the one to match this purpose.
It checks acpi_gbl_ppermanent_mmap in acpi_os_unmap_iomem().
And in fact early_acpi_os_unmap_memory() should be removed.

Thanks and best regards
-Lv

> 
> Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
> ---
>  drivers/acpi/osl.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
> index 67da6fb..8a552cd 100644
> --- a/drivers/acpi/osl.c
> +++ b/drivers/acpi/osl.c
> @@ -497,7 +497,11 @@ void __ref acpi_os_unmap_memory(void *virt,
> acpi_size size)
>  }
>  EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
> 
> -void __init early_acpi_os_unmap_memory(void __iomem *virt, acpi_size size)
> +/*
> + * acpi_gbl_permanent_mmap is set in __init acpi_early_init()
> + * so it is safe to call early_acpi_os_unmap_memory() from anywhere
> + */
> +void __ref early_acpi_os_unmap_memory(void __iomem *virt, acpi_size size)
>  {
>  	if (!acpi_gbl_permanent_mmap)
>  		__acpi_unmap_table(virt, size);
> --
> 2.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/5] ACPI: parse the SPCR table Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-15 19:20 +0100
  [PATCH v3 1/5] ACPI: change __init to __ref for early_acpi_os_unmap_memory() Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-15 19:20 +0100
    RE: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() "Zheng, Lv" <lv.zheng@intel.com> - 2016-02-17 03:50 +0100
      RE: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() "Zheng, Lv" <lv.zheng@intel.com> - 2016-02-17 04:00 +0100
        Re: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-17 14:10 +0100
          RE: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() "Zheng, Lv" <lv.zheng@intel.com> - 2016-02-18 04:40 +0100
            Re: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() Peter Hurley <peter@hurleysoftware.com> - 2016-02-18 23:10 +0100
              RE: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() "Zheng, Lv" <lv.zheng@intel.com> - 2016-02-19 04:00 +0100
                Re: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-19 12:10 +0100
                RE: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() "Zheng, Lv" <lv.zheng@intel.com> - 2016-02-22 03:30 +0100
                Re: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-22 16:10 +0100
              Re: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-19 11:50 +0100
                Re: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() Peter Hurley <peter@hurleysoftware.com> - 2016-02-19 16:30 +0100
                Re: [PATCH v3 1/5] ACPI: change __init to __ref for early_acpi_os_unmap_memory() Christopher Covington <cov@codeaurora.org> - 2016-02-19 18:30 +0100
                Re: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() Peter Hurley <peter@hurleysoftware.com> - 2016-02-22 06:40 +0100
                Re: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-22 15:50 +0100
                Re: [PATCH v3 1/5] ACPI: change __init to __ref for  early_acpi_os_unmap_memory() Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-22 15:40 +0100
  [PATCH v3 3/5] ACPI: enable ACPI_SPCR_TABLE on ARM64 Aleksey Makarov <aleksey.makarov@linaro.org> - 2016-02-15 19:20 +0100
  Re: [PATCH v3 0/5] ACPI: parse the SPCR table Mark Salter <msalter@redhat.com> - 2016-02-16 20:20 +0100
  Re: [PATCH v3 0/5] ACPI: parse the SPCR table Christopher Covington <cov@codeaurora.org> - 2016-02-17 03:40 +0100
  Re: [PATCH v3 0/5] ACPI: parse the SPCR table Jeremy Linton <jeremy.linton@arm.com> - 2016-02-18 22:20 +0100

csiph-web