Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2351054rdb; Mon, 20 Nov 2023 08:39:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IH22WIyXAlKpRODqUlq7eVoqUMm++Ma5lWWaSgvPd2muRWf17Do4PKttByjpSktiqBG0XFp X-Received: by 2002:a05:6a00:cc5:b0:6cb:a27f:5065 with SMTP id b5-20020a056a000cc500b006cba27f5065mr3301881pfv.34.1700498348690; Mon, 20 Nov 2023 08:39:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700498348; cv=none; d=google.com; s=arc-20160816; b=LrYlmqxRZB9NP+Zo94x2BjRl+XVsDG4zWpR9RrtAIZJVIZF2rTiIEar8h0iUZUe6Kj Fi2a3489OE0fqLKv5681wb7KBEllnpVbm3EB2JT0owswd/XVRDqexS8bqEtV5jvHuGyP DfYOworkDpZW0CBCrmiXkoTc5wUbr6nN3s0RR9vEvdjavjBD7fAUgUx/LRdNRfoG68rU 2npf4q9KAGNzD65lCRwPpaePvc24IZAw7vf+QFHA1SwxCCcvJWFpzsGqtjxCcoJGlT/V M5A8r5kmAGRNvv5mjyZoQkbEejf2QlzC/duS/5yFM2k/3OyUe3i/1s3GAvbOQ+5oBbRt QG7A== 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=2Mf0NHfbjCoQ5EJn1uMM7ePwXhzj5M1BQMhFBYGiXUo=; fh=HKyq825a4860/4W2zbnds0oSoTq+FG0Y+C78Fe8p124=; b=nZxB6mp24VCxtl65Q2oepMbUiNOhn5gnGJ82/KnmcToiws72ycjq3CXVzztQujEcEZ +3WjXPHiWuGeAQyN2Es+kpULiZZchAOX2Mii/iRtJ6UP5OK+v1lA3SBjmccxF/hAixYj Ak5PvUI85sFUJ6FL/TCNwLm2KhWgV9suxPwlWuqRBiztVLh22Y0YdrZs12QhWk0aSvuw XhdcST9EUbkeTNI3f0wden0TZYsZ1MpjsdEuJPsD4AnSF2GhUC44G6ZxcgwAUIJM9SCK XbQU4m//0cKH3Q5XSaiO/TjzKj59OuVMqKmJMIcqvhc1AwViietrRxWahkDCN5ZmNb/o OpAw== 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:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id q14-20020a056a00084e00b006cb68d849afsi4577472pfk.280.2023.11.20.08.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 08:39:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 6C02B8031122; Mon, 20 Nov 2023 08:38:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231839AbjKTQiw convert rfc822-to-8bit (ORCPT + 99 others); Mon, 20 Nov 2023 11:38:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231444AbjKTQiv (ORCPT ); Mon, 20 Nov 2023 11:38:51 -0500 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B2F1A1; Mon, 20 Nov 2023 08:38:44 -0800 (PST) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1cc28719cb0so8098135ad.0; Mon, 20 Nov 2023 08:38:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700498324; x=1701103124; 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=bQOioIBEe44MwPtkyvqYFQAPmWMTxr0AHcSiFY3JvEw=; b=DnMQudJR3Wr000u/XnmjMYt2A53FuvP8uzDUW823YlkmghXdCM5i1gY/U9Pg21fI6N TT4NdHgZVXsMe95I4wZ3Oq5Yj8001scT01LUkPp8xNXK2/yFoilF49kFW8B2qmWFyy3a 4lWsbES7L4/3vpfzhtCXEGmA29XR2ArwGGXfY2pY+rdI0BBdMxhp5IxJK7iCsNf3SiZU TksD4eC5W83vGD+MStab9ROqXvcMaovdq+MmqlTcOzKZTKMZa8OTVTsbUnXUarFseS9b c006qR++YBT4FsiXJw3XJlAM6XHQlVteF+TNQvtZvVDf3hyz6LTpSdfklUdWzQKS5pL+ VarA== X-Gm-Message-State: AOJu0YzDTui567Q3OQ4E/KKPxu1kiAx6l4uBDubDqsnDnoN9y2C1vHnk HtefUtKoHFuss7vviFDUXynf9C4IBIxstB5rXYY= X-Received: by 2002:a05:6a20:e125:b0:187:df59:5c43 with SMTP id kr37-20020a056a20e12500b00187df595c43mr12459064pzb.2.1700498323819; Mon, 20 Nov 2023 08:38:43 -0800 (PST) MIME-Version: 1.0 References: <20231114-arm-build-bug-v1-1-458745fe32a4@linaro.org> <41160dbf-d8c8-4dc0-9fda-42cc97df5b77@intel.com> In-Reply-To: <41160dbf-d8c8-4dc0-9fda-42cc97df5b77@intel.com> From: "Rafael J. Wysocki" Date: Mon, 20 Nov 2023 17:38:32 +0100 Message-ID: Subject: Re: [PATCH] ACPI: acenv: Permit compilation from within the kernel To: Dave Jiang Cc: "Rafael J. Wysocki" , Sam Edwards , Linus Walleij , Len Brown , Robert Moore , Jonathan Cameron , Dan Williams , Hanjun Guo , Arnd Bergmann , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 08:38:59 -0800 (PST) On Mon, Nov 20, 2023 at 5:19 PM Dave Jiang wrote: > > > > On 11/20/23 08:46, Rafael J. Wysocki wrote: > > On Tue, Nov 14, 2023 at 7:09 PM Sam Edwards wrote: > >> > >> On 11/13/23 16:08, Linus Walleij wrote: > >>> 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__. > >> > >> Hi Linus, > >> > >> I saw the same baremetal-compiler error here on the ARM64 side of the > >> fence, and narrowed the problem to the same commit as you. > >> > >>> > >>> This is because the header is now > >>> in the include path for : > >> > >> More generally, I think it's because of this addition to linux/acpi.h: > >> +#include > >> > >> linux/acpi.h is supposed to ensure _LINUX is defined (if it isn't > >> already done by a non-baremetal compiler) before we start pulling in > >> ACPICA includes, so that ACPICA knows the platform. But because > >> fw_table.h contains: > >> #include > >> #include > >> > >> ...the circular include does nothing (linux/acpi.h's include guard stops > >> the include before _LINUX is defined) and we end up pulling in > >> acpi/acpi.h before we're ready. > > Not including either causes compile errors for me. Interesting. What errors do you get if you include linux/acpi.h only? It should not be necessary to include acpi/acpi.h in addition to linux/acpi.h, because the latter is expected to include the former. If it doesn't do that, something is amiss. > And directly including acpi/acpi.h w/o linux/acpi.h causes triggering the #error and some other stuff: > > ./include/acpi/platform/aclinux.h:18:2: error: #error "Please don't include directly, include instead." > 18 | #error "Please don't include directly, include instead." > | ^~~~~ > > > Only including linux/acpi.h: > In file included from ./include/linux/acpi.h:18, > from init/main.c:30: > ./include/linux/fw_table.h:32:37: error: field ‘common’ has incomplete type > 32 | struct acpi_subtable_header common; > | ^~~~~~ > ./include/linux/fw_table.h:33:36: error: field ‘hmat’ has incomplete type > 33 | struct acpi_hmat_structure hmat; > | ^~~~ > ./include/linux/fw_table.h:34:40: error: field ‘prmt’ has incomplete type > 34 | struct acpi_prmt_module_header prmt; > | ^~~~ > ./include/linux/fw_table.h:35:33: error: field ‘cedt’ has incomplete type > 35 | struct acpi_cedt_header cedt; > | ^~~~ > > > > > > Yes, that's the problem AFAICS. Dave? > > > > What about moving the fw_table.h include in linux/acpi.h below the > > mutex.h one, along with the EXPORT_SYMBOL_ACPI_LIB-related > > definitions? > > This builds cleanly for me. OK, so I'm wondering if this also helps the other people in this thread.