From patchwork Fri Feb 12 17:43:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 61880 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp968300lbl; Fri, 12 Feb 2016 09:50:33 -0800 (PST) X-Received: by 10.98.8.74 with SMTP id c71mr3995172pfd.155.1455299433843; Fri, 12 Feb 2016 09:50:33 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id q77si19372776pfi.164.2016.02.12.09.50.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2016 09:50:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUHqb-0007tG-Js; Fri, 12 Feb 2016 17:49:37 +0000 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUHqE-0007hk-Hg for linux-arm-kernel@lists.infradead.org; Fri, 12 Feb 2016 17:49:16 +0000 Received: by mail-lf0-x229.google.com with SMTP id j78so56279767lfb.1 for ; Fri, 12 Feb 2016 09:48:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yt6snAIAf12ZcswtZFn0AfoI1y6PMZ9iJv/taTng/u0=; b=PaGwgRTDdk/mVncY/gZOYF4Wma4k5Db2oSBPLszWKfiggbEctv832prX4jWkyEmmVI Z1Ryp5BNA1O8oQyneokj4khCPSN9yQ7VjmhjJD4AfzvHnkgnKOQZYuihdGySFq5okQA4 AZsvQIeovZ2zBcM9dd7ZjU8vvwg35Ffc8k31g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yt6snAIAf12ZcswtZFn0AfoI1y6PMZ9iJv/taTng/u0=; b=AYg58UOESHkHnjI3+TqDHIc3q3XPGILD6BY4udQc1Yq1v1thkvSIC+cqPAmZZ8Cp1o rcg3UrMmqYqRXWZrNNQz+IrVfAA+ecsmg66ea6XzTScYkGt+WPT39qlJtQUTLzy1tpIO U6FBizXBvj1vHuguL52qxG+bEMTJOdKqqdWn1wZzj7u7sTH4YD0Dwi5OWgBj9af7qtbW 7LDnZxZXBO+NdXnfd5FyTmaDfe7qX3tZXTJ7IgVy/pTER9IqVl0o2NiJc1/ftN4a0n4k ClUu9C2ouryRzrkJBmP0NrcpgRhM71gVpfgu5/9VTt//pdab0/KMdhWH4Vw5xdJZUuXZ 5Btw== X-Gm-Message-State: AG10YOQqR+8SlVWPzwJpQP/88+Bim9/CPGNo9HuzURE8fN+9o3PuzRVClz1t5Lum7MRJ6i7j X-Received: by 10.25.18.214 with SMTP id 83mr1071802lfs.52.1455299332629; Fri, 12 Feb 2016 09:48:52 -0800 (PST) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id ei4sm2017549lbb.18.2016.02.12.09.48.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 09:48:51 -0800 (PST) From: Aleksey Makarov To: linux-acpi@vger.kernel.org Subject: [PATCH v2 2/9] ACPI: Change __init to __ref for early_acpi_os_unmap_memory() Date: Fri, 12 Feb 2016 20:43:33 +0300 Message-Id: <1455299022-11641-3-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455299022-11641-1-git-send-email-aleksey.makarov@linaro.org> References: <1455299022-11641-1-git-send-email-aleksey.makarov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160212_094914_933966_733114AF X-CRM114-Status: GOOD ( 11.81 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:229 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , Graeme Gregory , Greg Kroah-Hartman , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Leif Lindholm , Aleksey Makarov , Christopher Covington , linux-serial@vger.kernel.org, Al Stone , linux-arm-kernel@lists.infradead.org, Len Brown MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org 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. Signed-off-by: Aleksey Makarov --- drivers/acpi/osl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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);