From patchwork Tue Nov 21 22:19:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Jiang X-Patchwork-Id: 13463700 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 1AA41C61D97 for ; Tue, 21 Nov 2023 22:19:51 +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=ZpO3uFnMD9ghtUjmxeOxXVsr87HI1e1bQDmBOeRGuJI=; b=kJUqaJM7jbVa3R j+yBnHR/SHrM5hIiDNDU0maS7VDb/JoE3rfv/pAwDqmg6UeLyB0fXilIAElAynKdAWWomILwCKVUP uytD/UzrB0xzI4BgtNY5CjfKifvKON0vTS3OziIoBCLToA8n0RKuYhWC1Npq0MHi4M9nDrtPNB8Jr WVHQvBGN6Bz0gE1LrF3AP1v9Q38xQe1GEOFpOT3H0TvhFQIRjdpNIPgtwEt5sDb1VQ8mevY91sfA0 LCCxk6xHcY1Mx5cuNBdnbxtrfH/SozAzVQPyWdkvgggK0G5RT+BzZi/tx7UGBos3KNDvuG0VvOHmf fFYGLwGjL8viK1x72EZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r5Z5W-000ARW-0w; Tue, 21 Nov 2023 22:19:22 +0000 Received: from mgamail.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r5Z5T-000AR8-10 for linux-arm-kernel@lists.infradead.org; Tue, 21 Nov 2023 22:19:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700605159; x=1732141159; h=subject:from:to:cc:date:message-id:mime-version: content-transfer-encoding; bh=80Z6V0+UFCndLA11Ha1TxeEnx/2m86v49AN9qelggW4=; b=ScXaEQ7nUx57gOPAyfBNHLQ3viTxdL5bGSQeTMxW1YK8El14UkQu8ATs 1f7WJ+5oKX4LVQ4kIdWP4L1+KsNJSirBggbknN7Wd0uqIwW93MX2dgZRH qa3kbbIkptnCiiBzMWDVPxRxBxUygU6ERpY14ofSPrmZikv516SkTMsSM 1frP2MFJEW8NTF/5HukA4pZQWb8W0sh2a3AJp1J+5xtz9rwhpPbGqBCwW Kjefjh8T08PvRTZ/yHerZxEKVjYC4QjQUyEQBHwBSgsWxBsgMm8xR+97i LmdyPpiLODUxPkS746HMk4B1Aon0j4Aqu4ICXES7i5r/rKJIX7t5t8UtQ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="395856503" X-IronPort-AV: E=Sophos;i="6.04,216,1695711600"; d="scan'208";a="395856503" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 14:19:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="837183434" X-IronPort-AV: E=Sophos;i="6.04,216,1695711600"; d="scan'208";a="837183434" 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 14:19:16 -0800 Subject: [PATCH v2] 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, cfsworks@gmail.com Date: Tue, 21 Nov 2023 15:19:16 -0700 Message-ID: <170060515641.2447486.11798332619205301829.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_141919_411755_0708907F X-CRM114-Status: GOOD ( 13.75 ) 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 [1] moving the fw_table.h include in linux/acpi.h to below the linux/mutex.h. Remove the two includes in fw_table.h. Add include of linux/acpi.h in fw_table.c before the fw_table.h include. Link: https://lore.kernel.org/linux-acpi/CAJZ5v0idWdJq3JSqQWLG5q+b+b=zkEdWR55rGYEoxh7R6N8kFQ@mail.gmail.com/ 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 Tested-by: Linus Walleij --- v2: - Remove linux/acpi.h include as well in fw_table.h. (Sam) --- include/linux/acpi.h | 22 +++++++++++----------- include/linux/fw_table.h | 3 --- lib/fw_table.c | 1 + 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 54189e0e5f41..4db54e928b36 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,22 +24,13 @@ 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 #include #include #include +#include #include #include @@ -48,6 +38,16 @@ struct irq_domain_ops; #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..ca49947f0a77 100644 --- a/include/linux/fw_table.h +++ b/include/linux/fw_table.h @@ -25,9 +25,6 @@ struct acpi_subtable_proc { int count; }; -#include -#include - union acpi_subtable_headers { struct acpi_subtable_header common; struct acpi_hmat_structure hmat; diff --git a/lib/fw_table.c b/lib/fw_table.c index b51f30a28e47..c4831f3378be 100644 --- a/lib/fw_table.c +++ b/lib/fw_table.c @@ -7,6 +7,7 @@ * Copyright (C) 2023 Intel Corp. */ #include +#include #include #include #include