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: 168003 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp949026vqb; Tue, 21 Nov 2023 14:19:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIU19llJ8kyo8mf/5x+sOzTBSUyhWErocaEAwTfxqhxpAD47P0vB/lalh31pkaJpJ4ST8J X-Received: by 2002:a05:6a20:8e02:b0:188:2637:9242 with SMTP id y2-20020a056a208e0200b0018826379242mr456747pzj.47.1700605169707; Tue, 21 Nov 2023 14:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700605169; cv=none; d=google.com; s=arc-20160816; b=rSDXMm4/xW6Hqo6vAzH1xYn/6qefw0WN/TBuCm+/f8556QeVKNeU3w0Uxll+bowhvy FaSP9toT1yv+2S7kELNsHEME+GW1TL6tfsMmmomUeob0YGJaLJkStNqw6MFEvMeJP6Xj WBM77eiSXOWgU2yP1OD4hfctcILxpg8V+kpvFabUA9rKdIwfQpDspmo2XiS24cUNM7Tk Dtsh8ojfrfhQYL/t95wldec3lmRLoB28lU4weRj6bKOkJ3wuIaa6FsRzlQBqauJvJT/P XujQX5O7bJRtxL1DvU8jZih2CyXeJAgccG3pgRtr7gYy/Vj8OK+Hly150Sk9FeUvr1b1 PcvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=HRo1d9jUevqojdCLSPOscHY+mglK+y7oYHeF5UwACeI=; fh=7Vyt6mm2N6z/OJQ1EdTd28kTnum7FM2FtSpSqy59wCg=; b=sqxfyJoh6SjL+ozfU0iEl7cgpw9Wnxa4zBdHzRysxsaETT1op+chbC8hYiSSdVMjmc uocRoJ2LEY3raZYLuBaFX5K9Tbud9Ba/WTRDRRu6U66I8wsp+GjfbYkXzlx3IfkA3adJ l2akQgJQgiBJhH4g0hLooycl5o6mM1ripvU9XpGf/8PtCAV8BWrc4hN6iuH9jceQO30w qou2fIPYksH81LxMpEv0/Om+kpD5t3/x0YBwWz4xVLnXBCW8+gHJThFcO7wCfuDjYdkb 0AE2HhP3BGe7z9vYxVQiYpvaMu5Ve3xM/iE5F+SoFYHEw9neZFuifZ/fynuJ+AmedLDD CHxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JLYntSmD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id 196-20020a6301cd000000b005b8f7bbeb92si11071605pgb.153.2023.11.21.14.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 14:19:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JLYntSmD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 832FE802A032; Tue, 21 Nov 2023 14:19:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233054AbjKUWTX (ORCPT + 99 others); Tue, 21 Nov 2023 17:19:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjKUWTW (ORCPT ); Tue, 21 Nov 2023 17:19:22 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0056191; Tue, 21 Nov 2023 14:19:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700605158; x=1732141158; h=subject:from:to:cc:date:message-id:mime-version: content-transfer-encoding; bh=80Z6V0+UFCndLA11Ha1TxeEnx/2m86v49AN9qelggW4=; b=JLYntSmDgLG7/JaITcaawUq+K5YoajJyHX3zz6En1K8rlp1c3/wGiEiU kwLdsLspF9mTqN2BHLGe8eUKTkeg/Crk5TzNCZAb3kAn1eQJtrpeM9gJx um2U4WTY128uWkImvzlbSQt3XBFUt5bct4Z4eUQUdKhp7AkJqO4eZL5Wl jVZbFwxXhS9JRqDwnpzSK8hV0ZQ6rjiyb2ybUt51/vdC99+URYBp2UxjO N92lET3VxG9RtJGgQvBdbsM0O45ruLfxwMHxrxPrpt0QwgTICp028rfoB uQXGQqhjUrVjb3Hou5o1oqCwFgs7+rNfdD4CnNTU1fSAzaeIHb/MBsO4T Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="395856500" X-IronPort-AV: E=Sophos;i="6.04,216,1695711600"; d="scan'208";a="395856500" 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-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 14:19:22 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783189812548936754 X-GMAIL-MSGID: 1783213766890067145 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