Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'loongarch-fixes-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson

Pull LoongArch fixes from Huacai Chen.
"Fix build errors and a stale comment"

* tag 'loongarch-fixes-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
LoongArch: Remove MIPS comment about cycle counter
LoongArch: Fix copy_thread() build errors
LoongArch: Fix the !CONFIG_SMP build

+31 -36
+1
arch/loongarch/Kconfig
··· 343 343 344 344 config NUMA 345 345 bool "NUMA Support" 346 + select SMP 346 347 select ACPI_NUMA if ACPI 347 348 help 348 349 Say Y to compile the kernel with NUMA (Non-Uniform Memory Access)
+1 -1
arch/loongarch/include/asm/hardirq.h
··· 19 19 unsigned int __softirq_pending; 20 20 } ____cacheline_aligned irq_cpustat_t; 21 21 22 - DECLARE_PER_CPU_ALIGNED(irq_cpustat_t, irq_stat); 22 + DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); 23 23 24 24 #define __ARCH_IRQ_STAT 25 25
+1
arch/loongarch/include/asm/percpu.h
··· 6 6 #define __ASM_PERCPU_H 7 7 8 8 #include <asm/cmpxchg.h> 9 + #include <asm/loongarch.h> 9 10 10 11 /* Use r21 for fast access */ 11 12 register unsigned long __my_cpu_offset __asm__("$r21");
+7 -16
arch/loongarch/include/asm/smp.h
··· 9 9 #include <linux/atomic.h> 10 10 #include <linux/bitops.h> 11 11 #include <linux/linkage.h> 12 - #include <linux/smp.h> 13 12 #include <linux/threads.h> 14 13 #include <linux/cpumask.h> 14 + 15 + extern int smp_num_siblings; 16 + extern int num_processors; 17 + extern int disabled_cpus; 18 + extern cpumask_t cpu_sibling_map[]; 19 + extern cpumask_t cpu_core_map[]; 20 + extern cpumask_t cpu_foreign_map[]; 15 21 16 22 void loongson3_smp_setup(void); 17 23 void loongson3_prepare_cpus(unsigned int max_cpus); ··· 31 25 void loongson3_cpu_die(unsigned int cpu); 32 26 #endif 33 27 34 - #ifdef CONFIG_SMP 35 - 36 28 static inline void plat_smp_setup(void) 37 29 { 38 30 loongson3_smp_setup(); 39 31 } 40 - 41 - #else /* !CONFIG_SMP */ 42 - 43 - static inline void plat_smp_setup(void) { } 44 - 45 - #endif /* !CONFIG_SMP */ 46 - 47 - extern int smp_num_siblings; 48 - extern int num_processors; 49 - extern int disabled_cpus; 50 - extern cpumask_t cpu_sibling_map[]; 51 - extern cpumask_t cpu_core_map[]; 52 - extern cpumask_t cpu_foreign_map[]; 53 32 54 33 static inline int raw_smp_processor_id(void) 55 34 {
-7
arch/loongarch/include/asm/timex.h
··· 12 12 #include <asm/cpu.h> 13 13 #include <asm/cpu-features.h> 14 14 15 - /* 16 - * Standard way to access the cycle counter. 17 - * Currently only used on SMP for scheduling. 18 - * 19 - * We know that all SMP capable CPUs have cycle counters. 20 - */ 21 - 22 15 typedef unsigned long cycles_t; 23 16 24 17 #define get_cycles get_cycles
+4
arch/loongarch/kernel/acpi.c
··· 138 138 } 139 139 } 140 140 141 + #ifdef CONFIG_SMP 141 142 static int set_processor_mask(u32 id, u32 flags) 142 143 { 143 144 ··· 167 166 168 167 return cpu; 169 168 } 169 + #endif 170 170 171 171 static void __init acpi_process_madt(void) 172 172 { 173 + #ifdef CONFIG_SMP 173 174 int i; 174 175 175 176 for (i = 0; i < NR_CPUS; i++) { 176 177 __cpu_number_map[i] = -1; 177 178 __cpu_logical_map[i] = -1; 178 179 } 180 + #endif 179 181 180 182 loongson_sysconf.nr_cpus = num_processors; 181 183 }
+1
arch/loongarch/kernel/cacheinfo.c
··· 4 4 * 5 5 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 6 6 */ 7 + #include <asm/cpu-info.h> 7 8 #include <linux/cacheinfo.h> 8 9 9 10 /* Populates leaf and increments to next leaf */
+6 -1
arch/loongarch/kernel/irq.c
··· 22 22 #include <asm/setup.h> 23 23 24 24 DEFINE_PER_CPU(unsigned long, irq_stack); 25 + DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); 26 + EXPORT_PER_CPU_SYMBOL(irq_stat); 25 27 26 28 struct irq_domain *cpu_domain; 27 29 struct irq_domain *liointc_domain; ··· 58 56 59 57 void __init init_IRQ(void) 60 58 { 61 - int i, r, ipi_irq; 59 + int i; 60 + #ifdef CONFIG_SMP 61 + int r, ipi_irq; 62 62 static int ipi_dummy_dev; 63 + #endif 63 64 unsigned int order = get_order(IRQ_STACK_SIZE); 64 65 struct page *page; 65 66
+8 -6
arch/loongarch/kernel/process.c
··· 120 120 /* 121 121 * Copy architecture-specific thread state 122 122 */ 123 - int copy_thread(unsigned long clone_flags, unsigned long usp, 124 - unsigned long kthread_arg, struct task_struct *p, unsigned long tls) 123 + int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) 125 124 { 126 125 unsigned long childksp; 126 + unsigned long tls = args->tls; 127 + unsigned long usp = args->stack; 128 + unsigned long clone_flags = args->flags; 127 129 struct pt_regs *childregs, *regs = current_pt_regs(); 128 130 129 131 childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32; ··· 138 136 p->thread.csr_crmd = csr_read32(LOONGARCH_CSR_CRMD); 139 137 p->thread.csr_prmd = csr_read32(LOONGARCH_CSR_PRMD); 140 138 p->thread.csr_ecfg = csr_read32(LOONGARCH_CSR_ECFG); 141 - if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) { 139 + if (unlikely(args->fn)) { 142 140 /* kernel thread */ 143 - p->thread.reg23 = usp; /* fn */ 144 - p->thread.reg24 = kthread_arg; 145 141 p->thread.reg03 = childksp; 146 - p->thread.reg01 = (unsigned long) ret_from_kernel_thread; 142 + p->thread.reg23 = (unsigned long)args->fn; 143 + p->thread.reg24 = (unsigned long)args->fn_arg; 144 + p->thread.reg01 = (unsigned long)ret_from_kernel_thread; 147 145 memset(childregs, 0, sizeof(struct pt_regs)); 148 146 childregs->csr_euen = p->thread.csr_euen; 149 147 childregs->csr_crmd = p->thread.csr_crmd;
+2 -3
arch/loongarch/kernel/setup.c
··· 39 39 #include <asm/pgalloc.h> 40 40 #include <asm/sections.h> 41 41 #include <asm/setup.h> 42 - #include <asm/smp.h> 43 42 #include <asm/time.h> 44 43 45 44 #define SMBIOS_BIOSSIZE_OFFSET 0x09 ··· 348 349 349 350 nr_cpu_ids = possible; 350 351 } 351 - #else 352 - static inline void prefill_possible_map(void) {} 353 352 #endif 354 353 355 354 void __init setup_arch(char **cmdline_p) ··· 364 367 arch_mem_init(cmdline_p); 365 368 366 369 resource_init(); 370 + #ifdef CONFIG_SMP 367 371 plat_smp_setup(); 368 372 prefill_possible_map(); 373 + #endif 369 374 370 375 paging_init(); 371 376 }
-2
arch/loongarch/kernel/smp.c
··· 66 66 67 67 struct secondary_data cpuboot_data; 68 68 static DEFINE_PER_CPU(int, cpu_state); 69 - DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); 70 - EXPORT_PER_CPU_SYMBOL(irq_stat); 71 69 72 70 enum ipi_msg_type { 73 71 IPI_RESCHEDULE,