Message ID | 20231011055749.98840-1-yaolu@kylinos.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp327591vqb; Tue, 10 Oct 2023 22:58:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfutRNWf3kcTJROBpaf7zDFgIgGKFaPQfT1+NBsSL37wCWBoV+fFqYFHJLDLD/tiFQ6iN7 X-Received: by 2002:a17:90a:2dc5:b0:27c:e2d5:abb6 with SMTP id q5-20020a17090a2dc500b0027ce2d5abb6mr4079029pjm.0.1697003913074; Tue, 10 Oct 2023 22:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697003913; cv=none; d=google.com; s=arc-20160816; b=YTE6Qo3sXBcZfQirGr9DWfRPhiihv/p3muNgzTRPQ9P5a3Hz2ZUGR+LV5RgTFpI+qt AakBkaTsn/dPewtPBVFTO9RDT1JZgsYgST4QJur+9G1xCXkAxy2KydQNy0bUa2LwhFFb 5ePIST7FCpt2hWZ8OIwHWGnpK8Qzqz60crNv1FiAQYYUvNaX1BXYQpFaXri2bG9LV05Q 0KrcgIV8RsGJL05D+4qfvkJ9VrwL+0maOf44CJQQlQ0zTmUidjSQo9zzsv8mPkEtVhhc l37dunJ9Hnsbh+MAN6VCFnPOSPifp9CABkjzRAAx8TcZjFGh17PXIIL7aAXmXc6fzHWF DgVQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Yncb0X9AkLla4ex0ak7OinBBty6f3BXM/UMDu/YOP8M=; fh=Uli0oazh7oPSqtnKpDtEw09S0FipZl7wf9ittDApOrY=; b=sKDtrRPT2Cpu3NL+AXYI7vX42KVAMMKvOG1w0IpPsNeWt+qyURGzU+Vlv9RnOVUktG 7mPxbseRSJ/QaSN+PI6rRP4s2/fYIkRUtqewf+sMVD//RZKmU1GPQ0FhwLLMIG+WVHwr U56q+IhMdkCLhgE8L782/LQqZTAH+++ryd6jzvbLlP1ANGTpIbtq1foKBdODjUhr3DEg XjndL9ZMeZv596UaKUWpbmjMOgcQehRX85kTfYmeTlKBjsHAhaJpsAa4/AKEzuHqTBZD IbdSMTJ9gwXvFGOZDVOf6Fbb68CU4hdauTpWwi8uHFTfLfH9gf3IlrABxYdlcCFntRZs n4DQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id nv8-20020a17090b1b4800b0026c198d8182si16737771pjb.105.2023.10.10.22.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 22:58:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 787FE8079B23; Tue, 10 Oct 2023 22:58:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344240AbjJKF6Q (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Wed, 11 Oct 2023 01:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbjJKF6P (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Oct 2023 01:58:15 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 725568E for <linux-kernel@vger.kernel.org>; Tue, 10 Oct 2023 22:58:09 -0700 (PDT) X-UUID: f9ac824e9f20462685694ea3c5f6a613-20231011 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:d99964bf-05f0-4c51-9c6d-3ec5b34a12e5,IP:5,U RL:0,TC:0,Content:-25,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,AC TION:release,TS:-10 X-CID-INFO: VERSION:1.1.32,REQID:d99964bf-05f0-4c51-9c6d-3ec5b34a12e5,IP:5,URL :0,TC:0,Content:-25,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-10 X-CID-META: VersionHash:5f78ec9,CLOUDID:0252e514-4929-4845-9571-38c601e9c3c9,B ulkID:231011104149YJMBUFJ5,BulkQuantity:2,Recheck:0,SF:66|38|24|17|19|44|1 02,TC:nil,Content:0,EDM:5,IP:-2,URL:1,File:nil,Bulk:40,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 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_FSD,TF_CID_SPAM_FSI,TF_CID_SPAM_ULS,TF_CID_SPAM_SNR, TF_CID_SPAM_FAS X-UUID: f9ac824e9f20462685694ea3c5f6a613-20231011 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 1008634985; Wed, 11 Oct 2023 13:57:51 +0800 From: Lu Yao <yaolu@kylinos.cn> To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, rdunlap@infradead.org Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, Lu Yao <yaolu@kylinos.cn> Subject: [PATCH v2] x86/msi: Fix compile error caused by GENERIC_MSI_IRQ and X86_LOCAL_APIC Date: Wed, 11 Oct 2023 13:57:49 +0800 Message-Id: <20231011055749.98840-1-yaolu@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231008082827.279154-1-yaolu@kylinos.cn> References: <20231008082827.279154-1-yaolu@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 22:58:29 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779437575006491060 X-GMAIL-MSGID: 1779437575006491060 |
Series |
[v2] x86/msi: Fix compile error caused by GENERIC_MSI_IRQ and X86_LOCAL_APIC
|
|
Commit Message
Lu Yao
Oct. 11, 2023, 5:57 a.m. UTC
When compiling the x86 kernel, if X86_LOCAL_APIC is not enabled but
GENERIC_MSI_IRQ is selected in '.config', 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 file such as 'kernel/irq/msi.c' only depends on
'GENERIC_MSI_IRQ', and uses 'struct msi_alloc_info_t'. However,
this struct depends on 'X86_LOCAL_APIC'.
When enable 'GENERIC_MSI_IRQ' or 'X86_LOCAL_APIC' will select
'IRQ_DOMAIN_HIERARCHY', so exposing this struct using
'IRQ_DOMAIN_HIERARCHY' rather than 'X86_LOCAL_APIC'.
Under the above conditions, if 'HPET_TIMER' is selected, the following
compilation error will occur:
arch/x86/kernel/hpet.c:550:13: error: ‘x86_vector_domain’ undeclared
arch/x86/kernel/hpet.c:600:9: error: implicit declaration of
function ‘init_irq_alloc_info’
This is because 'x86_vector_domain' is defined in 'kernel/apic/vector.c'
which is compiled only when 'X86_LOCAL_APIC' is enabled. So use
'X86_LOCAL_APIC' to expose these code rather than 'GENERIC_MSI_IRQ'.
Signed-off-by: Lu Yao <yaolu@kylinos.cn>
---
Change from v1:
* Fix arch/x86/kernel/hpet.c compiled error
Thanks to Randy for the feedback.
v1: https://lore.kernel.org/lkml/20231008082827.279154-1-yaolu@kylinos.cn/
---
arch/x86/include/asm/hw_irq.h | 6 +++---
arch/x86/kernel/hpet.c | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
Comments
On 10/10/23 22:57, Lu Yao wrote: > When compiling the x86 kernel, if X86_LOCAL_APIC is not enabled but > GENERIC_MSI_IRQ is selected in '.config', 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 file such as 'kernel/irq/msi.c' only depends on > 'GENERIC_MSI_IRQ', and uses 'struct msi_alloc_info_t'. However, > this struct depends on 'X86_LOCAL_APIC'. > > When enable 'GENERIC_MSI_IRQ' or 'X86_LOCAL_APIC' will select > 'IRQ_DOMAIN_HIERARCHY', so exposing this struct using > 'IRQ_DOMAIN_HIERARCHY' rather than 'X86_LOCAL_APIC'. > > Under the above conditions, if 'HPET_TIMER' is selected, the following > compilation error will occur: > > arch/x86/kernel/hpet.c:550:13: error: ‘x86_vector_domain’ undeclared > > arch/x86/kernel/hpet.c:600:9: error: implicit declaration of > function ‘init_irq_alloc_info’ > > This is because 'x86_vector_domain' is defined in 'kernel/apic/vector.c' > which is compiled only when 'X86_LOCAL_APIC' is enabled. So use > 'X86_LOCAL_APIC' to expose these code rather than 'GENERIC_MSI_IRQ'. > > Signed-off-by: Lu Yao <yaolu@kylinos.cn> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Thanks. > --- > Change from v1: > * Fix arch/x86/kernel/hpet.c compiled error > Thanks to Randy for the feedback. > v1: https://lore.kernel.org/lkml/20231008082827.279154-1-yaolu@kylinos.cn/ > > --- > arch/x86/include/asm/hw_irq.h | 6 +++--- > arch/x86/kernel/hpet.c | 4 ++-- > 2 files changed, 5 insertions(+), 5 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/kernel/hpet.c b/arch/x86/kernel/hpet.c > index 1648aa0204d9..9904c0d46eba 100644 > --- a/arch/x86/kernel/hpet.c > +++ b/arch/x86/kernel/hpet.c > @@ -52,7 +52,7 @@ unsigned long hpet_address; > u8 hpet_blockid; /* OS timer block num */ > bool hpet_msi_disable; > > -#ifdef CONFIG_GENERIC_MSI_IRQ > +#ifdef CONFIG_X86_LOCAL_APIC > static DEFINE_PER_CPU(struct hpet_channel *, cpu_hpet_channel); > static struct irq_domain *hpet_domain; > #endif > @@ -469,7 +469,7 @@ static void __init hpet_legacy_clockevent_register(struct hpet_channel *hc) > /* > * HPET MSI Support > */ > -#ifdef CONFIG_GENERIC_MSI_IRQ > +#ifdef CONFIG_X86_LOCAL_APIC > static void hpet_msi_unmask(struct irq_data *data) > { > struct hpet_channel *hc = irq_data_get_irq_handler_data(data);
Hi Lu, kernel test robot noticed the following build warnings: [auto build test WARNING on tip/master] [also build test WARNING on tip/x86/core tip/auto-latest linus/master v6.6-rc5 next-20231011] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Lu-Yao/x86-msi-Fix-compile-error-caused-by-GENERIC_MSI_IRQ-and-X86_LOCAL_APIC/20231011-135941 base: tip/master patch link: https://lore.kernel.org/r/20231011055749.98840-1-yaolu%40kylinos.cn patch subject: [PATCH v2] x86/msi: Fix compile error caused by GENERIC_MSI_IRQ and X86_LOCAL_APIC config: i386-buildonly-randconfig-001-20231012 (https://download.01.org/0day-ci/archive/20231012/202310120849.zrfrI44Z-lkp@intel.com/config) compiler: gcc-11 (Debian 11.3.0-12) 11.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231012/202310120849.zrfrI44Z-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202310120849.zrfrI44Z-lkp@intel.com/ All warnings (new ones prefixed by >>): arch/x86/kernel/hpet.c:509:29: error: 'msi_domain_set_affinity' undeclared here (not in a function); did you mean 'irq_can_set_affinity'? 509 | .irq_set_affinity = msi_domain_set_affinity, | ^~~~~~~~~~~~~~~~~~~~~~~ | irq_can_set_affinity >> arch/x86/kernel/hpet.c:516:33: warning: 'struct msi_domain_info' declared inside parameter list will not be visible outside of this definition or declaration 516 | struct msi_domain_info *info, unsigned int virq, | ^~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c: In function 'hpet_msi_init': arch/x86/kernel/hpet.c:520:59: error: invalid use of undefined type 'struct msi_domain_info' 520 | irq_domain_set_info(domain, virq, arg->hwirq, info->chip, NULL, | ^~ arch/x86/kernel/hpet.c: At top level: arch/x86/kernel/hpet.c:527:34: warning: 'struct msi_domain_info' declared inside parameter list will not be visible outside of this definition or declaration 527 | struct msi_domain_info *info, unsigned int virq) | ^~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c:532:15: error: variable 'hpet_msi_domain_ops' has initializer but incomplete type 532 | static struct msi_domain_ops hpet_msi_domain_ops = { | ^~~~~~~~~~~~~~ arch/x86/kernel/hpet.c:533:10: error: 'struct msi_domain_ops' has no member named 'msi_init' 533 | .msi_init = hpet_msi_init, | ^~~~~~~~ >> arch/x86/kernel/hpet.c:533:27: warning: excess elements in struct initializer 533 | .msi_init = hpet_msi_init, | ^~~~~~~~~~~~~ arch/x86/kernel/hpet.c:533:27: note: (near initialization for 'hpet_msi_domain_ops') arch/x86/kernel/hpet.c:534:10: error: 'struct msi_domain_ops' has no member named 'msi_free' 534 | .msi_free = hpet_msi_free, | ^~~~~~~~ arch/x86/kernel/hpet.c:534:27: warning: excess elements in struct initializer 534 | .msi_free = hpet_msi_free, | ^~~~~~~~~~~~~ arch/x86/kernel/hpet.c:534:27: note: (near initialization for 'hpet_msi_domain_ops') arch/x86/kernel/hpet.c:537:15: error: variable 'hpet_msi_domain_info' has initializer but incomplete type 537 | static struct msi_domain_info hpet_msi_domain_info = { | ^~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c:538:10: error: 'struct msi_domain_info' has no member named 'ops' 538 | .ops = &hpet_msi_domain_ops, | ^~~ arch/x86/kernel/hpet.c:538:27: warning: excess elements in struct initializer 538 | .ops = &hpet_msi_domain_ops, | ^ arch/x86/kernel/hpet.c:538:27: note: (near initialization for 'hpet_msi_domain_info') arch/x86/kernel/hpet.c:539:10: error: 'struct msi_domain_info' has no member named 'chip' 539 | .chip = &hpet_msi_controller, | ^~~~ arch/x86/kernel/hpet.c:539:27: warning: excess elements in struct initializer 539 | .chip = &hpet_msi_controller, | ^ arch/x86/kernel/hpet.c:539:27: note: (near initialization for 'hpet_msi_domain_info') arch/x86/kernel/hpet.c:540:10: error: 'struct msi_domain_info' has no member named 'flags' 540 | .flags = MSI_FLAG_USE_DEF_DOM_OPS, | ^~~~~ arch/x86/kernel/hpet.c:540:27: error: 'MSI_FLAG_USE_DEF_DOM_OPS' undeclared here (not in a function) 540 | .flags = MSI_FLAG_USE_DEF_DOM_OPS, | ^~~~~~~~~~~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c:540:27: warning: excess elements in struct initializer arch/x86/kernel/hpet.c:540:27: note: (near initialization for 'hpet_msi_domain_info') arch/x86/kernel/hpet.c: In function 'hpet_create_irq_domain': arch/x86/kernel/hpet.c:553:37: error: invalid application of 'sizeof' to incomplete type 'struct msi_domain_info' 553 | domain_info = kzalloc(sizeof(*domain_info), GFP_KERNEL); | ^ arch/x86/kernel/hpet.c:557:24: error: 'hpet_msi_domain_info' has an incomplete type 'struct msi_domain_info' 557 | *domain_info = hpet_msi_domain_info; | ^~~~~~~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c:557:22: error: invalid use of undefined type 'struct msi_domain_info' 557 | *domain_info = hpet_msi_domain_info; | ^ arch/x86/kernel/hpet.c:558:20: error: invalid use of undefined type 'struct msi_domain_info' 558 | domain_info->data = (void *)(long)hpet_id; | ^~ arch/x86/kernel/hpet.c:580:13: error: implicit declaration of function 'msi_create_irq_domain'; did you mean 'hpet_create_irq_domain'? [-Werror=implicit-function-declaration] 580 | d = msi_create_irq_domain(fn, domain_info, parent); | ^~~~~~~~~~~~~~~~~~~~~ | hpet_create_irq_domain >> arch/x86/kernel/hpet.c:580:11: warning: assignment to 'struct irq_domain *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 580 | d = msi_create_irq_domain(fn, domain_info, parent); | ^ arch/x86/kernel/hpet.c: In function 'hpet_dev_id': arch/x86/kernel/hpet.c:590:40: error: implicit declaration of function 'msi_get_domain_info' [-Werror=implicit-function-declaration] 590 | struct msi_domain_info *info = msi_get_domain_info(domain); | ^~~~~~~~~~~~~~~~~~~ >> arch/x86/kernel/hpet.c:590:40: warning: initialization of 'struct msi_domain_info *' from 'int' makes pointer from integer without a cast [-Wint-conversion] arch/x86/kernel/hpet.c:592:31: error: invalid use of undefined type 'struct msi_domain_info' 592 | return (int)(long)info->data; | ^~ arch/x86/kernel/hpet.c: At top level: arch/x86/kernel/hpet.c:532:30: error: storage size of 'hpet_msi_domain_ops' isn't known 532 | static struct msi_domain_ops hpet_msi_domain_ops = { | ^~~~~~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c:537:31: error: storage size of 'hpet_msi_domain_info' isn't known 537 | static struct msi_domain_info hpet_msi_domain_info = { | ^~~~~~~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c: In function 'hpet_dev_id': arch/x86/kernel/hpet.c:593:1: error: control reaches end of non-void function [-Werror=return-type] 593 | } | ^ cc1: some warnings being treated as errors vim +516 arch/x86/kernel/hpet.c 3d7295eb3003ae David Woodhouse 2020-10-24 514 3d7295eb3003ae David Woodhouse 2020-10-24 515 static int hpet_msi_init(struct irq_domain *domain, 3d7295eb3003ae David Woodhouse 2020-10-24 @516 struct msi_domain_info *info, unsigned int virq, 3d7295eb3003ae David Woodhouse 2020-10-24 517 irq_hw_number_t hwirq, msi_alloc_info_t *arg) 3d7295eb3003ae David Woodhouse 2020-10-24 518 { 3d7295eb3003ae David Woodhouse 2020-10-24 519 irq_set_status_flags(virq, IRQ_MOVE_PCNTXT); 3d7295eb3003ae David Woodhouse 2020-10-24 520 irq_domain_set_info(domain, virq, arg->hwirq, info->chip, NULL, 3d7295eb3003ae David Woodhouse 2020-10-24 521 handle_edge_irq, arg->data, "edge"); 3d7295eb3003ae David Woodhouse 2020-10-24 522 3d7295eb3003ae David Woodhouse 2020-10-24 523 return 0; 3d7295eb3003ae David Woodhouse 2020-10-24 524 } 3d7295eb3003ae David Woodhouse 2020-10-24 525 3d7295eb3003ae David Woodhouse 2020-10-24 526 static void hpet_msi_free(struct irq_domain *domain, 3d7295eb3003ae David Woodhouse 2020-10-24 527 struct msi_domain_info *info, unsigned int virq) 3d7295eb3003ae David Woodhouse 2020-10-24 528 { 3d7295eb3003ae David Woodhouse 2020-10-24 529 irq_clear_status_flags(virq, IRQ_MOVE_PCNTXT); 3d7295eb3003ae David Woodhouse 2020-10-24 530 } 3d7295eb3003ae David Woodhouse 2020-10-24 531 3d7295eb3003ae David Woodhouse 2020-10-24 532 static struct msi_domain_ops hpet_msi_domain_ops = { 3d7295eb3003ae David Woodhouse 2020-10-24 @533 .msi_init = hpet_msi_init, 3d7295eb3003ae David Woodhouse 2020-10-24 534 .msi_free = hpet_msi_free, 3d7295eb3003ae David Woodhouse 2020-10-24 535 }; 3d7295eb3003ae David Woodhouse 2020-10-24 536 3d7295eb3003ae David Woodhouse 2020-10-24 537 static struct msi_domain_info hpet_msi_domain_info = { 3d7295eb3003ae David Woodhouse 2020-10-24 538 .ops = &hpet_msi_domain_ops, 3d7295eb3003ae David Woodhouse 2020-10-24 539 .chip = &hpet_msi_controller, 3d7295eb3003ae David Woodhouse 2020-10-24 540 .flags = MSI_FLAG_USE_DEF_DOM_OPS, 3d7295eb3003ae David Woodhouse 2020-10-24 541 }; 3d7295eb3003ae David Woodhouse 2020-10-24 542 3d7295eb3003ae David Woodhouse 2020-10-24 543 static struct irq_domain *hpet_create_irq_domain(int hpet_id) 3d7295eb3003ae David Woodhouse 2020-10-24 544 { 3d7295eb3003ae David Woodhouse 2020-10-24 545 struct msi_domain_info *domain_info; 3d7295eb3003ae David Woodhouse 2020-10-24 546 struct irq_domain *parent, *d; 3d7295eb3003ae David Woodhouse 2020-10-24 547 struct fwnode_handle *fn; c2a5881c28e5bb David Woodhouse 2020-10-24 548 struct irq_fwspec fwspec; 3d7295eb3003ae David Woodhouse 2020-10-24 549 3d7295eb3003ae David Woodhouse 2020-10-24 550 if (x86_vector_domain == NULL) 3d7295eb3003ae David Woodhouse 2020-10-24 551 return NULL; 3d7295eb3003ae David Woodhouse 2020-10-24 552 3d7295eb3003ae David Woodhouse 2020-10-24 553 domain_info = kzalloc(sizeof(*domain_info), GFP_KERNEL); 3d7295eb3003ae David Woodhouse 2020-10-24 554 if (!domain_info) 3d7295eb3003ae David Woodhouse 2020-10-24 555 return NULL; 3d7295eb3003ae David Woodhouse 2020-10-24 556 3d7295eb3003ae David Woodhouse 2020-10-24 557 *domain_info = hpet_msi_domain_info; 3d7295eb3003ae David Woodhouse 2020-10-24 558 domain_info->data = (void *)(long)hpet_id; 3d7295eb3003ae David Woodhouse 2020-10-24 559 3d7295eb3003ae David Woodhouse 2020-10-24 560 fn = irq_domain_alloc_named_id_fwnode(hpet_msi_controller.name, 3d7295eb3003ae David Woodhouse 2020-10-24 561 hpet_id); 3d7295eb3003ae David Woodhouse 2020-10-24 562 if (!fn) { 3d7295eb3003ae David Woodhouse 2020-10-24 563 kfree(domain_info); 3d7295eb3003ae David Woodhouse 2020-10-24 564 return NULL; 3d7295eb3003ae David Woodhouse 2020-10-24 565 } 3d7295eb3003ae David Woodhouse 2020-10-24 566 c2a5881c28e5bb David Woodhouse 2020-10-24 567 fwspec.fwnode = fn; c2a5881c28e5bb David Woodhouse 2020-10-24 568 fwspec.param_count = 1; c2a5881c28e5bb David Woodhouse 2020-10-24 569 fwspec.param[0] = hpet_id; c2a5881c28e5bb David Woodhouse 2020-10-24 570 c2a5881c28e5bb David Woodhouse 2020-10-24 571 parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_ANY); c2a5881c28e5bb David Woodhouse 2020-10-24 572 if (!parent) { c2a5881c28e5bb David Woodhouse 2020-10-24 573 irq_domain_free_fwnode(fn); c2a5881c28e5bb David Woodhouse 2020-10-24 574 kfree(domain_info); c2a5881c28e5bb David Woodhouse 2020-10-24 575 return NULL; c2a5881c28e5bb David Woodhouse 2020-10-24 576 } c2a5881c28e5bb David Woodhouse 2020-10-24 577 if (parent != x86_vector_domain) c2a5881c28e5bb David Woodhouse 2020-10-24 578 hpet_msi_controller.name = "IR-HPET-MSI"; c2a5881c28e5bb David Woodhouse 2020-10-24 579 3d7295eb3003ae David Woodhouse 2020-10-24 @580 d = msi_create_irq_domain(fn, domain_info, parent); 3d7295eb3003ae David Woodhouse 2020-10-24 581 if (!d) { 3d7295eb3003ae David Woodhouse 2020-10-24 582 irq_domain_free_fwnode(fn); 3d7295eb3003ae David Woodhouse 2020-10-24 583 kfree(domain_info); 3d7295eb3003ae David Woodhouse 2020-10-24 584 } 3d7295eb3003ae David Woodhouse 2020-10-24 585 return d; 3d7295eb3003ae David Woodhouse 2020-10-24 586 } 3d7295eb3003ae David Woodhouse 2020-10-24 587 3d7295eb3003ae David Woodhouse 2020-10-24 588 static inline int hpet_dev_id(struct irq_domain *domain) 3d7295eb3003ae David Woodhouse 2020-10-24 589 { 3d7295eb3003ae David Woodhouse 2020-10-24 @590 struct msi_domain_info *info = msi_get_domain_info(domain); 3d7295eb3003ae David Woodhouse 2020-10-24 591 3d7295eb3003ae David Woodhouse 2020-10-24 592 return (int)(long)info->data; 3d7295eb3003ae David Woodhouse 2020-10-24 593 } 3d7295eb3003ae David Woodhouse 2020-10-24 594
Hi Lu,
kernel test robot noticed the following build errors:
[auto build test ERROR on tip/master]
[also build test ERROR on tip/x86/core tip/auto-latest linus/master v6.6-rc5 next-20231012]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Lu-Yao/x86-msi-Fix-compile-error-caused-by-GENERIC_MSI_IRQ-and-X86_LOCAL_APIC/20231011-135941
base: tip/master
patch link: https://lore.kernel.org/r/20231011055749.98840-1-yaolu%40kylinos.cn
patch subject: [PATCH v2] x86/msi: Fix compile error caused by GENERIC_MSI_IRQ and X86_LOCAL_APIC
config: x86_64-buildonly-randconfig-006-20231012 (https://download.01.org/0day-ci/archive/20231012/202310121805.SVZD3j7K-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231012/202310121805.SVZD3j7K-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310121805.SVZD3j7K-lkp@intel.com/
All errors (new ones prefixed by >>):
arch/x86/kernel/hpet.c:509:22: error: 'msi_domain_set_affinity' undeclared here (not in a function); did you mean 'irq_can_set_affinity'?
509 | .irq_set_affinity = msi_domain_set_affinity,
| ^~~~~~~~~~~~~~~~~~~~~~~
| irq_can_set_affinity
arch/x86/kernel/hpet.c:516:12: warning: 'struct msi_domain_info' declared inside parameter list will not be visible outside of this definition or declaration
516 | struct msi_domain_info *info, unsigned int virq,
| ^~~~~~~~~~~~~~~
arch/x86/kernel/hpet.c: In function 'hpet_msi_init':
>> arch/x86/kernel/hpet.c:520:52: error: dereferencing pointer to incomplete type 'struct msi_domain_info'
520 | irq_domain_set_info(domain, virq, arg->hwirq, info->chip, NULL,
| ^~
arch/x86/kernel/hpet.c: At top level:
arch/x86/kernel/hpet.c:527:13: warning: 'struct msi_domain_info' declared inside parameter list will not be visible outside of this definition or declaration
527 | struct msi_domain_info *info, unsigned int virq)
| ^~~~~~~~~~~~~~~
arch/x86/kernel/hpet.c:532:15: error: variable 'hpet_msi_domain_ops' has initializer but incomplete type
532 | static struct msi_domain_ops hpet_msi_domain_ops = {
| ^~~~~~~~~~~~~~
arch/x86/kernel/hpet.c:533:3: error: 'struct msi_domain_ops' has no member named 'msi_init'
533 | .msi_init = hpet_msi_init,
| ^~~~~~~~
arch/x86/kernel/hpet.c:533:14: warning: excess elements in struct initializer
533 | .msi_init = hpet_msi_init,
| ^~~~~~~~~~~~~
arch/x86/kernel/hpet.c:533:14: note: (near initialization for 'hpet_msi_domain_ops')
arch/x86/kernel/hpet.c:534:3: error: 'struct msi_domain_ops' has no member named 'msi_free'
534 | .msi_free = hpet_msi_free,
| ^~~~~~~~
arch/x86/kernel/hpet.c:534:14: warning: excess elements in struct initializer
534 | .msi_free = hpet_msi_free,
| ^~~~~~~~~~~~~
arch/x86/kernel/hpet.c:534:14: note: (near initialization for 'hpet_msi_domain_ops')
arch/x86/kernel/hpet.c:537:15: error: variable 'hpet_msi_domain_info' has initializer but incomplete type
537 | static struct msi_domain_info hpet_msi_domain_info = {
| ^~~~~~~~~~~~~~~
arch/x86/kernel/hpet.c:538:3: error: 'struct msi_domain_info' has no member named 'ops'
538 | .ops = &hpet_msi_domain_ops,
| ^~~
arch/x86/kernel/hpet.c:538:10: warning: excess elements in struct initializer
538 | .ops = &hpet_msi_domain_ops,
| ^
arch/x86/kernel/hpet.c:538:10: note: (near initialization for 'hpet_msi_domain_info')
arch/x86/kernel/hpet.c:539:3: error: 'struct msi_domain_info' has no member named 'chip'
539 | .chip = &hpet_msi_controller,
| ^~~~
arch/x86/kernel/hpet.c:539:11: warning: excess elements in struct initializer
539 | .chip = &hpet_msi_controller,
| ^
arch/x86/kernel/hpet.c:539:11: note: (near initialization for 'hpet_msi_domain_info')
arch/x86/kernel/hpet.c:540:3: error: 'struct msi_domain_info' has no member named 'flags'
540 | .flags = MSI_FLAG_USE_DEF_DOM_OPS,
| ^~~~~
arch/x86/kernel/hpet.c:540:12: error: 'MSI_FLAG_USE_DEF_DOM_OPS' undeclared here (not in a function)
540 | .flags = MSI_FLAG_USE_DEF_DOM_OPS,
| ^~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/hpet.c:540:12: warning: excess elements in struct initializer
arch/x86/kernel/hpet.c:540:12: note: (near initialization for 'hpet_msi_domain_info')
arch/x86/kernel/hpet.c: In function 'hpet_create_irq_domain':
arch/x86/kernel/hpet.c:553:31: error: dereferencing pointer to incomplete type 'struct msi_domain_info'
553 | domain_info = kzalloc(sizeof(*domain_info), GFP_KERNEL);
| ^~~~~~~~~~~~
arch/x86/kernel/hpet.c:580:6: error: implicit declaration of function 'msi_create_irq_domain'; did you mean 'hpet_create_irq_domain'? [-Werror=implicit-function-declaration]
580 | d = msi_create_irq_domain(fn, domain_info, parent);
| ^~~~~~~~~~~~~~~~~~~~~
| hpet_create_irq_domain
arch/x86/kernel/hpet.c:580:4: warning: assignment to 'struct irq_domain *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
580 | d = msi_create_irq_domain(fn, domain_info, parent);
| ^
arch/x86/kernel/hpet.c: In function 'hpet_dev_id':
arch/x86/kernel/hpet.c:590:33: error: implicit declaration of function 'msi_get_domain_info' [-Werror=implicit-function-declaration]
590 | struct msi_domain_info *info = msi_get_domain_info(domain);
| ^~~~~~~~~~~~~~~~~~~
arch/x86/kernel/hpet.c:590:33: warning: initialization of 'struct msi_domain_info *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
arch/x86/kernel/hpet.c: At top level:
arch/x86/kernel/hpet.c:532:30: error: storage size of 'hpet_msi_domain_ops' isn't known
532 | static struct msi_domain_ops hpet_msi_domain_ops = {
| ^~~~~~~~~~~~~~~~~~~
arch/x86/kernel/hpet.c:537:31: error: storage size of 'hpet_msi_domain_info' isn't known
537 | static struct msi_domain_info hpet_msi_domain_info = {
| ^~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/hpet.c: In function 'hpet_dev_id':
arch/x86/kernel/hpet.c:593:1: error: control reaches end of non-void function [-Werror=return-type]
593 | }
| ^
cc1: some warnings being treated as errors
vim +520 arch/x86/kernel/hpet.c
3d7295eb3003ae David Woodhouse 2020-10-24 503
3d7295eb3003ae David Woodhouse 2020-10-24 504 static struct irq_chip hpet_msi_controller __ro_after_init = {
3d7295eb3003ae David Woodhouse 2020-10-24 505 .name = "HPET-MSI",
3d7295eb3003ae David Woodhouse 2020-10-24 506 .irq_unmask = hpet_msi_unmask,
3d7295eb3003ae David Woodhouse 2020-10-24 507 .irq_mask = hpet_msi_mask,
3d7295eb3003ae David Woodhouse 2020-10-24 508 .irq_ack = irq_chip_ack_parent,
3d7295eb3003ae David Woodhouse 2020-10-24 @509 .irq_set_affinity = msi_domain_set_affinity,
3d7295eb3003ae David Woodhouse 2020-10-24 510 .irq_retrigger = irq_chip_retrigger_hierarchy,
3d7295eb3003ae David Woodhouse 2020-10-24 511 .irq_write_msi_msg = hpet_msi_write_msg,
ff363f480e5997 Thomas Gleixner 2021-07-29 512 .flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_AFFINITY_PRE_STARTUP,
3d7295eb3003ae David Woodhouse 2020-10-24 513 };
3d7295eb3003ae David Woodhouse 2020-10-24 514
3d7295eb3003ae David Woodhouse 2020-10-24 515 static int hpet_msi_init(struct irq_domain *domain,
3d7295eb3003ae David Woodhouse 2020-10-24 516 struct msi_domain_info *info, unsigned int virq,
3d7295eb3003ae David Woodhouse 2020-10-24 517 irq_hw_number_t hwirq, msi_alloc_info_t *arg)
3d7295eb3003ae David Woodhouse 2020-10-24 518 {
3d7295eb3003ae David Woodhouse 2020-10-24 519 irq_set_status_flags(virq, IRQ_MOVE_PCNTXT);
3d7295eb3003ae David Woodhouse 2020-10-24 @520 irq_domain_set_info(domain, virq, arg->hwirq, info->chip, NULL,
3d7295eb3003ae David Woodhouse 2020-10-24 521 handle_edge_irq, arg->data, "edge");
3d7295eb3003ae David Woodhouse 2020-10-24 522
3d7295eb3003ae David Woodhouse 2020-10-24 523 return 0;
3d7295eb3003ae David Woodhouse 2020-10-24 524 }
3d7295eb3003ae David Woodhouse 2020-10-24 525
Hi Lu, kernel test robot noticed the following build warnings: [auto build test WARNING on tip/master] [also build test WARNING on tip/x86/core tip/auto-latest linus/master v6.6-rc5 next-20231012] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Lu-Yao/x86-msi-Fix-compile-error-caused-by-GENERIC_MSI_IRQ-and-X86_LOCAL_APIC/20231011-135941 base: tip/master patch link: https://lore.kernel.org/r/20231011055749.98840-1-yaolu%40kylinos.cn patch subject: [PATCH v2] x86/msi: Fix compile error caused by GENERIC_MSI_IRQ and X86_LOCAL_APIC config: x86_64-randconfig-076-20231012 (https://download.01.org/0day-ci/archive/20231012/202310121953.G7zdSGxU-lkp@intel.com/config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231012/202310121953.G7zdSGxU-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202310121953.G7zdSGxU-lkp@intel.com/ All warnings (new ones prefixed by >>): arch/x86/kernel/hpet.c:509:22: error: 'msi_domain_set_affinity' undeclared here (not in a function); did you mean 'irq_can_set_affinity'? .irq_set_affinity = msi_domain_set_affinity, ^~~~~~~~~~~~~~~~~~~~~~~ irq_can_set_affinity arch/x86/kernel/hpet.c:516:12: warning: 'struct msi_domain_info' declared inside parameter list will not be visible outside of this definition or declaration struct msi_domain_info *info, unsigned int virq, ^~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c: In function 'hpet_msi_init': arch/x86/kernel/hpet.c:520:52: error: dereferencing pointer to incomplete type 'struct msi_domain_info' irq_domain_set_info(domain, virq, arg->hwirq, info->chip, NULL, ^~ arch/x86/kernel/hpet.c: At top level: arch/x86/kernel/hpet.c:527:13: warning: 'struct msi_domain_info' declared inside parameter list will not be visible outside of this definition or declaration struct msi_domain_info *info, unsigned int virq) ^~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c:532:15: error: variable 'hpet_msi_domain_ops' has initializer but incomplete type static struct msi_domain_ops hpet_msi_domain_ops = { ^~~~~~~~~~~~~~ arch/x86/kernel/hpet.c:533:3: error: 'struct msi_domain_ops' has no member named 'msi_init' .msi_init = hpet_msi_init, ^~~~~~~~ arch/x86/kernel/hpet.c:533:14: warning: excess elements in struct initializer .msi_init = hpet_msi_init, ^~~~~~~~~~~~~ arch/x86/kernel/hpet.c:533:14: note: (near initialization for 'hpet_msi_domain_ops') arch/x86/kernel/hpet.c:534:3: error: 'struct msi_domain_ops' has no member named 'msi_free' .msi_free = hpet_msi_free, ^~~~~~~~ arch/x86/kernel/hpet.c:534:14: warning: excess elements in struct initializer .msi_free = hpet_msi_free, ^~~~~~~~~~~~~ arch/x86/kernel/hpet.c:534:14: note: (near initialization for 'hpet_msi_domain_ops') arch/x86/kernel/hpet.c:537:15: error: variable 'hpet_msi_domain_info' has initializer but incomplete type static struct msi_domain_info hpet_msi_domain_info = { ^~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c:538:3: error: 'struct msi_domain_info' has no member named 'ops' .ops = &hpet_msi_domain_ops, ^~~ arch/x86/kernel/hpet.c:538:10: warning: excess elements in struct initializer .ops = &hpet_msi_domain_ops, ^ arch/x86/kernel/hpet.c:538:10: note: (near initialization for 'hpet_msi_domain_info') arch/x86/kernel/hpet.c:539:3: error: 'struct msi_domain_info' has no member named 'chip' .chip = &hpet_msi_controller, ^~~~ arch/x86/kernel/hpet.c:539:11: warning: excess elements in struct initializer .chip = &hpet_msi_controller, ^ arch/x86/kernel/hpet.c:539:11: note: (near initialization for 'hpet_msi_domain_info') arch/x86/kernel/hpet.c:540:3: error: 'struct msi_domain_info' has no member named 'flags' .flags = MSI_FLAG_USE_DEF_DOM_OPS, ^~~~~ arch/x86/kernel/hpet.c:540:12: error: 'MSI_FLAG_USE_DEF_DOM_OPS' undeclared here (not in a function); did you mean 'SIMPLE_DEV_PM_OPS'? .flags = MSI_FLAG_USE_DEF_DOM_OPS, ^~~~~~~~~~~~~~~~~~~~~~~~ SIMPLE_DEV_PM_OPS arch/x86/kernel/hpet.c:540:12: warning: excess elements in struct initializer arch/x86/kernel/hpet.c:540:12: note: (near initialization for 'hpet_msi_domain_info') arch/x86/kernel/hpet.c: In function 'hpet_create_irq_domain': arch/x86/kernel/hpet.c:553:31: error: dereferencing pointer to incomplete type 'struct msi_domain_info' domain_info = kzalloc(sizeof(*domain_info), GFP_KERNEL); ^~~~~~~~~~~~ arch/x86/kernel/hpet.c:580:6: error: implicit declaration of function 'msi_create_irq_domain'; did you mean 'hpet_create_irq_domain'? [-Werror=implicit-function-declaration] d = msi_create_irq_domain(fn, domain_info, parent); ^~~~~~~~~~~~~~~~~~~~~ hpet_create_irq_domain >> arch/x86/kernel/hpet.c:580:4: warning: assignment makes pointer from integer without a cast [-Wint-conversion] d = msi_create_irq_domain(fn, domain_info, parent); ^ arch/x86/kernel/hpet.c: In function 'hpet_dev_id': arch/x86/kernel/hpet.c:590:33: error: implicit declaration of function 'msi_get_domain_info'; did you mean 'sched_domain_span'? [-Werror=implicit-function-declaration] struct msi_domain_info *info = msi_get_domain_info(domain); ^~~~~~~~~~~~~~~~~~~ sched_domain_span >> arch/x86/kernel/hpet.c:590:33: warning: initialization makes pointer from integer without a cast [-Wint-conversion] arch/x86/kernel/hpet.c: At top level: arch/x86/kernel/hpet.c:532:30: error: storage size of 'hpet_msi_domain_ops' isn't known static struct msi_domain_ops hpet_msi_domain_ops = { ^~~~~~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c:537:31: error: storage size of 'hpet_msi_domain_info' isn't known static struct msi_domain_info hpet_msi_domain_info = { ^~~~~~~~~~~~~~~~~~~~ arch/x86/kernel/hpet.c: In function 'hpet_dev_id': arch/x86/kernel/hpet.c:593:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1: some warnings being treated as errors vim +580 arch/x86/kernel/hpet.c 3d7295eb3003ae David Woodhouse 2020-10-24 536 3d7295eb3003ae David Woodhouse 2020-10-24 537 static struct msi_domain_info hpet_msi_domain_info = { 3d7295eb3003ae David Woodhouse 2020-10-24 538 .ops = &hpet_msi_domain_ops, 3d7295eb3003ae David Woodhouse 2020-10-24 539 .chip = &hpet_msi_controller, 3d7295eb3003ae David Woodhouse 2020-10-24 @540 .flags = MSI_FLAG_USE_DEF_DOM_OPS, 3d7295eb3003ae David Woodhouse 2020-10-24 541 }; 3d7295eb3003ae David Woodhouse 2020-10-24 542 3d7295eb3003ae David Woodhouse 2020-10-24 543 static struct irq_domain *hpet_create_irq_domain(int hpet_id) 3d7295eb3003ae David Woodhouse 2020-10-24 544 { 3d7295eb3003ae David Woodhouse 2020-10-24 545 struct msi_domain_info *domain_info; 3d7295eb3003ae David Woodhouse 2020-10-24 546 struct irq_domain *parent, *d; 3d7295eb3003ae David Woodhouse 2020-10-24 547 struct fwnode_handle *fn; c2a5881c28e5bb David Woodhouse 2020-10-24 548 struct irq_fwspec fwspec; 3d7295eb3003ae David Woodhouse 2020-10-24 549 3d7295eb3003ae David Woodhouse 2020-10-24 550 if (x86_vector_domain == NULL) 3d7295eb3003ae David Woodhouse 2020-10-24 551 return NULL; 3d7295eb3003ae David Woodhouse 2020-10-24 552 3d7295eb3003ae David Woodhouse 2020-10-24 553 domain_info = kzalloc(sizeof(*domain_info), GFP_KERNEL); 3d7295eb3003ae David Woodhouse 2020-10-24 554 if (!domain_info) 3d7295eb3003ae David Woodhouse 2020-10-24 555 return NULL; 3d7295eb3003ae David Woodhouse 2020-10-24 556 3d7295eb3003ae David Woodhouse 2020-10-24 557 *domain_info = hpet_msi_domain_info; 3d7295eb3003ae David Woodhouse 2020-10-24 558 domain_info->data = (void *)(long)hpet_id; 3d7295eb3003ae David Woodhouse 2020-10-24 559 3d7295eb3003ae David Woodhouse 2020-10-24 560 fn = irq_domain_alloc_named_id_fwnode(hpet_msi_controller.name, 3d7295eb3003ae David Woodhouse 2020-10-24 561 hpet_id); 3d7295eb3003ae David Woodhouse 2020-10-24 562 if (!fn) { 3d7295eb3003ae David Woodhouse 2020-10-24 563 kfree(domain_info); 3d7295eb3003ae David Woodhouse 2020-10-24 564 return NULL; 3d7295eb3003ae David Woodhouse 2020-10-24 565 } 3d7295eb3003ae David Woodhouse 2020-10-24 566 c2a5881c28e5bb David Woodhouse 2020-10-24 567 fwspec.fwnode = fn; c2a5881c28e5bb David Woodhouse 2020-10-24 568 fwspec.param_count = 1; c2a5881c28e5bb David Woodhouse 2020-10-24 569 fwspec.param[0] = hpet_id; c2a5881c28e5bb David Woodhouse 2020-10-24 570 c2a5881c28e5bb David Woodhouse 2020-10-24 571 parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_ANY); c2a5881c28e5bb David Woodhouse 2020-10-24 572 if (!parent) { c2a5881c28e5bb David Woodhouse 2020-10-24 573 irq_domain_free_fwnode(fn); c2a5881c28e5bb David Woodhouse 2020-10-24 574 kfree(domain_info); c2a5881c28e5bb David Woodhouse 2020-10-24 575 return NULL; c2a5881c28e5bb David Woodhouse 2020-10-24 576 } c2a5881c28e5bb David Woodhouse 2020-10-24 577 if (parent != x86_vector_domain) c2a5881c28e5bb David Woodhouse 2020-10-24 578 hpet_msi_controller.name = "IR-HPET-MSI"; c2a5881c28e5bb David Woodhouse 2020-10-24 579 3d7295eb3003ae David Woodhouse 2020-10-24 @580 d = msi_create_irq_domain(fn, domain_info, parent); 3d7295eb3003ae David Woodhouse 2020-10-24 581 if (!d) { 3d7295eb3003ae David Woodhouse 2020-10-24 582 irq_domain_free_fwnode(fn); 3d7295eb3003ae David Woodhouse 2020-10-24 583 kfree(domain_info); 3d7295eb3003ae David Woodhouse 2020-10-24 584 } 3d7295eb3003ae David Woodhouse 2020-10-24 585 return d; 3d7295eb3003ae David Woodhouse 2020-10-24 586 } 3d7295eb3003ae David Woodhouse 2020-10-24 587 3d7295eb3003ae David Woodhouse 2020-10-24 588 static inline int hpet_dev_id(struct irq_domain *domain) 3d7295eb3003ae David Woodhouse 2020-10-24 589 { 3d7295eb3003ae David Woodhouse 2020-10-24 @590 struct msi_domain_info *info = msi_get_domain_info(domain); 3d7295eb3003ae David Woodhouse 2020-10-24 591 3d7295eb3003ae David Woodhouse 2020-10-24 592 return (int)(long)info->data; 3d7295eb3003ae David Woodhouse 2020-10-24 593 } 3d7295eb3003ae David Woodhouse 2020-10-24 594
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/kernel/hpet.c b/arch/x86/kernel/hpet.c index 1648aa0204d9..9904c0d46eba 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -52,7 +52,7 @@ unsigned long hpet_address; u8 hpet_blockid; /* OS timer block num */ bool hpet_msi_disable; -#ifdef CONFIG_GENERIC_MSI_IRQ +#ifdef CONFIG_X86_LOCAL_APIC static DEFINE_PER_CPU(struct hpet_channel *, cpu_hpet_channel); static struct irq_domain *hpet_domain; #endif @@ -469,7 +469,7 @@ static void __init hpet_legacy_clockevent_register(struct hpet_channel *hc) /* * HPET MSI Support */ -#ifdef CONFIG_GENERIC_MSI_IRQ +#ifdef CONFIG_X86_LOCAL_APIC static void hpet_msi_unmask(struct irq_data *data) { struct hpet_channel *hc = irq_data_get_irq_handler_data(data);