From patchwork Tue Nov 21 15:58:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Jiang X-Patchwork-Id: 13463340 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98F84C61D90 for ; Tue, 21 Nov 2023 15:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Cc:To:From :Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=o8hUQ39IFvJsQFOCb6PI6SBTa/RXIZTRDkpbZYaX4D8=; b=ZZ8zRtjjwtJgM0 rqeMnLUx9IT7BQIBVAQUlPfLEh9OInjvGqK6kvWazW0cOsRwR+vJmqsEweg9CI/De1yz7ea2coHHe TlHY8uecXC7uzeg+SxYOJDJEhs5k3L2EHqRFOKMsf762H+FGQn4TkKi54BuZahTkbJ6e9goo76APC NPAJfZYK++sWpfkrPEwsdHKusUmuLp8+P5jXVfekVcyOGGuoHYvZ96dQQ6Z3vfDfrufV8WHGysGKK j6QB0C8GnrBFTIHzr3JmMayc1NnsMF0CokylF66bCpiTsJ68+SAjvPLWWg0i+u7D29HI0GYu1SBrm TXZKks5tbSPYVaAO1cjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r5T8j-00HDXe-01; Tue, 21 Nov 2023 15:58:17 +0000 Received: from mgamail.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r5T8g-00HDWj-25 for linux-arm-kernel@lists.infradead.org; Tue, 21 Nov 2023 15:58:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700582294; x=1732118294; h=subject:from:to:cc:date:message-id:mime-version: content-transfer-encoding; bh=itjj7X5Il/CLPzOHoOlkC+igDSCWB8zI/FawmL7Ca+8=; b=CDQ/VY2bHU+sws+4qlWk996SRaQynOckojutQMgxDBjtpIB3wtILIulW flEQrZOPgTfiSyDcbFy4ffPExTvdg88/jzE7n3GQKIlXVcVZ9xQRUvNad h4dOHKK5xdMdE3PaFXH88oFECpfKxfOWsCgp5CqzT6b0HQ/2Ffmk2x3b6 ujyW1ZzhoiMXx4gW6CQDhdLwBcwguE/ko4Da3DCH/yJGow6gtcm9p2X2b fJYPFazW7vAvzYKON3LdpyH5pFE00mOZ42KlMPKy6kgrC7kh08y+kiLrS dC3GZ0IriVw8S3+ZkGrRdZ1ITTdM8aBkj6gN60FgzR92gBuEJhLPhrCxD A==; X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="391640574" X-IronPort-AV: E=Sophos;i="6.04,216,1695711600"; d="scan'208";a="391640574" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 07:58:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="837090201" X-IronPort-AV: E=Sophos;i="6.04,216,1695711600"; d="scan'208";a="837090201" Received: from djiang5-mobl3.amr.corp.intel.com (HELO [192.168.1.177]) ([10.212.123.89]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 07:58:13 -0800 Subject: [PATCH] acpi: Fix ARM32 platforms compile issue introduced by fw_table changes From: Dave Jiang To: linus.walleij@linaro.org, rafael@kernel.org Cc: "Rafael J. Wysocki" , lenb@kernel.org, robert.moore@intel.com, Jonathan.Cameron@huawei.com, dan.j.williams@intel.com, guohanjun@huawei.com, arnd@arndb.de, linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Tue, 21 Nov 2023 08:58:12 -0700 Message-ID: <170058229266.2356592.11579977558324549374.stgit@djiang5-mobl3> User-Agent: StGit/1.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231121_075814_694623_C47FE699 X-CRM114-Status: GOOD ( 13.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Linus reported that: After commit a103f46633fd the kernel stopped compiling for several ARM32 platforms that I am building with a bare metal compiler. Bare metal compilers (arm-none-eabi-) don't define __linux__. This is because the header is now in the include path for : CC arch/arm/kernel/irq.o CC kernel/sysctl.o CC crypto/api.o In file included from ../include/acpi/acpi.h:22, from ../include/linux/fw_table.h:29, from ../include/linux/acpi.h:18, from ../include/linux/irqchip.h:14, from ../arch/arm/kernel/irq.c:25: ../include/acpi/platform/acenv.h:218:2: error: #error Unknown target environment 218 | #error Unknown target environment | ^~~~~ The issue is caused by the introducing of splitting out the ACPI code to support the new generic fw_table code. Rafael suggested moving the fw_table.h include in linux/acpi.h to below the asm/acpi.h. The move also helped with eliminating the inclusion of acpi/acpi.h in fw_table.h. The unfortunate circular inclusion of linux/acpi.h is needed for fw_table.h due fw_table code needing the defined acpi structs in order to build. Fixes: a103f46633fd ("acpi: Move common tables helper functions to common lib") Reported-by: Linus Walleij Suggested-by: Rafael J. Wysocki Signed-off-by: Dave Jiang --- include/linux/acpi.h | 23 ++++++++++++----------- include/linux/fw_table.h | 1 - 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 54189e0e5f41..2789beb26138 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -15,7 +15,6 @@ #include #include #include -#include struct irq_domain; struct irq_domain_ops; @@ -25,16 +24,6 @@ struct irq_domain_ops; #endif #include -#ifdef CONFIG_ACPI_TABLE_LIB -#define EXPORT_SYMBOL_ACPI_LIB(x) EXPORT_SYMBOL_NS_GPL(x, ACPI) -#define __init_or_acpilib -#define __initdata_or_acpilib -#else -#define EXPORT_SYMBOL_ACPI_LIB(x) -#define __init_or_acpilib __init -#define __initdata_or_acpilib __initdata -#endif - #ifdef CONFIG_ACPI #include @@ -48,6 +37,18 @@ struct irq_domain_ops; #include #include +#include + +#ifdef CONFIG_ACPI_TABLE_LIB +#define EXPORT_SYMBOL_ACPI_LIB(x) EXPORT_SYMBOL_NS_GPL(x, ACPI) +#define __init_or_acpilib +#define __initdata_or_acpilib +#else +#define EXPORT_SYMBOL_ACPI_LIB(x) +#define __init_or_acpilib __init +#define __initdata_or_acpilib __initdata +#endif + static inline acpi_handle acpi_device_handle(struct acpi_device *adev) { return adev ? adev->handle : NULL; diff --git a/include/linux/fw_table.h b/include/linux/fw_table.h index ff8fa58d5818..a722300c215b 100644 --- a/include/linux/fw_table.h +++ b/include/linux/fw_table.h @@ -26,7 +26,6 @@ struct acpi_subtable_proc { }; #include -#include union acpi_subtable_headers { struct acpi_subtable_header common;