From patchwork Wed Nov 22 15:33:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Jiang X-Patchwork-Id: 13465051 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 658B6C61D97 for ; Wed, 22 Nov 2023 15:34:31 +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=bTRxlOdV5gx4qETPudrJ7vZrO8E+Mw1GUxApb5UPtbQ=; b=AOk9M0LOTqWAbV 1NQwIt/GGbOcetuxef9B2QqxQwTKOVmkg9QOeU+M84olBmZbhTqqbSlUmq4e34uY4FzVGmuT6vVv7 rhYwJVR/Ss3SuJofKNYwEw3g6zUXu9TY5NbLGJ/x1UI+W/zM5UOhUjRd+O4kxvAcTJ7twE+IKFNDz R/Q9lGuV9H2FPHpE87lr+Ys4NYHri8ZjAZiN1jC08kNUAHLPwCnhBY0iG5KlJupVTEE/+NWauWHAz JVURa3B7M4h6rcUrKlFqeK492dCVPDXV8fISxVfTMxJ97li89+mxwsA4Y1/LYKlORKnl8+jfkzG+x j4iXbgJG1faCBP6uDeng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r5pEq-002H5n-2F; Wed, 22 Nov 2023 15:34:04 +0000 Received: from mgamail.intel.com ([134.134.136.126]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r5pEn-002H41-0r for linux-arm-kernel@lists.infradead.org; Wed, 22 Nov 2023 15:34:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700667241; x=1732203241; h=subject:from:to:cc:date:message-id:mime-version: content-transfer-encoding; bh=7Y9Z3YK8/R4dJKnxWdN1ttjo2dFNQU8UOECE2bBDFfA=; b=k3tZbtK/LJ6vKpzVauXZllCBDVfBN755d35hWRfpjN8BvzSf1GVeqRMf SXkqTn5KejVQSPGW8csK8BD7nM4xMKe9iMwnLrHR/4XzpBptWfOVyDdeT X6AhgnkqGAGQUfSxEoQl5+iK/gAXIoLhZWTm04QB3s7TDO6fjVkDAo0fZ uMltRiWL4Xf9GJNgLsD3BZBZrMwK9c9mZPCWBuUTlKioJG+YQYyBdb5gA uypI7eWiDSYOjMDzOMEnZ9ot/hx/xVlvIhzto5bmtQYSsEG2i6HZsdJP4 kLLyJATTPrysgVK/C91Rvcf34ejjTkxgtulq3yoW6XRb89i1vtTxFTOKZ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="377104710" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="377104710" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 07:33:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="770645824" X-IronPort-AV: E=Sophos;i="6.04,219,1695711600"; d="scan'208";a="770645824" Received: from tshtalsx-mobl.gar.corp.intel.com (HELO [192.168.1.177]) ([10.213.178.236]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 07:33:53 -0800 Subject: [PATCH v3] 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: Wed, 22 Nov 2023 08:33:53 -0700 Message-ID: <170066723324.2477261.2506149141979712937.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-20231122_073401_356534_29B366F1 X-CRM114-Status: GOOD ( 13.77 ) 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. Replace linux/fw_table.h include in fw_table.c with linux/acpi.h. 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") Closes: https://lore.kernel.org/linux-acpi/20231114-arm-build-bug-v1-1-458745fe32a4@linaro.org/ Reported-by: Linus Walleij Suggested-by: Rafael J. Wysocki Tested-by: Linus Walleij Signed-off-by: Dave Jiang Acked-by: Rafael J. Wysocki Acked-by: Dan Williams --- v3: - Drop fw_table.h in fw_table.c since acpi.h already included. (Rafael) 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 | 2 +- 3 files changed, 12 insertions(+), 15 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..294df54e33b6 100644 --- a/lib/fw_table.c +++ b/lib/fw_table.c @@ -7,7 +7,7 @@ * Copyright (C) 2023 Intel Corp. */ #include -#include +#include #include #include #include