From nobody Thu Oct 9 02:57:40 2025 Received: from sender4-op-o15.zoho.com (sender4-op-o15.zoho.com [136.143.188.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E78E3284662; Fri, 20 Jun 2025 13:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750425266; cv=pass; b=bdnEV+C3u4k2nq/yxhp09iNrazE7wb6kkblvvSHVsP3g5jmUFpaT9D1o7EKCLZ59u906uwD3p72ZFlzS2eDMK60Bgn9eQSyk856c8Eol30niWyuNqoyrPYalul5NrIQaXm+ta2/oVkKWt7gtljNj/o7uRCnZ2HKVxcEymSyatXs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750425266; c=relaxed/simple; bh=H5R8o0kXd66u4+i/qXbUVwWj9FSg3AdZtj4azxMfffE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JyfuAvdZGhqSGkwpaAhRwdBKqGb5/i37S8ppsnRlydUHdnDNCUTLcKmI0rzLHQsiSEmqAklrT64+R3ZxNWEA3PLvqHYIaNXX/ruZCIyXraYuztuQxL+WRVoPZ4myJACIP3CYc10SV2H1CCxd0wUy81uRuJNaFadJ0Me5Xj1KR8A= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty; spf=pass smtp.mailfrom=linux.beauty; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b=HiLE34Cx; arc=pass smtp.client-ip=136.143.188.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.beauty Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b="HiLE34Cx" ARC-Seal: i=1; a=rsa-sha256; t=1750425204; cv=none; d=zohomail.com; s=zohoarc; b=LtFC76nXKkFcv7Pm+hMID0+38hoRWwyfw9Hkc2V7QGmcf927r2g7WVUOBO+W/OXmvjXGgkFBgtYpFdfTSuK6sGRRo+j9MUbdodofRpSFwX/bMtCO3RC/0AWQCC4MG6AAQinSqEaDTYbo+ty6r1K5/zXAXKPL0/40SFmsWBxjN6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750425204; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=ih0cPhQO9yl9dR3mzLUlHo55Ox0dnBul4xmprtM+Rl4=; b=SUQ4ZyVR+J/0ALRomHqjpSmsozz3fAD3oNOrh7wM/LRSllmSgD/31q4sAyf1nROcuDtQYd0y0mrF6kAe6hRkTyjJu6sDJ/f7X8b5v5g5w4PhQTFwaexh+CHNMi4qm5nDApW5NQbqhZB64sx8b3fKfVQwOAGQRorN03eoLbolw6M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1750425204; s=zmail; d=linux.beauty; i=me@linux.beauty; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=ih0cPhQO9yl9dR3mzLUlHo55Ox0dnBul4xmprtM+Rl4=; b=HiLE34CxnUe43B8l8dOl4GSWJyGNGs5wH44+fK9LThUUfOh9NrZw2rY62ovYWVuk 00WAy/0HMmc6a/Z3WZzfVmVl15ZjfK6mwXYVcLSdqbBd+kj4PQ3X2M89mjsOoiVlS/9 75OwVo07G1m4ssYC71GY3kTRHAHy998KB7PWuMn4= Received: by mx.zohomail.com with SMTPS id 1750425202690448.1427826058292; Fri, 20 Jun 2025 06:13:22 -0700 (PDT) From: Li Chen To: Hanjun Guo , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Len Brown , Liu Wei , Ryan Roberts , Andrew Morton , Jonathan Cameron , Sudeep Holla , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH v2 1/2] ACPI: Return -ENODEV from acpi_parse_spcr() when SPCR support is disabled Date: Fri, 20 Jun 2025 21:13:07 +0800 Message-ID: <20250620131309.126555-2-me@linux.beauty> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620131309.126555-1-me@linux.beauty> References: <20250620131309.126555-1-me@linux.beauty> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" From: Li Chen If CONFIG_ACPI_SPCR_TABLE is disabled, acpi_parse_spcr() currently returns 0, which may incorrectly suggest that SPCR parsing was successful. This patch changes the behavior to return -ENODEV to clearly indicate that SPCR support is not available. This prepares the codebase for future changes that depend on acpi_parse_spcr() failure detection, such as suppressing misleading console messages. Signed-off-by: Li Chen Acked-by: Hanjun Guo --- include/linux/acpi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index f102c0fe34318..71e692f952905 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1503,7 +1503,7 @@ int acpi_parse_spcr(bool enable_earlycon, bool enable= _console); #else static inline int acpi_parse_spcr(bool enable_earlycon, bool enable_consol= e) { - return 0; + return -ENODEV; } #endif =20 --=20 2.49.0 From nobody Thu Oct 9 02:57:40 2025 Received: from sender4-op-o15.zoho.com (sender4-op-o15.zoho.com [136.143.188.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C795284662; Fri, 20 Jun 2025 13:14:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750425297; cv=pass; b=WSEAs/SACbBy8kTVVpEz2VPM0kSnNnTygx20SCCZ4Jp4u2dBjti1Ge49QTO7rIjfdrF8jGepqGPN48HQHfTepSbo/XsMiX8FfhRA3gLsUGgr66T6njyhZzWFbfMojWGonoGWLmU2y8Pb/QyGUQT7mNfjxoDqBPgPranMx8gwwdc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750425297; c=relaxed/simple; bh=JoqxZK5kKb3iGbF2HT2J3CanHyR4uWwtcC9OwzKn6kc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=txTRXLCIlvfxTOStZZqxCshmU5QE15rbrk26JAdBAYXGwk13YXBaTHjBMj5CzAF8BXqcAbCWtDURq7Oc+SKi7wDilLh6qXvVmjw/rVg3rgAIMoB8FaCZ5ZXAvJTqnrKFeePM6TrwleyoLNMEz+b15pqbp+abRyClH68VKrKChcA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty; spf=pass smtp.mailfrom=linux.beauty; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b=UHG+C+w5; arc=pass smtp.client-ip=136.143.188.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.beauty Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b="UHG+C+w5" ARC-Seal: i=1; a=rsa-sha256; t=1750425208; cv=none; d=zohomail.com; s=zohoarc; b=MNHPccnBs+XXqy/H38CYDXt+t1su8buoNkN2GLnJ8NF2v6G5p0nuG1vsO8RTsKLekpEN7rZNa5trxFxAQtJT3OjRBJm6GlSLsqctO+WIVxIBvzKqQ+QsjFOPnL0YY4LyBj/eGU8hPQdnYdw17FKpX/UiJky6R06GOtijle5FtE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750425208; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=P6KhJbmkVl7HuIV2HXHuYKvcE/VNTXSLGZUIxgNMypM=; b=dcciD0HGu+lRgum+Jz0u5+lLYqFY7J9aZuIz2meefUVjEpWYo15ETJY3tyFKW19Fjtw60EUiGh607t7r/gMw6djQvez0GicvceRzprUCOXh+JbqPKPvXwJ2qCnsS+5VHYf01RMC6doPNEIJIa0bFKSRy0doEl9bSQiZpT/ZtLJk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1750425208; s=zmail; d=linux.beauty; i=me@linux.beauty; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=P6KhJbmkVl7HuIV2HXHuYKvcE/VNTXSLGZUIxgNMypM=; b=UHG+C+w5Z4XSdDUJVC9HC7AjqBnOLQM2EiYpIDGXBLWk4SobNmSn+oBinQroOL53 /A7e0coeFgopow0/dHxl1Akf1dKGiyQOJcrkw8Jfb63haR/o6tLZceApq/W7RJKHIz4 vPEzqPZflBieXhzKF8RZAoVoa91hOKZhZZETC5vU= Received: by mx.zohomail.com with SMTPS id 17504252076891004.916800415434; Fri, 20 Jun 2025 06:13:27 -0700 (PDT) From: Li Chen To: Hanjun Guo , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Len Brown , Liu Wei , Ryan Roberts , Andrew Morton , Jonathan Cameron , Sudeep Holla , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Anshuman Khandual , Li Chen Subject: [PATCH v2 2/2] ACPI: Suppress misleading SPCR console message when SPCR table is absent Date: Fri, 20 Jun 2025 21:13:08 +0800 Message-ID: <20250620131309.126555-3-me@linux.beauty> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620131309.126555-1-me@linux.beauty> References: <20250620131309.126555-1-me@linux.beauty> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset="utf-8" From: Li Chen The kernel currently alway prints: "Use ACPI SPCR as default console: No/Yes " even on systems that lack an SPCR table. This can mislead users into thinking the SPCR table exists on the machines without SPCR. With this change, the "Yes" is only printed if the SPCR table is present, parsed and !param_acpi_nospcr. This avoids user confusion on SPCR-less systems. Signed-off-by: Li Chen Acked-by: Hanjun Guo --- changelog: v2: refine the printk message logic as suggested by Hanjun Guo. arch/arm64/kernel/acpi.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index b9a66fc146c9f..4d529ff7ba513 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -197,6 +197,8 @@ static int __init acpi_fadt_sanity_check(void) */ void __init acpi_boot_table_init(void) { + int ret; + /* * Enable ACPI instead of device tree unless * - ACPI has been disabled explicitly (acpi=3Doff), or @@ -250,10 +252,12 @@ void __init acpi_boot_table_init(void) * behaviour, use acpi=3Dnospcr to disable console in ACPI SPCR * table as default serial console. */ - acpi_parse_spcr(earlycon_acpi_spcr_enable, + ret =3D acpi_parse_spcr(earlycon_acpi_spcr_enable, !param_acpi_nospcr); - pr_info("Use ACPI SPCR as default console: %s\n", - param_acpi_nospcr ? "No" : "Yes"); + if (!ret || param_acpi_nospcr || !IS_ENABLED(CONFIG_ACPI_SPCR_TABLE)) + pr_info("Use ACPI SPCR as default console: No\n"); + else + pr_info("Use ACPI SPCR as default console: Yes\n"); =20 if (IS_ENABLED(CONFIG_ACPI_BGRT)) acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt); --=20 2.49.0