From patchwork Wed Feb 24 17:10:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 62815 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2527177lbl; Wed, 24 Feb 2016 09:12:26 -0800 (PST) X-Received: by 10.98.93.2 with SMTP id r2mr56521610pfb.64.1456333946346; Wed, 24 Feb 2016 09:12:26 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id c74si6076115pfj.65.2016.02.24.09.12.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Feb 2016 09:12:26 -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 1aYcy2-00079s-96; Wed, 24 Feb 2016 17:11:14 +0000 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYcxz-00077Q-88 for linux-arm-kernel@lists.infradead.org; Wed, 24 Feb 2016 17:11:12 +0000 Received: by mail-lf0-x22f.google.com with SMTP id 78so16177234lfy.3 for ; Wed, 24 Feb 2016 09:10:52 -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=nmQgM8upV2sn4UfvmzNJG9nhBeqhw7pWDkCokBlLB6w=; b=ZvyX+E+05Zi2JP2zpYBqkgoe8kNLEDevyxPzQx1IpArprY6Iq9ft8QQ4aD5SL0xaKe eCqco+a7Lt/8qzbNK8CSVwRxpyTcm2S3pHjsvhqqvXB1ZbtMUNNGzF5DnzbwuCkEqLOW heOPxhexWUukd2rbMgfX/b/1wW+OBpvm4jsUc= 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=nmQgM8upV2sn4UfvmzNJG9nhBeqhw7pWDkCokBlLB6w=; b=fKikARpMRy9FOBKkwc2dwpFwJIZPvKBicymaVjenO/Dpx/AX10WJfJoDh+GLriGXCV e30bHzPAORsXBUz7CQ75FuVIHBI65ZGTg1S+qTguGpTpi68ydJ+2GM2AchXD8uFZVk3s CL/FCIPKVIsTAzTZizGtLVv95A2S7g34t4Wfy5CmoPZUFYTZtaaV4CwVOWgdbUe0OVPS F/kOl4FRiTiUQdvpRGdcW/ZuJvihQ0b4F1czLJyGl7G07UcvclsuFg9vE9Usrrd5Z4jA D343f5mkvavo6xCYQctcd/1KnkBz3AUhH9Tfp0lzJtcGNImFLu4V4vyOi0D7uY1bMXaK cuoQ== X-Gm-Message-State: AG10YOT80/KZGtTDeFkw2nm1z48Y47wg/BQH1RUhTV5fhvWdYGAvHx41iE9wsXqtNMHG7C8m X-Received: by 10.25.83.83 with SMTP id h80mr12631438lfb.115.1456333851017; Wed, 24 Feb 2016 09:10:51 -0800 (PST) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id ne8sm509556lbc.21.2016.02.24.09.10.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Feb 2016 09:10:50 -0800 (PST) From: Aleksey Makarov To: linux-acpi@vger.kernel.org Subject: [PATCH v2 1/8] arm64: move acpi/dt decision earlier in boot process Date: Wed, 24 Feb 2016 20:10:10 +0300 Message-Id: <1456333819-13482-2-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1456333819-13482-1-git-send-email-aleksey.makarov@linaro.org> References: <1456333819-13482-1-git-send-email-aleksey.makarov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160224_091111_481494_82541DB7 X-CRM114-Status: GOOD ( 17.17 ) 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:22f 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_VALID Message has at least one valid DKIM or DK signature 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 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, Catalin Marinas , Will Deacon , Al Stone , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org From: Leif Lindholm In order to support selecting earlycon via either ACPI or DT, move the decision on whether to attempt ACPI configuration into the early_param handling. Then make acpi_boot_table_init() bail out if acpi_disabled. Signed-off-by: Leif Lindholm Signed-off-by: Aleksey Makarov --- arch/arm64/kernel/acpi.c | 62 +++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 32 deletions(-) -- 2.7.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index d1ce8e2..3faa323 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -41,26 +41,8 @@ EXPORT_SYMBOL(acpi_disabled); int acpi_pci_disabled = 1; /* skip ACPI PCI scan and IRQ initialization */ EXPORT_SYMBOL(acpi_pci_disabled); -static bool param_acpi_off __initdata; static bool param_acpi_force __initdata; -static int __init parse_acpi(char *arg) -{ - if (!arg) - return -EINVAL; - - /* "acpi=off" disables both ACPI table parsing and interpreter */ - if (strcmp(arg, "off") == 0) - param_acpi_off = true; - else if (strcmp(arg, "force") == 0) /* force ACPI to be enabled */ - param_acpi_force = true; - else - return -EINVAL; /* Core will print when we return error */ - - return 0; -} -early_param("acpi", parse_acpi); - static int __init dt_scan_depth1_nodes(unsigned long node, const char *uname, int depth, void *data) @@ -74,6 +56,35 @@ static int __init dt_scan_depth1_nodes(unsigned long node, return 0; } +static int __init parse_acpi(char *arg) +{ + if (!arg) + return -EINVAL; + + /* + * Enable ACPI instead of device tree unless + * - ACPI has been disabled explicitly (acpi=off), or + * - the device tree is not empty (it has more than just a /chosen node) + * and ACPI has not been force enabled (acpi=force) + */ + if (strcmp(arg, "off") == 0) + return 0; + else if (strcmp(arg, "force") == 0) + param_acpi_force = true; + else if (of_scan_flat_dt(dt_scan_depth1_nodes, NULL)) + return 0; + + /* + * ACPI is disabled at this point. Enable it in order to parse + * the ACPI tables and carry out sanity checks + */ + enable_acpi(); + + return 0; +} + +early_param("acpi", parse_acpi); + /* * __acpi_map_table() will be called before page_init(), so early_ioremap() * or early_memremap() should be called here to for ACPI table mapping. @@ -181,23 +192,10 @@ out: */ void __init acpi_boot_table_init(void) { - /* - * Enable ACPI instead of device tree unless - * - ACPI has been disabled explicitly (acpi=off), or - * - the device tree is not empty (it has more than just a /chosen node) - * and ACPI has not been force enabled (acpi=force) - */ - if (param_acpi_off || - (!param_acpi_force && of_scan_flat_dt(dt_scan_depth1_nodes, NULL))) + if (acpi_disabled) return; /* - * ACPI is disabled at this point. Enable it in order to parse - * the ACPI tables and carry out sanity checks - */ - enable_acpi(); - - /* * If ACPI tables are initialized and FADT sanity checks passed, * leave ACPI enabled and carry on booting; otherwise disable ACPI * on initialization error.