瀏覽代碼

Merge branch 'sh/stable-updates'

Paul Mundt 16 年之前
父節點
當前提交
95019b48ad
共有 100 個文件被更改,包括 1031 次插入331 次删除
  1. 20 1
      Documentation/scsi/hptiop.txt
  2. 21 1
      MAINTAINERS
  3. 1 1
      Makefile
  4. 3 3
      arch/arm/include/asm/bitops.h
  5. 1 0
      arch/arm/kernel/time.c
  6. 41 35
      arch/arm/kernel/traps.c
  7. 2 2
      arch/arm/mach-bcmring/core.c
  8. 1 1
      arch/arm/mach-bcmring/include/mach/system.h
  9. 35 9
      arch/arm/mach-ep93xx/Kconfig
  10. 9 0
      arch/arm/mach-ep93xx/Makefile.boot
  11. 119 47
      arch/arm/mach-ep93xx/clock.c
  12. 23 8
      arch/arm/mach-ep93xx/core.c
  13. 24 7
      arch/arm/mach-ep93xx/edb93xx.c
  14. 22 20
      arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
  15. 4 12
      arch/arm/mach-ep93xx/include/mach/gpio.h
  16. 6 0
      arch/arm/mach-ep93xx/include/mach/memory.h
  17. 3 1
      arch/arm/mach-ep93xx/include/mach/platform.h
  18. 77 55
      arch/arm/mach-ep93xx/micro9.c
  19. 1 0
      arch/arm/mach-integrator/pci_v3.c
  20. 1 1
      arch/arm/mach-pxa/cpufreq-pxa2xx.c
  21. 1 1
      arch/arm/mach-pxa/csb726.c
  22. 1 0
      arch/arm/mach-sa1100/Makefile
  23. 18 2
      arch/arm/mm/cache-v6.S
  24. 17 2
      arch/arm/mm/cache-v7.S
  25. 3 6
      arch/arm/mm/fault-armv.c
  26. 5 0
      arch/arm/mm/fault.c
  27. 2 0
      arch/arm/mm/highmem.c
  28. 1 1
      arch/arm/mm/init.c
  29. 1 0
      arch/arm/plat-s3c24xx/adc.c
  30. 1 0
      arch/blackfin/kernel/time.c
  31. 1 0
      arch/m32r/kernel/smp.c
  32. 4 3
      arch/s390/include/asm/delay.h
  33. 12 0
      arch/s390/include/asm/elf.h
  34. 4 0
      arch/s390/include/asm/ptrace.h
  35. 15 0
      arch/s390/include/asm/ucontext.h
  36. 34 1
      arch/s390/kernel/compat_signal.c
  37. 1 1
      arch/s390/kernel/compat_wrapper.S
  38. 0 3
      arch/s390/kernel/ftrace.c
  39. 3 0
      arch/s390/kernel/module.c
  40. 70 0
      arch/s390/kernel/ptrace.c
  41. 12 3
      arch/s390/kernel/setup.c
  42. 19 7
      arch/s390/kernel/swsusp_asm64.S
  43. 8 8
      arch/s390/kernel/vdso.c
  44. 1 0
      arch/s390/kernel/vmlinux.lds.S
  45. 16 11
      arch/s390/lib/delay.c
  46. 6 6
      arch/s390/lib/uaccess_mvcos.c
  47. 8 6
      arch/s390/lib/uaccess_std.c
  48. 8 2
      arch/s390/mm/pgtable.c
  49. 4 3
      arch/sh/kernel/traps_32.c
  50. 1 1
      arch/sh/mm/cache.c
  51. 1 0
      arch/um/drivers/line.c
  52. 1 0
      arch/um/drivers/port_kern.c
  53. 1 0
      arch/um/kernel/irq.c
  54. 1 0
      arch/x86/kernel/cpu/mcheck/mce_intel.c
  55. 2 2
      arch/x86/kernel/e820.c
  56. 1 0
      arch/x86/kernel/pci-gart_64.c
  57. 1 0
      arch/x86/kernel/reboot.c
  58. 1 0
      arch/xtensa/kernel/time.c
  59. 1 0
      crypto/aead.c
  60. 1 0
      drivers/char/applicom.c
  61. 1 0
      drivers/char/epca.c
  62. 1 0
      drivers/char/generic_serial.c
  63. 1 0
      drivers/char/istallion.c
  64. 1 0
      drivers/char/nozomi.c
  65. 1 0
      drivers/char/pty.c
  66. 1 0
      drivers/char/rio/riocmd.c
  67. 1 0
      drivers/char/rio/rioctrl.c
  68. 1 0
      drivers/char/rio/riotty.c
  69. 1 0
      drivers/char/ser_a2232.c
  70. 1 0
      drivers/char/stallion.c
  71. 1 0
      drivers/char/tlclk.c
  72. 1 1
      drivers/hwmon/Kconfig
  73. 284 55
      drivers/hwmon/asus_atk0110.c
  74. 7 1
      drivers/hwmon/sht15.c
  75. 1 0
      drivers/ieee1394/raw1394.c
  76. 1 0
      drivers/ieee1394/video1394.c
  77. 1 0
      drivers/infiniband/core/iwcm.c
  78. 1 0
      drivers/infiniband/core/ucma.c
  79. 1 0
      drivers/infiniband/hw/cxgb3/iwch_provider.c
  80. 1 0
      drivers/infiniband/hw/cxgb3/iwch_qp.c
  81. 1 0
      drivers/infiniband/hw/ipath/ipath_driver.c
  82. 1 0
      drivers/infiniband/hw/ipath/ipath_iba7220.c
  83. 1 0
      drivers/infiniband/hw/ipath/ipath_intr.c
  84. 1 0
      drivers/infiniband/hw/ipath/ipath_qp.c
  85. 1 0
      drivers/infiniband/hw/ipath/ipath_ruc.c
  86. 1 0
      drivers/infiniband/hw/ipath/ipath_ud.c
  87. 1 0
      drivers/infiniband/hw/ipath/ipath_user_pages.c
  88. 1 0
      drivers/infiniband/hw/ipath/ipath_user_sdma.c
  89. 1 0
      drivers/infiniband/hw/ipath/ipath_verbs_mcast.c
  90. 1 1
      drivers/infiniband/ulp/iser/iscsi_iser.c
  91. 1 0
      drivers/input/keyboard/hilkbd.c
  92. 1 0
      drivers/input/keyboard/sunkbd.c
  93. 1 0
      drivers/input/serio/libps2.c
  94. 1 0
      drivers/input/serio/serio_raw.c
  95. 1 0
      drivers/input/serio/serport.c
  96. 1 0
      drivers/isdn/capi/kcapi.c
  97. 1 0
      drivers/isdn/hisax/arcofi.c
  98. 1 0
      drivers/isdn/hisax/hfc_2bds0.c
  99. 1 0
      drivers/isdn/hisax/hfc_pci.c
  100. 1 0
      drivers/isdn/hysdn/hysdn_procconf.c

+ 20 - 1
Documentation/scsi/hptiop.txt

@@ -3,6 +3,25 @@ HIGHPOINT ROCKETRAID 3xxx/4xxx ADAPTER DRIVER (hptiop)
 Controller Register Map
 Controller Register Map
 -------------------------
 -------------------------
 
 
+For RR44xx Intel IOP based adapters, the controller IOP is accessed via PCI BAR0 and BAR2:
+
+     BAR0 offset    Register
+            0x11C5C Link Interface IRQ Set
+            0x11C60 Link Interface IRQ Clear
+
+     BAR2 offset    Register
+            0x10    Inbound Message Register 0
+            0x14    Inbound Message Register 1
+            0x18    Outbound Message Register 0
+            0x1C    Outbound Message Register 1
+            0x20    Inbound Doorbell Register
+            0x24    Inbound Interrupt Status Register
+            0x28    Inbound Interrupt Mask Register
+            0x30    Outbound Interrupt Status Register
+            0x34    Outbound Interrupt Mask Register
+            0x40    Inbound Queue Port
+            0x44    Outbound Queue Port
+
 For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0:
 For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0:
 
 
      BAR0 offset    Register
      BAR0 offset    Register
@@ -93,7 +112,7 @@ The driver exposes following sysfs attributes:
 
 
 
 
 -----------------------------------------------------------------------------
 -----------------------------------------------------------------------------
-Copyright (C) 2006-2007 HighPoint Technologies, Inc. All Rights Reserved.
+Copyright (C) 2006-2009 HighPoint Technologies, Inc. All Rights Reserved.
 
 
   This file is distributed in the hope that it will be useful,
   This file is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of

+ 21 - 1
MAINTAINERS

@@ -577,6 +577,11 @@ M:	Mike Rapoport <mike@compulab.co.il>
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:	Maintained
 S:	Maintained
 
 
+ARM/CONTEC MICRO9 MACHINE SUPPORT
+M:	Hubert Feurstein <hubert.feurstein@contec.at>
+S:	Maintained
+F:	arch/arm/mach-ep93xx/micro9.c
+
 ARM/CORGI MACHINE SUPPORT
 ARM/CORGI MACHINE SUPPORT
 M:	Richard Purdie <rpurdie@rpsys.net>
 M:	Richard Purdie <rpurdie@rpsys.net>
 S:	Maintained
 S:	Maintained
@@ -1231,6 +1236,13 @@ L:	netdev@vger.kernel.org
 S:	Supported
 S:	Supported
 F:	drivers/net/tg3.*
 F:	drivers/net/tg3.*
 
 
+BROCADE BFA FC SCSI DRIVER
+P:      Jing Huang
+M:      huangj@brocade.com
+L:      linux-scsi@vger.kernel.org
+S:      Supported
+F:      drivers/scsi/bfa/
+
 BSG (block layer generic sg v4 driver)
 BSG (block layer generic sg v4 driver)
 M:	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
 M:	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
 L:	linux-scsi@vger.kernel.org
 L:	linux-scsi@vger.kernel.org
@@ -2058,7 +2070,7 @@ S:	Maintained
 F:	fs/*
 F:	fs/*
 
 
 FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER
 FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER
-M:	Riku Voipio <riku.vipio@iki.fi>
+M:	Riku Voipio <riku.voipio@iki.fi>
 L:	lm-sensors@lm-sensors.org
 L:	lm-sensors@lm-sensors.org
 S:	Maintained
 S:	Maintained
 F:	drivers/hwmon/f75375s.c
 F:	drivers/hwmon/f75375s.c
@@ -4646,6 +4658,14 @@ F:	drivers/ata/
 F:	include/linux/ata.h
 F:	include/linux/ata.h
 F:	include/linux/libata.h
 F:	include/linux/libata.h
 
 
+SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER
+P:     Jayamohan Kallickal
+M:     jayamohank@serverengines.com
+L:     linux-scsi@vger.kernel.org
+W:     http://www.serverengines.com
+S:     Supported
+F:     drivers/scsi/be2iscsi/
+
 SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER
 SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER
 M:	Sathya Perla <sathyap@serverengines.com>
 M:	Sathya Perla <sathyap@serverengines.com>
 M:	Subbu Seetharaman <subbus@serverengines.com>
 M:	Subbu Seetharaman <subbus@serverengines.com>

+ 1 - 1
Makefile

@@ -1,7 +1,7 @@
 VERSION = 2
 VERSION = 2
 PATCHLEVEL = 6
 PATCHLEVEL = 6
 SUBLEVEL = 32
 SUBLEVEL = 32
-EXTRAVERSION = -rc3
+EXTRAVERSION = -rc4
 NAME = Man-Eating Seals of Antiquity
 NAME = Man-Eating Seals of Antiquity
 
 
 # *DOCUMENTATION*
 # *DOCUMENTATION*

+ 3 - 3
arch/arm/include/asm/bitops.h

@@ -84,7 +84,7 @@ ____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
 	*p = res | mask;
 	*p = res | mask;
 	raw_local_irq_restore(flags);
 	raw_local_irq_restore(flags);
 
 
-	return res & mask;
+	return (res & mask) != 0;
 }
 }
 
 
 static inline int
 static inline int
@@ -101,7 +101,7 @@ ____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
 	*p = res & ~mask;
 	*p = res & ~mask;
 	raw_local_irq_restore(flags);
 	raw_local_irq_restore(flags);
 
 
-	return res & mask;
+	return (res & mask) != 0;
 }
 }
 
 
 static inline int
 static inline int
@@ -118,7 +118,7 @@ ____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
 	*p = res ^ mask;
 	*p = res ^ mask;
 	raw_local_irq_restore(flags);
 	raw_local_irq_restore(flags);
 
 
-	return res & mask;
+	return (res & mask) != 0;
 }
 }
 
 
 #include <asm-generic/bitops/non-atomic.h>
 #include <asm-generic/bitops/non-atomic.h>

+ 1 - 0
arch/arm/kernel/time.c

@@ -21,6 +21,7 @@
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/time.h>
 #include <linux/time.h>
 #include <linux/init.h>
 #include <linux/init.h>
+#include <linux/sched.h>
 #include <linux/smp.h>
 #include <linux/smp.h>
 #include <linux/timex.h>
 #include <linux/timex.h>
 #include <linux/errno.h>
 #include <linux/errno.h>

+ 41 - 35
arch/arm/kernel/traps.c

@@ -45,21 +45,21 @@ static int __init user_debug_setup(char *str)
 __setup("user_debug=", user_debug_setup);
 __setup("user_debug=", user_debug_setup);
 #endif
 #endif
 
 
-static void dump_mem(const char *str, unsigned long bottom, unsigned long top);
+static void dump_mem(const char *, const char *, unsigned long, unsigned long);
 
 
 void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame)
 void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame)
 {
 {
 #ifdef CONFIG_KALLSYMS
 #ifdef CONFIG_KALLSYMS
-	printk("[<%08lx>] ", where);
-	print_symbol("(%s) ", where);
-	printk("from [<%08lx>] ", from);
-	print_symbol("(%s)\n", from);
+	char sym1[KSYM_SYMBOL_LEN], sym2[KSYM_SYMBOL_LEN];
+	sprint_symbol(sym1, where);
+	sprint_symbol(sym2, from);
+	printk("[<%08lx>] (%s) from [<%08lx>] (%s)\n", where, sym1, from, sym2);
 #else
 #else
 	printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
 	printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
 #endif
 #endif
 
 
 	if (in_exception_text(where))
 	if (in_exception_text(where))
-		dump_mem("Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs));
+		dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs));
 }
 }
 
 
 #ifndef CONFIG_ARM_UNWIND
 #ifndef CONFIG_ARM_UNWIND
@@ -81,9 +81,10 @@ static int verify_stack(unsigned long sp)
 /*
 /*
  * Dump out the contents of some memory nicely...
  * Dump out the contents of some memory nicely...
  */
  */
-static void dump_mem(const char *str, unsigned long bottom, unsigned long top)
+static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
+		     unsigned long top)
 {
 {
-	unsigned long p = bottom & ~31;
+	unsigned long first;
 	mm_segment_t fs;
 	mm_segment_t fs;
 	int i;
 	int i;
 
 
@@ -95,33 +96,37 @@ static void dump_mem(const char *str, unsigned long bottom, unsigned long top)
 	fs = get_fs();
 	fs = get_fs();
 	set_fs(KERNEL_DS);
 	set_fs(KERNEL_DS);
 
 
-	printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top);
+	printk("%s%s(0x%08lx to 0x%08lx)\n", lvl, str, bottom, top);
 
 
-	for (p = bottom & ~31; p < top;) {
-		printk("%04lx: ", p & 0xffff);
+	for (first = bottom & ~31; first < top; first += 32) {
+		unsigned long p;
+		char str[sizeof(" 12345678") * 8 + 1];
 
 
-		for (i = 0; i < 8; i++, p += 4) {
-			unsigned int val;
+		memset(str, ' ', sizeof(str));
+		str[sizeof(str) - 1] = '\0';
 
 
-			if (p < bottom || p >= top)
-				printk("         ");
-			else {
-				__get_user(val, (unsigned long *)p);
-				printk("%08x ", val);
+		for (p = first, i = 0; i < 8 && p < top; i++, p += 4) {
+			if (p >= bottom && p < top) {
+				unsigned long val;
+				if (__get_user(val, (unsigned long *)p) == 0)
+					sprintf(str + i * 9, " %08lx", val);
+				else
+					sprintf(str + i * 9, " ????????");
 			}
 			}
 		}
 		}
-		printk ("\n");
+		printk("%s%04lx:%s\n", lvl, first & 0xffff, str);
 	}
 	}
 
 
 	set_fs(fs);
 	set_fs(fs);
 }
 }
 
 
-static void dump_instr(struct pt_regs *regs)
+static void dump_instr(const char *lvl, struct pt_regs *regs)
 {
 {
 	unsigned long addr = instruction_pointer(regs);
 	unsigned long addr = instruction_pointer(regs);
 	const int thumb = thumb_mode(regs);
 	const int thumb = thumb_mode(regs);
 	const int width = thumb ? 4 : 8;
 	const int width = thumb ? 4 : 8;
 	mm_segment_t fs;
 	mm_segment_t fs;
+	char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str;
 	int i;
 	int i;
 
 
 	/*
 	/*
@@ -132,7 +137,6 @@ static void dump_instr(struct pt_regs *regs)
 	fs = get_fs();
 	fs = get_fs();
 	set_fs(KERNEL_DS);
 	set_fs(KERNEL_DS);
 
 
-	printk("Code: ");
 	for (i = -4; i < 1; i++) {
 	for (i = -4; i < 1; i++) {
 		unsigned int val, bad;
 		unsigned int val, bad;
 
 
@@ -142,13 +146,14 @@ static void dump_instr(struct pt_regs *regs)
 			bad = __get_user(val, &((u32 *)addr)[i]);
 			bad = __get_user(val, &((u32 *)addr)[i]);
 
 
 		if (!bad)
 		if (!bad)
-			printk(i == 0 ? "(%0*x) " : "%0*x ", width, val);
+			p += sprintf(p, i == 0 ? "(%0*x) " : "%0*x ",
+					width, val);
 		else {
 		else {
-			printk("bad PC value.");
+			p += sprintf(p, "bad PC value");
 			break;
 			break;
 		}
 		}
 	}
 	}
-	printk("\n");
+	printk("%sCode: %s\n", lvl, str);
 
 
 	set_fs(fs);
 	set_fs(fs);
 }
 }
@@ -224,18 +229,19 @@ static void __die(const char *str, int err, struct thread_info *thread, struct p
 	struct task_struct *tsk = thread->task;
 	struct task_struct *tsk = thread->task;
 	static int die_counter;
 	static int die_counter;
 
 
-	printk("Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n",
+	printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n",
 	       str, err, ++die_counter);
 	       str, err, ++die_counter);
+	sysfs_printk_last_file();
 	print_modules();
 	print_modules();
 	__show_regs(regs);
 	__show_regs(regs);
-	printk("Process %s (pid: %d, stack limit = 0x%p)\n",
-		tsk->comm, task_pid_nr(tsk), thread + 1);
+	printk(KERN_EMERG "Process %.*s (pid: %d, stack limit = 0x%p)\n",
+		TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), thread + 1);
 
 
 	if (!user_mode(regs) || in_interrupt()) {
 	if (!user_mode(regs) || in_interrupt()) {
-		dump_mem("Stack: ", regs->ARM_sp,
+		dump_mem(KERN_EMERG, "Stack: ", regs->ARM_sp,
 			 THREAD_SIZE + (unsigned long)task_stack_page(tsk));
 			 THREAD_SIZE + (unsigned long)task_stack_page(tsk));
 		dump_backtrace(regs, tsk);
 		dump_backtrace(regs, tsk);
-		dump_instr(regs);
+		dump_instr(KERN_EMERG, regs);
 	}
 	}
 }
 }
 
 
@@ -250,13 +256,14 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
 
 
 	oops_enter();
 	oops_enter();
 
 
-	console_verbose();
 	spin_lock_irq(&die_lock);
 	spin_lock_irq(&die_lock);
+	console_verbose();
 	bust_spinlocks(1);
 	bust_spinlocks(1);
 	__die(str, err, thread, regs);
 	__die(str, err, thread, regs);
 	bust_spinlocks(0);
 	bust_spinlocks(0);
 	add_taint(TAINT_DIE);
 	add_taint(TAINT_DIE);
 	spin_unlock_irq(&die_lock);
 	spin_unlock_irq(&die_lock);
+	oops_exit();
 
 
 	if (in_interrupt())
 	if (in_interrupt())
 		panic("Fatal exception in interrupt");
 		panic("Fatal exception in interrupt");
@@ -264,7 +271,6 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
 	if (panic_on_oops)
 	if (panic_on_oops)
 		panic("Fatal exception");
 		panic("Fatal exception");
 
 
-	oops_exit();
 	do_exit(SIGSEGV);
 	do_exit(SIGSEGV);
 }
 }
 
 
@@ -349,7 +355,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
 	if (user_debug & UDBG_UNDEFINED) {
 	if (user_debug & UDBG_UNDEFINED) {
 		printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n",
 		printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n",
 			current->comm, task_pid_nr(current), pc);
 			current->comm, task_pid_nr(current), pc);
-		dump_instr(regs);
+		dump_instr(KERN_INFO, regs);
 	}
 	}
 #endif
 #endif
 
 
@@ -400,7 +406,7 @@ static int bad_syscall(int n, struct pt_regs *regs)
 	if (user_debug & UDBG_SYSCALL) {
 	if (user_debug & UDBG_SYSCALL) {
 		printk(KERN_ERR "[%d] %s: obsolete system call %08x.\n",
 		printk(KERN_ERR "[%d] %s: obsolete system call %08x.\n",
 			task_pid_nr(current), current->comm, n);
 			task_pid_nr(current), current->comm, n);
-		dump_instr(regs);
+		dump_instr(KERN_ERR, regs);
 	}
 	}
 #endif
 #endif
 
 
@@ -579,7 +585,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
 	if (user_debug & UDBG_SYSCALL) {
 	if (user_debug & UDBG_SYSCALL) {
 		printk("[%d] %s: arm syscall %d\n",
 		printk("[%d] %s: arm syscall %d\n",
 		       task_pid_nr(current), current->comm, no);
 		       task_pid_nr(current), current->comm, no);
-		dump_instr(regs);
+		dump_instr("", regs);
 		if (user_mode(regs)) {
 		if (user_mode(regs)) {
 			__show_regs(regs);
 			__show_regs(regs);
 			c_backtrace(regs->ARM_fp, processor_mode(regs));
 			c_backtrace(regs->ARM_fp, processor_mode(regs));
@@ -656,7 +662,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
 	if (user_debug & UDBG_BADABORT) {
 	if (user_debug & UDBG_BADABORT) {
 		printk(KERN_ERR "[%d] %s: bad data abort: code %d instr 0x%08lx\n",
 		printk(KERN_ERR "[%d] %s: bad data abort: code %d instr 0x%08lx\n",
 			task_pid_nr(current), current->comm, code, instr);
 			task_pid_nr(current), current->comm, code, instr);
-		dump_instr(regs);
+		dump_instr(KERN_ERR, regs);
 		show_pte(current->mm, addr);
 		show_pte(current->mm, addr);
 	}
 	}
 #endif
 #endif

+ 2 - 2
arch/arm/mach-bcmring/core.c

@@ -271,12 +271,12 @@ static struct irqaction bcmring_timer_irq = {
 	.handler = bcmring_timer_interrupt,
 	.handler = bcmring_timer_interrupt,
 };
 };
 
 
-static cycle_t bcmring_get_cycles_timer1(void)
+static cycle_t bcmring_get_cycles_timer1(struct clocksource *cs)
 {
 {
 	return ~readl(TIMER1_VA_BASE + TIMER_VALUE);
 	return ~readl(TIMER1_VA_BASE + TIMER_VALUE);
 }
 }
 
 
-static cycle_t bcmring_get_cycles_timer3(void)
+static cycle_t bcmring_get_cycles_timer3(struct clocksource *cs)
 {
 {
 	return ~readl(TIMER3_VA_BASE + TIMER_VALUE);
 	return ~readl(TIMER3_VA_BASE + TIMER_VALUE);
 }
 }

+ 1 - 1
arch/arm/mach-bcmring/include/mach/system.h

@@ -29,7 +29,7 @@ static inline void arch_idle(void)
 	cpu_do_idle();
 	cpu_do_idle();
 }
 }
 
 
-static inline void arch_reset(char mode, char *cmd)
+static inline void arch_reset(char mode, const char *cmd)
 {
 {
 	printk("arch_reset:%c %x\n", mode, bcmring_arch_warm_reboot);
 	printk("arch_reset:%c %x\n", mode, bcmring_arch_warm_reboot);
 
 

+ 35 - 9
arch/arm/mach-ep93xx/Kconfig

@@ -17,13 +17,31 @@ config EP93XX_SDCE3_SYNC_PHYS_OFFSET
 	bool "0x00000000 - SDCE3/SyncBoot"
 	bool "0x00000000 - SDCE3/SyncBoot"
 	help
 	help
 	  Select this option if you want support for EP93xx boards with the
 	  Select this option if you want support for EP93xx boards with the
-	  first SDRAM bank at 0x00000000
+	  first SDRAM bank at 0x00000000.
 
 
 config EP93XX_SDCE0_PHYS_OFFSET
 config EP93XX_SDCE0_PHYS_OFFSET
 	bool "0xc0000000 - SDCEO"
 	bool "0xc0000000 - SDCEO"
 	help
 	help
 	  Select this option if you want support for EP93xx boards with the
 	  Select this option if you want support for EP93xx boards with the
-	  first SDRAM bank at 0xc0000000
+	  first SDRAM bank at 0xc0000000.
+
+config EP93XX_SDCE1_PHYS_OFFSET
+	bool "0xd0000000 - SDCE1"
+	help
+	  Select this option if you want support for EP93xx boards with the
+	  first SDRAM bank at 0xd0000000.
+
+config EP93XX_SDCE2_PHYS_OFFSET
+	bool "0xe0000000 - SDCE2"
+	help
+	  Select this option if you want support for EP93xx boards with the
+	  first SDRAM bank at 0xe0000000.
+
+config EP93XX_SDCE3_ASYNC_PHYS_OFFSET
+	bool "0xf0000000 - SDCE3/AsyncBoot"
+	help
+	  Select this option if you want support for EP93xx boards with the
+	  first SDRAM bank at 0xf0000000.
 
 
 endchoice
 endchoice
 
 
@@ -112,28 +130,36 @@ config MACH_MICRO9
 	bool
 	bool
 
 
 config MACH_MICRO9H
 config MACH_MICRO9H
-	bool "Support Contec Hypercontrol Micro9-H"
+	bool "Support Contec Micro9-High"
 	depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
 	depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
 	select MACH_MICRO9
 	select MACH_MICRO9
 	help
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  Say 'Y' here if you want your kernel to support the
-	  Contec Hypercontrol Micro9-H board.
+	  Contec Micro9-High board.
 
 
 config MACH_MICRO9M
 config MACH_MICRO9M
-	bool "Support Contec Hypercontrol Micro9-M"
-	depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
+	bool "Support Contec Micro9-Mid"
+	depends on EP93XX_SDCE3_ASYNC_PHYS_OFFSET
 	select MACH_MICRO9
 	select MACH_MICRO9
 	help
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  Say 'Y' here if you want your kernel to support the
-	  Contec Hypercontrol Micro9-M board.
+	  Contec Micro9-Mid board.
 
 
 config MACH_MICRO9L
 config MACH_MICRO9L
-	bool "Support Contec Hypercontrol Micro9-L"
+	bool "Support Contec Micro9-Lite"
 	depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
 	depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
 	select MACH_MICRO9
 	select MACH_MICRO9
 	help
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  Say 'Y' here if you want your kernel to support the
-	  Contec Hypercontrol Micro9-L board.
+	  Contec Micro9-Lite board.
+
+config MACH_MICRO9S
+	bool "Support Contec Micro9-Slim"
+	depends on EP93XX_SDCE3_ASYNC_PHYS_OFFSET
+	select MACH_MICRO9
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Contec Micro9-Slim board.
 
 
 config MACH_TS72XX
 config MACH_TS72XX
 	bool "Support Technologic Systems TS-72xx SBC"
 	bool "Support Technologic Systems TS-72xx SBC"

+ 9 - 0
arch/arm/mach-ep93xx/Makefile.boot

@@ -3,3 +3,12 @@ params_phys-$(CONFIG_EP93XX_SDCE3_SYNC_PHYS_OFFSET)	:= 0x00000100
 
 
    zreladdr-$(CONFIG_EP93XX_SDCE0_PHYS_OFFSET)		:= 0xc0008000
    zreladdr-$(CONFIG_EP93XX_SDCE0_PHYS_OFFSET)		:= 0xc0008000
 params_phys-$(CONFIG_EP93XX_SDCE0_PHYS_OFFSET)		:= 0xc0000100
 params_phys-$(CONFIG_EP93XX_SDCE0_PHYS_OFFSET)		:= 0xc0000100
+
+   zreladdr-$(CONFIG_EP93XX_SDCE1_PHYS_OFFSET)		:= 0xd0008000
+params_phys-$(CONFIG_EP93XX_SDCE1_PHYS_OFFSET)		:= 0xd0000100
+
+   zreladdr-$(CONFIG_EP93XX_SDCE2_PHYS_OFFSET)		:= 0xe0008000
+params_phys-$(CONFIG_EP93XX_SDCE2_PHYS_OFFSET)		:= 0xe0000100
+
+   zreladdr-$(CONFIG_EP93XX_SDCE3_ASYNC_PHYS_OFFSET)	:= 0xf0008000
+params_phys-$(CONFIG_EP93XX_SDCE3_ASYNC_PHYS_OFFSET)	:= 0xf0000100

+ 119 - 47
arch/arm/mach-ep93xx/clock.c

@@ -16,13 +16,16 @@
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/string.h>
 #include <linux/io.h>
 #include <linux/io.h>
+#include <linux/spinlock.h>
+
+#include <mach/hardware.h>
 
 
 #include <asm/clkdev.h>
 #include <asm/clkdev.h>
 #include <asm/div64.h>
 #include <asm/div64.h>
-#include <mach/hardware.h>
 
 
 
 
 struct clk {
 struct clk {
+	struct clk	*parent;
 	unsigned long	rate;
 	unsigned long	rate;
 	int		users;
 	int		users;
 	int		sw_locked;
 	int		sw_locked;
@@ -39,40 +42,60 @@ static unsigned long get_uart_rate(struct clk *clk);
 static int set_keytchclk_rate(struct clk *clk, unsigned long rate);
 static int set_keytchclk_rate(struct clk *clk, unsigned long rate);
 static int set_div_rate(struct clk *clk, unsigned long rate);
 static int set_div_rate(struct clk *clk, unsigned long rate);
 
 
+
+static struct clk clk_xtali = {
+	.rate		= EP93XX_EXT_CLK_RATE,
+};
 static struct clk clk_uart1 = {
 static struct clk clk_uart1 = {
+	.parent		= &clk_xtali,
 	.sw_locked	= 1,
 	.sw_locked	= 1,
 	.enable_reg	= EP93XX_SYSCON_DEVCFG,
 	.enable_reg	= EP93XX_SYSCON_DEVCFG,
 	.enable_mask	= EP93XX_SYSCON_DEVCFG_U1EN,
 	.enable_mask	= EP93XX_SYSCON_DEVCFG_U1EN,
 	.get_rate	= get_uart_rate,
 	.get_rate	= get_uart_rate,
 };
 };
 static struct clk clk_uart2 = {
 static struct clk clk_uart2 = {
+	.parent		= &clk_xtali,
 	.sw_locked	= 1,
 	.sw_locked	= 1,
 	.enable_reg	= EP93XX_SYSCON_DEVCFG,
 	.enable_reg	= EP93XX_SYSCON_DEVCFG,
 	.enable_mask	= EP93XX_SYSCON_DEVCFG_U2EN,
 	.enable_mask	= EP93XX_SYSCON_DEVCFG_U2EN,
 	.get_rate	= get_uart_rate,
 	.get_rate	= get_uart_rate,
 };
 };
 static struct clk clk_uart3 = {
 static struct clk clk_uart3 = {
+	.parent		= &clk_xtali,
 	.sw_locked	= 1,
 	.sw_locked	= 1,
 	.enable_reg	= EP93XX_SYSCON_DEVCFG,
 	.enable_reg	= EP93XX_SYSCON_DEVCFG,
 	.enable_mask	= EP93XX_SYSCON_DEVCFG_U3EN,
 	.enable_mask	= EP93XX_SYSCON_DEVCFG_U3EN,
 	.get_rate	= get_uart_rate,
 	.get_rate	= get_uart_rate,
 };
 };
-static struct clk clk_pll1;
-static struct clk clk_f;
-static struct clk clk_h;
-static struct clk clk_p;
-static struct clk clk_pll2;
+static struct clk clk_pll1 = {
+	.parent		= &clk_xtali,
+};
+static struct clk clk_f = {
+	.parent		= &clk_pll1,
+};
+static struct clk clk_h = {
+	.parent		= &clk_pll1,
+};
+static struct clk clk_p = {
+	.parent		= &clk_pll1,
+};
+static struct clk clk_pll2 = {
+	.parent		= &clk_xtali,
+};
 static struct clk clk_usb_host = {
 static struct clk clk_usb_host = {
+	.parent		= &clk_pll2,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_USH_EN,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_USH_EN,
 };
 };
 static struct clk clk_keypad = {
 static struct clk clk_keypad = {
+	.parent		= &clk_xtali,
 	.sw_locked	= 1,
 	.sw_locked	= 1,
 	.enable_reg	= EP93XX_SYSCON_KEYTCHCLKDIV,
 	.enable_reg	= EP93XX_SYSCON_KEYTCHCLKDIV,
 	.enable_mask	= EP93XX_SYSCON_KEYTCHCLKDIV_KEN,
 	.enable_mask	= EP93XX_SYSCON_KEYTCHCLKDIV_KEN,
 	.set_rate	= set_keytchclk_rate,
 	.set_rate	= set_keytchclk_rate,
 };
 };
 static struct clk clk_pwm = {
 static struct clk clk_pwm = {
+	.parent		= &clk_xtali,
 	.rate		= EP93XX_EXT_CLK_RATE,
 	.rate		= EP93XX_EXT_CLK_RATE,
 };
 };
 
 
@@ -85,50 +108,62 @@ static struct clk clk_video = {
 
 
 /* DMA Clocks */
 /* DMA Clocks */
 static struct clk clk_m2p0 = {
 static struct clk clk_m2p0 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P0,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P0,
 };
 };
 static struct clk clk_m2p1 = {
 static struct clk clk_m2p1 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P1,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P1,
 };
 };
 static struct clk clk_m2p2 = {
 static struct clk clk_m2p2 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P2,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P2,
 };
 };
 static struct clk clk_m2p3 = {
 static struct clk clk_m2p3 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P3,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P3,
 };
 };
 static struct clk clk_m2p4 = {
 static struct clk clk_m2p4 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P4,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P4,
 };
 };
 static struct clk clk_m2p5 = {
 static struct clk clk_m2p5 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P5,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P5,
 };
 };
 static struct clk clk_m2p6 = {
 static struct clk clk_m2p6 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P6,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P6,
 };
 };
 static struct clk clk_m2p7 = {
 static struct clk clk_m2p7 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P7,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P7,
 };
 };
 static struct clk clk_m2p8 = {
 static struct clk clk_m2p8 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P8,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P8,
 };
 };
 static struct clk clk_m2p9 = {
 static struct clk clk_m2p9 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P9,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2P9,
 };
 };
 static struct clk clk_m2m0 = {
 static struct clk clk_m2m0 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2M0,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2M0,
 };
 };
 static struct clk clk_m2m1 = {
 static struct clk clk_m2m1 = {
+	.parent		= &clk_h,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_reg	= EP93XX_SYSCON_PWRCNT,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2M1,
 	.enable_mask	= EP93XX_SYSCON_PWRCNT_DMA_M2M1,
 };
 };
@@ -137,6 +172,7 @@ static struct clk clk_m2m1 = {
 	{ .dev_id = dev, .con_id = con, .clk = ck }
 	{ .dev_id = dev, .con_id = con, .clk = ck }
 
 
 static struct clk_lookup clocks[] = {
 static struct clk_lookup clocks[] = {
+	INIT_CK(NULL,			"xtali",	&clk_xtali),
 	INIT_CK("apb:uart1",		NULL,		&clk_uart1),
 	INIT_CK("apb:uart1",		NULL,		&clk_uart1),
 	INIT_CK("apb:uart2",		NULL,		&clk_uart2),
 	INIT_CK("apb:uart2",		NULL,		&clk_uart2),
 	INIT_CK("apb:uart3",		NULL,		&clk_uart3),
 	INIT_CK("apb:uart3",		NULL,		&clk_uart3),
@@ -163,48 +199,84 @@ static struct clk_lookup clocks[] = {
 	INIT_CK(NULL,			"m2m1",		&clk_m2m1),
 	INIT_CK(NULL,			"m2m1",		&clk_m2m1),
 };
 };
 
 
+static DEFINE_SPINLOCK(clk_lock);
+
+static void __clk_enable(struct clk *clk)
+{
+	if (!clk->users++) {
+		if (clk->parent)
+			__clk_enable(clk->parent);
+
+		if (clk->enable_reg) {
+			u32 v;
+
+			v = __raw_readl(clk->enable_reg);
+			v |= clk->enable_mask;
+			if (clk->sw_locked)
+				ep93xx_syscon_swlocked_write(v, clk->enable_reg);
+			else
+				__raw_writel(v, clk->enable_reg);
+		}
+	}
+}
 
 
 int clk_enable(struct clk *clk)
 int clk_enable(struct clk *clk)
 {
 {
-	if (!clk->users++ && clk->enable_reg) {
-		u32 value;
+	unsigned long flags;
 
 
-		value = __raw_readl(clk->enable_reg);
-		value |= clk->enable_mask;
-		if (clk->sw_locked)
-			ep93xx_syscon_swlocked_write(value, clk->enable_reg);
-		else
-			__raw_writel(value, clk->enable_reg);
-	}
+	if (!clk)
+		return -EINVAL;
+
+	spin_lock_irqsave(&clk_lock, flags);
+	__clk_enable(clk);
+	spin_unlock_irqrestore(&clk_lock, flags);
 
 
 	return 0;
 	return 0;
 }
 }
 EXPORT_SYMBOL(clk_enable);
 EXPORT_SYMBOL(clk_enable);
 
 
-void clk_disable(struct clk *clk)
+static void __clk_disable(struct clk *clk)
 {
 {
-	if (!--clk->users && clk->enable_reg) {
-		u32 value;
+	if (!--clk->users) {
+		if (clk->enable_reg) {
+			u32 v;
+
+			v = __raw_readl(clk->enable_reg);
+			v &= ~clk->enable_mask;
+			if (clk->sw_locked)
+				ep93xx_syscon_swlocked_write(v, clk->enable_reg);
+			else
+				__raw_writel(v, clk->enable_reg);
+		}
 
 
-		value = __raw_readl(clk->enable_reg);
-		value &= ~clk->enable_mask;
-		if (clk->sw_locked)
-			ep93xx_syscon_swlocked_write(value, clk->enable_reg);
-		else
-			__raw_writel(value, clk->enable_reg);
+		if (clk->parent)
+			__clk_disable(clk->parent);
 	}
 	}
 }
 }
+
+void clk_disable(struct clk *clk)
+{
+	unsigned long flags;
+
+	if (!clk)
+		return;
+
+	spin_lock_irqsave(&clk_lock, flags);
+	__clk_disable(clk);
+	spin_unlock_irqrestore(&clk_lock, flags);
+}
 EXPORT_SYMBOL(clk_disable);
 EXPORT_SYMBOL(clk_disable);
 
 
 static unsigned long get_uart_rate(struct clk *clk)
 static unsigned long get_uart_rate(struct clk *clk)
 {
 {
+	unsigned long rate = clk_get_rate(clk->parent);
 	u32 value;
 	u32 value;
 
 
 	value = __raw_readl(EP93XX_SYSCON_PWRCNT);
 	value = __raw_readl(EP93XX_SYSCON_PWRCNT);
 	if (value & EP93XX_SYSCON_PWRCNT_UARTBAUD)
 	if (value & EP93XX_SYSCON_PWRCNT_UARTBAUD)
-		return EP93XX_EXT_CLK_RATE;
+		return rate;
 	else
 	else
-		return EP93XX_EXT_CLK_RATE / 2;
+		return rate / 2;
 }
 }
 
 
 unsigned long clk_get_rate(struct clk *clk)
 unsigned long clk_get_rate(struct clk *clk)
@@ -244,16 +316,16 @@ static int set_keytchclk_rate(struct clk *clk, unsigned long rate)
 	return 0;
 	return 0;
 }
 }
 
 
-static unsigned long calc_clk_div(unsigned long rate, int *psel, int *esel,
-				  int *pdiv, int *div)
+static int calc_clk_div(struct clk *clk, unsigned long rate,
+			int *psel, int *esel, int *pdiv, int *div)
 {
 {
-	unsigned long max_rate, best_rate = 0,
-		actual_rate = 0, mclk_rate = 0, rate_err = -1;
+	struct clk *mclk;
+	unsigned long max_rate, actual_rate, mclk_rate, rate_err = -1;
 	int i, found = 0, __div = 0, __pdiv = 0;
 	int i, found = 0, __div = 0, __pdiv = 0;
 
 
 	/* Don't exceed the maximum rate */
 	/* Don't exceed the maximum rate */
 	max_rate = max(max(clk_pll1.rate / 4, clk_pll2.rate / 4),
 	max_rate = max(max(clk_pll1.rate / 4, clk_pll2.rate / 4),
-		       (unsigned long)EP93XX_EXT_CLK_RATE / 4);
+		       clk_xtali.rate / 4);
 	rate = min(rate, max_rate);
 	rate = min(rate, max_rate);
 
 
 	/*
 	/*
@@ -267,11 +339,12 @@ static unsigned long calc_clk_div(unsigned long rate, int *psel, int *esel,
 	 */
 	 */
 	for (i = 0; i < 3; i++) {
 	for (i = 0; i < 3; i++) {
 		if (i == 0)
 		if (i == 0)
-			mclk_rate = EP93XX_EXT_CLK_RATE * 2;
+			mclk = &clk_xtali;
 		else if (i == 1)
 		else if (i == 1)
-			mclk_rate = clk_pll1.rate * 2;
-		else if (i == 2)
-			mclk_rate = clk_pll2.rate * 2;
+			mclk = &clk_pll1;
+		else
+			mclk = &clk_pll2;
+		mclk_rate = mclk->rate * 2;
 
 
 		/* Try each predivider value */
 		/* Try each predivider value */
 		for (__pdiv = 4; __pdiv <= 6; __pdiv++) {
 		for (__pdiv = 4; __pdiv <= 6; __pdiv++) {
@@ -286,7 +359,8 @@ static unsigned long calc_clk_div(unsigned long rate, int *psel, int *esel,
 				*div = __div;
 				*div = __div;
 				*psel = (i == 2);
 				*psel = (i == 2);
 				*esel = (i != 0);
 				*esel = (i != 0);
-				best_rate = actual_rate;
+				clk->parent = mclk;
+				clk->rate = actual_rate;
 				rate_err = abs(actual_rate - rate);
 				rate_err = abs(actual_rate - rate);
 				found = 1;
 				found = 1;
 			}
 			}
@@ -294,21 +368,19 @@ static unsigned long calc_clk_div(unsigned long rate, int *psel, int *esel,
 	}
 	}
 
 
 	if (!found)
 	if (!found)
-		return 0;
+		return -EINVAL;
 
 
-	return best_rate;
+	return 0;
 }
 }
 
 
 static int set_div_rate(struct clk *clk, unsigned long rate)
 static int set_div_rate(struct clk *clk, unsigned long rate)
 {
 {
-	unsigned long actual_rate;
-	int psel = 0, esel = 0, pdiv = 0, div = 0;
+	int err, psel = 0, esel = 0, pdiv = 0, div = 0;
 	u32 val;
 	u32 val;
 
 
-	actual_rate = calc_clk_div(rate, &psel, &esel, &pdiv, &div);
-	if (actual_rate == 0)
-		return -EINVAL;
-	clk->rate = actual_rate;
+	err = calc_clk_div(clk, rate, &psel, &esel, &pdiv, &div);
+	if (err)
+		return err;
 
 
 	/* Clear the esel, psel, pdiv and div bits */
 	/* Clear the esel, psel, pdiv and div bits */
 	val = __raw_readl(clk->enable_reg);
 	val = __raw_readl(clk->enable_reg);
@@ -344,7 +416,7 @@ static unsigned long calc_pll_rate(u32 config_word)
 	unsigned long long rate;
 	unsigned long long rate;
 	int i;
 	int i;
 
 
-	rate = EP93XX_EXT_CLK_RATE;
+	rate = clk_xtali.rate;
 	rate *= ((config_word >> 11) & 0x1f) + 1;		/* X1FBD */
 	rate *= ((config_word >> 11) & 0x1f) + 1;		/* X1FBD */
 	rate *= ((config_word >> 5) & 0x3f) + 1;		/* X2FBD */
 	rate *= ((config_word >> 5) & 0x3f) + 1;		/* X2FBD */
 	do_div(rate, (config_word & 0x1f) + 1);			/* X2IPD */
 	do_div(rate, (config_word & 0x1f) + 1);			/* X2IPD */
@@ -377,7 +449,7 @@ static int __init ep93xx_clock_init(void)
 
 
 	value = __raw_readl(EP93XX_SYSCON_CLOCK_SET1);
 	value = __raw_readl(EP93XX_SYSCON_CLOCK_SET1);
 	if (!(value & 0x00800000)) {			/* PLL1 bypassed?  */
 	if (!(value & 0x00800000)) {			/* PLL1 bypassed?  */
-		clk_pll1.rate = EP93XX_EXT_CLK_RATE;
+		clk_pll1.rate = clk_xtali.rate;
 	} else {
 	} else {
 		clk_pll1.rate = calc_pll_rate(value);
 		clk_pll1.rate = calc_pll_rate(value);
 	}
 	}
@@ -388,7 +460,7 @@ static int __init ep93xx_clock_init(void)
 
 
 	value = __raw_readl(EP93XX_SYSCON_CLOCK_SET2);
 	value = __raw_readl(EP93XX_SYSCON_CLOCK_SET2);
 	if (!(value & 0x00080000)) {			/* PLL2 bypassed?  */
 	if (!(value & 0x00080000)) {			/* PLL2 bypassed?  */
-		clk_pll2.rate = EP93XX_EXT_CLK_RATE;
+		clk_pll2.rate = clk_xtali.rate;
 	} else if (value & 0x00040000) {		/* PLL2 enabled?  */
 	} else if (value & 0x00040000) {		/* PLL2 enabled?  */
 		clk_pll2.rate = calc_pll_rate(value);
 		clk_pll2.rate = calc_pll_rate(value);
 	} else {
 	} else {

+ 23 - 8
arch/arm/mach-ep93xx/core.c

@@ -550,13 +550,11 @@ void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr)
 	platform_device_register(&ep93xx_eth_device);
 	platform_device_register(&ep93xx_eth_device);
 }
 }
 
 
-static struct i2c_gpio_platform_data ep93xx_i2c_data = {
-	.sda_pin		= EP93XX_GPIO_LINE_EEDAT,
-	.sda_is_open_drain	= 0,
-	.scl_pin		= EP93XX_GPIO_LINE_EECLK,
-	.scl_is_open_drain	= 0,
-	.udelay			= 2,
-};
+
+/*************************************************************************
+ * EP93xx i2c peripheral handling
+ *************************************************************************/
+static struct i2c_gpio_platform_data ep93xx_i2c_data;
 
 
 static struct platform_device ep93xx_i2c_device = {
 static struct platform_device ep93xx_i2c_device = {
 	.name			= "i2c-gpio",
 	.name			= "i2c-gpio",
@@ -564,8 +562,25 @@ static struct platform_device ep93xx_i2c_device = {
 	.dev.platform_data	= &ep93xx_i2c_data,
 	.dev.platform_data	= &ep93xx_i2c_data,
 };
 };
 
 
-void __init ep93xx_register_i2c(struct i2c_board_info *devices, int num)
+void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
+				struct i2c_board_info *devices, int num)
 {
 {
+	/*
+	 * Set the EEPROM interface pin drive type control.
+	 * Defines the driver type for the EECLK and EEDAT pins as either
+	 * open drain, which will require an external pull-up, or a normal
+	 * CMOS driver.
+	 */
+	if (data->sda_is_open_drain && data->sda_pin != EP93XX_GPIO_LINE_EEDAT)
+		pr_warning("ep93xx: sda != EEDAT, open drain has no effect\n");
+	if (data->scl_is_open_drain && data->scl_pin != EP93XX_GPIO_LINE_EECLK)
+		pr_warning("ep93xx: scl != EECLK, open drain has no effect\n");
+
+	__raw_writel((data->sda_is_open_drain << 1) |
+		     (data->scl_is_open_drain << 0),
+		     EP93XX_GPIO_EEDRIVE);
+
+	ep93xx_i2c_data = *data;
 	i2c_register_board_info(0, devices, num);
 	i2c_register_board_info(0, devices, num);
 	platform_device_register(&ep93xx_i2c_device);
 	platform_device_register(&ep93xx_i2c_device);
 }
 }

+ 24 - 7
arch/arm/mach-ep93xx/edb93xx.c

@@ -27,8 +27,10 @@
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/platform_device.h>
-#include <linux/i2c.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/physmap.h>
+#include <linux/gpio.h>
+#include <linux/i2c.h>
+#include <linux/i2c-gpio.h>
 
 
 #include <mach/hardware.h>
 #include <mach/hardware.h>
 
 
@@ -76,13 +78,26 @@ static struct ep93xx_eth_data edb93xx_eth_data = {
 	.phy_id		= 1,
 	.phy_id		= 1,
 };
 };
 
 
-static struct i2c_board_info __initdata edb93xxa_i2c_data[] = {
+
+/*************************************************************************
+ * EDB93xx i2c peripheral handling
+ *************************************************************************/
+static struct i2c_gpio_platform_data edb93xx_i2c_gpio_data = {
+	.sda_pin		= EP93XX_GPIO_LINE_EEDAT,
+	.sda_is_open_drain	= 0,
+	.scl_pin		= EP93XX_GPIO_LINE_EECLK,
+	.scl_is_open_drain	= 0,
+	.udelay			= 0,	/* default to 100 kHz */
+	.timeout		= 0,	/* default to 100 ms */
+};
+
+static struct i2c_board_info __initdata edb93xxa_i2c_board_info[] = {
 	{
 	{
 		I2C_BOARD_INFO("isl1208", 0x6f),
 		I2C_BOARD_INFO("isl1208", 0x6f),
 	},
 	},
 };
 };
 
 
-static struct i2c_board_info __initdata edb93xx_i2c_data[] = {
+static struct i2c_board_info __initdata edb93xx_i2c_board_info[] = {
 	{
 	{
 		I2C_BOARD_INFO("ds1337", 0x68),
 		I2C_BOARD_INFO("ds1337", 0x68),
 	},
 	},
@@ -92,12 +107,14 @@ static void __init edb93xx_register_i2c(void)
 {
 {
 	if (machine_is_edb9302a() || machine_is_edb9307a() ||
 	if (machine_is_edb9302a() || machine_is_edb9307a() ||
 	    machine_is_edb9315a()) {
 	    machine_is_edb9315a()) {
-		ep93xx_register_i2c(edb93xxa_i2c_data,
-				ARRAY_SIZE(edb93xxa_i2c_data));
+		ep93xx_register_i2c(&edb93xx_i2c_gpio_data,
+				    edb93xxa_i2c_board_info,
+				    ARRAY_SIZE(edb93xxa_i2c_board_info));
 	} else if (machine_is_edb9307() || machine_is_edb9312() ||
 	} else if (machine_is_edb9307() || machine_is_edb9312() ||
 		   machine_is_edb9315()) {
 		   machine_is_edb9315()) {
-		ep93xx_register_i2c(edb93xx_i2c_data,
-				ARRAY_SIZE(edb93xx_i2c_data));
+		ep93xx_register_i2c(&edb93xx_i2c_gpio_data
+				    edb93xx_i2c_board_info,
+				    ARRAY_SIZE(edb93xx_i2c_board_info));
 	}
 	}
 }
 }
 
 

+ 22 - 20
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h

@@ -52,25 +52,27 @@
 #define EP93XX_AHB_VIRT_BASE		0xfef00000
 #define EP93XX_AHB_VIRT_BASE		0xfef00000
 #define EP93XX_AHB_SIZE			0x00100000
 #define EP93XX_AHB_SIZE			0x00100000
 
 
+#define EP93XX_AHB_PHYS(x)		(EP93XX_AHB_PHYS_BASE + (x))
 #define EP93XX_AHB_IOMEM(x)		IOMEM(EP93XX_AHB_VIRT_BASE + (x))
 #define EP93XX_AHB_IOMEM(x)		IOMEM(EP93XX_AHB_VIRT_BASE + (x))
 
 
 #define EP93XX_APB_PHYS_BASE		0x80800000
 #define EP93XX_APB_PHYS_BASE		0x80800000
 #define EP93XX_APB_VIRT_BASE		0xfed00000
 #define EP93XX_APB_VIRT_BASE		0xfed00000
 #define EP93XX_APB_SIZE			0x00200000
 #define EP93XX_APB_SIZE			0x00200000
 
 
+#define EP93XX_APB_PHYS(x)		(EP93XX_APB_PHYS_BASE + (x))
 #define EP93XX_APB_IOMEM(x)		IOMEM(EP93XX_APB_VIRT_BASE + (x))
 #define EP93XX_APB_IOMEM(x)		IOMEM(EP93XX_APB_VIRT_BASE + (x))
 
 
 
 
 /* AHB peripherals */
 /* AHB peripherals */
 #define EP93XX_DMA_BASE			EP93XX_AHB_IOMEM(0x00000000)
 #define EP93XX_DMA_BASE			EP93XX_AHB_IOMEM(0x00000000)
 
 
-#define EP93XX_ETHERNET_PHYS_BASE	(EP93XX_AHB_PHYS_BASE + 0x00010000)
+#define EP93XX_ETHERNET_PHYS_BASE	EP93XX_AHB_PHYS(0x00010000)
 #define EP93XX_ETHERNET_BASE		EP93XX_AHB_IOMEM(0x00010000)
 #define EP93XX_ETHERNET_BASE		EP93XX_AHB_IOMEM(0x00010000)
 
 
-#define EP93XX_USB_PHYS_BASE		(EP93XX_AHB_PHYS_BASE + 0x00020000)
+#define EP93XX_USB_PHYS_BASE		EP93XX_AHB_PHYS(0x00020000)
 #define EP93XX_USB_BASE			EP93XX_AHB_IOMEM(0x00020000)
 #define EP93XX_USB_BASE			EP93XX_AHB_IOMEM(0x00020000)
 
 
-#define EP93XX_RASTER_PHYS_BASE		(EP93XX_AHB_PHYS_BASE + 0x00030000)
+#define EP93XX_RASTER_PHYS_BASE		EP93XX_AHB_PHYS(0x00030000)
 #define EP93XX_RASTER_BASE		EP93XX_AHB_IOMEM(0x00030000)
 #define EP93XX_RASTER_BASE		EP93XX_AHB_IOMEM(0x00030000)
 
 
 #define EP93XX_GRAPHICS_ACCEL_BASE	EP93XX_AHB_IOMEM(0x00040000)
 #define EP93XX_GRAPHICS_ACCEL_BASE	EP93XX_AHB_IOMEM(0x00040000)
@@ -112,21 +114,10 @@
 
 
 #define EP93XX_GPIO_BASE		EP93XX_APB_IOMEM(0x00040000)
 #define EP93XX_GPIO_BASE		EP93XX_APB_IOMEM(0x00040000)
 #define EP93XX_GPIO_REG(x)		(EP93XX_GPIO_BASE + (x))
 #define EP93XX_GPIO_REG(x)		(EP93XX_GPIO_BASE + (x))
-#define EP93XX_GPIO_F_INT_TYPE1		EP93XX_GPIO_REG(0x4c)
-#define EP93XX_GPIO_F_INT_TYPE2		EP93XX_GPIO_REG(0x50)
-#define EP93XX_GPIO_F_INT_ACK		EP93XX_GPIO_REG(0x54)
-#define EP93XX_GPIO_F_INT_ENABLE	EP93XX_GPIO_REG(0x58)
 #define EP93XX_GPIO_F_INT_STATUS	EP93XX_GPIO_REG(0x5c)
 #define EP93XX_GPIO_F_INT_STATUS	EP93XX_GPIO_REG(0x5c)
-#define EP93XX_GPIO_A_INT_TYPE1		EP93XX_GPIO_REG(0x90)
-#define EP93XX_GPIO_A_INT_TYPE2		EP93XX_GPIO_REG(0x94)
-#define EP93XX_GPIO_A_INT_ACK		EP93XX_GPIO_REG(0x98)
-#define EP93XX_GPIO_A_INT_ENABLE	EP93XX_GPIO_REG(0x9c)
 #define EP93XX_GPIO_A_INT_STATUS	EP93XX_GPIO_REG(0xa0)
 #define EP93XX_GPIO_A_INT_STATUS	EP93XX_GPIO_REG(0xa0)
-#define EP93XX_GPIO_B_INT_TYPE1		EP93XX_GPIO_REG(0xac)
-#define EP93XX_GPIO_B_INT_TYPE2		EP93XX_GPIO_REG(0xb0)
-#define EP93XX_GPIO_B_INT_ACK		EP93XX_GPIO_REG(0xb4)
-#define EP93XX_GPIO_B_INT_ENABLE	EP93XX_GPIO_REG(0xb8)
 #define EP93XX_GPIO_B_INT_STATUS	EP93XX_GPIO_REG(0xbc)
 #define EP93XX_GPIO_B_INT_STATUS	EP93XX_GPIO_REG(0xbc)
+#define EP93XX_GPIO_EEDRIVE		EP93XX_GPIO_REG(0xc8)
 
 
 #define EP93XX_AAC_BASE			EP93XX_APB_IOMEM(0x00080000)
 #define EP93XX_AAC_BASE			EP93XX_APB_IOMEM(0x00080000)
 
 
@@ -134,13 +125,13 @@
 
 
 #define EP93XX_IRDA_BASE		EP93XX_APB_IOMEM(0x000b0000)
 #define EP93XX_IRDA_BASE		EP93XX_APB_IOMEM(0x000b0000)
 
 
-#define EP93XX_UART1_PHYS_BASE		(EP93XX_APB_PHYS_BASE + 0x000c0000)
+#define EP93XX_UART1_PHYS_BASE		EP93XX_APB_PHYS(0x000c0000)
 #define EP93XX_UART1_BASE		EP93XX_APB_IOMEM(0x000c0000)
 #define EP93XX_UART1_BASE		EP93XX_APB_IOMEM(0x000c0000)
 
 
-#define EP93XX_UART2_PHYS_BASE		(EP93XX_APB_PHYS_BASE + 0x000d0000)
+#define EP93XX_UART2_PHYS_BASE		EP93XX_APB_PHYS(0x000d0000)
 #define EP93XX_UART2_BASE		EP93XX_APB_IOMEM(0x000d0000)
 #define EP93XX_UART2_BASE		EP93XX_APB_IOMEM(0x000d0000)
 
 
-#define EP93XX_UART3_PHYS_BASE		(EP93XX_APB_PHYS_BASE + 0x000e0000)
+#define EP93XX_UART3_PHYS_BASE		EP93XX_APB_PHYS(0x000e0000)
 #define EP93XX_UART3_BASE		EP93XX_APB_IOMEM(0x000e0000)
 #define EP93XX_UART3_BASE		EP93XX_APB_IOMEM(0x000e0000)
 
 
 #define EP93XX_KEY_MATRIX_BASE		EP93XX_APB_IOMEM(0x000f0000)
 #define EP93XX_KEY_MATRIX_BASE		EP93XX_APB_IOMEM(0x000f0000)
@@ -148,10 +139,10 @@
 #define EP93XX_ADC_BASE			EP93XX_APB_IOMEM(0x00100000)
 #define EP93XX_ADC_BASE			EP93XX_APB_IOMEM(0x00100000)
 #define EP93XX_TOUCHSCREEN_BASE		EP93XX_APB_IOMEM(0x00100000)
 #define EP93XX_TOUCHSCREEN_BASE		EP93XX_APB_IOMEM(0x00100000)
 
 
-#define EP93XX_PWM_PHYS_BASE		(EP93XX_APB_PHYS_BASE + 0x00110000)
+#define EP93XX_PWM_PHYS_BASE		EP93XX_APB_PHYS(0x00110000)
 #define EP93XX_PWM_BASE			EP93XX_APB_IOMEM(0x00110000)
 #define EP93XX_PWM_BASE			EP93XX_APB_IOMEM(0x00110000)
 
 
-#define EP93XX_RTC_PHYS_BASE		(EP93XX_APB_PHYS_BASE + 0x00120000)
+#define EP93XX_RTC_PHYS_BASE		EP93XX_APB_PHYS(0x00120000)
 #define EP93XX_RTC_BASE			EP93XX_APB_IOMEM(0x00120000)
 #define EP93XX_RTC_BASE			EP93XX_APB_IOMEM(0x00120000)
 
 
 #define EP93XX_SYSCON_BASE		EP93XX_APB_IOMEM(0x00130000)
 #define EP93XX_SYSCON_BASE		EP93XX_APB_IOMEM(0x00130000)
@@ -218,6 +209,17 @@
 #define EP93XX_SYSCON_KEYTCHCLKDIV_ADIV	(1<<16)
 #define EP93XX_SYSCON_KEYTCHCLKDIV_ADIV	(1<<16)
 #define EP93XX_SYSCON_KEYTCHCLKDIV_KEN	(1<<15)
 #define EP93XX_SYSCON_KEYTCHCLKDIV_KEN	(1<<15)
 #define EP93XX_SYSCON_KEYTCHCLKDIV_KDIV	(1<<0)
 #define EP93XX_SYSCON_KEYTCHCLKDIV_KDIV	(1<<0)
+#define EP93XX_SYSCON_SYSCFG		EP93XX_SYSCON_REG(0x9c)
+#define EP93XX_SYSCON_SYSCFG_REV_MASK	(0xf0000000)
+#define EP93XX_SYSCON_SYSCFG_REV_SHIFT	(28)
+#define EP93XX_SYSCON_SYSCFG_SBOOT	(1<<8)
+#define EP93XX_SYSCON_SYSCFG_LCSN7	(1<<7)
+#define EP93XX_SYSCON_SYSCFG_LCSN6	(1<<6)
+#define EP93XX_SYSCON_SYSCFG_LASDO	(1<<5)
+#define EP93XX_SYSCON_SYSCFG_LEEDA	(1<<4)
+#define EP93XX_SYSCON_SYSCFG_LEECLK	(1<<3)
+#define EP93XX_SYSCON_SYSCFG_LCSN2	(1<<1)
+#define EP93XX_SYSCON_SYSCFG_LCSN1	(1<<0)
 #define EP93XX_SYSCON_SWLOCK		EP93XX_SYSCON_REG(0xc0)
 #define EP93XX_SYSCON_SWLOCK		EP93XX_SYSCON_REG(0xc0)
 
 
 #define EP93XX_WATCHDOG_BASE		EP93XX_APB_IOMEM(0x00140000)
 #define EP93XX_WATCHDOG_BASE		EP93XX_APB_IOMEM(0x00140000)

+ 4 - 12
arch/arm/mach-ep93xx/include/mach/gpio.h

@@ -114,17 +114,9 @@ extern void ep93xx_gpio_int_debounce(unsigned int irq, int enable);
  *          B0..B7  (7..15) to irq 72..79, and
  *          B0..B7  (7..15) to irq 72..79, and
  *          F0..F7 (16..24) to irq 80..87.
  *          F0..F7 (16..24) to irq 80..87.
  */
  */
-static inline int gpio_to_irq(unsigned gpio)
-{
-	if (gpio <= EP93XX_GPIO_LINE_MAX_IRQ)
-		return 64 + gpio;
-
-	return -EINVAL;
-}
-
-static inline int irq_to_gpio(unsigned irq)
-{
-	return irq - gpio_to_irq(0);
-}
+#define gpio_to_irq(gpio)	\
+	(((gpio) <= EP93XX_GPIO_LINE_MAX_IRQ) ? (64 + (gpio)) : -EINVAL)
+
+#define irq_to_gpio(irq)	((irq) - gpio_to_irq(0))
 
 
 #endif
 #endif

+ 6 - 0
arch/arm/mach-ep93xx/include/mach/memory.h

@@ -9,6 +9,12 @@
 #define PHYS_OFFSET		UL(0x00000000)
 #define PHYS_OFFSET		UL(0x00000000)
 #elif defined(CONFIG_EP93XX_SDCE0_PHYS_OFFSET)
 #elif defined(CONFIG_EP93XX_SDCE0_PHYS_OFFSET)
 #define PHYS_OFFSET		UL(0xc0000000)
 #define PHYS_OFFSET		UL(0xc0000000)
+#elif defined(CONFIG_EP93XX_SDCE1_PHYS_OFFSET)
+#define PHYS_OFFSET		UL(0xd0000000)
+#elif defined(CONFIG_EP93XX_SDCE2_PHYS_OFFSET)
+#define PHYS_OFFSET		UL(0xe0000000)
+#elif defined(CONFIG_EP93XX_SDCE3_ASYNC_PHYS_OFFSET)
+#define PHYS_OFFSET		UL(0xf0000000)
 #else
 #else
 #error "Kconfig bug: No EP93xx PHYS_OFFSET set"
 #error "Kconfig bug: No EP93xx PHYS_OFFSET set"
 #endif
 #endif

+ 3 - 1
arch/arm/mach-ep93xx/include/mach/platform.h

@@ -4,6 +4,7 @@
 
 
 #ifndef __ASSEMBLY__
 #ifndef __ASSEMBLY__
 
 
+struct i2c_gpio_platform_data;
 struct i2c_board_info;
 struct i2c_board_info;
 struct platform_device;
 struct platform_device;
 struct ep93xxfb_mach_info;
 struct ep93xxfb_mach_info;
@@ -33,7 +34,8 @@ static inline void ep93xx_devcfg_clear_bits(unsigned int bits)
 }
 }
 
 
 void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr);
 void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr);
-void ep93xx_register_i2c(struct i2c_board_info *devices, int num);
+void ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
+			 struct i2c_board_info *devices, int num);
 void ep93xx_register_fb(struct ep93xxfb_mach_info *data);
 void ep93xx_register_fb(struct ep93xxfb_mach_info *data);
 void ep93xx_register_pwm(int pwm0, int pwm1);
 void ep93xx_register_pwm(int pwm0, int pwm1);
 int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);
 int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);

+ 77 - 55
arch/arm/mach-ep93xx/micro9.c

@@ -2,7 +2,9 @@
  *  linux/arch/arm/mach-ep93xx/micro9.c
  *  linux/arch/arm/mach-ep93xx/micro9.c
  *
  *
  * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH
  * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH
- *                   Manfred Gruber <manfred.gruber@contec.at>
+ *                    Manfred Gruber <m.gruber@tirol.com>
+ * Copyright (C) 2009 Contec Steuerungstechnik & Automation GmbH
+ *                    Hubert Feurstein <hubert.feurstein@contec.at>
  *
  *
  * This program is free software; you can redistribute it and/or modify
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * it under the terms of the GNU General Public License version 2 as
@@ -20,104 +22,124 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/arch.h>
 
 
 
 
-static struct ep93xx_eth_data micro9_eth_data = {
-	.phy_id		= 0x1f,
-};
-
-static void __init micro9_init(void)
-{
-	ep93xx_register_eth(&micro9_eth_data, 1);
-}
-
-/*
- * Micro9-H
- */
-#ifdef CONFIG_MACH_MICRO9H
-static struct physmap_flash_data micro9h_flash_data = {
-	.width		= 4,
-};
-
-static struct resource micro9h_flash_resource = {
+/*************************************************************************
+ * Micro9 NOR Flash
+ *
+ * Micro9-High has up to 64MB of 32-bit flash on CS1
+ * Micro9-Mid has up to 64MB of either 32-bit or 16-bit flash on CS1
+ * Micro9-Lite uses a seperate MTD map driver for flash support
+ * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1
+ *************************************************************************/
+static struct physmap_flash_data micro9_flash_data;
+
+static struct resource micro9_flash_resource = {
 	.start		= EP93XX_CS1_PHYS_BASE,
 	.start		= EP93XX_CS1_PHYS_BASE,
 	.end		= EP93XX_CS1_PHYS_BASE + SZ_64M - 1,
 	.end		= EP93XX_CS1_PHYS_BASE + SZ_64M - 1,
 	.flags		= IORESOURCE_MEM,
 	.flags		= IORESOURCE_MEM,
 };
 };
 
 
-static struct platform_device micro9h_flash = {
+static struct platform_device micro9_flash = {
 	.name		= "physmap-flash",
 	.name		= "physmap-flash",
 	.id		= 0,
 	.id		= 0,
 	.dev		= {
 	.dev		= {
-		.platform_data	= &micro9h_flash_data,
+		.platform_data	= &micro9_flash_data,
 	},
 	},
 	.num_resources	= 1,
 	.num_resources	= 1,
-	.resource	= &micro9h_flash_resource,
+	.resource	= &micro9_flash_resource,
 };
 };
 
 
-static void __init micro9h_init(void)
+static void __init __micro9_register_flash(unsigned int width)
+{
+	micro9_flash_data.width = width;
+
+	platform_device_register(&micro9_flash);
+}
+
+static unsigned int __init micro9_detect_bootwidth(void)
+{
+	u32 v;
+
+	/* Detect the bus width of the external flash memory */
+	v = __raw_readl(EP93XX_SYSCON_SYSCFG);
+	if (v & EP93XX_SYSCON_SYSCFG_LCSN7)
+		return 4; /* 32-bit */
+	else
+		return 2; /* 16-bit */
+}
+
+static void __init micro9_register_flash(void)
 {
 {
-	platform_device_register(&micro9h_flash);
+	if (machine_is_micro9())
+		__micro9_register_flash(4);
+	else if (machine_is_micro9m() || machine_is_micro9s())
+		__micro9_register_flash(micro9_detect_bootwidth());
 }
 }
 
 
-static void __init micro9h_init_machine(void)
+
+/*************************************************************************
+ * Micro9 Ethernet
+ *************************************************************************/
+static struct ep93xx_eth_data micro9_eth_data = {
+	.phy_id		= 0x1f,
+};
+
+
+static void __init micro9_init_machine(void)
 {
 {
 	ep93xx_init_devices();
 	ep93xx_init_devices();
-	micro9_init();
-	micro9h_init();
+	ep93xx_register_eth(&micro9_eth_data, 1);
+	micro9_register_flash();
 }
 }
 
 
-MACHINE_START(MICRO9, "Contec Hypercontrol Micro9-H")
-	/* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
+
+#ifdef CONFIG_MACH_MICRO9H
+MACHINE_START(MICRO9, "Contec Micro9-High")
+	/* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
 	.phys_io	= EP93XX_APB_PHYS_BASE,
 	.phys_io	= EP93XX_APB_PHYS_BASE,
 	.io_pg_offst	= ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
 	.io_pg_offst	= ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
 	.boot_params	= EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
 	.boot_params	= EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
 	.map_io		= ep93xx_map_io,
 	.map_io		= ep93xx_map_io,
 	.init_irq	= ep93xx_init_irq,
 	.init_irq	= ep93xx_init_irq,
 	.timer		= &ep93xx_timer,
 	.timer		= &ep93xx_timer,
-	.init_machine	= micro9h_init_machine,
+	.init_machine	= micro9_init_machine,
 MACHINE_END
 MACHINE_END
 #endif
 #endif
 
 
-/*
- * Micro9-M
- */
 #ifdef CONFIG_MACH_MICRO9M
 #ifdef CONFIG_MACH_MICRO9M
-static void __init micro9m_init_machine(void)
-{
-	ep93xx_init_devices();
-	micro9_init();
-}
-
-MACHINE_START(MICRO9M, "Contec Hypercontrol Micro9-M")
-	/* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
+MACHINE_START(MICRO9M, "Contec Micro9-Mid")
+	/* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
 	.phys_io	= EP93XX_APB_PHYS_BASE,
 	.phys_io	= EP93XX_APB_PHYS_BASE,
 	.io_pg_offst	= ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
 	.io_pg_offst	= ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
-	.boot_params	= EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
+	.boot_params	= EP93XX_SDCE3_PHYS_BASE_ASYNC + 0x100,
 	.map_io		= ep93xx_map_io,
 	.map_io		= ep93xx_map_io,
 	.init_irq	= ep93xx_init_irq,
 	.init_irq	= ep93xx_init_irq,
 	.timer		= &ep93xx_timer,
 	.timer		= &ep93xx_timer,
-	.init_machine	= micro9m_init_machine,
+	.init_machine	= micro9_init_machine,
 MACHINE_END
 MACHINE_END
 #endif
 #endif
 
 
-/*
- * Micro9-L
- */
 #ifdef CONFIG_MACH_MICRO9L
 #ifdef CONFIG_MACH_MICRO9L
-static void __init micro9l_init_machine(void)
-{
-	ep93xx_init_devices();
-	micro9_init();
-}
-
-MACHINE_START(MICRO9L, "Contec Hypercontrol Micro9-L")
-	/* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
+MACHINE_START(MICRO9L, "Contec Micro9-Lite")
+	/* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
 	.phys_io	= EP93XX_APB_PHYS_BASE,
 	.phys_io	= EP93XX_APB_PHYS_BASE,
 	.io_pg_offst	= ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
 	.io_pg_offst	= ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
 	.boot_params	= EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
 	.boot_params	= EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
 	.map_io		= ep93xx_map_io,
 	.map_io		= ep93xx_map_io,
 	.init_irq	= ep93xx_init_irq,
 	.init_irq	= ep93xx_init_irq,
 	.timer		= &ep93xx_timer,
 	.timer		= &ep93xx_timer,
-	.init_machine	= micro9l_init_machine,
+	.init_machine	= micro9_init_machine,
 MACHINE_END
 MACHINE_END
 #endif
 #endif
 
 
+#ifdef CONFIG_MACH_MICRO9S
+MACHINE_START(MICRO9S, "Contec Micro9-Slim")
+	/* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
+	.phys_io	= EP93XX_APB_PHYS_BASE,
+	.io_pg_offst	= ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
+	.boot_params	= EP93XX_SDCE3_PHYS_BASE_ASYNC + 0x100,
+	.map_io		= ep93xx_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.timer		= &ep93xx_timer,
+	.init_machine	= micro9_init_machine,
+MACHINE_END
+#endif

+ 1 - 0
arch/arm/mach-integrator/pci_v3.c

@@ -31,6 +31,7 @@
 
 
 #include <mach/hardware.h>
 #include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/irq.h>
+#include <asm/signal.h>
 #include <asm/system.h>
 #include <asm/system.h>
 #include <asm/mach/pci.h>
 #include <asm/mach/pci.h>
 #include <asm/irq_regs.h>
 #include <asm/irq_regs.h>

+ 1 - 1
arch/arm/mach-pxa/cpufreq-pxa2xx.c

@@ -155,7 +155,7 @@ MODULE_PARM_DESC(pxa255_turbo_table, "Selects the frequency table (0 = run table
 
 
 static pxa_freqs_t pxa27x_freqs[] = {
 static pxa_freqs_t pxa27x_freqs[] = {
 	{104000, 104000, PXA27x_CCCR(1,	 8, 2), 0, CCLKCFG2(1, 0, 1),  900000, 1705000 },
 	{104000, 104000, PXA27x_CCCR(1,	 8, 2), 0, CCLKCFG2(1, 0, 1),  900000, 1705000 },
-	{156000, 104000, PXA27x_CCCR(1,	 8, 6), 0, CCLKCFG2(1, 1, 1), 1000000, 1705000 },
+	{156000, 104000, PXA27x_CCCR(1,	 8, 3), 0, CCLKCFG2(1, 0, 1), 1000000, 1705000 },
 	{208000, 208000, PXA27x_CCCR(0, 16, 2), 1, CCLKCFG2(0, 0, 1), 1180000, 1705000 },
 	{208000, 208000, PXA27x_CCCR(0, 16, 2), 1, CCLKCFG2(0, 0, 1), 1180000, 1705000 },
 	{312000, 208000, PXA27x_CCCR(1, 16, 3), 1, CCLKCFG2(1, 0, 1), 1250000, 1705000 },
 	{312000, 208000, PXA27x_CCCR(1, 16, 3), 1, CCLKCFG2(1, 0, 1), 1250000, 1705000 },
 	{416000, 208000, PXA27x_CCCR(1, 16, 4), 1, CCLKCFG2(1, 0, 1), 1350000, 1705000 },
 	{416000, 208000, PXA27x_CCCR(1, 16, 4), 1, CCLKCFG2(1, 0, 1), 1350000, 1705000 },

+ 1 - 1
arch/arm/mach-pxa/csb726.c

@@ -238,7 +238,7 @@ static struct resource csb726_lan_resources[] = {
 };
 };
 
 
 struct smsc911x_platform_config csb726_lan_config = {
 struct smsc911x_platform_config csb726_lan_config = {
-	.irq_type	= SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
 	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
 	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
 	.flags		= SMSC911X_USE_32BIT,
 	.flags		= SMSC911X_USE_32BIT,
 	.phy_interface	= PHY_INTERFACE_MODE_MII,
 	.phy_interface	= PHY_INTERFACE_MODE_MII,

+ 1 - 0
arch/arm/mach-sa1100/Makefile

@@ -25,6 +25,7 @@ led-$(CONFIG_SA1100_CERF)		+= leds-cerf.o
 
 
 obj-$(CONFIG_SA1100_COLLIE)		+= collie.o
 obj-$(CONFIG_SA1100_COLLIE)		+= collie.o
 
 
+obj-$(CONFIG_SA1100_H3100)		+= h3600.o
 obj-$(CONFIG_SA1100_H3600)		+= h3600.o
 obj-$(CONFIG_SA1100_H3600)		+= h3600.o
 
 
 obj-$(CONFIG_SA1100_HACKKIT)		+= hackkit.o
 obj-$(CONFIG_SA1100_HACKKIT)		+= hackkit.o

+ 18 - 2
arch/arm/mm/cache-v6.S

@@ -12,6 +12,7 @@
 #include <linux/linkage.h>
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/assembler.h>
+#include <asm/unwind.h>
 
 
 #include "proc-macros.S"
 #include "proc-macros.S"
 
 
@@ -121,11 +122,13 @@ ENTRY(v6_coherent_kern_range)
  *	- the Icache does not read data from the write buffer
  *	- the Icache does not read data from the write buffer
  */
  */
 ENTRY(v6_coherent_user_range)
 ENTRY(v6_coherent_user_range)
-
+ UNWIND(.fnstart		)
 #ifdef HARVARD_CACHE
 #ifdef HARVARD_CACHE
 	bic	r0, r0, #CACHE_LINE_SIZE - 1
 	bic	r0, r0, #CACHE_LINE_SIZE - 1
-1:	mcr	p15, 0, r0, c7, c10, 1		@ clean D line
+1:
+ USER(	mcr	p15, 0, r0, c7, c10, 1	)	@ clean D line
 	add	r0, r0, #CACHE_LINE_SIZE
 	add	r0, r0, #CACHE_LINE_SIZE
+2:
 	cmp	r0, r1
 	cmp	r0, r1
 	blo	1b
 	blo	1b
 #endif
 #endif
@@ -142,6 +145,19 @@ ENTRY(v6_coherent_user_range)
 #endif
 #endif
 	mov	pc, lr
 	mov	pc, lr
 
 
+/*
+ * Fault handling for the cache operation above. If the virtual address in r0
+ * isn't mapped, just try the next page.
+ */
+9001:
+	mov	r0, r0, lsr #12
+	mov	r0, r0, lsl #12
+	add	r0, r0, #4096
+	b	2b
+ UNWIND(.fnend		)
+ENDPROC(v6_coherent_user_range)
+ENDPROC(v6_coherent_kern_range)
+
 /*
 /*
  *	v6_flush_kern_dcache_page(kaddr)
  *	v6_flush_kern_dcache_page(kaddr)
  *
  *

+ 17 - 2
arch/arm/mm/cache-v7.S

@@ -13,6 +13,7 @@
 #include <linux/linkage.h>
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
 #include <asm/assembler.h>
+#include <asm/unwind.h>
 
 
 #include "proc-macros.S"
 #include "proc-macros.S"
 
 
@@ -153,13 +154,16 @@ ENTRY(v7_coherent_kern_range)
  *	- the Icache does not read data from the write buffer
  *	- the Icache does not read data from the write buffer
  */
  */
 ENTRY(v7_coherent_user_range)
 ENTRY(v7_coherent_user_range)
+ UNWIND(.fnstart		)
 	dcache_line_size r2, r3
 	dcache_line_size r2, r3
 	sub	r3, r2, #1
 	sub	r3, r2, #1
 	bic	r0, r0, r3
 	bic	r0, r0, r3
-1:	mcr	p15, 0, r0, c7, c11, 1		@ clean D line to the point of unification
+1:
+ USER(	mcr	p15, 0, r0, c7, c11, 1	)	@ clean D line to the point of unification
 	dsb
 	dsb
-	mcr	p15, 0, r0, c7, c5, 1		@ invalidate I line
+ USER(	mcr	p15, 0, r0, c7, c5, 1	)	@ invalidate I line
 	add	r0, r0, r2
 	add	r0, r0, r2
+2:
 	cmp	r0, r1
 	cmp	r0, r1
 	blo	1b
 	blo	1b
 	mov	r0, #0
 	mov	r0, #0
@@ -167,6 +171,17 @@ ENTRY(v7_coherent_user_range)
 	dsb
 	dsb
 	isb
 	isb
 	mov	pc, lr
 	mov	pc, lr
+
+/*
+ * Fault handling for the cache operation above. If the virtual address in r0
+ * isn't mapped, just try the next page.
+ */
+9001:
+	mov	r0, r0, lsr #12
+	mov	r0, r0, lsl #12
+	add	r0, r0, #4096
+	b	2b
+ UNWIND(.fnend		)
 ENDPROC(v7_coherent_kern_range)
 ENDPROC(v7_coherent_kern_range)
 ENDPROC(v7_coherent_user_range)
 ENDPROC(v7_coherent_user_range)
 
 

+ 3 - 6
arch/arm/mm/fault-armv.c

@@ -153,14 +153,11 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
 
 
 	page = pfn_to_page(pfn);
 	page = pfn_to_page(pfn);
 	mapping = page_mapping(page);
 	mapping = page_mapping(page);
-	if (mapping) {
 #ifndef CONFIG_SMP
 #ifndef CONFIG_SMP
-		int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);
-
-		if (dirty)
-			__flush_dcache_page(mapping, page);
+	if (test_and_clear_bit(PG_dcache_dirty, &page->flags))
+		__flush_dcache_page(mapping, page);
 #endif
 #endif
-
+	if (mapping) {
 		if (cache_is_vivt())
 		if (cache_is_vivt())
 			make_coherent(mapping, vma, addr, pfn);
 			make_coherent(mapping, vma, addr, pfn);
 		else if (vma->vm_flags & VM_EXEC)
 		else if (vma->vm_flags & VM_EXEC)

+ 5 - 0
arch/arm/mm/fault.c

@@ -292,6 +292,11 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
 		 * down_read()
 		 * down_read()
 		 */
 		 */
 		might_sleep();
 		might_sleep();
+#ifdef CONFIG_DEBUG_VM
+		if (!user_mode(regs) &&
+		    !search_exception_tables(regs->ARM_pc))
+			goto no_context;
+#endif
 	}
 	}
 
 
 	fault = __do_page_fault(mm, addr, fsr, tsk);
 	fault = __do_page_fault(mm, addr, fsr, tsk);

+ 2 - 0
arch/arm/mm/highmem.c

@@ -46,6 +46,8 @@ void *kmap_atomic(struct page *page, enum km_type type)
 	if (!PageHighMem(page))
 	if (!PageHighMem(page))
 		return page_address(page);
 		return page_address(page);
 
 
+	debug_kmap_atomic(type);
+
 	kmap = kmap_high_get(page);
 	kmap = kmap_high_get(page);
 	if (kmap)
 	if (kmap)
 		return kmap;
 		return kmap;

+ 1 - 1
arch/arm/mm/init.c

@@ -483,7 +483,7 @@ free_memmap(int node, unsigned long start_pfn, unsigned long end_pfn)
 	/*
 	/*
 	 * Convert start_pfn/end_pfn to a struct page pointer.
 	 * Convert start_pfn/end_pfn to a struct page pointer.
 	 */
 	 */
-	start_pg = pfn_to_page(start_pfn);
+	start_pg = pfn_to_page(start_pfn - 1) + 1;
 	end_pg = pfn_to_page(end_pfn);
 	end_pg = pfn_to_page(end_pfn);
 
 
 	/*
 	/*

+ 1 - 0
arch/arm/plat-s3c24xx/adc.c

@@ -14,6 +14,7 @@
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/platform_device.h>
+#include <linux/sched.h>
 #include <linux/list.h>
 #include <linux/list.h>
 #include <linux/err.h>
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/clk.h>

+ 1 - 0
arch/blackfin/kernel/time.c

@@ -14,6 +14,7 @@
 #include <linux/time.h>
 #include <linux/time.h>
 #include <linux/irq.h>
 #include <linux/irq.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
+#include <linux/sched.h>
 
 
 #include <asm/blackfin.h>
 #include <asm/blackfin.h>
 #include <asm/time.h>
 #include <asm/time.h>

+ 1 - 0
arch/m32r/kernel/smp.c

@@ -17,6 +17,7 @@
 
 
 #include <linux/irq.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
+#include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/spinlock.h>
 #include <linux/mm.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/smp.h>

+ 4 - 3
arch/s390/include/asm/delay.h

@@ -14,10 +14,11 @@
 #ifndef _S390_DELAY_H
 #ifndef _S390_DELAY_H
 #define _S390_DELAY_H
 #define _S390_DELAY_H
 
 
-extern void __udelay(unsigned long usecs);
-extern void udelay_simple(unsigned long usecs);
+extern void __udelay(unsigned long long usecs);
+extern void udelay_simple(unsigned long long usecs);
 extern void __delay(unsigned long loops);
 extern void __delay(unsigned long loops);
 
 
-#define udelay(n) __udelay(n)
+#define udelay(n) __udelay((unsigned long long) (n))
+#define mdelay(n) __udelay((unsigned long long) (n) * 1000)
 
 
 #endif /* defined(_S390_DELAY_H) */
 #endif /* defined(_S390_DELAY_H) */

+ 12 - 0
arch/s390/include/asm/elf.h

@@ -92,6 +92,18 @@
 /* Keep this the last entry.  */
 /* Keep this the last entry.  */
 #define R_390_NUM	61
 #define R_390_NUM	61
 
 
+/* Bits present in AT_HWCAP. */
+#define HWCAP_S390_ESAN3	1
+#define HWCAP_S390_ZARCH	2
+#define HWCAP_S390_STFLE	4
+#define HWCAP_S390_MSA		8
+#define HWCAP_S390_LDISP	16
+#define HWCAP_S390_EIMM		32
+#define HWCAP_S390_DFP		64
+#define HWCAP_S390_HPAGE	128
+#define HWCAP_S390_ETF3EH	256
+#define HWCAP_S390_HIGH_GPRS	512
+
 /*
 /*
  * These are used to set parameters in the core dumps.
  * These are used to set parameters in the core dumps.
  */
  */

+ 4 - 0
arch/s390/include/asm/ptrace.h

@@ -311,6 +311,10 @@ typedef struct
 	__u32		orig_gpr2;
 	__u32		orig_gpr2;
 } s390_compat_regs;
 } s390_compat_regs;
 
 
+typedef struct
+{
+	__u32		gprs_high[NUM_GPRS];
+} s390_compat_regs_high;
 
 
 #ifdef __KERNEL__
 #ifdef __KERNEL__
 
 

+ 15 - 0
arch/s390/include/asm/ucontext.h

@@ -9,6 +9,21 @@
 #ifndef _ASM_S390_UCONTEXT_H
 #ifndef _ASM_S390_UCONTEXT_H
 #define _ASM_S390_UCONTEXT_H
 #define _ASM_S390_UCONTEXT_H
 
 
+#define UC_EXTENDED	0x00000001
+
+#ifndef __s390x__
+
+struct ucontext_extended {
+	unsigned long	  uc_flags;
+	struct ucontext  *uc_link;
+	stack_t		  uc_stack;
+	_sigregs	  uc_mcontext;
+	unsigned long	  uc_sigmask[2];
+	unsigned long	  uc_gprs_high[16];
+};
+
+#endif
+
 struct ucontext {
 struct ucontext {
 	unsigned long	  uc_flags;
 	unsigned long	  uc_flags;
 	struct ucontext  *uc_link;
 	struct ucontext  *uc_link;

+ 34 - 1
arch/s390/kernel/compat_signal.c

@@ -39,6 +39,7 @@ typedef struct
 	struct sigcontext32 sc;
 	struct sigcontext32 sc;
 	_sigregs32 sregs;
 	_sigregs32 sregs;
 	int signo;
 	int signo;
+	__u32 gprs_high[NUM_GPRS];
 	__u8 retcode[S390_SYSCALL_SIZE];
 	__u8 retcode[S390_SYSCALL_SIZE];
 } sigframe32;
 } sigframe32;
 
 
@@ -48,6 +49,7 @@ typedef struct
 	__u8 retcode[S390_SYSCALL_SIZE];
 	__u8 retcode[S390_SYSCALL_SIZE];
 	compat_siginfo_t info;
 	compat_siginfo_t info;
 	struct ucontext32 uc;
 	struct ucontext32 uc;
+	__u32 gprs_high[NUM_GPRS];
 } rt_sigframe32;
 } rt_sigframe32;
 
 
 int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
 int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
@@ -344,6 +346,30 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs)
 	return 0;
 	return 0;
 }
 }
 
 
+static int save_sigregs_gprs_high(struct pt_regs *regs, __u32 __user *uregs)
+{
+	__u32 gprs_high[NUM_GPRS];
+	int i;
+
+	for (i = 0; i < NUM_GPRS; i++)
+		gprs_high[i] = regs->gprs[i] >> 32;
+
+	return __copy_to_user(uregs, &gprs_high, sizeof(gprs_high));
+}
+
+static int restore_sigregs_gprs_high(struct pt_regs *regs, __u32 __user *uregs)
+{
+	__u32 gprs_high[NUM_GPRS];
+	int err, i;
+
+	err = __copy_from_user(&gprs_high, uregs, sizeof(gprs_high));
+	if (err)
+		return err;
+	for (i = 0; i < NUM_GPRS; i++)
+		*(__u32 *)&regs->gprs[i] = gprs_high[i];
+	return 0;
+}
+
 asmlinkage long sys32_sigreturn(void)
 asmlinkage long sys32_sigreturn(void)
 {
 {
 	struct pt_regs *regs = task_pt_regs(current);
 	struct pt_regs *regs = task_pt_regs(current);
@@ -363,6 +389,8 @@ asmlinkage long sys32_sigreturn(void)
 
 
 	if (restore_sigregs32(regs, &frame->sregs))
 	if (restore_sigregs32(regs, &frame->sregs))
 		goto badframe;
 		goto badframe;
+	if (restore_sigregs_gprs_high(regs, frame->gprs_high))
+		goto badframe;
 
 
 	return regs->gprs[2];
 	return regs->gprs[2];
 
 
@@ -394,6 +422,8 @@ asmlinkage long sys32_rt_sigreturn(void)
 
 
 	if (restore_sigregs32(regs, &frame->uc.uc_mcontext))
 	if (restore_sigregs32(regs, &frame->uc.uc_mcontext))
 		goto badframe;
 		goto badframe;
+	if (restore_sigregs_gprs_high(regs, frame->gprs_high))
+		goto badframe;
 
 
 	err = __get_user(ss_sp, &frame->uc.uc_stack.ss_sp);
 	err = __get_user(ss_sp, &frame->uc.uc_stack.ss_sp);
 	st.ss_sp = compat_ptr(ss_sp);
 	st.ss_sp = compat_ptr(ss_sp);
@@ -474,6 +504,8 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
 
 
 	if (save_sigregs32(regs, &frame->sregs))
 	if (save_sigregs32(regs, &frame->sregs))
 		goto give_sigsegv;
 		goto give_sigsegv;
+	if (save_sigregs_gprs_high(regs, frame->gprs_high))
+		goto give_sigsegv;
 	if (__put_user((unsigned long) &frame->sregs, &frame->sc.sregs))
 	if (__put_user((unsigned long) &frame->sregs, &frame->sc.sregs))
 		goto give_sigsegv;
 		goto give_sigsegv;
 
 
@@ -529,13 +561,14 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
 		goto give_sigsegv;
 		goto give_sigsegv;
 
 
 	/* Create the ucontext.  */
 	/* Create the ucontext.  */
-	err |= __put_user(0, &frame->uc.uc_flags);
+	err |= __put_user(UC_EXTENDED, &frame->uc.uc_flags);
 	err |= __put_user(0, &frame->uc.uc_link);
 	err |= __put_user(0, &frame->uc.uc_link);
 	err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
 	err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
 	err |= __put_user(sas_ss_flags(regs->gprs[15]),
 	err |= __put_user(sas_ss_flags(regs->gprs[15]),
 	                  &frame->uc.uc_stack.ss_flags);
 	                  &frame->uc.uc_stack.ss_flags);
 	err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
 	err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
 	err |= save_sigregs32(regs, &frame->uc.uc_mcontext);
 	err |= save_sigregs32(regs, &frame->uc.uc_mcontext);
+	err |= save_sigregs_gprs_high(regs, frame->gprs_high);
 	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
 	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
 	if (err)
 	if (err)
 		goto give_sigsegv;
 		goto give_sigsegv;

+ 1 - 1
arch/s390/kernel/compat_wrapper.S

@@ -409,7 +409,7 @@ sys32_munmap_wrapper:
 	.globl	sys32_truncate_wrapper
 	.globl	sys32_truncate_wrapper
 sys32_truncate_wrapper:
 sys32_truncate_wrapper:
 	llgtr	%r2,%r2			# const char *
 	llgtr	%r2,%r2			# const char *
-	llgfr	%r3,%r3			# unsigned long
+	lgfr	%r3,%r3			# long
 	jg	sys_truncate		# branch to system call
 	jg	sys_truncate		# branch to system call
 
 
 	.globl	sys32_ftruncate_wrapper
 	.globl	sys32_ftruncate_wrapper

+ 0 - 3
arch/s390/kernel/ftrace.c

@@ -185,9 +185,6 @@ unsigned long prepare_ftrace_return(unsigned long ip, unsigned long parent)
 {
 {
 	struct ftrace_graph_ent trace;
 	struct ftrace_graph_ent trace;
 
 
-	/* Nmi's are currently unsupported. */
-	if (unlikely(in_nmi()))
-		goto out;
 	if (unlikely(atomic_read(&current->tracing_graph_pause)))
 	if (unlikely(atomic_read(&current->tracing_graph_pause)))
 		goto out;
 		goto out;
 	if (ftrace_push_return_trace(parent, ip, &trace.depth, 0) == -EBUSY)
 	if (ftrace_push_return_trace(parent, ip, &trace.depth, 0) == -EBUSY)

+ 3 - 0
arch/s390/kernel/module.c

@@ -55,6 +55,8 @@ void *module_alloc(unsigned long size)
 /* Free memory returned from module_alloc */
 /* Free memory returned from module_alloc */
 void module_free(struct module *mod, void *module_region)
 void module_free(struct module *mod, void *module_region)
 {
 {
+	vfree(mod->arch.syminfo);
+	mod->arch.syminfo = NULL;
 	vfree(module_region);
 	vfree(module_region);
 }
 }
 
 
@@ -402,6 +404,7 @@ int module_finalize(const Elf_Ehdr *hdr,
 		    struct module *me)
 		    struct module *me)
 {
 {
 	vfree(me->arch.syminfo);
 	vfree(me->arch.syminfo);
+	me->arch.syminfo = NULL;
 	return module_bug_finalize(hdr, sechdrs, me);
 	return module_bug_finalize(hdr, sechdrs, me);
 }
 }
 
 

+ 70 - 0
arch/s390/kernel/ptrace.c

@@ -57,6 +57,7 @@
 enum s390_regset {
 enum s390_regset {
 	REGSET_GENERAL,
 	REGSET_GENERAL,
 	REGSET_FP,
 	REGSET_FP,
+	REGSET_GENERAL_EXTENDED,
 };
 };
 
 
 static void
 static void
@@ -879,6 +880,67 @@ static int s390_compat_regs_set(struct task_struct *target,
 	return rc;
 	return rc;
 }
 }
 
 
+static int s390_compat_regs_high_get(struct task_struct *target,
+				     const struct user_regset *regset,
+				     unsigned int pos, unsigned int count,
+				     void *kbuf, void __user *ubuf)
+{
+	compat_ulong_t *gprs_high;
+
+	gprs_high = (compat_ulong_t *)
+		&task_pt_regs(target)->gprs[pos / sizeof(compat_ulong_t)];
+	if (kbuf) {
+		compat_ulong_t *k = kbuf;
+		while (count > 0) {
+			*k++ = *gprs_high;
+			gprs_high += 2;
+			count -= sizeof(*k);
+		}
+	} else {
+		compat_ulong_t __user *u = ubuf;
+		while (count > 0) {
+			if (__put_user(*gprs_high, u++))
+				return -EFAULT;
+			gprs_high += 2;
+			count -= sizeof(*u);
+		}
+	}
+	return 0;
+}
+
+static int s390_compat_regs_high_set(struct task_struct *target,
+				     const struct user_regset *regset,
+				     unsigned int pos, unsigned int count,
+				     const void *kbuf, const void __user *ubuf)
+{
+	compat_ulong_t *gprs_high;
+	int rc = 0;
+
+	gprs_high = (compat_ulong_t *)
+		&task_pt_regs(target)->gprs[pos / sizeof(compat_ulong_t)];
+	if (kbuf) {
+		const compat_ulong_t *k = kbuf;
+		while (count > 0) {
+			*gprs_high = *k++;
+			*gprs_high += 2;
+			count -= sizeof(*k);
+		}
+	} else {
+		const compat_ulong_t  __user *u = ubuf;
+		while (count > 0 && !rc) {
+			unsigned long word;
+			rc = __get_user(word, u++);
+			if (rc)
+				break;
+			*gprs_high = word;
+			*gprs_high += 2;
+			count -= sizeof(*u);
+		}
+	}
+
+	return rc;
+}
+
 static const struct user_regset s390_compat_regsets[] = {
 static const struct user_regset s390_compat_regsets[] = {
 	[REGSET_GENERAL] = {
 	[REGSET_GENERAL] = {
 		.core_note_type = NT_PRSTATUS,
 		.core_note_type = NT_PRSTATUS,
@@ -896,6 +958,14 @@ static const struct user_regset s390_compat_regsets[] = {
 		.get = s390_fpregs_get,
 		.get = s390_fpregs_get,
 		.set = s390_fpregs_set,
 		.set = s390_fpregs_set,
 	},
 	},
+	[REGSET_GENERAL_EXTENDED] = {
+		.core_note_type = NT_PRXSTATUS,
+		.n = sizeof(s390_compat_regs_high) / sizeof(compat_long_t),
+		.size = sizeof(compat_long_t),
+		.align = sizeof(compat_long_t),
+		.get = s390_compat_regs_high_get,
+		.set = s390_compat_regs_high_set,
+	},
 };
 };
 
 
 static const struct user_regset_view user_s390_compat_view = {
 static const struct user_regset_view user_s390_compat_view = {

+ 12 - 3
arch/s390/kernel/setup.c

@@ -729,7 +729,7 @@ static void __init setup_hwcaps(void)
 
 
 	if ((facility_list & (1UL << (31 - 22)))
 	if ((facility_list & (1UL << (31 - 22)))
 	    && (facility_list & (1UL << (31 - 30))))
 	    && (facility_list & (1UL << (31 - 30))))
-		elf_hwcap |= 1UL << 8;
+		elf_hwcap |= HWCAP_S390_ETF3EH;
 
 
 	/*
 	/*
 	 * Check for additional facilities with store-facility-list-extended.
 	 * Check for additional facilities with store-facility-list-extended.
@@ -748,11 +748,20 @@ static void __init setup_hwcaps(void)
 	    __stfle(&facility_list_extended, 1) > 0) {
 	    __stfle(&facility_list_extended, 1) > 0) {
 		if ((facility_list_extended & (1ULL << (63 - 42)))
 		if ((facility_list_extended & (1ULL << (63 - 42)))
 		    && (facility_list_extended & (1ULL << (63 - 44))))
 		    && (facility_list_extended & (1ULL << (63 - 44))))
-			elf_hwcap |= 1UL << 6;
+			elf_hwcap |= HWCAP_S390_DFP;
 	}
 	}
 
 
+	/*
+	 * Huge page support HWCAP_S390_HPAGE is bit 7.
+	 */
 	if (MACHINE_HAS_HPAGE)
 	if (MACHINE_HAS_HPAGE)
-		elf_hwcap |= 1UL << 7;
+		elf_hwcap |= HWCAP_S390_HPAGE;
+
+	/*
+	 * 64-bit register support for 31-bit processes
+	 * HWCAP_S390_HIGH_GPRS is bit 9.
+	 */
+	elf_hwcap |= HWCAP_S390_HIGH_GPRS;
 
 
 	switch (S390_lowcore.cpu_id.machine) {
 	switch (S390_lowcore.cpu_id.machine) {
 	case 0x9672:
 	case 0x9672:

+ 19 - 7
arch/s390/kernel/swsusp_asm64.S

@@ -43,7 +43,7 @@ swsusp_arch_suspend:
 	lghi	%r1,0x1000
 	lghi	%r1,0x1000
 
 
 	/* Save CPU address */
 	/* Save CPU address */
-	stap	__LC_CPU_ADDRESS(%r1)
+	stap	__LC_CPU_ADDRESS(%r0)
 
 
 	/* Store registers */
 	/* Store registers */
 	mvc	0x318(4,%r1),__SF_EMPTY(%r15)	/* move prefix to lowcore */
 	mvc	0x318(4,%r1),__SF_EMPTY(%r15)	/* move prefix to lowcore */
@@ -69,8 +69,21 @@ swsusp_arch_suspend:
 	stmg	%r0,%r15,0x280(%r1)		/* store general registers */
 	stmg	%r0,%r15,0x280(%r1)		/* store general registers */
 
 
 	stpt	0x328(%r1)			/* store timer */
 	stpt	0x328(%r1)			/* store timer */
+	stck	__SF_EMPTY(%r15)		/* store clock */
 	stckc	0x330(%r1)			/* store clock comparator */
 	stckc	0x330(%r1)			/* store clock comparator */
 
 
+	/* Update cputime accounting before going to sleep */
+	lg	%r0,__LC_LAST_UPDATE_TIMER
+	slg	%r0,0x328(%r1)
+	alg	%r0,__LC_SYSTEM_TIMER
+	stg	%r0,__LC_SYSTEM_TIMER
+	mvc	__LC_LAST_UPDATE_TIMER(8),0x328(%r1)
+	lg	%r0,__LC_LAST_UPDATE_CLOCK
+	slg	%r0,__SF_EMPTY(%r15)
+	alg	%r0,__LC_STEAL_TIMER
+	stg	%r0,__LC_STEAL_TIMER
+	mvc	__LC_LAST_UPDATE_CLOCK(8),__SF_EMPTY(%r15)
+
 	/* Activate DAT */
 	/* Activate DAT */
 	stosm	__SF_EMPTY(%r15),0x04
 	stosm	__SF_EMPTY(%r15),0x04
 
 
@@ -159,8 +172,7 @@ pgm_check_entry:
 	larl	%r1,.Lresume_cpu		/* Resume CPU address: r2 */
 	larl	%r1,.Lresume_cpu		/* Resume CPU address: r2 */
 	stap	0(%r1)
 	stap	0(%r1)
 	llgh	%r2,0(%r1)
 	llgh	%r2,0(%r1)
-	lghi	%r3,0x1000
-	llgh	%r1,__LC_CPU_ADDRESS(%r3)	/* Suspend CPU address: r1 */
+	llgh	%r1,__LC_CPU_ADDRESS(%r0)	/* Suspend CPU address: r1 */
 	cgr	%r1,%r2
 	cgr	%r1,%r2
 	je	restore_registers		/* r1 = r2 -> nothing to do */
 	je	restore_registers		/* r1 = r2 -> nothing to do */
 	larl	%r4,.Lrestart_suspend_psw	/* Set new restart PSW */
 	larl	%r4,.Lrestart_suspend_psw	/* Set new restart PSW */
@@ -200,8 +212,11 @@ restart_suspend:
 
 
 restore_registers:
 restore_registers:
 	/* Restore registers */
 	/* Restore registers */
-	lghi	%r13,0x1000		/* %r1 = pointer to save arae */
+	lghi	%r13,0x1000		/* %r1 = pointer to save area */
 
 
+	/* Ignore time spent in suspended state. */
+	llgf	%r1,0x318(%r13)
+	stck	__LC_LAST_UPDATE_CLOCK(%r1)
 	spt	0x328(%r13)		/* reprogram timer */
 	spt	0x328(%r13)		/* reprogram timer */
 	//sckc	0x330(%r13)		/* set clock comparator */
 	//sckc	0x330(%r13)		/* set clock comparator */
 
 
@@ -229,9 +244,6 @@ restore_registers:
 	/* Load old stack */
 	/* Load old stack */
 	lg	%r15,0x2f8(%r13)
 	lg	%r15,0x2f8(%r13)
 
 
-	/* Pointer to save area */
-	lghi	%r13,0x1000
-
 	/* Restore prefix register */
 	/* Restore prefix register */
 	spx	0x318(%r13)
 	spx	0x318(%r13)
 
 

+ 8 - 8
arch/s390/kernel/vdso.c

@@ -246,6 +246,13 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
 		goto out_up;
 		goto out_up;
 	}
 	}
 
 
+	/*
+	 * Put vDSO base into mm struct. We need to do this before calling
+	 * install_special_mapping or the perf counter mmap tracking code
+	 * will fail to recognise it as a vDSO (since arch_vma_name fails).
+	 */
+	current->mm->context.vdso_base = vdso_base;
+
 	/*
 	/*
 	 * our vma flags don't have VM_WRITE so by default, the process
 	 * our vma flags don't have VM_WRITE so by default, the process
 	 * isn't allowed to write those pages.
 	 * isn't allowed to write those pages.
@@ -267,14 +274,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
 				     VM_ALWAYSDUMP,
 				     VM_ALWAYSDUMP,
 				     vdso_pagelist);
 				     vdso_pagelist);
 	if (rc)
 	if (rc)
-		goto out_up;
-
-	/* Put vDSO base into mm struct */
-	current->mm->context.vdso_base = vdso_base;
-
-	up_write(&mm->mmap_sem);
-	return 0;
-
+		current->mm->context.vdso_base = 0;
 out_up:
 out_up:
 	up_write(&mm->mmap_sem);
 	up_write(&mm->mmap_sem);
 	return rc;
 	return rc;

+ 1 - 0
arch/s390/kernel/vmlinux.lds.S

@@ -51,6 +51,7 @@ SECTIONS
 
 
 	. = ALIGN(PAGE_SIZE);
 	. = ALIGN(PAGE_SIZE);
 	_eshared = .;		/* End of shareable data */
 	_eshared = .;		/* End of shareable data */
+	_sdata = .;		/* Start of data section */
 
 
 	EXCEPTION_TABLE(16) :data
 	EXCEPTION_TABLE(16) :data
 
 

+ 16 - 11
arch/s390/lib/delay.c

@@ -25,13 +25,13 @@ void __delay(unsigned long loops)
 	asm volatile("0: brct %0,0b" : : "d" ((loops/2) + 1));
 	asm volatile("0: brct %0,0b" : : "d" ((loops/2) + 1));
 }
 }
 
 
-static void __udelay_disabled(unsigned long usecs)
+static void __udelay_disabled(unsigned long long usecs)
 {
 {
 	unsigned long mask, cr0, cr0_saved;
 	unsigned long mask, cr0, cr0_saved;
 	u64 clock_saved;
 	u64 clock_saved;
 
 
 	clock_saved = local_tick_disable();
 	clock_saved = local_tick_disable();
-	set_clock_comparator(get_clock() + ((u64) usecs << 12));
+	set_clock_comparator(get_clock() + (usecs << 12));
 	__ctl_store(cr0_saved, 0, 0);
 	__ctl_store(cr0_saved, 0, 0);
 	cr0 = (cr0_saved & 0xffff00e0) | 0x00000800;
 	cr0 = (cr0_saved & 0xffff00e0) | 0x00000800;
 	__ctl_load(cr0 , 0, 0);
 	__ctl_load(cr0 , 0, 0);
@@ -46,20 +46,25 @@ static void __udelay_disabled(unsigned long usecs)
 	set_clock_comparator(S390_lowcore.clock_comparator);
 	set_clock_comparator(S390_lowcore.clock_comparator);
 }
 }
 
 
-static void __udelay_enabled(unsigned long usecs)
+static void __udelay_enabled(unsigned long long usecs)
 {
 {
 	unsigned long mask;
 	unsigned long mask;
-	u64 end, time;
+	u64 clock_saved;
+	u64 end;
 
 
 	mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT | PSW_MASK_IO;
 	mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT | PSW_MASK_IO;
-	end = get_clock() + ((u64) usecs << 12);
+	end = get_clock() + (usecs << 12);
 	do {
 	do {
-		time = end < S390_lowcore.clock_comparator ?
-			end : S390_lowcore.clock_comparator;
-		set_clock_comparator(time);
+		clock_saved = 0;
+		if (end < S390_lowcore.clock_comparator) {
+			clock_saved = local_tick_disable();
+			set_clock_comparator(end);
+		}
 		trace_hardirqs_on();
 		trace_hardirqs_on();
 		__load_psw_mask(mask);
 		__load_psw_mask(mask);
 		local_irq_disable();
 		local_irq_disable();
+		if (clock_saved)
+			local_tick_enable(clock_saved);
 	} while (get_clock() < end);
 	} while (get_clock() < end);
 	set_clock_comparator(S390_lowcore.clock_comparator);
 	set_clock_comparator(S390_lowcore.clock_comparator);
 }
 }
@@ -67,7 +72,7 @@ static void __udelay_enabled(unsigned long usecs)
 /*
 /*
  * Waits for 'usecs' microseconds using the TOD clock comparator.
  * Waits for 'usecs' microseconds using the TOD clock comparator.
  */
  */
-void __udelay(unsigned long usecs)
+void __udelay(unsigned long long usecs)
 {
 {
 	unsigned long flags;
 	unsigned long flags;
 
 
@@ -101,11 +106,11 @@ EXPORT_SYMBOL(__udelay);
  * Simple udelay variant. To be used on startup and reboot
  * Simple udelay variant. To be used on startup and reboot
  * when the interrupt handler isn't working.
  * when the interrupt handler isn't working.
  */
  */
-void udelay_simple(unsigned long usecs)
+void udelay_simple(unsigned long long usecs)
 {
 {
 	u64 end;
 	u64 end;
 
 
-	end = get_clock() + ((u64) usecs << 12);
+	end = get_clock() + (usecs << 12);
 	while (get_clock() < end)
 	while (get_clock() < end)
 		cpu_relax();
 		cpu_relax();
 }
 }

+ 6 - 6
arch/s390/lib/uaccess_mvcos.c

@@ -36,7 +36,7 @@ static size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x)
 	tmp1 = -4096UL;
 	tmp1 = -4096UL;
 	asm volatile(
 	asm volatile(
 		"0: .insn ss,0xc80000000000,0(%0,%2),0(%1),0\n"
 		"0: .insn ss,0xc80000000000,0(%0,%2),0(%1),0\n"
-		"   jz    7f\n"
+		"9: jz    7f\n"
 		"1:"ALR"  %0,%3\n"
 		"1:"ALR"  %0,%3\n"
 		"  "SLR"  %1,%3\n"
 		"  "SLR"  %1,%3\n"
 		"  "SLR"  %2,%3\n"
 		"  "SLR"  %2,%3\n"
@@ -47,7 +47,7 @@ static size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x)
 		"  "CLR"  %0,%4\n"	/* copy crosses next page boundary? */
 		"  "CLR"  %0,%4\n"	/* copy crosses next page boundary? */
 		"   jnh   4f\n"
 		"   jnh   4f\n"
 		"3: .insn ss,0xc80000000000,0(%4,%2),0(%1),0\n"
 		"3: .insn ss,0xc80000000000,0(%4,%2),0(%1),0\n"
-		"  "SLR"  %0,%4\n"
+		"10:"SLR"  %0,%4\n"
 		"  "ALR"  %2,%4\n"
 		"  "ALR"  %2,%4\n"
 		"4:"LHI"  %4,-1\n"
 		"4:"LHI"  %4,-1\n"
 		"  "ALR"  %4,%0\n"	/* copy remaining size, subtract 1 */
 		"  "ALR"  %4,%0\n"	/* copy remaining size, subtract 1 */
@@ -61,7 +61,7 @@ static size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x)
 		"   j     8f\n"
 		"   j     8f\n"
 		"7:"SLR"  %0,%0\n"
 		"7:"SLR"  %0,%0\n"
 		"8: \n"
 		"8: \n"
-		EX_TABLE(0b,2b) EX_TABLE(3b,4b)
+		EX_TABLE(0b,2b) EX_TABLE(3b,4b) EX_TABLE(9b,2b) EX_TABLE(10b,4b)
 		: "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
 		: "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
 		: "d" (reg0) : "cc", "memory");
 		: "d" (reg0) : "cc", "memory");
 	return size;
 	return size;
@@ -82,7 +82,7 @@ static size_t copy_to_user_mvcos(size_t size, void __user *ptr, const void *x)
 	tmp1 = -4096UL;
 	tmp1 = -4096UL;
 	asm volatile(
 	asm volatile(
 		"0: .insn ss,0xc80000000000,0(%0,%1),0(%2),0\n"
 		"0: .insn ss,0xc80000000000,0(%0,%1),0(%2),0\n"
-		"   jz    4f\n"
+		"6: jz    4f\n"
 		"1:"ALR"  %0,%3\n"
 		"1:"ALR"  %0,%3\n"
 		"  "SLR"  %1,%3\n"
 		"  "SLR"  %1,%3\n"
 		"  "SLR"  %2,%3\n"
 		"  "SLR"  %2,%3\n"
@@ -93,11 +93,11 @@ static size_t copy_to_user_mvcos(size_t size, void __user *ptr, const void *x)
 		"  "CLR"  %0,%4\n"	/* copy crosses next page boundary? */
 		"  "CLR"  %0,%4\n"	/* copy crosses next page boundary? */
 		"   jnh   5f\n"
 		"   jnh   5f\n"
 		"3: .insn ss,0xc80000000000,0(%4,%1),0(%2),0\n"
 		"3: .insn ss,0xc80000000000,0(%4,%1),0(%2),0\n"
-		"  "SLR"  %0,%4\n"
+		"7:"SLR"  %0,%4\n"
 		"   j     5f\n"
 		"   j     5f\n"
 		"4:"SLR"  %0,%0\n"
 		"4:"SLR"  %0,%0\n"
 		"5: \n"
 		"5: \n"
-		EX_TABLE(0b,2b) EX_TABLE(3b,5b)
+		EX_TABLE(0b,2b) EX_TABLE(3b,5b) EX_TABLE(6b,2b) EX_TABLE(7b,5b)
 		: "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
 		: "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
 		: "d" (reg0) : "cc", "memory");
 		: "d" (reg0) : "cc", "memory");
 	return size;
 	return size;

+ 8 - 6
arch/s390/lib/uaccess_std.c

@@ -36,12 +36,12 @@ size_t copy_from_user_std(size_t size, const void __user *ptr, void *x)
 	tmp1 = -256UL;
 	tmp1 = -256UL;
 	asm volatile(
 	asm volatile(
 		"0: mvcp  0(%0,%2),0(%1),%3\n"
 		"0: mvcp  0(%0,%2),0(%1),%3\n"
-		"   jz    8f\n"
+		"10:jz    8f\n"
 		"1:"ALR"  %0,%3\n"
 		"1:"ALR"  %0,%3\n"
 		"   la    %1,256(%1)\n"
 		"   la    %1,256(%1)\n"
 		"   la    %2,256(%2)\n"
 		"   la    %2,256(%2)\n"
 		"2: mvcp  0(%0,%2),0(%1),%3\n"
 		"2: mvcp  0(%0,%2),0(%1),%3\n"
-		"   jnz   1b\n"
+		"11:jnz   1b\n"
 		"   j     8f\n"
 		"   j     8f\n"
 		"3: la    %4,255(%1)\n"	/* %4 = ptr + 255 */
 		"3: la    %4,255(%1)\n"	/* %4 = ptr + 255 */
 		"  "LHI"  %3,-4096\n"
 		"  "LHI"  %3,-4096\n"
@@ -50,7 +50,7 @@ size_t copy_from_user_std(size_t size, const void __user *ptr, void *x)
 		"  "CLR"  %0,%4\n"	/* copy crosses next page boundary? */
 		"  "CLR"  %0,%4\n"	/* copy crosses next page boundary? */
 		"   jnh   5f\n"
 		"   jnh   5f\n"
 		"4: mvcp  0(%4,%2),0(%1),%3\n"
 		"4: mvcp  0(%4,%2),0(%1),%3\n"
-		"  "SLR"  %0,%4\n"
+		"12:"SLR"  %0,%4\n"
 		"  "ALR"  %2,%4\n"
 		"  "ALR"  %2,%4\n"
 		"5:"LHI"  %4,-1\n"
 		"5:"LHI"  %4,-1\n"
 		"  "ALR"  %4,%0\n"	/* copy remaining size, subtract 1 */
 		"  "ALR"  %4,%0\n"	/* copy remaining size, subtract 1 */
@@ -65,6 +65,7 @@ size_t copy_from_user_std(size_t size, const void __user *ptr, void *x)
 		"8:"SLR"  %0,%0\n"
 		"8:"SLR"  %0,%0\n"
 		"9: \n"
 		"9: \n"
 		EX_TABLE(0b,3b) EX_TABLE(2b,3b) EX_TABLE(4b,5b)
 		EX_TABLE(0b,3b) EX_TABLE(2b,3b) EX_TABLE(4b,5b)
+		EX_TABLE(10b,3b) EX_TABLE(11b,3b) EX_TABLE(12b,5b)
 		: "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
 		: "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
 		: : "cc", "memory");
 		: : "cc", "memory");
 	return size;
 	return size;
@@ -85,12 +86,12 @@ size_t copy_to_user_std(size_t size, void __user *ptr, const void *x)
 	tmp1 = -256UL;
 	tmp1 = -256UL;
 	asm volatile(
 	asm volatile(
 		"0: mvcs  0(%0,%1),0(%2),%3\n"
 		"0: mvcs  0(%0,%1),0(%2),%3\n"
-		"   jz    5f\n"
+		"7: jz    5f\n"
 		"1:"ALR"  %0,%3\n"
 		"1:"ALR"  %0,%3\n"
 		"   la    %1,256(%1)\n"
 		"   la    %1,256(%1)\n"
 		"   la    %2,256(%2)\n"
 		"   la    %2,256(%2)\n"
 		"2: mvcs  0(%0,%1),0(%2),%3\n"
 		"2: mvcs  0(%0,%1),0(%2),%3\n"
-		"   jnz   1b\n"
+		"8: jnz   1b\n"
 		"   j     5f\n"
 		"   j     5f\n"
 		"3: la    %4,255(%1)\n" /* %4 = ptr + 255 */
 		"3: la    %4,255(%1)\n" /* %4 = ptr + 255 */
 		"  "LHI"  %3,-4096\n"
 		"  "LHI"  %3,-4096\n"
@@ -99,11 +100,12 @@ size_t copy_to_user_std(size_t size, void __user *ptr, const void *x)
 		"  "CLR"  %0,%4\n"	/* copy crosses next page boundary? */
 		"  "CLR"  %0,%4\n"	/* copy crosses next page boundary? */
 		"   jnh   6f\n"
 		"   jnh   6f\n"
 		"4: mvcs  0(%4,%1),0(%2),%3\n"
 		"4: mvcs  0(%4,%1),0(%2),%3\n"
-		"  "SLR"  %0,%4\n"
+		"9:"SLR"  %0,%4\n"
 		"   j     6f\n"
 		"   j     6f\n"
 		"5:"SLR"  %0,%0\n"
 		"5:"SLR"  %0,%0\n"
 		"6: \n"
 		"6: \n"
 		EX_TABLE(0b,3b) EX_TABLE(2b,3b) EX_TABLE(4b,6b)
 		EX_TABLE(0b,3b) EX_TABLE(2b,3b) EX_TABLE(4b,6b)
+		EX_TABLE(7b,3b) EX_TABLE(8b,3b) EX_TABLE(9b,6b)
 		: "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
 		: "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
 		: : "cc", "memory");
 		: : "cc", "memory");
 	return size;
 	return size;

+ 8 - 2
arch/s390/mm/pgtable.c

@@ -279,7 +279,10 @@ int s390_enable_sie(void)
 	/* lets check if we are allowed to replace the mm */
 	/* lets check if we are allowed to replace the mm */
 	task_lock(tsk);
 	task_lock(tsk);
 	if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 ||
 	if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 ||
-	    tsk->mm != tsk->active_mm || !hlist_empty(&tsk->mm->ioctx_list)) {
+#ifdef CONFIG_AIO
+	    !hlist_empty(&tsk->mm->ioctx_list) ||
+#endif
+	    tsk->mm != tsk->active_mm) {
 		task_unlock(tsk);
 		task_unlock(tsk);
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
@@ -295,7 +298,10 @@ int s390_enable_sie(void)
 	/* Now lets check again if something happened */
 	/* Now lets check again if something happened */
 	task_lock(tsk);
 	task_lock(tsk);
 	if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 ||
 	if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 ||
-	    tsk->mm != tsk->active_mm || !hlist_empty(&tsk->mm->ioctx_list)) {
+#ifdef CONFIG_AIO
+	    !hlist_empty(&tsk->mm->ioctx_list) ||
+#endif
+	    tsk->mm != tsk->active_mm) {
 		mmput(mm);
 		mmput(mm);
 		task_unlock(tsk);
 		task_unlock(tsk);
 		return -EINVAL;
 		return -EINVAL;

+ 4 - 3
arch/sh/kernel/traps_32.c

@@ -25,6 +25,7 @@
 #include <linux/kexec.h>
 #include <linux/kexec.h>
 #include <linux/limits.h>
 #include <linux/limits.h>
 #include <linux/proc_fs.h>
 #include <linux/proc_fs.h>
+#include <linux/sysfs.h>
 #include <asm/system.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/uaccess.h>
 #include <asm/fpu.h>
 #include <asm/fpu.h>
@@ -159,12 +160,12 @@ void die(const char * str, struct pt_regs * regs, long err)
 
 
 	oops_enter();
 	oops_enter();
 
 
-	console_verbose();
 	spin_lock_irq(&die_lock);
 	spin_lock_irq(&die_lock);
+	console_verbose();
 	bust_spinlocks(1);
 	bust_spinlocks(1);
 
 
 	printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
 	printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
-
+	sysfs_printk_last_file();
 	print_modules();
 	print_modules();
 	show_regs(regs);
 	show_regs(regs);
 
 
@@ -180,6 +181,7 @@ void die(const char * str, struct pt_regs * regs, long err)
 	bust_spinlocks(0);
 	bust_spinlocks(0);
 	add_taint(TAINT_DIE);
 	add_taint(TAINT_DIE);
 	spin_unlock_irq(&die_lock);
 	spin_unlock_irq(&die_lock);
+	oops_exit();
 
 
 	if (kexec_should_crash(current))
 	if (kexec_should_crash(current))
 		crash_kexec(regs);
 		crash_kexec(regs);
@@ -190,7 +192,6 @@ void die(const char * str, struct pt_regs * regs, long err)
 	if (panic_on_oops)
 	if (panic_on_oops)
 		panic("Fatal exception");
 		panic("Fatal exception");
 
 
-	oops_exit();
 	do_exit(SIGSEGV);
 	do_exit(SIGSEGV);
 }
 }
 
 

+ 1 - 1
arch/sh/mm/cache.c

@@ -128,7 +128,7 @@ void __update_cache(struct vm_area_struct *vma,
 		return;
 		return;
 
 
 	page = pfn_to_page(pfn);
 	page = pfn_to_page(pfn);
-	if (pfn_valid(pfn) && page_mapping(page)) {
+	if (pfn_valid(pfn)) {
 		int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);
 		int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);
 		if (dirty) {
 		if (dirty) {
 			unsigned long addr = (unsigned long)page_address(page);
 			unsigned long addr = (unsigned long)page_address(page);

+ 1 - 0
arch/um/drivers/line.c

@@ -5,6 +5,7 @@
 
 
 #include "linux/irqreturn.h"
 #include "linux/irqreturn.h"
 #include "linux/kd.h"
 #include "linux/kd.h"
+#include "linux/sched.h"
 #include "chan_kern.h"
 #include "chan_kern.h"
 #include "irq_kern.h"
 #include "irq_kern.h"
 #include "irq_user.h"
 #include "irq_user.h"

+ 1 - 0
arch/um/drivers/port_kern.c

@@ -7,6 +7,7 @@
 #include "linux/interrupt.h"
 #include "linux/interrupt.h"
 #include "linux/list.h"
 #include "linux/list.h"
 #include "linux/mutex.h"
 #include "linux/mutex.h"
+#include "linux/workqueue.h"
 #include "asm/atomic.h"
 #include "asm/atomic.h"
 #include "init.h"
 #include "init.h"
 #include "irq_kern.h"
 #include "irq_kern.h"

+ 1 - 0
arch/um/kernel/irq.c

@@ -10,6 +10,7 @@
 #include "linux/interrupt.h"
 #include "linux/interrupt.h"
 #include "linux/kernel_stat.h"
 #include "linux/kernel_stat.h"
 #include "linux/module.h"
 #include "linux/module.h"
+#include "linux/sched.h"
 #include "linux/seq_file.h"
 #include "linux/seq_file.h"
 #include "as-layout.h"
 #include "as-layout.h"
 #include "kern_util.h"
 #include "kern_util.h"

+ 1 - 0
arch/x86/kernel/cpu/mcheck/mce_intel.c

@@ -8,6 +8,7 @@
 #include <linux/init.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/percpu.h>
 #include <linux/percpu.h>
+#include <linux/sched.h>
 #include <asm/apic.h>
 #include <asm/apic.h>
 #include <asm/processor.h>
 #include <asm/processor.h>
 #include <asm/msr.h>
 #include <asm/msr.h>

+ 2 - 2
arch/x86/kernel/e820.c

@@ -1378,8 +1378,8 @@ static unsigned long ram_alignment(resource_size_t pos)
 	if (mb < 16)
 	if (mb < 16)
 		return 1024*1024;
 		return 1024*1024;
 
 
-	/* To 32MB for anything above that */
-	return 32*1024*1024;
+	/* To 64MB for anything above that */
+	return 64*1024*1024;
 }
 }
 
 
 #define MAX_RESOURCE_SIZE ((resource_size_t)-1)
 #define MAX_RESOURCE_SIZE ((resource_size_t)-1)

+ 1 - 0
arch/x86/kernel/pci-gart_64.c

@@ -16,6 +16,7 @@
 #include <linux/agp_backend.h>
 #include <linux/agp_backend.h>
 #include <linux/init.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/mm.h>
+#include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/string.h>
 #include <linux/spinlock.h>
 #include <linux/spinlock.h>
 #include <linux/pci.h>
 #include <linux/pci.h>

+ 1 - 0
arch/x86/kernel/reboot.c

@@ -4,6 +4,7 @@
 #include <linux/pm.h>
 #include <linux/pm.h>
 #include <linux/efi.h>
 #include <linux/efi.h>
 #include <linux/dmi.h>
 #include <linux/dmi.h>
+#include <linux/sched.h>
 #include <linux/tboot.h>
 #include <linux/tboot.h>
 #include <acpi/reboot.h>
 #include <acpi/reboot.h>
 #include <asm/io.h>
 #include <asm/io.h>

+ 1 - 0
arch/xtensa/kernel/time.c

@@ -13,6 +13,7 @@
  */
  */
 
 
 #include <linux/errno.h>
 #include <linux/errno.h>
+#include <linux/sched.h>
 #include <linux/time.h>
 #include <linux/time.h>
 #include <linux/clocksource.h>
 #include <linux/clocksource.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>

+ 1 - 0
crypto/aead.c

@@ -18,6 +18,7 @@
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/rtnetlink.h>
 #include <linux/rtnetlink.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/seq_file.h>
 #include <linux/seq_file.h>
 
 

+ 1 - 0
drivers/char/applicom.c

@@ -23,6 +23,7 @@
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
 #include <linux/miscdevice.h>

+ 1 - 0
drivers/char/epca.c

@@ -30,6 +30,7 @@
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/init.h>
+#include <linux/sched.h>
 #include <linux/serial.h>
 #include <linux/serial.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
 #include <linux/ctype.h>
 #include <linux/ctype.h>

+ 1 - 0
drivers/char/generic_serial.c

@@ -22,6 +22,7 @@
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/tty.h>
 #include <linux/tty.h>
+#include <linux/sched.h>
 #include <linux/serial.h>
 #include <linux/serial.h>
 #include <linux/mm.h>
 #include <linux/mm.h>
 #include <linux/generic_serial.h>
 #include <linux/generic_serial.h>

+ 1 - 0
drivers/char/istallion.c

@@ -19,6 +19,7 @@
 /*****************************************************************************/
 /*****************************************************************************/
 
 
 #include <linux/module.h>
 #include <linux/module.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/smp_lock.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>

+ 1 - 0
drivers/char/nozomi.c

@@ -48,6 +48,7 @@
 #include <linux/tty.h>
 #include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
 #include <linux/tty_flip.h>
+#include <linux/sched.h>
 #include <linux/serial.h>
 #include <linux/serial.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/kmod.h>
 #include <linux/kmod.h>

+ 1 - 0
drivers/char/pty.c

@@ -18,6 +18,7 @@
 #include <linux/tty.h>
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
 #include <linux/tty_flip.h>
 #include <linux/fcntl.h>
 #include <linux/fcntl.h>
+#include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/string.h>
 #include <linux/major.h>
 #include <linux/major.h>
 #include <linux/mm.h>
 #include <linux/mm.h>

+ 1 - 0
drivers/char/rio/riocmd.c

@@ -32,6 +32,7 @@
 */
 */
 
 
 #include <linux/module.h>
 #include <linux/module.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/errno.h>
 #include <linux/tty.h>
 #include <linux/tty.h>

+ 1 - 0
drivers/char/rio/rioctrl.c

@@ -31,6 +31,7 @@
 */
 */
 
 
 #include <linux/module.h>
 #include <linux/module.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/io.h>

+ 1 - 0
drivers/char/rio/riotty.c

@@ -33,6 +33,7 @@
 #define __EXPLICIT_DEF_H__
 #define __EXPLICIT_DEF_H__
 
 
 #include <linux/module.h>
 #include <linux/module.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/errno.h>
 #include <linux/tty.h>
 #include <linux/tty.h>

+ 1 - 0
drivers/char/ser_a2232.c

@@ -89,6 +89,7 @@
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/errno.h>
+#include <linux/sched.h>
 #include <linux/tty.h>
 #include <linux/tty.h>
 
 
 #include <asm/setup.h>
 #include <asm/setup.h>

+ 1 - 0
drivers/char/stallion.c

@@ -27,6 +27,7 @@
 /*****************************************************************************/
 /*****************************************************************************/
 
 
 #include <linux/module.h>
 #include <linux/module.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/tty.h>
 #include <linux/tty.h>

+ 1 - 0
drivers/char/tlclk.c

@@ -32,6 +32,7 @@
 #include <linux/kernel.h>	/* printk() */
 #include <linux/kernel.h>	/* printk() */
 #include <linux/fs.h>		/* everything... */
 #include <linux/fs.h>		/* everything... */
 #include <linux/errno.h>	/* error codes */
 #include <linux/errno.h>	/* error codes */
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>

+ 1 - 1
drivers/hwmon/Kconfig

@@ -675,7 +675,7 @@ config SENSORS_SHT15
 
 
 config SENSORS_S3C
 config SENSORS_S3C
 	tristate "S3C24XX/S3C64XX Inbuilt ADC"
 	tristate "S3C24XX/S3C64XX Inbuilt ADC"
-	depends on ARCH_S3C2410 || ARCH_S3C64XX
+	depends on ARCH_S3C2410
 	help
 	help
 	  If you say yes here you get support for the on-board ADCs of
 	  If you say yes here you get support for the on-board ADCs of
 	  the Samsung S3C24XX or S3C64XX series of SoC
 	  the Samsung S3C24XX or S3C64XX series of SoC

+ 284 - 55
drivers/hwmon/asus_atk0110.c

@@ -35,18 +35,22 @@
 #define METHOD_OLD_ENUM_FAN	"FSIF"
 #define METHOD_OLD_ENUM_FAN	"FSIF"
 
 
 #define ATK_MUX_HWMON		0x00000006ULL
 #define ATK_MUX_HWMON		0x00000006ULL
+#define ATK_MUX_MGMT		0x00000011ULL
 
 
 #define ATK_CLASS_MASK		0xff000000ULL
 #define ATK_CLASS_MASK		0xff000000ULL
 #define ATK_CLASS_FREQ_CTL	0x03000000ULL
 #define ATK_CLASS_FREQ_CTL	0x03000000ULL
 #define ATK_CLASS_FAN_CTL	0x04000000ULL
 #define ATK_CLASS_FAN_CTL	0x04000000ULL
 #define ATK_CLASS_HWMON		0x06000000ULL
 #define ATK_CLASS_HWMON		0x06000000ULL
+#define ATK_CLASS_MGMT		0x11000000ULL
 
 
 #define ATK_TYPE_MASK		0x00ff0000ULL
 #define ATK_TYPE_MASK		0x00ff0000ULL
 #define HWMON_TYPE_VOLT		0x00020000ULL
 #define HWMON_TYPE_VOLT		0x00020000ULL
 #define HWMON_TYPE_TEMP		0x00030000ULL
 #define HWMON_TYPE_TEMP		0x00030000ULL
 #define HWMON_TYPE_FAN		0x00040000ULL
 #define HWMON_TYPE_FAN		0x00040000ULL
 
 
-#define HWMON_SENSOR_ID_MASK	0x0000ffffULL
+#define ATK_ELEMENT_ID_MASK	0x0000ffffULL
+
+#define ATK_EC_ID		0x11060004ULL
 
 
 enum atk_pack_member {
 enum atk_pack_member {
 	HWMON_PACK_FLAGS,
 	HWMON_PACK_FLAGS,
@@ -89,6 +93,9 @@ struct atk_data {
 	/* new inteface */
 	/* new inteface */
 	acpi_handle enumerate_handle;
 	acpi_handle enumerate_handle;
 	acpi_handle read_handle;
 	acpi_handle read_handle;
+	acpi_handle write_handle;
+
+	bool disable_ec;
 
 
 	int voltage_count;
 	int voltage_count;
 	int temperature_count;
 	int temperature_count;
@@ -129,9 +136,22 @@ struct atk_sensor_data {
 	char const *acpi_name;
 	char const *acpi_name;
 };
 };
 
 
-struct atk_acpi_buffer_u64 {
-	union acpi_object buf;
-	u64 value;
+/* Return buffer format:
+ * [0-3] "value" is valid flag
+ * [4-7] value
+ * [8- ] unknown stuff on newer mobos
+ */
+struct atk_acpi_ret_buffer {
+	u32 flags;
+	u32 value;
+	u8 data[];
+};
+
+/* Input buffer used for GITM and SITM methods */
+struct atk_acpi_input_buf {
+	u32 id;
+	u32 param1;
+	u32 param2;
 };
 };
 
 
 static int atk_add(struct acpi_device *device);
 static int atk_add(struct acpi_device *device);
@@ -439,52 +459,147 @@ static int atk_read_value_old(struct atk_sensor_data *sensor, u64 *value)
 	return 0;
 	return 0;
 }
 }
 
 
-static int atk_read_value_new(struct atk_sensor_data *sensor, u64 *value)
+static union acpi_object *atk_ggrp(struct atk_data *data, u16 mux)
 {
 {
-	struct atk_data *data = sensor->data;
 	struct device *dev = &data->acpi_dev->dev;
 	struct device *dev = &data->acpi_dev->dev;
+	struct acpi_buffer buf;
+	acpi_status ret;
 	struct acpi_object_list params;
 	struct acpi_object_list params;
-	struct acpi_buffer ret;
 	union acpi_object id;
 	union acpi_object id;
-	struct atk_acpi_buffer_u64 tmp;
-	acpi_status status;
+	union acpi_object *pack;
 
 
 	id.type = ACPI_TYPE_INTEGER;
 	id.type = ACPI_TYPE_INTEGER;
-	id.integer.value = sensor->id;
-
+	id.integer.value = mux;
 	params.count = 1;
 	params.count = 1;
 	params.pointer = &id;
 	params.pointer = &id;
 
 
-	tmp.buf.type = ACPI_TYPE_BUFFER;
-	tmp.buf.buffer.pointer = (u8 *)&tmp.value;
-	tmp.buf.buffer.length = sizeof(u64);
-	ret.length = sizeof(tmp);
-	ret.pointer = &tmp;
+	buf.length = ACPI_ALLOCATE_BUFFER;
+	ret = acpi_evaluate_object(data->enumerate_handle, NULL, &params, &buf);
+	if (ret != AE_OK) {
+		dev_err(dev, "GGRP[%#x] ACPI exception: %s\n", mux,
+				acpi_format_exception(ret));
+		return ERR_PTR(-EIO);
+	}
+	pack = buf.pointer;
+	if (pack->type != ACPI_TYPE_PACKAGE) {
+		/* Execution was successful, but the id was not found */
+		ACPI_FREE(pack);
+		return ERR_PTR(-ENOENT);
+	}
+
+	if (pack->package.count < 1) {
+		dev_err(dev, "GGRP[%#x] package is too small\n", mux);
+		ACPI_FREE(pack);
+		return ERR_PTR(-EIO);
+	}
+	return pack;
+}
+
+static union acpi_object *atk_gitm(struct atk_data *data, u64 id)
+{
+	struct device *dev = &data->acpi_dev->dev;
+	struct atk_acpi_input_buf buf;
+	union acpi_object tmp;
+	struct acpi_object_list params;
+	struct acpi_buffer ret;
+	union acpi_object *obj;
+	acpi_status status;
+
+	buf.id = id;
+	buf.param1 = 0;
+	buf.param2 = 0;
 
 
+	tmp.type = ACPI_TYPE_BUFFER;
+	tmp.buffer.pointer = (u8 *)&buf;
+	tmp.buffer.length = sizeof(buf);
+
+	params.count = 1;
+	params.pointer = (void *)&tmp;
+
+	ret.length = ACPI_ALLOCATE_BUFFER;
 	status = acpi_evaluate_object_typed(data->read_handle, NULL, &params,
 	status = acpi_evaluate_object_typed(data->read_handle, NULL, &params,
 			&ret, ACPI_TYPE_BUFFER);
 			&ret, ACPI_TYPE_BUFFER);
 	if (status != AE_OK) {
 	if (status != AE_OK) {
-		dev_warn(dev, "%s: ACPI exception: %s\n", __func__,
+		dev_warn(dev, "GITM[%#llx] ACPI exception: %s\n", id,
 				acpi_format_exception(status));
 				acpi_format_exception(status));
-		return -EIO;
+		return ERR_PTR(-EIO);
+	}
+	obj = ret.pointer;
+
+	/* Sanity check */
+	if (obj->buffer.length < 8) {
+		dev_warn(dev, "Unexpected ASBF length: %u\n",
+				obj->buffer.length);
+		ACPI_FREE(obj);
+		return ERR_PTR(-EIO);
 	}
 	}
+	return obj;
+}
 
 
-	/* Return buffer format:
-	 * [0-3] "value" is valid flag
-	 * [4-7] value
-	 */
-	if (!(tmp.value & 0xffffffff)) {
+static union acpi_object *atk_sitm(struct atk_data *data,
+		struct atk_acpi_input_buf *buf)
+{
+	struct device *dev = &data->acpi_dev->dev;
+	struct acpi_object_list params;
+	union acpi_object tmp;
+	struct acpi_buffer ret;
+	union acpi_object *obj;
+	acpi_status status;
+
+	tmp.type = ACPI_TYPE_BUFFER;
+	tmp.buffer.pointer = (u8 *)buf;
+	tmp.buffer.length = sizeof(*buf);
+
+	params.count = 1;
+	params.pointer = &tmp;
+
+	ret.length = ACPI_ALLOCATE_BUFFER;
+	status = acpi_evaluate_object_typed(data->write_handle, NULL, &params,
+			&ret, ACPI_TYPE_BUFFER);
+	if (status != AE_OK) {
+		dev_warn(dev, "SITM[%#x] ACPI exception: %s\n", buf->id,
+				acpi_format_exception(status));
+		return ERR_PTR(-EIO);
+	}
+	obj = ret.pointer;
+
+	/* Sanity check */
+	if (obj->buffer.length < 8) {
+		dev_warn(dev, "Unexpected ASBF length: %u\n",
+				obj->buffer.length);
+		ACPI_FREE(obj);
+		return ERR_PTR(-EIO);
+	}
+	return obj;
+}
+
+static int atk_read_value_new(struct atk_sensor_data *sensor, u64 *value)
+{
+	struct atk_data *data = sensor->data;
+	struct device *dev = &data->acpi_dev->dev;
+	union acpi_object *obj;
+	struct atk_acpi_ret_buffer *buf;
+	int err = 0;
+
+	obj = atk_gitm(data, sensor->id);
+	if (IS_ERR(obj))
+		return PTR_ERR(obj);
+
+	buf = (struct atk_acpi_ret_buffer *)obj->buffer.pointer;
+	if (buf->flags == 0) {
 		/* The reading is not valid, possible causes:
 		/* The reading is not valid, possible causes:
 		 * - sensor failure
 		 * - sensor failure
 		 * - enumeration was FUBAR (and we didn't notice)
 		 * - enumeration was FUBAR (and we didn't notice)
 		 */
 		 */
-		dev_info(dev, "Failure: %#llx\n", tmp.value);
-		return -EIO;
+		dev_warn(dev, "Read failed, sensor = %#llx\n", sensor->id);
+		err = -EIO;
+		goto out;
 	}
 	}
 
 
-	*value = (tmp.value & 0xffffffff00000000ULL) >> 32;
-
-	return 0;
+	*value = buf->value;
+out:
+	ACPI_FREE(obj);
+	return err;
 }
 }
 
 
 static int atk_read_value(struct atk_sensor_data *sensor, u64 *value)
 static int atk_read_value(struct atk_sensor_data *sensor, u64 *value)
@@ -713,43 +828,141 @@ static int atk_enumerate_old_hwmon(struct atk_data *data)
 	return ret;
 	return ret;
 }
 }
 
 
-static int atk_enumerate_new_hwmon(struct atk_data *data)
+static int atk_ec_present(struct atk_data *data)
 {
 {
 	struct device *dev = &data->acpi_dev->dev;
 	struct device *dev = &data->acpi_dev->dev;
-	struct acpi_buffer buf;
-	acpi_status ret;
-	struct acpi_object_list params;
-	union acpi_object id;
 	union acpi_object *pack;
 	union acpi_object *pack;
-	int err;
+	union acpi_object *ec;
+	int ret;
 	int i;
 	int i;
 
 
-	dev_dbg(dev, "Enumerating hwmon sensors\n");
+	pack = atk_ggrp(data, ATK_MUX_MGMT);
+	if (IS_ERR(pack)) {
+		if (PTR_ERR(pack) == -ENOENT) {
+			/* The MGMT class does not exists - that's ok */
+			dev_dbg(dev, "Class %#llx not found\n", ATK_MUX_MGMT);
+			return 0;
+		}
+		return PTR_ERR(pack);
+	}
 
 
-	id.type = ACPI_TYPE_INTEGER;
-	id.integer.value = ATK_MUX_HWMON;
-	params.count = 1;
-	params.pointer = &id;
+	/* Search the EC */
+	ec = NULL;
+	for (i = 0; i < pack->package.count; i++) {
+		union acpi_object *obj = &pack->package.elements[i];
+		union acpi_object *id;
 
 
-	buf.length = ACPI_ALLOCATE_BUFFER;
-	ret = acpi_evaluate_object_typed(data->enumerate_handle, NULL, &params,
-			&buf, ACPI_TYPE_PACKAGE);
-	if (ret != AE_OK) {
-		dev_warn(dev, METHOD_ENUMERATE ": ACPI exception: %s\n",
-				acpi_format_exception(ret));
-		return -ENODEV;
+		if (obj->type != ACPI_TYPE_PACKAGE)
+			continue;
+
+		id = &obj->package.elements[0];
+		if (id->type != ACPI_TYPE_INTEGER)
+			continue;
+
+		if (id->integer.value == ATK_EC_ID) {
+			ec = obj;
+			break;
+		}
 	}
 	}
 
 
-	/* Result must be a package */
-	pack = buf.pointer;
+	ret = (ec != NULL);
+	if (!ret)
+		/* The system has no EC */
+		dev_dbg(dev, "EC not found\n");
 
 
-	if (pack->package.count < 1) {
-		dev_dbg(dev, "%s: hwmon package is too small: %d\n", __func__,
-				pack->package.count);
-		err = -EINVAL;
-		goto out;
+	ACPI_FREE(pack);
+	return ret;
+}
+
+static int atk_ec_enabled(struct atk_data *data)
+{
+	struct device *dev = &data->acpi_dev->dev;
+	union acpi_object *obj;
+	struct atk_acpi_ret_buffer *buf;
+	int err;
+
+	obj = atk_gitm(data, ATK_EC_ID);
+	if (IS_ERR(obj)) {
+		dev_err(dev, "Unable to query EC status\n");
+		return PTR_ERR(obj);
+	}
+	buf = (struct atk_acpi_ret_buffer *)obj->buffer.pointer;
+
+	if (buf->flags == 0) {
+		dev_err(dev, "Unable to query EC status\n");
+		err = -EIO;
+	} else {
+		err = (buf->value != 0);
+		dev_dbg(dev, "EC is %sabled\n",
+				err ? "en" : "dis");
+	}
+
+	ACPI_FREE(obj);
+	return err;
+}
+
+static int atk_ec_ctl(struct atk_data *data, int enable)
+{
+	struct device *dev = &data->acpi_dev->dev;
+	union acpi_object *obj;
+	struct atk_acpi_input_buf sitm;
+	struct atk_acpi_ret_buffer *ec_ret;
+	int err = 0;
+
+	sitm.id = ATK_EC_ID;
+	sitm.param1 = enable;
+	sitm.param2 = 0;
+
+	obj = atk_sitm(data, &sitm);
+	if (IS_ERR(obj)) {
+		dev_err(dev, "Failed to %sable the EC\n",
+				enable ? "en" : "dis");
+		return PTR_ERR(obj);
+	}
+	ec_ret = (struct atk_acpi_ret_buffer *)obj->buffer.pointer;
+	if (ec_ret->flags == 0) {
+		dev_err(dev, "Failed to %sable the EC\n",
+				enable ? "en" : "dis");
+		err = -EIO;
+	} else {
+		dev_info(dev, "EC %sabled\n",
+				enable ? "en" : "dis");
+	}
+
+	ACPI_FREE(obj);
+	return err;
+}
+
+static int atk_enumerate_new_hwmon(struct atk_data *data)
+{
+	struct device *dev = &data->acpi_dev->dev;
+	union acpi_object *pack;
+	int err;
+	int i;
+
+	err = atk_ec_present(data);
+	if (err < 0)
+		return err;
+	if (err) {
+		err = atk_ec_enabled(data);
+		if (err < 0)
+			return err;
+		/* If the EC was disabled we will disable it again on unload */
+		data->disable_ec = err;
+
+		err = atk_ec_ctl(data, 1);
+		if (err) {
+			data->disable_ec = false;
+			return err;
+		}
 	}
 	}
 
 
+	dev_dbg(dev, "Enumerating hwmon sensors\n");
+
+	pack = atk_ggrp(data, ATK_MUX_HWMON);
+	if (IS_ERR(pack))
+		return PTR_ERR(pack);
+
 	for (i = 0; i < pack->package.count; i++) {
 	for (i = 0; i < pack->package.count; i++) {
 		union acpi_object *obj = &pack->package.elements[i];
 		union acpi_object *obj = &pack->package.elements[i];
 
 
@@ -758,8 +971,7 @@ static int atk_enumerate_new_hwmon(struct atk_data *data)
 
 
 	err = data->voltage_count + data->temperature_count + data->fan_count;
 	err = data->voltage_count + data->temperature_count + data->fan_count;
 
 
-out:
-	ACPI_FREE(buf.pointer);
+	ACPI_FREE(pack);
 	return err;
 	return err;
 }
 }
 
 
@@ -895,6 +1107,15 @@ static int atk_check_new_if(struct atk_data *data)
 	}
 	}
 	data->read_handle = ret;
 	data->read_handle = ret;
 
 
+	/* De-multiplexer (write) */
+	status = acpi_get_handle(data->atk_handle, METHOD_WRITE, &ret);
+	if (status != AE_OK) {
+		dev_dbg(dev, "method " METHOD_READ " not found: %s\n",
+				 acpi_format_exception(status));
+		return -ENODEV;
+	}
+	data->write_handle = ret;
+
 	return 0;
 	return 0;
 }
 }
 
 
@@ -915,6 +1136,7 @@ static int atk_add(struct acpi_device *device)
 	data->acpi_dev = device;
 	data->acpi_dev = device;
 	data->atk_handle = device->handle;
 	data->atk_handle = device->handle;
 	INIT_LIST_HEAD(&data->sensor_list);
 	INIT_LIST_HEAD(&data->sensor_list);
+	data->disable_ec = false;
 
 
 	buf.length = ACPI_ALLOCATE_BUFFER;
 	buf.length = ACPI_ALLOCATE_BUFFER;
 	ret = acpi_evaluate_object_typed(data->atk_handle, BOARD_ID, NULL,
 	ret = acpi_evaluate_object_typed(data->atk_handle, BOARD_ID, NULL,
@@ -973,6 +1195,8 @@ static int atk_add(struct acpi_device *device)
 cleanup:
 cleanup:
 	atk_free_sensors(data);
 	atk_free_sensors(data);
 out:
 out:
+	if (data->disable_ec)
+		atk_ec_ctl(data, 0);
 	kfree(data);
 	kfree(data);
 	return err;
 	return err;
 }
 }
@@ -988,6 +1212,11 @@ static int atk_remove(struct acpi_device *device, int type)
 	atk_free_sensors(data);
 	atk_free_sensors(data);
 	hwmon_device_unregister(data->hwmon_dev);
 	hwmon_device_unregister(data->hwmon_dev);
 
 
+	if (data->disable_ec) {
+		if (atk_ec_ctl(data, 0))
+			dev_err(&device->dev, "Failed to disable EC\n");
+	}
+
 	kfree(data);
 	kfree(data);
 
 
 	return 0;
 	return 0;

+ 7 - 1
drivers/hwmon/sht15.c

@@ -30,6 +30,7 @@
 #include <linux/hwmon-sysfs.h>
 #include <linux/hwmon-sysfs.h>
 #include <linux/mutex.h>
 #include <linux/mutex.h>
 #include <linux/platform_device.h>
 #include <linux/platform_device.h>
+#include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
 #include <linux/jiffies.h>
 #include <linux/jiffies.h>
 #include <linux/err.h>
 #include <linux/err.h>
@@ -622,7 +623,12 @@ static int __devexit sht15_remove(struct platform_device *pdev)
 }
 }
 
 
 
 
-static struct platform_driver sht_drivers[] = {
+/*
+ * sht_drivers simultaneously refers to __devinit and __devexit function
+ * which causes spurious section mismatch warning. So use __refdata to
+ * get rid from this.
+ */
+static struct platform_driver __refdata sht_drivers[] = {
 	{
 	{
 		.driver = {
 		.driver = {
 			.name = "sht10",
 			.name = "sht10",

+ 1 - 0
drivers/ieee1394/raw1394.c

@@ -29,6 +29,7 @@
 
 
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/list.h>
+#include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
 #include <linux/fs.h>

+ 1 - 0
drivers/ieee1394/video1394.c

@@ -30,6 +30,7 @@
  */
  */
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/list.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/wait.h>
 #include <linux/wait.h>

+ 1 - 0
drivers/infiniband/core/iwcm.c

@@ -40,6 +40,7 @@
 #include <linux/idr.h>
 #include <linux/idr.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/rbtree.h>
 #include <linux/rbtree.h>
+#include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
 #include <linux/workqueue.h>
 #include <linux/completion.h>
 #include <linux/completion.h>

+ 1 - 0
drivers/infiniband/core/ucma.c

@@ -34,6 +34,7 @@
 #include <linux/file.h>
 #include <linux/file.h>
 #include <linux/mutex.h>
 #include <linux/mutex.h>
 #include <linux/poll.h>
 #include <linux/poll.h>
+#include <linux/sched.h>
 #include <linux/idr.h>
 #include <linux/idr.h>
 #include <linux/in.h>
 #include <linux/in.h>
 #include <linux/in6.h>
 #include <linux/in6.h>

+ 1 - 0
drivers/infiniband/hw/cxgb3/iwch_provider.c

@@ -37,6 +37,7 @@
 #include <linux/delay.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/errno.h>
 #include <linux/list.h>
 #include <linux/list.h>
+#include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/spinlock.h>
 #include <linux/ethtool.h>
 #include <linux/ethtool.h>
 #include <linux/rtnetlink.h>
 #include <linux/rtnetlink.h>

+ 1 - 0
drivers/infiniband/hw/cxgb3/iwch_qp.c

@@ -29,6 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  * SOFTWARE.
  */
  */
+#include <linux/sched.h>
 #include "iwch_provider.h"
 #include "iwch_provider.h"
 #include "iwch.h"
 #include "iwch.h"
 #include "iwch_cm.h"
 #include "iwch_cm.h"

+ 1 - 0
drivers/infiniband/hw/ipath/ipath_driver.c

@@ -31,6 +31,7 @@
  * SOFTWARE.
  * SOFTWARE.
  */
  */
 
 
+#include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/spinlock.h>
 #include <linux/idr.h>
 #include <linux/idr.h>
 #include <linux/pci.h>
 #include <linux/pci.h>

+ 1 - 0
drivers/infiniband/hw/ipath/ipath_iba7220.c

@@ -37,6 +37,7 @@
 
 
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/pci.h>
+#include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/io.h>
 #include <rdma/ib_verbs.h>
 #include <rdma/ib_verbs.h>

+ 1 - 0
drivers/infiniband/hw/ipath/ipath_intr.c

@@ -33,6 +33,7 @@
 
 
 #include <linux/pci.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
+#include <linux/sched.h>
 
 
 #include "ipath_kernel.h"
 #include "ipath_kernel.h"
 #include "ipath_verbs.h"
 #include "ipath_verbs.h"

+ 1 - 0
drivers/infiniband/hw/ipath/ipath_qp.c

@@ -32,6 +32,7 @@
  */
  */
 
 
 #include <linux/err.h>
 #include <linux/err.h>
+#include <linux/sched.h>
 #include <linux/vmalloc.h>
 #include <linux/vmalloc.h>
 
 
 #include "ipath_verbs.h"
 #include "ipath_verbs.h"

+ 1 - 0
drivers/infiniband/hw/ipath/ipath_ruc.c

@@ -31,6 +31,7 @@
  * SOFTWARE.
  * SOFTWARE.
  */
  */
 
 
+#include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/spinlock.h>
 
 
 #include "ipath_verbs.h"
 #include "ipath_verbs.h"

+ 1 - 0
drivers/infiniband/hw/ipath/ipath_ud.c

@@ -31,6 +31,7 @@
  * SOFTWARE.
  * SOFTWARE.
  */
  */
 
 
+#include <linux/sched.h>
 #include <rdma/ib_smi.h>
 #include <rdma/ib_smi.h>
 
 
 #include "ipath_verbs.h"
 #include "ipath_verbs.h"

+ 1 - 0
drivers/infiniband/hw/ipath/ipath_user_pages.c

@@ -33,6 +33,7 @@
 
 
 #include <linux/mm.h>
 #include <linux/mm.h>
 #include <linux/device.h>
 #include <linux/device.h>
+#include <linux/sched.h>
 
 
 #include "ipath_kernel.h"
 #include "ipath_kernel.h"
 
 

+ 1 - 0
drivers/infiniband/hw/ipath/ipath_user_sdma.c

@@ -33,6 +33,7 @@
 #include <linux/types.h>
 #include <linux/types.h>
 #include <linux/device.h>
 #include <linux/device.h>
 #include <linux/dmapool.h>
 #include <linux/dmapool.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/list.h>
 #include <linux/list.h>
 #include <linux/highmem.h>
 #include <linux/highmem.h>

+ 1 - 0
drivers/infiniband/hw/ipath/ipath_verbs_mcast.c

@@ -32,6 +32,7 @@
  */
  */
 
 
 #include <linux/rculist.h>
 #include <linux/rculist.h>
+#include <linux/sched.h>
 
 
 #include "ipath_verbs.h"
 #include "ipath_verbs.h"
 
 

+ 1 - 1
drivers/infiniband/ulp/iser/iscsi_iser.c

@@ -426,7 +426,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
 	 * because we preallocate so many resources
 	 * because we preallocate so many resources
 	 */
 	 */
 	cls_session = iscsi_session_setup(&iscsi_iser_transport, shost,
 	cls_session = iscsi_session_setup(&iscsi_iser_transport, shost,
-					  ISCSI_DEF_XMIT_CMDS_MAX,
+					  ISCSI_DEF_XMIT_CMDS_MAX, 0,
 					  sizeof(struct iscsi_iser_task),
 					  sizeof(struct iscsi_iser_task),
 					  initial_cmdsn, 0);
 					  initial_cmdsn, 0);
 	if (!cls_session)
 	if (!cls_session)

+ 1 - 0
drivers/input/keyboard/hilkbd.c

@@ -24,6 +24,7 @@
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/hil.h>
 #include <linux/hil.h>
 #include <linux/io.h>
 #include <linux/io.h>
+#include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/spinlock.h>
 #include <asm/irq.h>
 #include <asm/irq.h>
 #ifdef CONFIG_HP300
 #ifdef CONFIG_HP300

+ 1 - 0
drivers/input/keyboard/sunkbd.c

@@ -27,6 +27,7 @@
  */
  */
 
 
 #include <linux/delay.h>
 #include <linux/delay.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>

+ 1 - 0
drivers/input/serio/libps2.c

@@ -13,6 +13,7 @@
 
 
 #include <linux/delay.h>
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/module.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
 #include <linux/input.h>

+ 1 - 0
drivers/input/serio/serio_raw.c

@@ -9,6 +9,7 @@
  * the Free Software Foundation.
  * the Free Software Foundation.
  */
  */
 
 
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/smp_lock.h>
 #include <linux/poll.h>
 #include <linux/poll.h>

+ 1 - 0
drivers/input/serio/serport.c

@@ -15,6 +15,7 @@
 
 
 #include <asm/uaccess.h>
 #include <asm/uaccess.h>
 #include <linux/kernel.h>
 #include <linux/kernel.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/init.h>

+ 1 - 0
drivers/isdn/capi/kcapi.c

@@ -18,6 +18,7 @@
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/ioport.h>
 #include <linux/proc_fs.h>
 #include <linux/proc_fs.h>
+#include <linux/sched.h>
 #include <linux/seq_file.h>
 #include <linux/seq_file.h>
 #include <linux/skbuff.h>
 #include <linux/skbuff.h>
 #include <linux/workqueue.h>
 #include <linux/workqueue.h>

+ 1 - 0
drivers/isdn/hisax/arcofi.c

@@ -10,6 +10,7 @@
  *
  *
  */
  */
  
  
+#include <linux/sched.h>
 #include "hisax.h"
 #include "hisax.h"
 #include "isdnl1.h"
 #include "isdnl1.h"
 #include "isac.h"
 #include "isac.h"

+ 1 - 0
drivers/isdn/hisax/hfc_2bds0.c

@@ -11,6 +11,7 @@
  */
  */
 
 
 #include <linux/init.h>
 #include <linux/init.h>
+#include <linux/sched.h>
 #include "hisax.h"
 #include "hisax.h"
 #include "hfc_2bds0.h"
 #include "hfc_2bds0.h"
 #include "isdnl1.h"
 #include "isdnl1.h"

+ 1 - 0
drivers/isdn/hisax/hfc_pci.c

@@ -20,6 +20,7 @@
 #include "hfc_pci.h"
 #include "hfc_pci.h"
 #include "isdnl1.h"
 #include "isdnl1.h"
 #include <linux/pci.h>
 #include <linux/pci.h>
+#include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/interrupt.h>
 
 
 static const char *hfcpci_revision = "$Revision: 1.48.2.4 $";
 static const char *hfcpci_revision = "$Revision: 1.48.2.4 $";

+ 1 - 0
drivers/isdn/hysdn/hysdn_procconf.c

@@ -11,6 +11,7 @@
  *
  *
  */
  */
 
 
+#include <linux/cred.h>
 #include <linux/module.h>
 #include <linux/module.h>
 #include <linux/poll.h>
 #include <linux/poll.h>
 #include <linux/proc_fs.h>
 #include <linux/proc_fs.h>

Some files were not shown because too many files changed in this diff