Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp1184208rdf; Wed, 22 Nov 2023 07:43:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHA6HQKWFeF7rD214M+yeihB9E/D8NxE+dRTTOFSV3Om+fHu6OkRFPV/a4fPV8r34AT7g3T X-Received: by 2002:a05:6a00:3992:b0:6c3:41fd:3a3e with SMTP id fi18-20020a056a00399200b006c341fd3a3emr2770576pfb.27.1700667788906; Wed, 22 Nov 2023 07:43:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700667788; cv=none; d=google.com; s=arc-20160816; b=gzlrDH7MkoM2D/X2zTHGSSzeX7wICQFvld9F8VRj199hEtwPHyPLo7QSLmK+79wu2Y 0WrVU7pclpkXUkShlutsTkn0qyjappqbN9gAoIgyeYIFTp9No5ZrtTcbfEtF5U7ZvcRv isxxAh24SjG1gp6JqWtW8oWRMxyuoSuDiPqGVpogNUT+R2ZDm75/JmVHC6EQiV6NYOo0 V60kj2REUc3q63qYarcxO/iuIFTkUYM7a4ETvmDPmyHCT4k8cL2+5ai3eZN3u2pQ9m6H 5rm/fBhjJs0nzTRA8fKu8OR0MdjDJqUZFx8AumLHthBB2EzxKEaq5fyEf1qlsx5wv/EF q/Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=bP2RlcdsHF5cfgRyjDVty4wcxliMBNXWFciN2jTXwdE=; fh=Ri/KwhA3ZtsFtcXMsC7W3O9Rg+WqS9JYrkhRG0dgRWc=; b=X36EjKn6E/8TXdGbButgWn5sD0z8m0iNTXkg8crFFT2HjzDCl/qj/tRHhAfi73XZXz CnWPBIvZkyVm70iDY3Wm9bul55fOcZ+quNfwRGIEYeymre1B9uF8IcZUub3u8uViU2vK 9t62ZJ0iPRgDt7memKuEVwSqmJ7F0pE8azeguEj/67nCZekvGKiHoMlGgIXcOtduYAfE Qnyy5Bv/ZnFz9CKwXkvjG2qfPWrQ3vakPGy7KmFCR+HsreVxzz07ayYj1Ag18JB2NSSd IyQutbmGfUwKEWC/d2bbudDuebNaNZsYCVV8JjZIDSODe9dqZqtpeDJDlY1/XO7mKl8Y Plhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bv132-20020a632e8a000000b005bd68976351si12464676pgb.55.2023.11.22.07.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 07:43:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8F16F8093CBC; Wed, 22 Nov 2023 07:41:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344620AbjKVPkB convert rfc822-to-8bit (ORCPT + 99 others); Wed, 22 Nov 2023 10:40:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344547AbjKVPji (ORCPT ); Wed, 22 Nov 2023 10:39:38 -0500 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75E0B49FA; Wed, 22 Nov 2023 07:37:27 -0800 (PST) Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6d7e6a08299so229201a34.0; Wed, 22 Nov 2023 07:37:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700667446; x=1701272246; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/Axuz+35EuK//V55jI0luW/JRmpf/RhvJBWT8L3iWiA=; b=qP4Ve6wHz+J5Ptx5GnnfHFospatxSd47pu+pcFBu3LDYZk5GgBM1Pl1T2Nz8LZM287 bqAEdv41F7RfAyJ0o14+C+bpmhrXn4enAjbxeOSz2Kjnr0L1V7drV5MW8/5BTHz3LnFz Pt/prkIb/xkSdDNhWn4hbbgbIo4JiMSIvTCv9tdjorbvPnul4ICbi0vGHUwR4xS0TwER i4fawXbQTzVJVutOuO0GT2xH7H3VfAw4zDCzBLjjr6GGx6trqP+qS0tR8Uq7tHUuSgcd TpVm0anx7vRn9ALksCSCRGhcpsnVWH2GdvXM/MZHrMABesMp2u8w2c9tqVkdZng6m/jL 0k1Q== X-Gm-Message-State: AOJu0Yzm3RBZjpk+9muauX8FvqR1/BTkcxHZ6BEGWDxXh1xQctMgwRcC 2wVDZ79F8xPe084p1M2KAK8YZ7i61tY/Wjf00VgqMtYh X-Received: by 2002:a05:6870:2401:b0:1f9:5d11:cc7a with SMTP id n1-20020a056870240100b001f95d11cc7amr3211659oap.3.1700667446561; Wed, 22 Nov 2023 07:37:26 -0800 (PST) MIME-Version: 1.0 References: <170066723324.2477261.2506149141979712937.stgit@djiang5-mobl3> In-Reply-To: <170066723324.2477261.2506149141979712937.stgit@djiang5-mobl3> From: "Rafael J. Wysocki" Date: Wed, 22 Nov 2023 16:37:15 +0100 Message-ID: Subject: Re: [PATCH v3] acpi: Fix ARM32 platforms compile issue introduced by fw_table changes To: Dave Jiang Cc: linus.walleij@linaro.org, rafael@kernel.org, "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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 22 Nov 2023 07:41:05 -0800 (PST) On Wed, Nov 22, 2023 at 4:34 PM Dave Jiang wrote: > > 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 > --- > v3: > - Drop fw_table.h in fw_table.c since acpi.h already included. (Rafael) Do you want me to apply this, or do you prefer to route it in a different way? In the latter case, please feel free to add Acked-by: Rafael J. Wysocki to it. > 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 > > >