Message ID | 20231008082827.279154-1-yaolu@kylinos.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1272587vqo; Sun, 8 Oct 2023 01:29:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHapVale69oYLVBeboGBkMIZtbUA73oSwFFefPm+jn8eS67w7Ei/hXC5TIJjwd14ZQOJFEB X-Received: by 2002:a05:6358:7e49:b0:145:707f:ebe1 with SMTP id p9-20020a0563587e4900b00145707febe1mr13229116rwm.12.1696753741533; Sun, 08 Oct 2023 01:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696753741; cv=none; d=google.com; s=arc-20160816; b=lXMacbyvdVlv8zi4lArHBM6dG+HoOM1T6GNdGOIcTyqm17HvyoNp2X4yaIadaT50iJ d167lNFrA9PYS13TZKqMqotWYU9z3nk61yZXa770u9kYIMZFVQAiB6v5VtCZEa+rrCek GV1tzWMCHe2zWJiRb7/9xv+0wCsjrUe5z3DhMrW+mY2kw2i4jgbp0DQJ+6YptEnvlAFU 1sDcb/EBFlrRjnHjJvRpGYJvct3Cm5sD4j8TqCRIGJGnWY2PmBUAWrj+sUZkMGoMvlSR 1ieUmRLBhFWzUGyYIimTPQAdKZyCedVpds5sIxTPYjwNRZeSJsFBrmPebfKyvqAeil9g XdcA== 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 :message-id:date:subject:cc:to:from; bh=LJ5ghyqI3gQEXSmaPYCvlZ/g5erk2hmVUiLbnEaaHz8=; fh=JzcZ2nd9DsUnzG2xZAkmMP0j1nYPj8+QUzyugTggKPU=; b=LEmANp9ND7KHhq8jY2lLr4d9pflGpqUMxY3fwZWgxwNi+lyzs6khpae1WAosWzjswB px0PNld1rrse0cuYFKJ6tSl7BCKhLO67ee8hbwfburxQ3AZiedzl2RGtZEs9YH6AZSSa z3P/FhQeI2QkIU3VzXWryQmdkkrmHctWNT/WsKEc88QVuVm0jQk+HTiVe226H9kg9c9K 562yXlB5C0nQOLRNutSxvA9vv0BzNlVS7z/K+P/ke41a9a5C4kMJqa9sH483xKnXLCzd cqeZV35SYUhfHNFTReaXmoTlL49GsO6KWoVrsFKzl/GN2JUQkk4VeV35zmK6Ofv9qjzN yb8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h12-20020a170902f7cc00b001c604f8de9fsi6967057plw.631.2023.10.08.01.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 01:29:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B2ABF804B038; Sun, 8 Oct 2023 01:29:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234237AbjJHI2r (ORCPT <rfc822;pusanteemu@gmail.com> + 17 others); Sun, 8 Oct 2023 04:28:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234118AbjJHI2p (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 8 Oct 2023 04:28:45 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55277C5 for <linux-kernel@vger.kernel.org>; Sun, 8 Oct 2023 01:28:43 -0700 (PDT) X-UUID: d81ea7d0ab2e484db2894242fdc67240-20231008 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:bc513836-fd88-4365-9f67-0f81455eb21e,IP:5,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:0 X-CID-INFO: VERSION:1.1.32,REQID:bc513836-fd88-4365-9f67-0f81455eb21e,IP:5,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:0 X-CID-META: VersionHash:5f78ec9,CLOUDID:dea2ce14-4929-4845-9571-38c601e9c3c9,B ulkID:2310081553314Y00UXH7,BulkQuantity:1,Recheck:0,SF:17|19|44|38|24|102, TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:41,QS:nil,BEC:nil,COL:0, OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_FSI,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD X-UUID: d81ea7d0ab2e484db2894242fdc67240-20231008 X-User: yaolu@kylinos.cn Received: from localhost.localdomain [(116.128.244.169)] by mailgw (envelope-from <yaolu@kylinos.cn>) (Generic MTA) with ESMTP id 515217298; Sun, 08 Oct 2023 16:28:31 +0800 From: yaolu <yaolu@kylinos.cn> To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, yaolu <yaolu@kylinos.cn> Subject: [PATCH] x86/msi: Fix compile error "incomplete typedef 'msi_alloc_info_t'" Date: Sun, 8 Oct 2023 16:28:27 +0800 Message-Id: <20231008082827.279154-1-yaolu@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 08 Oct 2023 01:29:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779175251578142243 X-GMAIL-MSGID: 1779175251578142243 |
Series |
x86/msi: Fix compile error "incomplete typedef 'msi_alloc_info_t'"
|
|
Commit Message
Lu Yao
Oct. 8, 2023, 8:28 a.m. UTC
When compiling the x86 kernel, if X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || PCI_MSI is not enabled in '.config' and GENERIC_MSI_IRQ is selected, the following compilation error will occur: > include/linux/gpio/driver.h:38:19: error: > field 'msiinfo' has incomplete type > kernel/irq/msi.c:752:5: error: invalid use of incomplete typedef > 'msi_alloc_info_t' {aka 'struct irq_alloc_info'} > kernel/irq/msi.c:740:1: error: control reaches end of non-void function This is because 'X86_LOCAL_APIC' is not defined, but file such as 'kernel/irq/msi.c' only depends on 'GENERIC_MSI_IRQ', and uses 'struct msi_alloc_info_t'. When enable 'GENERIC_MSI_IRQ' will select 'IRQ_DOMAIN_HIERARCHY', so exposing this struct using 'IRQ_DOMAIN_HIERARCHY' rather than 'X86_LOCAL_APIC'. Signed-off-by: yaolu <yaolu@kylinos.cn> --- arch/x86/include/asm/hw_irq.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Comments
Hi, On 10/8/23 01:28, yaolu wrote: > When compiling the x86 kernel, if X86_64 || SMP || X86_32_NON_STANDARD || > X86_UP_APIC || PCI_MSI is not enabled in '.config' and GENERIC_MSI_IRQ is > selected, the following compilation error will occur: > >> include/linux/gpio/driver.h:38:19: error: >> field 'msiinfo' has incomplete type >> kernel/irq/msi.c:752:5: error: invalid use of incomplete typedef >> 'msi_alloc_info_t' {aka 'struct irq_alloc_info'} >> kernel/irq/msi.c:740:1: error: control reaches end of non-void function > > This is because 'X86_LOCAL_APIC' is not defined, but file such as > 'kernel/irq/msi.c' only depends on 'GENERIC_MSI_IRQ', and uses > 'struct msi_alloc_info_t'. When enable 'GENERIC_MSI_IRQ' will select > 'IRQ_DOMAIN_HIERARCHY', so exposing this struct using > 'IRQ_DOMAIN_HIERARCHY' rather than 'X86_LOCAL_APIC'. > > Signed-off-by: yaolu <yaolu@kylinos.cn> Thank for the patch. This reduces the build error count from around 190 down to two remaining problems for me: ../arch/x86/kernel/hpet.c: In function ‘hpet_create_irq_domain’: ../arch/x86/kernel/hpet.c:550:13: error: ‘x86_vector_domain’ undeclared (first use in this function) 550 | if (x86_vector_domain == NULL) | ^~~~~~~~~~~~~~~~~ ../arch/x86/kernel/hpet.c:550:13: note: each undeclared identifier is reported only once for each function it appears in ../arch/x86/kernel/hpet.c: In function ‘hpet_assign_irq’: ../arch/x86/kernel/hpet.c:600:9: error: implicit declaration of function ‘init_irq_alloc_info’ [-Werror=implicit-function-declaration] 600 | init_irq_alloc_info(&info, NULL); | ^~~~~~~~~~~~~~~~~~~ I haven't looked into how to fix this yet... > --- > arch/x86/include/asm/hw_irq.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h > index 551829884734..b02c3cd3c0f6 100644 > --- a/arch/x86/include/asm/hw_irq.h > +++ b/arch/x86/include/asm/hw_irq.h > @@ -28,7 +28,7 @@ > #include <asm/irq.h> > #include <asm/sections.h> > > -#ifdef CONFIG_X86_LOCAL_APIC > +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY > struct irq_data; > struct pci_dev; > struct msi_desc; > @@ -105,10 +105,10 @@ static inline void irq_complete_move(struct irq_cfg *c) { } > #endif > > extern void apic_ack_edge(struct irq_data *data); > -#else /* CONFIG_X86_LOCAL_APIC */ > +#else /* CONFIG_IRQ_DOMAIN_HIERARCHY */ > static inline void lock_vector_lock(void) {} > static inline void unlock_vector_lock(void) {} > -#endif /* CONFIG_X86_LOCAL_APIC */ > +#endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */ > > /* Statistics */ > extern atomic_t irq_err_count;
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index 551829884734..b02c3cd3c0f6 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h @@ -28,7 +28,7 @@ #include <asm/irq.h> #include <asm/sections.h> -#ifdef CONFIG_X86_LOCAL_APIC +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY struct irq_data; struct pci_dev; struct msi_desc; @@ -105,10 +105,10 @@ static inline void irq_complete_move(struct irq_cfg *c) { } #endif extern void apic_ack_edge(struct irq_data *data); -#else /* CONFIG_X86_LOCAL_APIC */ +#else /* CONFIG_IRQ_DOMAIN_HIERARCHY */ static inline void lock_vector_lock(void) {} static inline void unlock_vector_lock(void) {} -#endif /* CONFIG_X86_LOCAL_APIC */ +#endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */ /* Statistics */ extern atomic_t irq_err_count;