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

Pull MIPS fixes from Thomas Bogendoerfer:

- Fix memory detection for MT7621 devices

- Fix setnocoherentio kernel option

- Fix warning when CONFIG_SCHED_CORE is enabled

* tag 'mips-fixes-5.17_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
MIPS: ralink: mt7621: use bitwise NOT instead of logical
mips: setup: fix setnocoherentio() boolean setting
MIPS: smp: fill in sibling and core maps earlier
MIPS: ralink: mt7621: do memory detection on KSEG1

+27 -17
+1 -1
arch/mips/kernel/setup.c
··· 803 803 804 804 static int __init setnocoherentio(char *str) 805 805 { 806 - dma_default_coherent = true; 806 + dma_default_coherent = false; 807 807 pr_info("Software DMA cache coherency (command line)\n"); 808 808 return 0; 809 809 }
+3 -3
arch/mips/kernel/smp.c
··· 351 351 cpu = smp_processor_id(); 352 352 cpu_data[cpu].udelay_val = loops_per_jiffy; 353 353 354 + set_cpu_sibling_map(cpu); 355 + set_cpu_core_map(cpu); 356 + 354 357 cpumask_set_cpu(cpu, &cpu_coherent_mask); 355 358 notify_cpu_starting(cpu); 356 359 ··· 364 361 365 362 /* The CPU is running and counters synchronised, now mark it online */ 366 363 set_cpu_online(cpu, true); 367 - 368 - set_cpu_sibling_map(cpu); 369 - set_cpu_core_map(cpu); 370 364 371 365 calculate_cpu_foreign_map(); 372 366
+23 -13
arch/mips/ralink/mt7621.c
··· 22 22 23 23 #include "common.h" 24 24 25 - static void *detect_magic __initdata = detect_memory_region; 25 + #define MT7621_MEM_TEST_PATTERN 0xaa5555aa 26 + 27 + static u32 detect_magic __initdata; 26 28 27 29 int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) 28 30 { ··· 60 58 panic("Cannot detect cpc address"); 61 59 } 62 60 61 + static bool __init mt7621_addr_wraparound_test(phys_addr_t size) 62 + { 63 + void *dm = (void *)KSEG1ADDR(&detect_magic); 64 + 65 + if (CPHYSADDR(dm + size) >= MT7621_LOWMEM_MAX_SIZE) 66 + return true; 67 + __raw_writel(MT7621_MEM_TEST_PATTERN, dm); 68 + if (__raw_readl(dm) != __raw_readl(dm + size)) 69 + return false; 70 + __raw_writel(~MT7621_MEM_TEST_PATTERN, dm); 71 + return __raw_readl(dm) == __raw_readl(dm + size); 72 + } 73 + 63 74 static void __init mt7621_memory_detect(void) 64 75 { 65 - void *dm = &detect_magic; 66 76 phys_addr_t size; 67 77 68 - for (size = 32 * SZ_1M; size < 256 * SZ_1M; size <<= 1) { 69 - if (!__builtin_memcmp(dm, dm + size, sizeof(detect_magic))) 70 - break; 78 + for (size = 32 * SZ_1M; size <= 256 * SZ_1M; size <<= 1) { 79 + if (mt7621_addr_wraparound_test(size)) { 80 + memblock_add(MT7621_LOWMEM_BASE, size); 81 + return; 82 + } 71 83 } 72 84 73 - if ((size == 256 * SZ_1M) && 74 - (CPHYSADDR(dm + size) < MT7621_LOWMEM_MAX_SIZE) && 75 - __builtin_memcmp(dm, dm + size, sizeof(detect_magic))) { 76 - memblock_add(MT7621_LOWMEM_BASE, MT7621_LOWMEM_MAX_SIZE); 77 - memblock_add(MT7621_HIGHMEM_BASE, MT7621_HIGHMEM_SIZE); 78 - } else { 79 - memblock_add(MT7621_LOWMEM_BASE, size); 80 - } 85 + memblock_add(MT7621_LOWMEM_BASE, MT7621_LOWMEM_MAX_SIZE); 86 + memblock_add(MT7621_HIGHMEM_BASE, MT7621_HIGHMEM_SIZE); 81 87 } 82 88 83 89 void __init ralink_of_remap(void)