Merge branch 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: Kill off stray HAVE_FTRACE_SYSCALLS reference.
sh: Remove BKL from landisk gio.
sh: disabled cache handling fix.
sh: Fix up single page flushing to use PAGE_SIZE.

+24 -19
-1
arch/sh/Kconfig
··· 37 select HAVE_FTRACE_MCOUNT_RECORD 38 select HAVE_DYNAMIC_FTRACE 39 select HAVE_FUNCTION_TRACE_MCOUNT_TEST 40 - select HAVE_FTRACE_SYSCALLS 41 select HAVE_FUNCTION_GRAPH_TRACER 42 select HAVE_ARCH_KGDB 43 select ARCH_HIBERNATION_POSSIBLE if MMU
··· 37 select HAVE_FTRACE_MCOUNT_RECORD 38 select HAVE_DYNAMIC_FTRACE 39 select HAVE_FUNCTION_TRACE_MCOUNT_TEST 40 select HAVE_FUNCTION_GRAPH_TRACER 41 select HAVE_ARCH_KGDB 42 select ARCH_HIBERNATION_POSSIBLE if MMU
+4 -6
arch/sh/boards/mach-landisk/gio.c
··· 14 */ 15 #include <linux/module.h> 16 #include <linux/init.h> 17 - #include <linux/smp_lock.h> 18 #include <linux/kdev_t.h> 19 #include <linux/cdev.h> 20 #include <linux/fs.h> ··· 34 int minor; 35 int ret = -ENOENT; 36 37 - lock_kernel(); 38 minor = MINOR(inode->i_rdev); 39 if (minor < DEVCOUNT) { 40 if (openCnt > 0) { ··· 44 ret = 0; 45 } 46 } 47 - unlock_kernel(); 48 return ret; 49 } 50 ··· 59 return 0; 60 } 61 62 - static int gio_ioctl(struct inode *inode, struct file *filp, 63 - unsigned int cmd, unsigned long arg) 64 { 65 unsigned int data; 66 static unsigned int addr = 0; ··· 127 .owner = THIS_MODULE, 128 .open = gio_open, /* open */ 129 .release = gio_close, /* release */ 130 - .ioctl = gio_ioctl, /* ioctl */ 131 }; 132 133 static int __init gio_init(void)
··· 14 */ 15 #include <linux/module.h> 16 #include <linux/init.h> 17 #include <linux/kdev_t.h> 18 #include <linux/cdev.h> 19 #include <linux/fs.h> ··· 35 int minor; 36 int ret = -ENOENT; 37 38 + preempt_disable(); 39 minor = MINOR(inode->i_rdev); 40 if (minor < DEVCOUNT) { 41 if (openCnt > 0) { ··· 45 ret = 0; 46 } 47 } 48 + preempt_enable(); 49 return ret; 50 } 51 ··· 60 return 0; 61 } 62 63 + static long gio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 64 { 65 unsigned int data; 66 static unsigned int addr = 0; ··· 129 .owner = THIS_MODULE, 130 .open = gio_open, /* open */ 131 .release = gio_close, /* release */ 132 + .unlocked_ioctl = gio_ioctl, 133 }; 134 135 static int __init gio_init(void)
+10 -12
arch/sh/mm/cache-sh4.c
··· 26 #define MAX_DCACHE_PAGES 64 /* XXX: Tune for ways */ 27 #define MAX_ICACHE_PAGES 32 28 29 - static void __flush_cache_4096(unsigned long addr, unsigned long phys, 30 unsigned long exec_offset); 31 32 /* ··· 89 local_irq_restore(flags); 90 } 91 92 - static inline void flush_cache_4096(unsigned long start, 93 - unsigned long phys) 94 { 95 unsigned long flags, exec_offset = 0; 96 ··· 102 exec_offset = 0x20000000; 103 104 local_irq_save(flags); 105 - __flush_cache_4096(start | SH_CACHE_ASSOC, 106 - P1SEGADDR(phys), exec_offset); 107 local_irq_restore(flags); 108 } 109 ··· 127 128 /* Loop all the D-cache */ 129 n = boot_cpu_data.dcache.n_aliases; 130 - for (i = 0; i < n; i++, addr += 4096) 131 - flush_cache_4096(addr, phys); 132 } 133 134 wmb(); ··· 316 /* We only need to flush D-cache when we have alias */ 317 if ((address^phys) & alias_mask) { 318 /* Loop 4K of the D-cache */ 319 - flush_cache_4096( 320 CACHE_OC_ADDRESS_ARRAY | (address & alias_mask), 321 phys); 322 /* Loop another 4K of the D-cache */ 323 - flush_cache_4096( 324 CACHE_OC_ADDRESS_ARRAY | (phys & alias_mask), 325 phys); 326 } ··· 335 * kernel has never executed the code through its identity 336 * translation. 337 */ 338 - flush_cache_4096( 339 CACHE_IC_ADDRESS_ARRAY | (address & alias_mask), 340 phys); 341 } ··· 391 } 392 393 /** 394 - * __flush_cache_4096 395 * 396 * @addr: address in memory mapped cache array 397 * @phys: P1 address to flush (has to match tags if addr has 'A' bit ··· 404 * operation (purge/write-back) is selected by the lower 2 bits of 405 * 'phys'. 406 */ 407 - static void __flush_cache_4096(unsigned long addr, unsigned long phys, 408 unsigned long exec_offset) 409 { 410 int way_count;
··· 26 #define MAX_DCACHE_PAGES 64 /* XXX: Tune for ways */ 27 #define MAX_ICACHE_PAGES 32 28 29 + static void __flush_cache_one(unsigned long addr, unsigned long phys, 30 unsigned long exec_offset); 31 32 /* ··· 89 local_irq_restore(flags); 90 } 91 92 + static inline void flush_cache_one(unsigned long start, unsigned long phys) 93 { 94 unsigned long flags, exec_offset = 0; 95 ··· 103 exec_offset = 0x20000000; 104 105 local_irq_save(flags); 106 + __flush_cache_one(start | SH_CACHE_ASSOC, P1SEGADDR(phys), exec_offset); 107 local_irq_restore(flags); 108 } 109 ··· 129 130 /* Loop all the D-cache */ 131 n = boot_cpu_data.dcache.n_aliases; 132 + for (i = 0; i < n; i++, addr += PAGE_SIZE) 133 + flush_cache_one(addr, phys); 134 } 135 136 wmb(); ··· 318 /* We only need to flush D-cache when we have alias */ 319 if ((address^phys) & alias_mask) { 320 /* Loop 4K of the D-cache */ 321 + flush_cache_one( 322 CACHE_OC_ADDRESS_ARRAY | (address & alias_mask), 323 phys); 324 /* Loop another 4K of the D-cache */ 325 + flush_cache_one( 326 CACHE_OC_ADDRESS_ARRAY | (phys & alias_mask), 327 phys); 328 } ··· 337 * kernel has never executed the code through its identity 338 * translation. 339 */ 340 + flush_cache_one( 341 CACHE_IC_ADDRESS_ARRAY | (address & alias_mask), 342 phys); 343 } ··· 393 } 394 395 /** 396 + * __flush_cache_one 397 * 398 * @addr: address in memory mapped cache array 399 * @phys: P1 address to flush (has to match tags if addr has 'A' bit ··· 406 * operation (purge/write-back) is selected by the lower 2 bits of 407 * 'phys'. 408 */ 409 + static void __flush_cache_one(unsigned long addr, unsigned long phys, 410 unsigned long exec_offset) 411 { 412 int way_count;
+10
arch/sh/mm/cache.c
··· 265 266 void __init cpu_cache_init(void) 267 { 268 compute_alias(&boot_cpu_data.icache); 269 compute_alias(&boot_cpu_data.dcache); 270 compute_alias(&boot_cpu_data.scache); ··· 274 __flush_wback_region = noop__flush_region; 275 __flush_purge_region = noop__flush_region; 276 __flush_invalidate_region = noop__flush_region; 277 278 if (boot_cpu_data.family == CPU_FAMILY_SH2) { 279 extern void __weak sh2_cache_init(void); ··· 321 sh5_cache_init(); 322 } 323 324 emit_cache_params(); 325 }
··· 265 266 void __init cpu_cache_init(void) 267 { 268 + unsigned int cache_disabled = !(__raw_readl(CCR) & CCR_CACHE_ENABLE); 269 + 270 compute_alias(&boot_cpu_data.icache); 271 compute_alias(&boot_cpu_data.dcache); 272 compute_alias(&boot_cpu_data.scache); ··· 272 __flush_wback_region = noop__flush_region; 273 __flush_purge_region = noop__flush_region; 274 __flush_invalidate_region = noop__flush_region; 275 + 276 + /* 277 + * No flushing is necessary in the disabled cache case so we can 278 + * just keep the noop functions in local_flush_..() and __flush_..() 279 + */ 280 + if (unlikely(cache_disabled)) 281 + goto skip; 282 283 if (boot_cpu_data.family == CPU_FAMILY_SH2) { 284 extern void __weak sh2_cache_init(void); ··· 312 sh5_cache_init(); 313 } 314 315 + skip: 316 emit_cache_params(); 317 }