Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6931838rwb; Wed, 10 Aug 2022 03:52:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR4bB8Ae/FUewm3AxJVUiBUcOGeK/gjWGnKAga0Je4sN6cCAQ4edJ/toWCpMSoYL27WaYGNi X-Received: by 2002:aa7:dbd7:0:b0:43e:8c3b:f444 with SMTP id v23-20020aa7dbd7000000b0043e8c3bf444mr25168839edt.83.1660128737745; Wed, 10 Aug 2022 03:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660128737; cv=none; d=google.com; s=arc-20160816; b=mUz2/20Y/740l6yFg0GYiX6gY/XGoClbq0KaxZozwmvQwqpna3ZdlGLaAAxQsvLzlR wtcqcSHFSxhOYGdvacnxOe9JHCBRWk8xISarfrO4K3HAjbI4lUDcT1P2EXgieM6sveDG /twcxsjtXQuy45G2h5rq9FbLkVbGlm2ILey65ik6OUWBR4+voZqMdezElfKhJLZzPUpQ vgk1U9BtK0h6IzleKR+Tgo/8Jy6rwvfN+nVnqN1vDPXxfXl0ceLRFt7YEN7+uqmCEROJ mTTkgvmjKCXYsd792H9ySgtKEE82KUjykmOBaew67RJgTc+RpkgoYxAAmNeXdb7lTqfT 7Maw== 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=/LUEMRjdJlM+HYsAZf8oPrGfu+SOYllRmBA2Gg2/ODQ=; b=wlLJyXvRn0a+SBh3gew13ffglOizAitEKv2kGTZpUvzktnMwKaYSJiW0VsKNCO7nEj ouu4D47G+NZZRFyuo/EEitURKqvAeHmzFZ236AqvCuN8wtK7+tos2HiBudXVGRL2rbM7 22+In3Ore55djlNzEqql20V37Jw56US8h3NwoTp0DBtI70c5RIQ9WvTuRuzaxjyx1+nM ucFS42sKcl5Y/r594pJK0hTj4Qdt7tiHbKcG6PQT1pJFms8M7Q25ktSBJ1B8RjrCwsuu Ek7dpurCEGzuoNKyCemOMzkAXlfNQCYprAEMt9lu5jkGVdN0u3vzBoYmuxn4TB60ignX /7IA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m13-20020aa7c48d000000b0043dc97d184csi9802385edq.263.2022.08.10.03.51.52; Wed, 10 Aug 2022 03:52:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231135AbiHJKb6 (ORCPT + 99 others); Wed, 10 Aug 2022 06:31:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiHJKb4 (ORCPT ); Wed, 10 Aug 2022 06:31:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6FBF753AD for ; Wed, 10 Aug 2022 03:31:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8800DB81B57 for ; Wed, 10 Aug 2022 10:31:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3A9CC433D7; Wed, 10 Aug 2022 10:31:49 +0000 (UTC) From: Huacai Chen To: Huacai Chen , Thomas Gleixner , Marc Zyngier Cc: loongarch@lists.linux.dev, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-kernel@vger.kernel.org, Huacai Chen Subject: [PATCH] LoongArch: Fix the !CONFIG_SMP build for irqchip drivers Date: Wed, 10 Aug 2022 18:31:56 +0800 Message-Id: <20220810103156.1214996-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org 1, Guard get_ipi_irq() in CONFIG_SMP; 2, Define cpu_logical_map() for the EIOINTC driver; 3, Make eiointc_set_irq_affinity() return early for !CONFIG_SMP. Signed-off-by: Huacai Chen --- arch/loongarch/include/asm/smp.h | 8 ++++++++ arch/loongarch/kernel/irq.c | 2 ++ drivers/irqchip/irq-loongson-eiointc.c | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/arch/loongarch/include/asm/smp.h b/arch/loongarch/include/asm/smp.h index 71189b28bfb2..9ee5a309df5b 100644 --- a/arch/loongarch/include/asm/smp.h +++ b/arch/loongarch/include/asm/smp.h @@ -12,6 +12,8 @@ #include #include +#ifdef CONFIG_SMP + extern int smp_num_siblings; extern int num_processors; extern int disabled_cpus; @@ -112,4 +114,10 @@ static inline void __cpu_die(unsigned int cpu) extern void play_dead(void); #endif +#else /* !CONFIG_SMP */ + +#define cpu_logical_map(cpu) 0 + +#endif + #endif /* __ASM_SMP_H */ diff --git a/arch/loongarch/kernel/irq.c b/arch/loongarch/kernel/irq.c index 1ba19c76563e..d83623bc59fa 100644 --- a/arch/loongarch/kernel/irq.c +++ b/arch/loongarch/kernel/irq.c @@ -87,6 +87,7 @@ static void __init init_vec_parent_group(void) acpi_table_parse(ACPI_SIG_MCFG, early_pci_mcfg_parse); } +#ifdef CONFIG_SMP static int __init get_ipi_irq(void) { struct irq_domain *d = irq_find_matching_fwnode(cpuintc_handle, DOMAIN_BUS_ANY); @@ -96,6 +97,7 @@ static int __init get_ipi_irq(void) return -EINVAL; } +#endif void __init init_IRQ(void) { diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index 80d8ca6f2d46..17f94f3c11af 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -18,6 +18,8 @@ #include #include +#include + #define EIOINTC_REG_NODEMAP 0x14a0 #define EIOINTC_REG_IPMAP 0x14c0 #define EIOINTC_REG_ENABLE 0x1600 @@ -96,6 +98,9 @@ static int eiointc_set_irq_affinity(struct irq_data *d, const struct cpumask *af struct cpumask intersect_affinity; struct eiointc_priv *priv = d->domain->host_data; + if (!IS_ENABLED(CONFIG_SMP)) + return -EPERM; + raw_spin_lock_irqsave(&affinity_lock, flags); cpumask_and(&intersect_affinity, affinity, cpu_online_mask); -- 2.31.1