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

parisc: kill WARN in free_initmem when DEBUG_KERNEL

Doing an IPI with local interrupts off triggers a warning. We
don't need to be quite so ridiculously paranoid. Also, clean up
a bit of the code a little.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>

+9 -20
+9 -20
arch/parisc/mm/init.c
··· 370 370 371 371 void free_initmem(void) 372 372 { 373 - unsigned long addr, init_begin, init_end; 374 - 375 - printk(KERN_INFO "Freeing unused kernel memory: "); 373 + unsigned long addr; 374 + unsigned long init_begin = (unsigned long)__init_begin; 375 + unsigned long init_end = (unsigned long)__init_end; 376 376 377 377 #ifdef CONFIG_DEBUG_KERNEL 378 378 /* Attempt to catch anyone trying to execute code here 379 379 * by filling the page with BRK insns. 380 - * 381 - * If we disable interrupts for all CPUs, then IPI stops working. 382 - * Kinda breaks the global cache flushing. 383 380 */ 384 - local_irq_disable(); 385 - 386 - memset(__init_begin, 0x00, 387 - (unsigned long)__init_end - (unsigned long)__init_begin); 388 - 389 - flush_data_cache(); 390 - asm volatile("sync" : : ); 391 - flush_icache_range((unsigned long)__init_begin, (unsigned long)__init_end); 392 - asm volatile("sync" : : ); 393 - 394 - local_irq_enable(); 381 + memset(init_begin, 0x00, init_end - init_begin); 382 + flush_icache_range(init_begin, init_end); 395 383 #endif 396 384 397 385 /* align __init_begin and __init_end to page size, 398 386 ignoring linker script where we might have tried to save RAM */ 399 - init_begin = PAGE_ALIGN((unsigned long)(__init_begin)); 400 - init_end = PAGE_ALIGN((unsigned long)(__init_end)); 387 + init_begin = PAGE_ALIGN(init_begin); 388 + init_end = PAGE_ALIGN(init_end); 401 389 for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) { 402 390 ClearPageReserved(virt_to_page(addr)); 403 391 init_page_count(virt_to_page(addr)); ··· 397 409 /* set up a new led state on systems shipped LED State panel */ 398 410 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 399 411 400 - printk("%luk freed\n", (init_end - init_begin) >> 10); 412 + printk(KERN_INFO "Freeing unused kernel memory: %luk freed\n", 413 + (init_end - init_begin) >> 10); 401 414 } 402 415 403 416