From nobody Mon Feb 9 08:30:26 2026 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 468E96F09C for ; Tue, 26 Mar 2024 12:11:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711455098; cv=none; b=d4lqlJDp4VgHWsEAMZo0MzHAuZa3N6hYUqUFyHEpRzVNQPBs8vT6180scT/FIh2J3+xPN8yYSCCDc1HcwzL/mOokZGAyE5VI/QAsXhh/PvBwzr2NRC7DRjrYblbPIJtwy/pNHczNHZxqASrl+IZONANMAq23aVA7Ozizwm/KWOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711455098; c=relaxed/simple; bh=IPnqgB78qUgeBMSAv4tIpBYUNFAYVlCqB+9U3MdX+oY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jMahALYWKd5Y8xgyJjbPZNjcknRyQwGM/PT6ZGFwtmLNrvnOFsDG7ABOkegB+U0FuAPnwUlVBk20LSPG2XubCJ0XwLvNHZG/4AD4+NNkKBP8CzWhUJlx8yZO+Z36mPX6FGqz8GVmFmPw7snu3DkUlaZ9Mejqm2tY3o9qM8WYmRM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8DxdfF2uwJm_FweAA--.6132S3; Tue, 26 Mar 2024 20:11:34 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxTs1zuwJm8eVoAA--.8693S3; Tue, 26 Mar 2024 20:11:33 +0800 (CST) From: Tiezhu Yang To: Huacai Chen , Thomas Gleixner , Arnd Bergmann , Marc Zyngier Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: [PATCH v2 1/3] LoongArch: Give chance to build under !CONFIG_SMP Date: Tue, 26 Mar 2024 20:11:28 +0800 Message-ID: <20240326121130.16622-2-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240326121130.16622-1-yangtiezhu@loongson.cn> References: <20240326121130.16622-1-yangtiezhu@loongson.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: AQAAf8AxTs1zuwJm8eVoAA--.8693S3 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoW3Jr4UKFWDJw4kuFy3Xry8tFc_yoWxGF15pF 9Fyr1kJr4rWr1kAFyqy34fWr1UJr1kG3yaqF12kay8AFsrXw1UZr4vgrnFqFyUKws5WFWI gFn3G3WaqF15AwbCm3ZEXasCq-sJn29KB7ZKAUJUUUUx529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUB2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVWxJr0_GcWln4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q 6rW5McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64 vIr41lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_ Jr0_Gr1l4IxYO2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8Gjc xK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0 cI8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8V AvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E 14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU4Xo7DUUUU In the current code, SMP is selected in Kconfig for LoongArch, the users can not unset it, this is reasonable for a multiprocessor machine. But as the help info of config SMP said, if you have a system with only one CPU, say N. On a uniprocessor machine, the kernel will run faster if you say N here. The Loongson-2K0500 is a single-core CPU for applications like industrial control, printing terminals, and BMC (Baseboard Management Controller), there are many development boards, products and solutions on the market, so it is better and necessary to give a chance to build under !CONFIG_SMP for a uniprocessor machine. First of all, do not select SMP for config LOONGARCH in Kconfig to make it possible to unset CONFIG_SMP. Then, do some changes to fix the warnings and errors if CONFIG_SMP is not set. (1) Define cpu_logical_map(cpu) as 0 under !CONFIG_SMP in asm/smp.h and include asm/smp.h in asm/acpi.h to fix the error: ./arch/loongarch/include/asm/acpi.h: In function =E2=80=98get_acpi_id_for_c= pu=E2=80=99: ./arch/loongarch/include/asm/acpi.h:44:30: error: implicit declaration of f= unction =E2=80=98cpu_logical_map=E2=80=99 [-Wimplicit-function-declaration] (2) Define get_ipi_irq() only if CONFIG_SMP is set to fix the warning: arch/loongarch/kernel/irq.c:90:19: warning: =E2=80=98get_ipi_irq=E2=80=99 d= efined but not used [-Wunused-function] (3) Define machine_shutdown() as empty under !CONFIG_SMP to fix the error: arch/loongarch/kernel/machine_kexec.c: In function =E2=80=98machine_shutdow= n=E2=80=99: arch/loongarch/kernel/machine_kexec.c:233:25: error: implicit declaration o= f function =E2=80=98cpu_device_up=E2=80=99; did you mean =E2=80=98put_devic= e=E2=80=99? [-Wimplicit-function-declaration] (4) Make config SCHED_SMT depends on SMP to avoid many errors such as: kernel/sched/core.c: In function =E2=80=98sched_core_find=E2=80=99: kernel/sched/core.c:310:43: error: =E2=80=98struct rq=E2=80=99 has no membe= r named =E2=80=98cpu=E2=80=99 (5) Call per_cpu_offset() only under CONFIG_HAVE_SETUP_PER_CPU_AREA to fix the error: arch/loongarch/power/suspend.c: In function =E2=80=98loongarch_common_resum= e=E2=80=99: arch/loongarch/power/suspend.c:47:21: error: implicit declaration of functi= on =E2=80=98per_cpu_offset=E2=80=99 [-Wimplicit-function-declaration] When running the UnixBench tests with "-c 1" single-streamed pass, the improvement in performance is about 9 percent with this patch. By the way, it is helpful to debug and analysis the kernel issue of multi-core system under !CONFIG_SMP. Signed-off-by: Tiezhu Yang --- arch/loongarch/Kconfig | 2 +- arch/loongarch/include/asm/acpi.h | 1 + arch/loongarch/include/asm/smp.h | 5 +++++ arch/loongarch/kernel/irq.c | 2 ++ arch/loongarch/kernel/machine_kexec.c | 2 +- arch/loongarch/power/suspend.c | 2 ++ 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index a5f300ec6f28..8d892de0b7a8 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -174,7 +174,6 @@ config LOONGARCH select PCI_QUIRKS select PERF_USE_VMALLOC select RTC_LIB - select SMP select SPARSE_IRQ select SYSCTL_ARCH_UNALIGN_ALLOW select SYSCTL_ARCH_UNALIGN_NO_WARN @@ -420,6 +419,7 @@ config EFI_STUB =20 config SCHED_SMT bool "SMT scheduler support" + depends on SMP default y help Improves scheduler's performance when there are multiple diff --git a/arch/loongarch/include/asm/acpi.h b/arch/loongarch/include/asm= /acpi.h index 49e29b29996f..313f66f7913a 100644 --- a/arch/loongarch/include/asm/acpi.h +++ b/arch/loongarch/include/asm/acpi.h @@ -8,6 +8,7 @@ #ifndef _ASM_LOONGARCH_ACPI_H #define _ASM_LOONGARCH_ACPI_H =20 +#include #include =20 #ifdef CONFIG_ACPI diff --git a/arch/loongarch/include/asm/smp.h b/arch/loongarch/include/asm/= smp.h index f81e5f01d619..c14ddfcd4829 100644 --- a/arch/loongarch/include/asm/smp.h +++ b/arch/loongarch/include/asm/smp.h @@ -6,6 +6,7 @@ #ifndef __ASM_SMP_H #define __ASM_SMP_H =20 +#ifdef CONFIG_SMP #include #include #include @@ -101,4 +102,8 @@ static inline void __cpu_die(unsigned int cpu) } #endif =20 +#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 883e5066ae44..e791fa275ec5 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); } =20 +#ifdef CONFIG_SMP static int __init get_ipi_irq(void) { struct irq_domain *d =3D irq_find_matching_fwnode(cpuintc_handle, DOMAIN_= BUS_ANY); @@ -96,6 +97,7 @@ static int __init get_ipi_irq(void) =20 return -EINVAL; } +#endif =20 void __init init_IRQ(void) { diff --git a/arch/loongarch/kernel/machine_kexec.c b/arch/loongarch/kernel/= machine_kexec.c index 2dcb9e003657..8ae641dc53bb 100644 --- a/arch/loongarch/kernel/machine_kexec.c +++ b/arch/loongarch/kernel/machine_kexec.c @@ -225,6 +225,7 @@ void crash_smp_send_stop(void) =20 void machine_shutdown(void) { +#ifdef CONFIG_SMP int cpu; =20 /* All CPUs go to reboot_code_buffer */ @@ -232,7 +233,6 @@ void machine_shutdown(void) if (!cpu_online(cpu)) cpu_device_up(get_cpu_device(cpu)); =20 -#ifdef CONFIG_SMP smp_call_function(kexec_shutdown_secondary, NULL, 0); #endif } diff --git a/arch/loongarch/power/suspend.c b/arch/loongarch/power/suspend.c index 166d9e06a64b..e8ca77eb3288 100644 --- a/arch/loongarch/power/suspend.c +++ b/arch/loongarch/power/suspend.c @@ -44,7 +44,9 @@ void loongarch_common_resume(void) { sync_counter(); local_flush_tlb_all(); +#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA csr_write64(per_cpu_offset(0), PERCPU_BASE_KS); +#endif csr_write64(eentry, LOONGARCH_CSR_EENTRY); csr_write64(eentry, LOONGARCH_CSR_MERRENTRY); csr_write64(tlbrentry, LOONGARCH_CSR_TLBRENTRY); --=20 2.42.0 From nobody Mon Feb 9 08:30:26 2026 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4696370CDA for ; Tue, 26 Mar 2024 12:11:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711455098; cv=none; b=SbzktnzZnRlp5blyBxfnjZcV4Fhm3iqEVt1rM0RsLjy8sOhxJGx9o/TRT4LSDxD/Uz+TY0JI5nQPNcwtEEi3wyUkFPURYL+H8GGT82IsCikVdJZyOGtkVZhrBiKi6rZz3UC3Jvn9HyuyKUhqDd1DJMjcIdUMGUicfN0W+sVshGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711455098; c=relaxed/simple; bh=lsoSm34ubJ+R6ngdvSLEb9Nqtayv+QYEjzkROLHcyw8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FqO4Xj8LNo3/O4GBPFs6jWBTxwg1zUkdovhnMtm9xUgJfTqH/O9cZ6OKA9uE9kBJDFr4zSOKZaP0bAzkpI0qvIZwIsAl7YqghvhGMnK/P7Kyd1ssv7/WPlis7J3UQCLMj3W99XBBPzHjelYnvD47hg2LLz+XVvJzk3o2kSiAh/I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8DxK+l2uwJmAl0eAA--.53036S3; Tue, 26 Mar 2024 20:11:34 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxTs1zuwJm8eVoAA--.8693S4; Tue, 26 Mar 2024 20:11:34 +0800 (CST) From: Tiezhu Yang To: Huacai Chen , Thomas Gleixner , Arnd Bergmann , Marc Zyngier Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: [PATCH v2 2/3] irqchip: Select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP for IRQ_LOONGARCH_CPU Date: Tue, 26 Mar 2024 20:11:29 +0800 Message-ID: <20240326121130.16622-3-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240326121130.16622-1-yangtiezhu@loongson.cn> References: <20240326121130.16622-1-yangtiezhu@loongson.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: AQAAf8AxTs1zuwJm8eVoAA--.8693S4 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj9xXoW7GFW3XryxGw47Gr4UXr48Zrc_yoWDJrX_Cr yavFsrCa13CrW7tw1Iqa1fZrWYkan0gFs7Za1vvw1rX34xXwnxXF4IyF15XrsxGw4UtFna 9FWxCr1a9w12vosvyTuYvTs0mTUanT9S1TB71UUUUj7qnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUbS8YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_JF0_JFyl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6F4UJVW0owAaw2AFwI0_JF0_Jw1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0c Ia020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_ WrylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwI xGrwCY1x0262kKe7AKxVWUAVWUtwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWU JVW8JwCFI7km07C267AKxVWUAVWUtwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4 vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IY x2IY67AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26c xKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAF wI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jr6p9UUUUU= Content-Type: text/plain; charset="utf-8" An IRQ's effective affinity can only be different from its configured affinity if there are multiple CPUs. Make it clear that this option is only meaningful when SMP is enabled. Otherwise, there exists "WARNING: unmet direct dependencies detected for GENERIC_IRQ_EFFECTIVE_AFF_MASK" when make menuconfig if CONFIG_SMP is not set on LoongArch. Signed-off-by: Tiezhu Yang --- drivers/irqchip/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index 72c07a12f5e1..bfa1d77749f3 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -568,7 +568,7 @@ config IRQ_LOONGARCH_CPU bool select GENERIC_IRQ_CHIP select IRQ_DOMAIN - select GENERIC_IRQ_EFFECTIVE_AFF_MASK + select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP select LOONGSON_HTVEC select LOONGSON_LIOINTC select LOONGSON_EIOINTC --=20 2.42.0 From nobody Mon Feb 9 08:30:26 2026 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3166071731 for ; Tue, 26 Mar 2024 12:11:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711455099; cv=none; b=THF6WKljZ0hCyVugeG20wgwbu5I3zMAf4Z+UlH/uK31v9umf8EQ4JvYN7VGnzokddilbaw2F1NM1qH+qe5r1/L1tWWKieQvnwtwFQgjj7Sskf/OlxYaNJh4eilHfLmAuE2hi+M5ceqAFCR0RJyjvZ8Ml3TNFk+eNiF6GhndnxF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711455099; c=relaxed/simple; bh=5m4BnN7yVidmxnCnJgX/ChA9bEUto3lM71CJzMUOCf4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J6qdudiNs7Otn6Hghz/vaI/M3oFHkj0bQHxivqTuPWLw6meXMM1jBX0FTsH3LaIzpD9Lj6DEcrtB0Z1nm7Jshsv7GEFs90TbdD2v21dFpzqRU77lLm0DNNmEwoDEsG137EP+fyNTQngg7Kr4xVr4a0eKhLuB/x0CoVAZ64waMSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8Cx77t3uwJmCF0eAA--.51725S3; Tue, 26 Mar 2024 20:11:35 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxTs1zuwJm8eVoAA--.8693S5; Tue, 26 Mar 2024 20:11:34 +0800 (CST) From: Tiezhu Yang To: Huacai Chen , Thomas Gleixner , Arnd Bergmann , Marc Zyngier Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: [PATCH v2 3/3] irqchip: Set CPU affinity only on SMP machines for LoongArch Date: Tue, 26 Mar 2024 20:11:30 +0800 Message-ID: <20240326121130.16622-4-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240326121130.16622-1-yangtiezhu@loongson.cn> References: <20240326121130.16622-1-yangtiezhu@loongson.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: AQAAf8AxTs1zuwJm8eVoAA--.8693S5 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoW7WrW3WrW8Zr4UAr1UJFWUGFX_yoW8Gw4fpr WUCFn0vr43Ja4UWr9YkayDJryakr9IqrW7taya9a97ZFZ8Ja1DWF4rAF9xZF10k3y8GF12 gFs7WFW8ua15JwbCm3ZEXasCq-sJn29KB7ZKAUJUUUUx529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUB2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVWxJr0_GcWln4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q 6rW5McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64 vIr41lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_ Jr0_Gr1l4IxYO2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8Gjc xK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0 cI8IcVAFwI0_Xr0_Ar1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8V AvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E 14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU4Xo7DUUUU Content-Type: text/plain; charset="utf-8" According to the code comment of "struct irq_chip" in include/linux/irq.h, the member "irq_set_affinity" is to set the CPU affinity on SMP machines, so define and call eiointc_set_irq_affinity() only under CONFIG_SMP. Signed-off-by: Tiezhu Yang --- drivers/irqchip/irq-loongson-eiointc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-l= oongson-eiointc.c index b64cbe3052e8..4f5e6d21d77d 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -59,6 +59,7 @@ static int cpu_to_eio_node(int cpu) return cpu_logical_map(cpu) / CORES_PER_EIO_NODE; } =20 +#ifdef CONFIG_SMP static void eiointc_set_irq_route(int pos, unsigned int cpu, unsigned int = mnode, nodemask_t *node_map) { int i, node, cpu_node, route_node; @@ -126,6 +127,7 @@ static int eiointc_set_irq_affinity(struct irq_data *d,= const struct cpumask *af =20 return IRQ_SET_MASK_OK; } +#endif =20 static int eiointc_index(int node) { @@ -238,7 +240,9 @@ static struct irq_chip eiointc_irq_chip =3D { .irq_ack =3D eiointc_ack_irq, .irq_mask =3D eiointc_mask_irq, .irq_unmask =3D eiointc_unmask_irq, +#ifdef CONFIG_SMP .irq_set_affinity =3D eiointc_set_irq_affinity, +#endif }; =20 static int eiointc_domain_alloc(struct irq_domain *domain, unsigned int vi= rq, --=20 2.42.0