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 'mips-fixes_6.7_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux

Pull MIPS fixes from Thomas Bogendoerfer:

- Fixes for broken Loongson firmware

- Fix lockdep splat

- Fix FPU states when creating kernel threads

* tag 'mips-fixes_6.7_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
MIPS: kernel: Clear FPU states when setting up kernel threads
MIPS: Loongson64: Handle more memory types passed from firmware
MIPS: Loongson64: Enable DMA noncoherent support
MIPS: Loongson64: Reserve vgabios memory on boot
mips/smp: Call rcutree_report_cpu_starting() earlier

+64 -33
+2
arch/mips/Kconfig
··· 460 460 461 461 config MACH_LOONGSON64 462 462 bool "Loongson 64-bit family of machines" 463 + select ARCH_DMA_DEFAULT_COHERENT 463 464 select ARCH_SPARSEMEM_ENABLE 464 465 select ARCH_MIGHT_HAVE_PC_PARPORT 465 466 select ARCH_MIGHT_HAVE_PC_SERIO ··· 1252 1251 select CPU_SUPPORTS_MSA 1253 1252 select CPU_DIEI_BROKEN if !LOONGSON3_ENHANCEMENT 1254 1253 select CPU_MIPSR2_IRQ_VI 1254 + select DMA_NONCOHERENT 1255 1255 select WEAK_ORDERING 1256 1256 select WEAK_REORDERING_BEYOND_LLSC 1257 1257 select MIPS_ASID_BITS_VARIABLE
+7 -2
arch/mips/include/asm/mach-loongson64/boot_param.h
··· 14 14 #define ADAPTER_ROM 8 15 15 #define ACPI_TABLE 9 16 16 #define SMBIOS_TABLE 10 17 - #define MAX_MEMORY_TYPE 11 17 + #define UMA_VIDEO_RAM 11 18 + #define VUMA_VIDEO_RAM 12 19 + #define MAX_MEMORY_TYPE 13 20 + 21 + #define MEM_SIZE_IS_IN_BYTES (1 << 31) 18 22 19 23 #define LOONGSON3_BOOT_MEM_MAP_MAX 128 20 24 struct efi_memory_map_loongson { ··· 121 117 u64 pci_io_start_addr; 122 118 u64 pci_io_end_addr; 123 119 u64 pci_config_addr; 124 - u32 dma_mask_bits; 120 + u16 dma_mask_bits; 121 + u16 dma_noncoherent; 125 122 } __packed; 126 123 127 124 struct interface_info {
+13 -12
arch/mips/kernel/process.c
··· 121 121 /* Put the stack after the struct pt_regs. */ 122 122 childksp = (unsigned long) childregs; 123 123 p->thread.cp0_status = (read_c0_status() & ~(ST0_CU2|ST0_CU1)) | ST0_KERNEL_CUMASK; 124 + 125 + /* 126 + * New tasks lose permission to use the fpu. This accelerates context 127 + * switching for most programs since they don't use the fpu. 128 + */ 129 + clear_tsk_thread_flag(p, TIF_USEDFPU); 130 + clear_tsk_thread_flag(p, TIF_USEDMSA); 131 + clear_tsk_thread_flag(p, TIF_MSA_CTX_LIVE); 132 + 133 + #ifdef CONFIG_MIPS_MT_FPAFF 134 + clear_tsk_thread_flag(p, TIF_FPUBOUND); 135 + #endif /* CONFIG_MIPS_MT_FPAFF */ 136 + 124 137 if (unlikely(args->fn)) { 125 138 /* kernel thread */ 126 139 unsigned long status = p->thread.cp0_status; ··· 162 149 p->thread.reg29 = (unsigned long) childregs; 163 150 p->thread.reg31 = (unsigned long) ret_from_fork; 164 151 165 - /* 166 - * New tasks lose permission to use the fpu. This accelerates context 167 - * switching for most programs since they don't use the fpu. 168 - */ 169 152 childregs->cp0_status &= ~(ST0_CU2|ST0_CU1); 170 - 171 - clear_tsk_thread_flag(p, TIF_USEDFPU); 172 - clear_tsk_thread_flag(p, TIF_USEDMSA); 173 - clear_tsk_thread_flag(p, TIF_MSA_CTX_LIVE); 174 - 175 - #ifdef CONFIG_MIPS_MT_FPAFF 176 - clear_tsk_thread_flag(p, TIF_FPUBOUND); 177 - #endif /* CONFIG_MIPS_MT_FPAFF */ 178 153 179 154 #ifdef CONFIG_MIPS_FP_SUPPORT 180 155 atomic_set(&p->thread.bd_emu_frame, BD_EMUFRAME_NONE);
+2 -2
arch/mips/kernel/smp.c
··· 351 351 */ 352 352 asmlinkage void start_secondary(void) 353 353 { 354 - unsigned int cpu; 354 + unsigned int cpu = raw_smp_processor_id(); 355 355 356 356 cpu_probe(); 357 357 per_cpu_trap_init(false); 358 + rcutree_report_cpu_starting(cpu); 358 359 mips_clockevent_init(); 359 360 mp_ops->init_secondary(); 360 361 cpu_report(); ··· 367 366 */ 368 367 369 368 calibrate_delay(); 370 - cpu = smp_processor_id(); 371 369 cpu_data[cpu].udelay_val = loops_per_jiffy; 372 370 373 371 set_cpu_sibling_map(cpu);
+9 -1
arch/mips/loongson64/env.c
··· 13 13 * Copyright (C) 2009 Lemote Inc. 14 14 * Author: Wu Zhangjin, wuzhangjin@gmail.com 15 15 */ 16 + 17 + #include <linux/dma-map-ops.h> 16 18 #include <linux/export.h> 17 19 #include <linux/pci_ids.h> 18 20 #include <asm/bootinfo.h> ··· 149 147 150 148 loongson_sysconf.dma_mask_bits = eirq_source->dma_mask_bits; 151 149 if (loongson_sysconf.dma_mask_bits < 32 || 152 - loongson_sysconf.dma_mask_bits > 64) 150 + loongson_sysconf.dma_mask_bits > 64) { 153 151 loongson_sysconf.dma_mask_bits = 32; 152 + dma_default_coherent = true; 153 + } else { 154 + dma_default_coherent = !eirq_source->dma_noncoherent; 155 + } 156 + 157 + pr_info("Firmware: Coherent DMA: %s\n", dma_default_coherent ? "on" : "off"); 154 158 155 159 loongson_sysconf.restart_addr = boot_p->reset_system.ResetWarm; 156 160 loongson_sysconf.poweroff_addr = boot_p->reset_system.Shutdown;
+31 -16
arch/mips/loongson64/init.c
··· 49 49 void __init szmem(unsigned int node) 50 50 { 51 51 u32 i, mem_type; 52 - static unsigned long num_physpages; 53 - u64 node_id, node_psize, start_pfn, end_pfn, mem_start, mem_size; 52 + phys_addr_t node_id, mem_start, mem_size; 54 53 55 54 /* Otherwise come from DTB */ 56 55 if (loongson_sysconf.fw_interface != LOONGSON_LEFI) ··· 63 64 64 65 mem_type = loongson_memmap->map[i].mem_type; 65 66 mem_size = loongson_memmap->map[i].mem_size; 66 - mem_start = loongson_memmap->map[i].mem_start; 67 + 68 + /* Memory size comes in MB if MEM_SIZE_IS_IN_BYTES not set */ 69 + if (mem_size & MEM_SIZE_IS_IN_BYTES) 70 + mem_size &= ~MEM_SIZE_IS_IN_BYTES; 71 + else 72 + mem_size = mem_size << 20; 73 + 74 + mem_start = (node_id << 44) | loongson_memmap->map[i].mem_start; 67 75 68 76 switch (mem_type) { 69 77 case SYSTEM_RAM_LOW: 70 78 case SYSTEM_RAM_HIGH: 71 - start_pfn = ((node_id << 44) + mem_start) >> PAGE_SHIFT; 72 - node_psize = (mem_size << 20) >> PAGE_SHIFT; 73 - end_pfn = start_pfn + node_psize; 74 - num_physpages += node_psize; 75 - pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx MB\n", 76 - (u32)node_id, mem_type, mem_start, mem_size); 77 - pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", 78 - start_pfn, end_pfn, num_physpages); 79 - memblock_add_node(PFN_PHYS(start_pfn), 80 - PFN_PHYS(node_psize), node, 79 + case UMA_VIDEO_RAM: 80 + pr_info("Node %d, mem_type:%d\t[%pa], %pa bytes usable\n", 81 + (u32)node_id, mem_type, &mem_start, &mem_size); 82 + memblock_add_node(mem_start, mem_size, node, 81 83 MEMBLOCK_NONE); 82 84 break; 83 85 case SYSTEM_RAM_RESERVED: 84 - pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx MB\n", 85 - (u32)node_id, mem_type, mem_start, mem_size); 86 - memblock_reserve(((node_id << 44) + mem_start), mem_size << 20); 86 + case VIDEO_ROM: 87 + case ADAPTER_ROM: 88 + case ACPI_TABLE: 89 + case SMBIOS_TABLE: 90 + pr_info("Node %d, mem_type:%d\t[%pa], %pa bytes reserved\n", 91 + (u32)node_id, mem_type, &mem_start, &mem_size); 92 + memblock_reserve(mem_start, mem_size); 93 + break; 94 + /* We should not reserve VUMA_VIDEO_RAM as it overlaps with MMIO */ 95 + case VUMA_VIDEO_RAM: 96 + default: 97 + pr_info("Node %d, mem_type:%d\t[%pa], %pa bytes unhandled\n", 98 + (u32)node_id, mem_type, &mem_start, &mem_size); 87 99 break; 88 100 } 89 101 } 102 + 103 + /* Reserve vgabios if it comes from firmware */ 104 + if (loongson_sysconf.vgabios_addr) 105 + memblock_reserve(virt_to_phys((void *)loongson_sysconf.vgabios_addr), 106 + SZ_256K); 90 107 } 91 108 92 109 #ifndef CONFIG_NUMA