aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-22 15:51:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-22 15:51:28 -0400
commita9b011f5ac57cbaedb32a8149f3d39d7b2c1f0e0 (patch)
tree89c850cc9e2ed949f5fc3b99180cd6cb70db6160
parentb5bdd43876e475724c662f99206f0349c67e33e6 (diff)
parentda6330fccc251db73945ee3eb6248985cf2574de (diff)
Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: (22 commits) [S390] Update default configuration. [S390] kprobes: defer setting of ctlblk state [S390] Enable tick based perf_counter on s390. [S390] dasd: fix refcounting in dasd_change_state [S390] lockless idle time accounting [S390] driver_data access [S390] pm: fix build error for !SMP [S390] dasd_pm: fix stop flag handling [S390] ap/zcrypt: Suspend/Resume ap bus and zcrypt [S390] qdio: Sanitize do_QDIO sanity checks [S390] qdio: leave inbound SBALs primed [S390] qdio: merge AI tasklet into interrupt handler [S390] qdio: extract all primed SBALs at once [S390] qdio: fix check for running under z/VM [S390] qdio: move adapter interrupt tasklet code [S390] Use del_timer instead of del_timer_sync [S390] s390: remove DEBUG_MALLOC [S390] vt220 console: convert from bootmem to slab [S390] sclp console: convert from bootmem to slab [S390] 3270 console: convert from bootmem to slab ...
-rw-r--r--arch/s390/Kconfig1
-rw-r--r--arch/s390/defconfig72
-rw-r--r--arch/s390/include/asm/cputime.h2
-rw-r--r--arch/s390/include/asm/debug.h9
-rw-r--r--arch/s390/include/asm/perf_counter.h8
-rw-r--r--arch/s390/include/asm/qdio.h2
-rw-r--r--arch/s390/kernel/kprobes.c18
-rw-r--r--arch/s390/kernel/smp.c28
-rw-r--r--arch/s390/kernel/time.c16
-rw-r--r--arch/s390/kernel/vtime.c27
-rw-r--r--arch/s390/power/swsusp_asm64.S6
-rw-r--r--drivers/s390/block/dasd.c20
-rw-r--r--drivers/s390/block/dasd_eckd.c10
-rw-r--r--drivers/s390/char/con3215.c22
-rw-r--r--drivers/s390/char/con3270.c13
-rw-r--r--drivers/s390/char/monreader.c6
-rw-r--r--drivers/s390/char/raw3270.c36
-rw-r--r--drivers/s390/char/sclp_con.c7
-rw-r--r--drivers/s390/char/sclp_vt220.c18
-rw-r--r--drivers/s390/char/tape_core.c2
-rw-r--r--drivers/s390/char/vmlogrdr.c4
-rw-r--r--drivers/s390/char/vmur.c2
-rw-r--r--drivers/s390/cio/qdio.h11
-rw-r--r--drivers/s390/cio/qdio_debug.c3
-rw-r--r--drivers/s390/cio/qdio_main.c144
-rw-r--r--drivers/s390/cio/qdio_thinint.c114
-rw-r--r--drivers/s390/crypto/ap_bus.c85
-rw-r--r--drivers/s390/net/netiucv.c4
-rw-r--r--tools/perf/perf.h6
29 files changed, 350 insertions, 346 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index a14dba0e4d67..e577839f3073 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -94,6 +94,7 @@ config S390
94 select HAVE_KVM if 64BIT 94 select HAVE_KVM if 64BIT
95 select HAVE_ARCH_TRACEHOOK 95 select HAVE_ARCH_TRACEHOOK
96 select INIT_ALL_POSSIBLE 96 select INIT_ALL_POSSIBLE
97 select HAVE_PERF_COUNTERS
97 98
98source "init/Kconfig" 99source "init/Kconfig"
99 100
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index d401d56c255f..fcba206529f3 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.30
4# Thu Apr 23 09:29:52 2009 4# Mon Jun 22 11:08:16 2009
5# 5#
6CONFIG_SCHED_MC=y 6CONFIG_SCHED_MC=y
7CONFIG_MMU=y 7CONFIG_MMU=y
@@ -25,6 +25,7 @@ CONFIG_VIRT_CPU_ACCOUNTING=y
25CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 25CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
26CONFIG_S390=y 26CONFIG_S390=y
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28CONFIG_CONSTRUCTORS=y
28 29
29# 30#
30# General setup 31# General setup
@@ -90,7 +91,6 @@ CONFIG_SYSCTL_SYSCALL=y
90CONFIG_KALLSYMS=y 91CONFIG_KALLSYMS=y
91# CONFIG_KALLSYMS_ALL is not set 92# CONFIG_KALLSYMS_ALL is not set
92# CONFIG_KALLSYMS_EXTRA_PASS is not set 93# CONFIG_KALLSYMS_EXTRA_PASS is not set
93# CONFIG_STRIP_ASM_SYMS is not set
94CONFIG_HOTPLUG=y 94CONFIG_HOTPLUG=y
95CONFIG_PRINTK=y 95CONFIG_PRINTK=y
96CONFIG_BUG=y 96CONFIG_BUG=y
@@ -103,7 +103,14 @@ CONFIG_TIMERFD=y
103CONFIG_EVENTFD=y 103CONFIG_EVENTFD=y
104CONFIG_SHMEM=y 104CONFIG_SHMEM=y
105CONFIG_AIO=y 105CONFIG_AIO=y
106CONFIG_HAVE_PERF_COUNTERS=y
107
108#
109# Performance Counters
110#
111# CONFIG_PERF_COUNTERS is not set
106CONFIG_VM_EVENT_COUNTERS=y 112CONFIG_VM_EVENT_COUNTERS=y
113# CONFIG_STRIP_ASM_SYMS is not set
107# CONFIG_COMPAT_BRK is not set 114# CONFIG_COMPAT_BRK is not set
108CONFIG_SLAB=y 115CONFIG_SLAB=y
109# CONFIG_SLUB is not set 116# CONFIG_SLUB is not set
@@ -119,6 +126,11 @@ CONFIG_HAVE_KRETPROBES=y
119CONFIG_HAVE_ARCH_TRACEHOOK=y 126CONFIG_HAVE_ARCH_TRACEHOOK=y
120CONFIG_USE_GENERIC_SMP_HELPERS=y 127CONFIG_USE_GENERIC_SMP_HELPERS=y
121CONFIG_HAVE_DEFAULT_NO_SPIN_MUTEXES=y 128CONFIG_HAVE_DEFAULT_NO_SPIN_MUTEXES=y
129
130#
131# GCOV-based kernel profiling
132#
133# CONFIG_GCOV_KERNEL is not set
122# CONFIG_SLOW_WORK is not set 134# CONFIG_SLOW_WORK is not set
123# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 135# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
124CONFIG_SLABINFO=y 136CONFIG_SLABINFO=y
@@ -150,7 +162,7 @@ CONFIG_DEFAULT_DEADLINE=y
150# CONFIG_DEFAULT_NOOP is not set 162# CONFIG_DEFAULT_NOOP is not set
151CONFIG_DEFAULT_IOSCHED="deadline" 163CONFIG_DEFAULT_IOSCHED="deadline"
152CONFIG_PREEMPT_NOTIFIERS=y 164CONFIG_PREEMPT_NOTIFIERS=y
153# CONFIG_FREEZER is not set 165CONFIG_FREEZER=y
154 166
155# 167#
156# Base setup 168# Base setup
@@ -199,6 +211,7 @@ CONFIG_ARCH_SPARSEMEM_DEFAULT=y
199CONFIG_ARCH_SELECT_MEMORY_MODEL=y 211CONFIG_ARCH_SELECT_MEMORY_MODEL=y
200CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 212CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
201CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 213CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
214CONFIG_ARCH_HIBERNATION_POSSIBLE=y
202CONFIG_SELECT_MEMORY_MODEL=y 215CONFIG_SELECT_MEMORY_MODEL=y
203# CONFIG_FLATMEM_MANUAL is not set 216# CONFIG_FLATMEM_MANUAL is not set
204# CONFIG_DISCONTIGMEM_MANUAL is not set 217# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -218,9 +231,9 @@ CONFIG_PHYS_ADDR_T_64BIT=y
218CONFIG_ZONE_DMA_FLAG=1 231CONFIG_ZONE_DMA_FLAG=1
219CONFIG_BOUNCE=y 232CONFIG_BOUNCE=y
220CONFIG_VIRT_TO_BUS=y 233CONFIG_VIRT_TO_BUS=y
221CONFIG_UNEVICTABLE_LRU=y
222CONFIG_HAVE_MLOCK=y 234CONFIG_HAVE_MLOCK=y
223CONFIG_HAVE_MLOCKED_PAGE_BIT=y 235CONFIG_HAVE_MLOCKED_PAGE_BIT=y
236CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
224 237
225# 238#
226# I/O subsystem configuration 239# I/O subsystem configuration
@@ -257,6 +270,16 @@ CONFIG_KEXEC=y
257# CONFIG_ZFCPDUMP is not set 270# CONFIG_ZFCPDUMP is not set
258CONFIG_S390_GUEST=y 271CONFIG_S390_GUEST=y
259CONFIG_SECCOMP=y 272CONFIG_SECCOMP=y
273
274#
275# Power Management
276#
277CONFIG_PM=y
278# CONFIG_PM_DEBUG is not set
279CONFIG_PM_SLEEP_SMP=y
280CONFIG_PM_SLEEP=y
281CONFIG_HIBERNATION=y
282CONFIG_PM_STD_PARTITION=""
260CONFIG_NET=y 283CONFIG_NET=y
261 284
262# 285#
@@ -384,6 +407,7 @@ CONFIG_SCTP_HMAC_MD5=y
384# CONFIG_ECONET is not set 407# CONFIG_ECONET is not set
385# CONFIG_WAN_ROUTER is not set 408# CONFIG_WAN_ROUTER is not set
386# CONFIG_PHONET is not set 409# CONFIG_PHONET is not set
410# CONFIG_IEEE802154 is not set
387CONFIG_NET_SCHED=y 411CONFIG_NET_SCHED=y
388 412
389# 413#
@@ -446,6 +470,7 @@ CONFIG_CAN_BCM=m
446# CAN Device Drivers 470# CAN Device Drivers
447# 471#
448CONFIG_CAN_VCAN=m 472CONFIG_CAN_VCAN=m
473# CONFIG_CAN_DEV is not set
449# CONFIG_CAN_DEBUG_DEVICES is not set 474# CONFIG_CAN_DEBUG_DEVICES is not set
450# CONFIG_AF_RXRPC is not set 475# CONFIG_AF_RXRPC is not set
451# CONFIG_WIMAX is not set 476# CONFIG_WIMAX is not set
@@ -524,10 +549,6 @@ CONFIG_BLK_DEV_SR=y
524CONFIG_BLK_DEV_SR_VENDOR=y 549CONFIG_BLK_DEV_SR_VENDOR=y
525CONFIG_CHR_DEV_SG=y 550CONFIG_CHR_DEV_SG=y
526# CONFIG_CHR_DEV_SCH is not set 551# CONFIG_CHR_DEV_SCH is not set
527
528#
529# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
530#
531CONFIG_SCSI_MULTI_LUN=y 552CONFIG_SCSI_MULTI_LUN=y
532CONFIG_SCSI_CONSTANTS=y 553CONFIG_SCSI_CONSTANTS=y
533CONFIG_SCSI_LOGGING=y 554CONFIG_SCSI_LOGGING=y
@@ -578,7 +599,6 @@ CONFIG_DM_MULTIPATH=m
578# CONFIG_DM_DELAY is not set 599# CONFIG_DM_DELAY is not set
579# CONFIG_DM_UEVENT is not set 600# CONFIG_DM_UEVENT is not set
580CONFIG_NETDEVICES=y 601CONFIG_NETDEVICES=y
581CONFIG_COMPAT_NET_DEV_OPS=y
582# CONFIG_IFB is not set 602# CONFIG_IFB is not set
583CONFIG_DUMMY=m 603CONFIG_DUMMY=m
584CONFIG_BONDING=m 604CONFIG_BONDING=m
@@ -595,6 +615,7 @@ CONFIG_NET_ETHERNET=y
595# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 615# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
596# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 616# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
597# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 617# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
618# CONFIG_KS8842 is not set
598CONFIG_NETDEV_1000=y 619CONFIG_NETDEV_1000=y
599CONFIG_NETDEV_10000=y 620CONFIG_NETDEV_10000=y
600# CONFIG_TR is not set 621# CONFIG_TR is not set
@@ -674,6 +695,11 @@ CONFIG_S390_TAPE_34XX=m
674# CONFIG_MONREADER is not set 695# CONFIG_MONREADER is not set
675CONFIG_MONWRITER=m 696CONFIG_MONWRITER=m
676CONFIG_S390_VMUR=m 697CONFIG_S390_VMUR=m
698
699#
700# PPS support
701#
702# CONFIG_PPS is not set
677# CONFIG_POWER_SUPPLY is not set 703# CONFIG_POWER_SUPPLY is not set
678# CONFIG_THERMAL is not set 704# CONFIG_THERMAL is not set
679# CONFIG_THERMAL_HWMON is not set 705# CONFIG_THERMAL_HWMON is not set
@@ -683,6 +709,10 @@ CONFIG_S390_VMUR=m
683# CONFIG_NEW_LEDS is not set 709# CONFIG_NEW_LEDS is not set
684CONFIG_ACCESSIBILITY=y 710CONFIG_ACCESSIBILITY=y
685# CONFIG_AUXDISPLAY is not set 711# CONFIG_AUXDISPLAY is not set
712
713#
714# TI VLYNQ
715#
686# CONFIG_STAGING is not set 716# CONFIG_STAGING is not set
687 717
688# 718#
@@ -703,11 +733,12 @@ CONFIG_FS_MBCACHE=y
703# CONFIG_REISERFS_FS is not set 733# CONFIG_REISERFS_FS is not set
704# CONFIG_JFS_FS is not set 734# CONFIG_JFS_FS is not set
705CONFIG_FS_POSIX_ACL=y 735CONFIG_FS_POSIX_ACL=y
706CONFIG_FILE_LOCKING=y
707# CONFIG_XFS_FS is not set 736# CONFIG_XFS_FS is not set
708# CONFIG_GFS2_FS is not set 737# CONFIG_GFS2_FS is not set
709# CONFIG_OCFS2_FS is not set 738# CONFIG_OCFS2_FS is not set
710# CONFIG_BTRFS_FS is not set 739# CONFIG_BTRFS_FS is not set
740CONFIG_FILE_LOCKING=y
741CONFIG_FSNOTIFY=y
711CONFIG_DNOTIFY=y 742CONFIG_DNOTIFY=y
712CONFIG_INOTIFY=y 743CONFIG_INOTIFY=y
713CONFIG_INOTIFY_USER=y 744CONFIG_INOTIFY_USER=y
@@ -865,19 +896,23 @@ CONFIG_DEBUG_MEMORY_INIT=y
865CONFIG_SYSCTL_SYSCALL_CHECK=y 896CONFIG_SYSCTL_SYSCALL_CHECK=y
866# CONFIG_DEBUG_PAGEALLOC is not set 897# CONFIG_DEBUG_PAGEALLOC is not set
867CONFIG_HAVE_FUNCTION_TRACER=y 898CONFIG_HAVE_FUNCTION_TRACER=y
899CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
900CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
901CONFIG_HAVE_DYNAMIC_FTRACE=y
902CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
903CONFIG_HAVE_FTRACE_SYSCALLS=y
868CONFIG_TRACING_SUPPORT=y 904CONFIG_TRACING_SUPPORT=y
869 905CONFIG_FTRACE=y
870#
871# Tracers
872#
873# CONFIG_FUNCTION_TRACER is not set 906# CONFIG_FUNCTION_TRACER is not set
874# CONFIG_IRQSOFF_TRACER is not set 907# CONFIG_IRQSOFF_TRACER is not set
875# CONFIG_PREEMPT_TRACER is not set 908# CONFIG_PREEMPT_TRACER is not set
876# CONFIG_SCHED_TRACER is not set 909# CONFIG_SCHED_TRACER is not set
877# CONFIG_CONTEXT_SWITCH_TRACER is not set 910# CONFIG_ENABLE_DEFAULT_TRACERS is not set
878# CONFIG_EVENT_TRACER is not set 911# CONFIG_FTRACE_SYSCALLS is not set
879# CONFIG_BOOT_TRACER is not set 912# CONFIG_BOOT_TRACER is not set
880# CONFIG_TRACE_BRANCH_PROFILING is not set 913CONFIG_BRANCH_PROFILE_NONE=y
914# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
915# CONFIG_PROFILE_ALL_BRANCHES is not set
881# CONFIG_STACK_TRACER is not set 916# CONFIG_STACK_TRACER is not set
882# CONFIG_KMEMTRACE is not set 917# CONFIG_KMEMTRACE is not set
883# CONFIG_WORKQUEUE_TRACER is not set 918# CONFIG_WORKQUEUE_TRACER is not set
@@ -886,6 +921,7 @@ CONFIG_TRACING_SUPPORT=y
886CONFIG_SAMPLES=y 921CONFIG_SAMPLES=y
887# CONFIG_SAMPLE_KOBJECT is not set 922# CONFIG_SAMPLE_KOBJECT is not set
888# CONFIG_SAMPLE_KPROBES is not set 923# CONFIG_SAMPLE_KPROBES is not set
924# CONFIG_KMEMCHECK is not set
889 925
890# 926#
891# Security options 927# Security options
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index ec917d42ee6d..7a3817a656df 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -178,7 +178,7 @@ cputime64_to_clock_t(cputime64_t cputime)
178} 178}
179 179
180struct s390_idle_data { 180struct s390_idle_data {
181 spinlock_t lock; 181 unsigned int sequence;
182 unsigned long long idle_count; 182 unsigned long long idle_count;
183 unsigned long long idle_enter; 183 unsigned long long idle_enter;
184 unsigned long long idle_time; 184 unsigned long long idle_time;
diff --git a/arch/s390/include/asm/debug.h b/arch/s390/include/asm/debug.h
index 9450ce6e32de..31ed5686a968 100644
--- a/arch/s390/include/asm/debug.h
+++ b/arch/s390/include/asm/debug.h
@@ -248,14 +248,5 @@ int debug_unregister_view(debug_info_t* id, struct debug_view* view);
248#define PRINT_FATAL(x...) printk ( KERN_DEBUG PRINTK_HEADER x ) 248#define PRINT_FATAL(x...) printk ( KERN_DEBUG PRINTK_HEADER x )
249#endif /* DASD_DEBUG */ 249#endif /* DASD_DEBUG */
250 250
251#undef DEBUG_MALLOC
252#ifdef DEBUG_MALLOC
253void *b;
254#define kmalloc(x...) (PRINT_INFO(" kmalloc %p\n",b=kmalloc(x)),b)
255#define kfree(x) PRINT_INFO(" kfree %p\n",x);kfree(x)
256#define get_zeroed_page(x...) (PRINT_INFO(" gfp %p\n",b=get_zeroed_page(x)),b)
257#define __get_free_pages(x...) (PRINT_INFO(" gfps %p\n",b=__get_free_pages(x)),b)
258#endif /* DEBUG_MALLOC */
259
260#endif /* __KERNEL__ */ 251#endif /* __KERNEL__ */
261#endif /* DEBUG_H */ 252#endif /* DEBUG_H */
diff --git a/arch/s390/include/asm/perf_counter.h b/arch/s390/include/asm/perf_counter.h
new file mode 100644
index 000000000000..a7205a3828cb
--- /dev/null
+++ b/arch/s390/include/asm/perf_counter.h
@@ -0,0 +1,8 @@
1/*
2 * Performance counter support - s390 specific definitions.
3 *
4 * Copyright 2009 Martin Schwidefsky, IBM Corporation.
5 */
6
7static inline void set_perf_counter_pending(void) {}
8static inline void clear_perf_counter_pending(void) {}
diff --git a/arch/s390/include/asm/qdio.h b/arch/s390/include/asm/qdio.h
index 402d6dcf0d26..79d849f014f0 100644
--- a/arch/s390/include/asm/qdio.h
+++ b/arch/s390/include/asm/qdio.h
@@ -380,7 +380,7 @@ extern int qdio_establish(struct qdio_initialize *);
380extern int qdio_activate(struct ccw_device *); 380extern int qdio_activate(struct ccw_device *);
381 381
382extern int do_QDIO(struct ccw_device *cdev, unsigned int callflags, 382extern int do_QDIO(struct ccw_device *cdev, unsigned int callflags,
383 int q_nr, int bufnr, int count); 383 int q_nr, unsigned int bufnr, unsigned int count);
384extern int qdio_cleanup(struct ccw_device*, int); 384extern int qdio_cleanup(struct ccw_device*, int);
385extern int qdio_shutdown(struct ccw_device*, int); 385extern int qdio_shutdown(struct ccw_device*, int);
386extern int qdio_free(struct ccw_device *); 386extern int qdio_free(struct ccw_device *);
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 9bb2f6241d9f..86783efa24ee 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -154,39 +154,35 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn)
154 154
155static int __kprobes swap_instruction(void *aref) 155static int __kprobes swap_instruction(void *aref)
156{ 156{
157 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
158 unsigned long status = kcb->kprobe_status;
157 struct ins_replace_args *args = aref; 159 struct ins_replace_args *args = aref;
160 int rc;
158 161
159 return probe_kernel_write(args->ptr, &args->new, sizeof(args->new)); 162 kcb->kprobe_status = KPROBE_SWAP_INST;
163 rc = probe_kernel_write(args->ptr, &args->new, sizeof(args->new));
164 kcb->kprobe_status = status;
165 return rc;
160} 166}
161 167
162void __kprobes arch_arm_kprobe(struct kprobe *p) 168void __kprobes arch_arm_kprobe(struct kprobe *p)
163{ 169{
164 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
165 unsigned long status = kcb->kprobe_status;
166 struct ins_replace_args args; 170 struct ins_replace_args args;
167 171
168 args.ptr = p->addr; 172 args.ptr = p->addr;
169 args.old = p->opcode; 173 args.old = p->opcode;
170 args.new = BREAKPOINT_INSTRUCTION; 174 args.new = BREAKPOINT_INSTRUCTION;
171
172 kcb->kprobe_status = KPROBE_SWAP_INST;
173 stop_machine(swap_instruction, &args, NULL); 175 stop_machine(swap_instruction, &args, NULL);
174 kcb->kprobe_status = status;
175} 176}
176 177
177void __kprobes arch_disarm_kprobe(struct kprobe *p) 178void __kprobes arch_disarm_kprobe(struct kprobe *p)
178{ 179{
179 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
180 unsigned long status = kcb->kprobe_status;
181 struct ins_replace_args args; 180 struct ins_replace_args args;
182 181
183 args.ptr = p->addr; 182 args.ptr = p->addr;
184 args.old = BREAKPOINT_INSTRUCTION; 183 args.old = BREAKPOINT_INSTRUCTION;
185 args.new = p->opcode; 184 args.new = p->opcode;
186
187 kcb->kprobe_status = KPROBE_SWAP_INST;
188 stop_machine(swap_instruction, &args, NULL); 185 stop_machine(swap_instruction, &args, NULL);
189 kcb->kprobe_status = status;
190} 186}
191 187
192void __kprobes arch_remove_kprobe(struct kprobe *p) 188void __kprobes arch_remove_kprobe(struct kprobe *p)
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index fd8e3111a4e8..2270730f5354 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -856,13 +856,20 @@ static ssize_t show_idle_count(struct sys_device *dev,
856{ 856{
857 struct s390_idle_data *idle; 857 struct s390_idle_data *idle;
858 unsigned long long idle_count; 858 unsigned long long idle_count;
859 unsigned int sequence;
859 860
860 idle = &per_cpu(s390_idle, dev->id); 861 idle = &per_cpu(s390_idle, dev->id);
861 spin_lock(&idle->lock); 862repeat:
863 sequence = idle->sequence;
864 smp_rmb();
865 if (sequence & 1)
866 goto repeat;
862 idle_count = idle->idle_count; 867 idle_count = idle->idle_count;
863 if (idle->idle_enter) 868 if (idle->idle_enter)
864 idle_count++; 869 idle_count++;
865 spin_unlock(&idle->lock); 870 smp_rmb();
871 if (idle->sequence != sequence)
872 goto repeat;
866 return sprintf(buf, "%llu\n", idle_count); 873 return sprintf(buf, "%llu\n", idle_count);
867} 874}
868static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL); 875static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL);
@@ -872,15 +879,22 @@ static ssize_t show_idle_time(struct sys_device *dev,
872{ 879{
873 struct s390_idle_data *idle; 880 struct s390_idle_data *idle;
874 unsigned long long now, idle_time, idle_enter; 881 unsigned long long now, idle_time, idle_enter;
882 unsigned int sequence;
875 883
876 idle = &per_cpu(s390_idle, dev->id); 884 idle = &per_cpu(s390_idle, dev->id);
877 spin_lock(&idle->lock);
878 now = get_clock(); 885 now = get_clock();
886repeat:
887 sequence = idle->sequence;
888 smp_rmb();
889 if (sequence & 1)
890 goto repeat;
879 idle_time = idle->idle_time; 891 idle_time = idle->idle_time;
880 idle_enter = idle->idle_enter; 892 idle_enter = idle->idle_enter;
881 if (idle_enter != 0ULL && idle_enter < now) 893 if (idle_enter != 0ULL && idle_enter < now)
882 idle_time += now - idle_enter; 894 idle_time += now - idle_enter;
883 spin_unlock(&idle->lock); 895 smp_rmb();
896 if (idle->sequence != sequence)
897 goto repeat;
884 return sprintf(buf, "%llu\n", idle_time >> 12); 898 return sprintf(buf, "%llu\n", idle_time >> 12);
885} 899}
886static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL); 900static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL);
@@ -908,11 +922,7 @@ static int __cpuinit smp_cpu_notify(struct notifier_block *self,
908 case CPU_ONLINE: 922 case CPU_ONLINE:
909 case CPU_ONLINE_FROZEN: 923 case CPU_ONLINE_FROZEN:
910 idle = &per_cpu(s390_idle, cpu); 924 idle = &per_cpu(s390_idle, cpu);
911 spin_lock_irq(&idle->lock); 925 memset(idle, 0, sizeof(struct s390_idle_data));
912 idle->idle_enter = 0;
913 idle->idle_time = 0;
914 idle->idle_count = 0;
915 spin_unlock_irq(&idle->lock);
916 if (sysfs_create_group(&s->kobj, &cpu_online_attr_group)) 926 if (sysfs_create_group(&s->kobj, &cpu_online_attr_group))
917 return NOTIFY_BAD; 927 return NOTIFY_BAD;
918 break; 928 break;
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 215330a2c128..d4c8e9c47c81 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -36,7 +36,6 @@
36#include <linux/notifier.h> 36#include <linux/notifier.h>
37#include <linux/clocksource.h> 37#include <linux/clocksource.h>
38#include <linux/clockchips.h> 38#include <linux/clockchips.h>
39#include <linux/bootmem.h>
40#include <asm/uaccess.h> 39#include <asm/uaccess.h>
41#include <asm/delay.h> 40#include <asm/delay.h>
42#include <asm/s390_ext.h> 41#include <asm/s390_ext.h>
@@ -62,9 +61,6 @@
62 61
63u64 sched_clock_base_cc = -1; /* Force to data section. */ 62u64 sched_clock_base_cc = -1; /* Force to data section. */
64 63
65static ext_int_info_t ext_int_info_cc;
66static ext_int_info_t ext_int_etr_cc;
67
68static DEFINE_PER_CPU(struct clock_event_device, comparators); 64static DEFINE_PER_CPU(struct clock_event_device, comparators);
69 65
70/* 66/*
@@ -255,15 +251,11 @@ void __init time_init(void)
255 stp_reset(); 251 stp_reset();
256 252
257 /* request the clock comparator external interrupt */ 253 /* request the clock comparator external interrupt */
258 if (register_early_external_interrupt(0x1004, 254 if (register_external_interrupt(0x1004, clock_comparator_interrupt))
259 clock_comparator_interrupt,
260 &ext_int_info_cc) != 0)
261 panic("Couldn't request external interrupt 0x1004"); 255 panic("Couldn't request external interrupt 0x1004");
262 256
263 /* request the timing alert external interrupt */ 257 /* request the timing alert external interrupt */
264 if (register_early_external_interrupt(0x1406, 258 if (register_external_interrupt(0x1406, timing_alert_interrupt))
265 timing_alert_interrupt,
266 &ext_int_etr_cc) != 0)
267 panic("Couldn't request external interrupt 0x1406"); 259 panic("Couldn't request external interrupt 0x1406");
268 260
269 if (clocksource_register(&clocksource_tod) != 0) 261 if (clocksource_register(&clocksource_tod) != 0)
@@ -1445,14 +1437,14 @@ static void __init stp_reset(void)
1445{ 1437{
1446 int rc; 1438 int rc;
1447 1439
1448 stp_page = alloc_bootmem_pages(PAGE_SIZE); 1440 stp_page = (void *) get_zeroed_page(GFP_ATOMIC);
1449 rc = chsc_sstpc(stp_page, STP_OP_CTRL, 0x0000); 1441 rc = chsc_sstpc(stp_page, STP_OP_CTRL, 0x0000);
1450 if (rc == 0) 1442 if (rc == 0)
1451 set_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags); 1443 set_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags);
1452 else if (stp_online) { 1444 else if (stp_online) {
1453 pr_warning("The real or virtual hardware system does " 1445 pr_warning("The real or virtual hardware system does "
1454 "not provide an STP interface\n"); 1446 "not provide an STP interface\n");
1455 free_bootmem((unsigned long) stp_page, PAGE_SIZE); 1447 free_page((unsigned long) stp_page);
1456 stp_page = NULL; 1448 stp_page = NULL;
1457 stp_online = 0; 1449 stp_online = 0;
1458 } 1450 }
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index c8eb7255332b..c41bb0d416e1 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -25,13 +25,9 @@
25#include <asm/irq_regs.h> 25#include <asm/irq_regs.h>
26#include <asm/cputime.h> 26#include <asm/cputime.h>
27 27
28static ext_int_info_t ext_int_info_timer;
29
30static DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer); 28static DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer);
31 29
32DEFINE_PER_CPU(struct s390_idle_data, s390_idle) = { 30DEFINE_PER_CPU(struct s390_idle_data, s390_idle);
33 .lock = __SPIN_LOCK_UNLOCKED(s390_idle.lock)
34};
35 31
36static inline __u64 get_vtimer(void) 32static inline __u64 get_vtimer(void)
37{ 33{
@@ -153,11 +149,13 @@ void vtime_start_cpu(void)
153 vq->elapsed -= vq->idle - S390_lowcore.async_enter_timer; 149 vq->elapsed -= vq->idle - S390_lowcore.async_enter_timer;
154 } 150 }
155 151
156 spin_lock(&idle->lock); 152 idle->sequence++;
153 smp_wmb();
157 idle->idle_time += idle_time; 154 idle->idle_time += idle_time;
158 idle->idle_enter = 0ULL; 155 idle->idle_enter = 0ULL;
159 idle->idle_count++; 156 idle->idle_count++;
160 spin_unlock(&idle->lock); 157 smp_wmb();
158 idle->sequence++;
161} 159}
162 160
163void vtime_stop_cpu(void) 161void vtime_stop_cpu(void)
@@ -244,15 +242,23 @@ cputime64_t s390_get_idle_time(int cpu)
244{ 242{
245 struct s390_idle_data *idle; 243 struct s390_idle_data *idle;
246 unsigned long long now, idle_time, idle_enter; 244 unsigned long long now, idle_time, idle_enter;
245 unsigned int sequence;
247 246
248 idle = &per_cpu(s390_idle, cpu); 247 idle = &per_cpu(s390_idle, cpu);
249 spin_lock(&idle->lock); 248
250 now = get_clock(); 249 now = get_clock();
250repeat:
251 sequence = idle->sequence;
252 smp_rmb();
253 if (sequence & 1)
254 goto repeat;
251 idle_time = 0; 255 idle_time = 0;
252 idle_enter = idle->idle_enter; 256 idle_enter = idle->idle_enter;
253 if (idle_enter != 0ULL && idle_enter < now) 257 if (idle_enter != 0ULL && idle_enter < now)
254 idle_time = now - idle_enter; 258 idle_time = now - idle_enter;
255 spin_unlock(&idle->lock); 259 smp_rmb();
260 if (idle->sequence != sequence)
261 goto repeat;
256 return idle_time; 262 return idle_time;
257} 263}
258 264
@@ -557,8 +563,7 @@ void init_cpu_vtimer(void)
557void __init vtime_init(void) 563void __init vtime_init(void)
558{ 564{
559 /* request the cpu timer external interrupt */ 565 /* request the cpu timer external interrupt */
560 if (register_early_external_interrupt(0x1005, do_cpu_timer_interrupt, 566 if (register_external_interrupt(0x1005, do_cpu_timer_interrupt))
561 &ext_int_info_timer) != 0)
562 panic("Couldn't request external interrupt 0x1005"); 567 panic("Couldn't request external interrupt 0x1005");
563 568
564 /* Enable cpu timer interrupts on the boot cpu. */ 569 /* Enable cpu timer interrupts on the boot cpu. */
diff --git a/arch/s390/power/swsusp_asm64.S b/arch/s390/power/swsusp_asm64.S
index 3c74e7d827c9..76d688da32fa 100644
--- a/arch/s390/power/swsusp_asm64.S
+++ b/arch/s390/power/swsusp_asm64.S
@@ -109,10 +109,11 @@ swsusp_arch_resume:
109 aghi %r15,-STACK_FRAME_OVERHEAD 109 aghi %r15,-STACK_FRAME_OVERHEAD
110 stg %r1,__SF_BACKCHAIN(%r15) 110 stg %r1,__SF_BACKCHAIN(%r15)
111 111
112#ifdef CONFIG_SMP
112 /* Save boot cpu number */ 113 /* Save boot cpu number */
113 brasl %r14,smp_get_phys_cpu_id 114 brasl %r14,smp_get_phys_cpu_id
114 lgr %r10,%r2 115 lgr %r10,%r2
115 116#endif
116 /* Deactivate DAT */ 117 /* Deactivate DAT */
117 stnsm __SF_EMPTY(%r15),0xfb 118 stnsm __SF_EMPTY(%r15),0xfb
118 119
@@ -177,11 +178,12 @@ swsusp_arch_resume:
177 /* Pointer to save arae */ 178 /* Pointer to save arae */
178 lghi %r13,0x1000 179 lghi %r13,0x1000
179 180
181#ifdef CONFIG_SMP
180 /* Switch CPUs */ 182 /* Switch CPUs */
181 lgr %r2,%r10 /* get cpu id */ 183 lgr %r2,%r10 /* get cpu id */
182 llgf %r3,0x318(%r13) 184 llgf %r3,0x318(%r13)
183 brasl %r14,smp_switch_boot_cpu_in_resume 185 brasl %r14,smp_switch_boot_cpu_in_resume
184 186#endif
185 /* Restore prefix register */ 187 /* Restore prefix register */
186 spx 0x318(%r13) 188 spx 0x318(%r13)
187 189
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index e5b84db0aa03..749836668655 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -470,7 +470,7 @@ static int dasd_decrease_state(struct dasd_device *device)
470 */ 470 */
471static void dasd_change_state(struct dasd_device *device) 471static void dasd_change_state(struct dasd_device *device)
472{ 472{
473 int rc; 473 int rc;
474 474
475 if (device->state == device->target) 475 if (device->state == device->target)
476 /* Already where we want to go today... */ 476 /* Already where we want to go today... */
@@ -479,8 +479,10 @@ static void dasd_change_state(struct dasd_device *device)
479 rc = dasd_increase_state(device); 479 rc = dasd_increase_state(device);
480 else 480 else
481 rc = dasd_decrease_state(device); 481 rc = dasd_decrease_state(device);
482 if (rc && rc != -EAGAIN) 482 if (rc == -EAGAIN)
483 device->target = device->state; 483 return;
484 if (rc)
485 device->target = device->state;
484 486
485 if (device->state == device->target) { 487 if (device->state == device->target) {
486 wake_up(&dasd_init_waitq); 488 wake_up(&dasd_init_waitq);
@@ -2503,15 +2505,25 @@ int dasd_generic_restore_device(struct ccw_device *cdev)
2503 if (IS_ERR(device)) 2505 if (IS_ERR(device))
2504 return PTR_ERR(device); 2506 return PTR_ERR(device);
2505 2507
2508 /* allow new IO again */
2509 device->stopped &= ~DASD_STOPPED_PM;
2510 device->stopped &= ~DASD_UNRESUMED_PM;
2511
2506 dasd_schedule_device_bh(device); 2512 dasd_schedule_device_bh(device);
2507 if (device->block) 2513 if (device->block)
2508 dasd_schedule_block_bh(device->block); 2514 dasd_schedule_block_bh(device->block);
2509 2515
2510 if (device->discipline->restore) 2516 if (device->discipline->restore)
2511 rc = device->discipline->restore(device); 2517 rc = device->discipline->restore(device);
2518 if (rc)
2519 /*
2520 * if the resume failed for the DASD we put it in
2521 * an UNRESUMED stop state
2522 */
2523 device->stopped |= DASD_UNRESUMED_PM;
2512 2524
2513 dasd_put_device(device); 2525 dasd_put_device(device);
2514 return rc; 2526 return 0;
2515} 2527}
2516EXPORT_SYMBOL_GPL(dasd_generic_restore_device); 2528EXPORT_SYMBOL_GPL(dasd_generic_restore_device);
2517 2529
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 1c28ec3e4ccb..f8b1f04f26b8 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -3243,9 +3243,6 @@ int dasd_eckd_restore_device(struct dasd_device *device)
3243 int is_known, rc; 3243 int is_known, rc;
3244 struct dasd_uid temp_uid; 3244 struct dasd_uid temp_uid;
3245 3245
3246 /* allow new IO again */
3247 device->stopped &= ~DASD_STOPPED_PM;
3248
3249 private = (struct dasd_eckd_private *) device->private; 3246 private = (struct dasd_eckd_private *) device->private;
3250 3247
3251 /* Read Configuration Data */ 3248 /* Read Configuration Data */
@@ -3295,12 +3292,7 @@ int dasd_eckd_restore_device(struct dasd_device *device)
3295 return 0; 3292 return 0;
3296 3293
3297out_err: 3294out_err:
3298 /* 3295 return -1;
3299 * if the resume failed for the DASD we put it in
3300 * an UNRESUMED stop state
3301 */
3302 device->stopped |= DASD_UNRESUMED_PM;
3303 return 0;
3304} 3296}
3305 3297
3306static struct ccw_driver dasd_eckd_driver = { 3298static struct ccw_driver dasd_eckd_driver = {
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 04dc734805c6..21639d6c996f 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -20,10 +20,7 @@
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/reboot.h> 22#include <linux/reboot.h>
23
24#include <linux/slab.h> 23#include <linux/slab.h>
25#include <linux/bootmem.h>
26
27#include <asm/ccwdev.h> 24#include <asm/ccwdev.h>
28#include <asm/cio.h> 25#include <asm/cio.h>
29#include <asm/io.h> 26#include <asm/io.h>
@@ -735,7 +732,7 @@ static int raw3215_pm_stop(struct ccw_device *cdev)
735 unsigned long flags; 732 unsigned long flags;
736 733
737 /* Empty the output buffer, then prevent new I/O. */ 734 /* Empty the output buffer, then prevent new I/O. */
738 raw = cdev->dev.driver_data; 735 raw = dev_get_drvdata(&cdev->dev);
739 spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); 736 spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
740 raw3215_make_room(raw, RAW3215_BUFFER_SIZE); 737 raw3215_make_room(raw, RAW3215_BUFFER_SIZE);
741 raw->flags |= RAW3215_FROZEN; 738 raw->flags |= RAW3215_FROZEN;
@@ -749,7 +746,7 @@ static int raw3215_pm_start(struct ccw_device *cdev)
749 unsigned long flags; 746 unsigned long flags;
750 747
751 /* Allow I/O again and flush output buffer. */ 748 /* Allow I/O again and flush output buffer. */
752 raw = cdev->dev.driver_data; 749 raw = dev_get_drvdata(&cdev->dev);
753 spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); 750 spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
754 raw->flags &= ~RAW3215_FROZEN; 751 raw->flags &= ~RAW3215_FROZEN;
755 raw->flags |= RAW3215_FLUSHING; 752 raw->flags |= RAW3215_FLUSHING;
@@ -883,7 +880,7 @@ static int __init con3215_init(void)
883 raw3215_freelist = NULL; 880 raw3215_freelist = NULL;
884 spin_lock_init(&raw3215_freelist_lock); 881 spin_lock_init(&raw3215_freelist_lock);
885 for (i = 0; i < NR_3215_REQ; i++) { 882 for (i = 0; i < NR_3215_REQ; i++) {
886 req = (struct raw3215_req *) alloc_bootmem_low(sizeof(struct raw3215_req)); 883 req = kzalloc(sizeof(struct raw3215_req), GFP_KERNEL | GFP_DMA);
887 req->next = raw3215_freelist; 884 req->next = raw3215_freelist;
888 raw3215_freelist = req; 885 raw3215_freelist = req;
889 } 886 }
@@ -893,10 +890,9 @@ static int __init con3215_init(void)
893 return -ENODEV; 890 return -ENODEV;
894 891
895 raw3215[0] = raw = (struct raw3215_info *) 892 raw3215[0] = raw = (struct raw3215_info *)
896 alloc_bootmem_low(sizeof(struct raw3215_info)); 893 kzalloc(sizeof(struct raw3215_info), GFP_KERNEL | GFP_DMA);
897 memset(raw, 0, sizeof(struct raw3215_info)); 894 raw->buffer = kzalloc(RAW3215_BUFFER_SIZE, GFP_KERNEL | GFP_DMA);
898 raw->buffer = (char *) alloc_bootmem_low(RAW3215_BUFFER_SIZE); 895 raw->inbuf = kzalloc(RAW3215_INBUF_SIZE, GFP_KERNEL | GFP_DMA);
899 raw->inbuf = (char *) alloc_bootmem_low(RAW3215_INBUF_SIZE);
900 raw->cdev = cdev; 896 raw->cdev = cdev;
901 dev_set_drvdata(&cdev->dev, raw); 897 dev_set_drvdata(&cdev->dev, raw);
902 cdev->handler = raw3215_irq; 898 cdev->handler = raw3215_irq;
@@ -906,9 +902,9 @@ static int __init con3215_init(void)
906 902
907 /* Request the console irq */ 903 /* Request the console irq */
908 if (raw3215_startup(raw) != 0) { 904 if (raw3215_startup(raw) != 0) {
909 free_bootmem((unsigned long) raw->inbuf, RAW3215_INBUF_SIZE); 905 kfree(raw->inbuf);
910 free_bootmem((unsigned long) raw->buffer, RAW3215_BUFFER_SIZE); 906 kfree(raw->buffer);
911 free_bootmem((unsigned long) raw, sizeof(struct raw3215_info)); 907 kfree(raw);
912 raw3215[0] = NULL; 908 raw3215[0] = NULL;
913 return -ENODEV; 909 return -ENODEV;
914 } 910 }
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c
index 44d02e371c04..bb838bdf829d 100644
--- a/drivers/s390/char/con3270.c
+++ b/drivers/s390/char/con3270.c
@@ -7,7 +7,6 @@
7 * Copyright IBM Corp. 2003, 2009 7 * Copyright IBM Corp. 2003, 2009
8 */ 8 */
9 9
10#include <linux/bootmem.h>
11#include <linux/console.h> 10#include <linux/console.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/interrupt.h> 12#include <linux/interrupt.h>
@@ -600,16 +599,14 @@ con3270_init(void)
600 if (IS_ERR(rp)) 599 if (IS_ERR(rp))
601 return PTR_ERR(rp); 600 return PTR_ERR(rp);
602 601
603 condev = (struct con3270 *) alloc_bootmem_low(sizeof(struct con3270)); 602 condev = kzalloc(sizeof(struct con3270), GFP_KERNEL | GFP_DMA);
604 memset(condev, 0, sizeof(struct con3270));
605 condev->view.dev = rp; 603 condev->view.dev = rp;
606 604
607 condev->read = raw3270_request_alloc_bootmem(0); 605 condev->read = raw3270_request_alloc(0);
608 condev->read->callback = con3270_read_callback; 606 condev->read->callback = con3270_read_callback;
609 condev->read->callback_data = condev; 607 condev->read->callback_data = condev;
610 condev->write = 608 condev->write = raw3270_request_alloc(CON3270_OUTPUT_BUFFER_SIZE);
611 raw3270_request_alloc_bootmem(CON3270_OUTPUT_BUFFER_SIZE); 609 condev->kreset = raw3270_request_alloc(1);
612 condev->kreset = raw3270_request_alloc_bootmem(1);
613 610
614 INIT_LIST_HEAD(&condev->lines); 611 INIT_LIST_HEAD(&condev->lines);
615 INIT_LIST_HEAD(&condev->update); 612 INIT_LIST_HEAD(&condev->update);
@@ -623,7 +620,7 @@ con3270_init(void)
623 620
624 INIT_LIST_HEAD(&condev->freemem); 621 INIT_LIST_HEAD(&condev->freemem);
625 for (i = 0; i < CON3270_STRING_PAGES; i++) { 622 for (i = 0; i < CON3270_STRING_PAGES; i++) {
626 cbuf = (void *) alloc_bootmem_low_pages(PAGE_SIZE); 623 cbuf = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
627 add_string_memory(&condev->freemem, cbuf, PAGE_SIZE); 624 add_string_memory(&condev->freemem, cbuf, PAGE_SIZE);
628 } 625 }
629 condev->cline = alloc_string(&condev->freemem, condev->view.cols); 626 condev->cline = alloc_string(&condev->freemem, condev->view.cols);
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index 75a8831eebbc..7892550d7932 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -320,7 +320,7 @@ static int mon_open(struct inode *inode, struct file *filp)
320 goto out_path; 320 goto out_path;
321 } 321 }
322 filp->private_data = monpriv; 322 filp->private_data = monpriv;
323 monreader_device->driver_data = monpriv; 323 dev_set_drvdata(&monreader_device, monpriv);
324 unlock_kernel(); 324 unlock_kernel();
325 return nonseekable_open(inode, filp); 325 return nonseekable_open(inode, filp);
326 326
@@ -463,7 +463,7 @@ static struct miscdevice mon_dev = {
463 *****************************************************************************/ 463 *****************************************************************************/
464static int monreader_freeze(struct device *dev) 464static int monreader_freeze(struct device *dev)
465{ 465{
466 struct mon_private *monpriv = dev->driver_data; 466 struct mon_private *monpriv = dev_get_drvdata(&dev);
467 int rc; 467 int rc;
468 468
469 if (!monpriv) 469 if (!monpriv)
@@ -487,7 +487,7 @@ static int monreader_freeze(struct device *dev)
487 487
488static int monreader_thaw(struct device *dev) 488static int monreader_thaw(struct device *dev)
489{ 489{
490 struct mon_private *monpriv = dev->driver_data; 490 struct mon_private *monpriv = dev_get_drvdata(dev);
491 int rc; 491 int rc;
492 492
493 if (!monpriv) 493 if (!monpriv)
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index acab7b2dfe8a..d6a022f55e92 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -7,7 +7,6 @@
7 * Copyright IBM Corp. 2003, 2009 7 * Copyright IBM Corp. 2003, 2009
8 */ 8 */
9 9
10#include <linux/bootmem.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/err.h> 11#include <linux/err.h>
13#include <linux/init.h> 12#include <linux/init.h>
@@ -143,33 +142,6 @@ raw3270_request_alloc(size_t size)
143 return rq; 142 return rq;
144} 143}
145 144
146#ifdef CONFIG_TN3270_CONSOLE
147/*
148 * Allocate a new 3270 ccw request from bootmem. Only works very
149 * early in the boot process. Only con3270.c should be using this.
150 */
151struct raw3270_request __init *raw3270_request_alloc_bootmem(size_t size)
152{
153 struct raw3270_request *rq;
154
155 rq = alloc_bootmem_low(sizeof(struct raw3270));
156
157 /* alloc output buffer. */
158 if (size > 0)
159 rq->buffer = alloc_bootmem_low(size);
160 rq->size = size;
161 INIT_LIST_HEAD(&rq->list);
162
163 /*
164 * Setup ccw.
165 */
166 rq->ccw.cda = __pa(rq->buffer);
167 rq->ccw.flags = CCW_FLAG_SLI;
168
169 return rq;
170}
171#endif
172
173/* 145/*
174 * Free 3270 ccw request 146 * Free 3270 ccw request
175 */ 147 */
@@ -846,8 +818,8 @@ struct raw3270 __init *raw3270_setup_console(struct ccw_device *cdev)
846 char *ascebc; 818 char *ascebc;
847 int rc; 819 int rc;
848 820
849 rp = (struct raw3270 *) alloc_bootmem_low(sizeof(struct raw3270)); 821 rp = kzalloc(sizeof(struct raw3270), GFP_KERNEL | GFP_DMA);
850 ascebc = (char *) alloc_bootmem(256); 822 ascebc = kzalloc(256, GFP_KERNEL);
851 rc = raw3270_setup_device(cdev, rp, ascebc); 823 rc = raw3270_setup_device(cdev, rp, ascebc);
852 if (rc) 824 if (rc)
853 return ERR_PTR(rc); 825 return ERR_PTR(rc);
@@ -1350,7 +1322,7 @@ static int raw3270_pm_stop(struct ccw_device *cdev)
1350 struct raw3270_view *view; 1322 struct raw3270_view *view;
1351 unsigned long flags; 1323 unsigned long flags;
1352 1324
1353 rp = cdev->dev.driver_data; 1325 rp = dev_get_drvdata(&cdev->dev);
1354 if (!rp) 1326 if (!rp)
1355 return 0; 1327 return 0;
1356 spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags); 1328 spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
@@ -1376,7 +1348,7 @@ static int raw3270_pm_start(struct ccw_device *cdev)
1376 struct raw3270 *rp; 1348 struct raw3270 *rp;
1377 unsigned long flags; 1349 unsigned long flags;
1378 1350
1379 rp = cdev->dev.driver_data; 1351 rp = dev_get_drvdata(&cdev->dev);
1380 if (!rp) 1352 if (!rp)
1381 return 0; 1353 return 0;
1382 spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags); 1354 spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
diff --git a/drivers/s390/char/sclp_con.c b/drivers/s390/char/sclp_con.c
index 336811a77672..ad698d30cb3b 100644
--- a/drivers/s390/char/sclp_con.c
+++ b/drivers/s390/char/sclp_con.c
@@ -11,7 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/timer.h> 12#include <linux/timer.h>
13#include <linux/jiffies.h> 13#include <linux/jiffies.h>
14#include <linux/bootmem.h>
15#include <linux/termios.h> 14#include <linux/termios.h>
16#include <linux/err.h> 15#include <linux/err.h>
17#include <linux/reboot.h> 16#include <linux/reboot.h>
@@ -110,7 +109,7 @@ static void sclp_console_sync_queue(void)
110 109
111 spin_lock_irqsave(&sclp_con_lock, flags); 110 spin_lock_irqsave(&sclp_con_lock, flags);
112 if (timer_pending(&sclp_con_timer)) 111 if (timer_pending(&sclp_con_timer))
113 del_timer_sync(&sclp_con_timer); 112 del_timer(&sclp_con_timer);
114 while (sclp_con_queue_running) { 113 while (sclp_con_queue_running) {
115 spin_unlock_irqrestore(&sclp_con_lock, flags); 114 spin_unlock_irqrestore(&sclp_con_lock, flags);
116 sclp_sync_wait(); 115 sclp_sync_wait();
@@ -298,8 +297,8 @@ sclp_console_init(void)
298 /* Allocate pages for output buffering */ 297 /* Allocate pages for output buffering */
299 INIT_LIST_HEAD(&sclp_con_pages); 298 INIT_LIST_HEAD(&sclp_con_pages);
300 for (i = 0; i < MAX_CONSOLE_PAGES; i++) { 299 for (i = 0; i < MAX_CONSOLE_PAGES; i++) {
301 page = alloc_bootmem_low_pages(PAGE_SIZE); 300 page = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
302 list_add_tail((struct list_head *) page, &sclp_con_pages); 301 list_add_tail(page, &sclp_con_pages);
303 } 302 }
304 INIT_LIST_HEAD(&sclp_con_outqueue); 303 INIT_LIST_HEAD(&sclp_con_outqueue);
305 spin_lock_init(&sclp_con_lock); 304 spin_lock_init(&sclp_con_lock);
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c
index 5518e24946aa..178724f2a4c3 100644
--- a/drivers/s390/char/sclp_vt220.c
+++ b/drivers/s390/char/sclp_vt220.c
@@ -20,7 +20,6 @@
20#include <linux/major.h> 20#include <linux/major.h>
21#include <linux/console.h> 21#include <linux/console.h>
22#include <linux/kdev_t.h> 22#include <linux/kdev_t.h>
23#include <linux/bootmem.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <linux/init.h> 24#include <linux/init.h>
26#include <linux/reboot.h> 25#include <linux/reboot.h>
@@ -601,10 +600,7 @@ static void __init __sclp_vt220_free_pages(void)
601 600
602 list_for_each_safe(page, p, &sclp_vt220_empty) { 601 list_for_each_safe(page, p, &sclp_vt220_empty) {
603 list_del(page); 602 list_del(page);
604 if (slab_is_available()) 603 free_page((unsigned long) page);
605 free_page((unsigned long) page);
606 else
607 free_bootmem((unsigned long) page, PAGE_SIZE);
608 } 604 }
609} 605}
610 606
@@ -640,16 +636,12 @@ static int __init __sclp_vt220_init(int num_pages)
640 sclp_vt220_flush_later = 0; 636 sclp_vt220_flush_later = 0;
641 637
642 /* Allocate pages for output buffering */ 638 /* Allocate pages for output buffering */
639 rc = -ENOMEM;
643 for (i = 0; i < num_pages; i++) { 640 for (i = 0; i < num_pages; i++) {
644 if (slab_is_available()) 641 page = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
645 page = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA); 642 if (!page)
646 else
647 page = alloc_bootmem_low_pages(PAGE_SIZE);
648 if (!page) {
649 rc = -ENOMEM;
650 goto out; 643 goto out;
651 } 644 list_add_tail(page, &sclp_vt220_empty);
652 list_add_tail((struct list_head *) page, &sclp_vt220_empty);
653 } 645 }
654 rc = sclp_register(&sclp_vt220_register); 646 rc = sclp_register(&sclp_vt220_register);
655out: 647out:
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 595aa04cfd01..1d420d947596 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -396,7 +396,7 @@ int tape_generic_pm_suspend(struct ccw_device *cdev)
396{ 396{
397 struct tape_device *device; 397 struct tape_device *device;
398 398
399 device = cdev->dev.driver_data; 399 device = dev_get_drvdata(&cdev->dev);
400 if (!device) { 400 if (!device) {
401 return -ENODEV; 401 return -ENODEV;
402 } 402 }
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index 411cfa3c7719..c20a4fe6da51 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -663,7 +663,7 @@ static struct attribute *vmlogrdr_attrs[] = {
663static int vmlogrdr_pm_prepare(struct device *dev) 663static int vmlogrdr_pm_prepare(struct device *dev)
664{ 664{
665 int rc; 665 int rc;
666 struct vmlogrdr_priv_t *priv = dev->driver_data; 666 struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev);
667 667
668 rc = 0; 668 rc = 0;
669 if (priv) { 669 if (priv) {
@@ -753,7 +753,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
753 dev->bus = &iucv_bus; 753 dev->bus = &iucv_bus;
754 dev->parent = iucv_root; 754 dev->parent = iucv_root;
755 dev->driver = &vmlogrdr_driver; 755 dev->driver = &vmlogrdr_driver;
756 dev->driver_data = priv; 756 dev_set_drvdata(dev, priv);
757 /* 757 /*
758 * The release function could be called after the 758 * The release function could be called after the
759 * module has been unloaded. It's _only_ task is to 759 * module has been unloaded. It's _only_ task is to
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 7d9e67cb6471..31b902e94f7b 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -170,7 +170,7 @@ static void urdev_put(struct urdev *urd)
170 */ 170 */
171static int ur_pm_suspend(struct ccw_device *cdev) 171static int ur_pm_suspend(struct ccw_device *cdev)
172{ 172{
173 struct urdev *urd = cdev->dev.driver_data; 173 struct urdev *urd = dev_get_drvdata(&cdev->dev);
174 174
175 TRACE("ur_pm_suspend: cdev=%p\n", cdev); 175 TRACE("ur_pm_suspend: cdev=%p\n", cdev);
176 if (urd->open_flag) { 176 if (urd->open_flag) {
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index 13bcb8114388..b1241f8fae88 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -351,15 +351,6 @@ static inline unsigned long long get_usecs(void)
351 ((bufnr - dec) & QDIO_MAX_BUFFERS_MASK) 351 ((bufnr - dec) & QDIO_MAX_BUFFERS_MASK)
352 352
353/* prototypes for thin interrupt */ 353/* prototypes for thin interrupt */
354void qdio_sync_after_thinint(struct qdio_q *q);
355int get_buf_state(struct qdio_q *q, unsigned int bufnr, unsigned char *state,
356 int auto_ack);
357void qdio_check_outbound_after_thinint(struct qdio_q *q);
358int qdio_inbound_q_moved(struct qdio_q *q);
359void qdio_kick_handler(struct qdio_q *q);
360void qdio_stop_polling(struct qdio_q *q);
361int qdio_siga_sync_q(struct qdio_q *q);
362
363void qdio_setup_thinint(struct qdio_irq *irq_ptr); 354void qdio_setup_thinint(struct qdio_irq *irq_ptr);
364int qdio_establish_thinint(struct qdio_irq *irq_ptr); 355int qdio_establish_thinint(struct qdio_irq *irq_ptr);
365void qdio_shutdown_thinint(struct qdio_irq *irq_ptr); 356void qdio_shutdown_thinint(struct qdio_irq *irq_ptr);
@@ -392,4 +383,6 @@ void qdio_setup_destroy_sysfs(struct ccw_device *cdev);
392int qdio_setup_init(void); 383int qdio_setup_init(void);
393void qdio_setup_exit(void); 384void qdio_setup_exit(void);
394 385
386int debug_get_buf_state(struct qdio_q *q, unsigned int bufnr,
387 unsigned char *state);
395#endif /* _CIO_QDIO_H */ 388#endif /* _CIO_QDIO_H */
diff --git a/drivers/s390/cio/qdio_debug.c b/drivers/s390/cio/qdio_debug.c
index e3434b34f86c..b8626d4df116 100644
--- a/drivers/s390/cio/qdio_debug.c
+++ b/drivers/s390/cio/qdio_debug.c
@@ -70,9 +70,8 @@ static int qstat_show(struct seq_file *m, void *v)
70 seq_printf(m, "slsb buffer states:\n"); 70 seq_printf(m, "slsb buffer states:\n");
71 seq_printf(m, "|0 |8 |16 |24 |32 |40 |48 |56 63|\n"); 71 seq_printf(m, "|0 |8 |16 |24 |32 |40 |48 |56 63|\n");
72 72
73 qdio_siga_sync_q(q);
74 for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; i++) { 73 for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; i++) {
75 get_buf_state(q, i, &state, 0); 74 debug_get_buf_state(q, i, &state);
76 switch (state) { 75 switch (state) {
77 case SLSB_P_INPUT_NOT_INIT: 76 case SLSB_P_INPUT_NOT_INIT:
78 case SLSB_P_OUTPUT_NOT_INIT: 77 case SLSB_P_OUTPUT_NOT_INIT:
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index d79cf5bf0e62..0038750ad945 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -231,8 +231,8 @@ static inline int get_buf_states(struct qdio_q *q, unsigned int bufnr,
231 return i; 231 return i;
232} 232}
233 233
234inline int get_buf_state(struct qdio_q *q, unsigned int bufnr, 234static inline int get_buf_state(struct qdio_q *q, unsigned int bufnr,
235 unsigned char *state, int auto_ack) 235 unsigned char *state, int auto_ack)
236{ 236{
237 return get_buf_states(q, bufnr, state, 1, auto_ack); 237 return get_buf_states(q, bufnr, state, 1, auto_ack);
238} 238}
@@ -276,7 +276,7 @@ void qdio_init_buf_states(struct qdio_irq *irq_ptr)
276 QDIO_MAX_BUFFERS_PER_Q); 276 QDIO_MAX_BUFFERS_PER_Q);
277} 277}
278 278
279static int qdio_siga_sync(struct qdio_q *q, unsigned int output, 279static inline int qdio_siga_sync(struct qdio_q *q, unsigned int output,
280 unsigned int input) 280 unsigned int input)
281{ 281{
282 int cc; 282 int cc;
@@ -293,7 +293,7 @@ static int qdio_siga_sync(struct qdio_q *q, unsigned int output,
293 return cc; 293 return cc;
294} 294}
295 295
296inline int qdio_siga_sync_q(struct qdio_q *q) 296static inline int qdio_siga_sync_q(struct qdio_q *q)
297{ 297{
298 if (q->is_input_q) 298 if (q->is_input_q)
299 return qdio_siga_sync(q, 0, q->mask); 299 return qdio_siga_sync(q, 0, q->mask);
@@ -358,8 +358,7 @@ static inline int qdio_siga_input(struct qdio_q *q)
358 return cc; 358 return cc;
359} 359}
360 360
361/* called from thinint inbound handler */ 361static inline void qdio_sync_after_thinint(struct qdio_q *q)
362void qdio_sync_after_thinint(struct qdio_q *q)
363{ 362{
364 if (pci_out_supported(q)) { 363 if (pci_out_supported(q)) {
365 if (need_siga_sync_thinint(q)) 364 if (need_siga_sync_thinint(q))
@@ -370,7 +369,14 @@ void qdio_sync_after_thinint(struct qdio_q *q)
370 qdio_siga_sync_q(q); 369 qdio_siga_sync_q(q);
371} 370}
372 371
373inline void qdio_stop_polling(struct qdio_q *q) 372int debug_get_buf_state(struct qdio_q *q, unsigned int bufnr,
373 unsigned char *state)
374{
375 qdio_siga_sync_q(q);
376 return get_buf_states(q, bufnr, state, 1, 0);
377}
378
379static inline void qdio_stop_polling(struct qdio_q *q)
374{ 380{
375 if (!q->u.in.polling) 381 if (!q->u.in.polling)
376 return; 382 return;
@@ -449,13 +455,6 @@ static inline void inbound_primed(struct qdio_q *q, int count)
449 count--; 455 count--;
450 if (!count) 456 if (!count)
451 return; 457 return;
452
453 /*
454 * Need to change all PRIMED buffers to NOT_INIT, otherwise
455 * we're loosing initiative in the thinint code.
456 */
457 set_buf_states(q, q->first_to_check, SLSB_P_INPUT_NOT_INIT,
458 count);
459} 458}
460 459
461static int get_inbound_buffer_frontier(struct qdio_q *q) 460static int get_inbound_buffer_frontier(struct qdio_q *q)
@@ -470,19 +469,13 @@ static int get_inbound_buffer_frontier(struct qdio_q *q)
470 count = min(atomic_read(&q->nr_buf_used), QDIO_MAX_BUFFERS_MASK); 469 count = min(atomic_read(&q->nr_buf_used), QDIO_MAX_BUFFERS_MASK);
471 stop = add_buf(q->first_to_check, count); 470 stop = add_buf(q->first_to_check, count);
472 471
473 /*
474 * No siga sync here, as a PCI or we after a thin interrupt
475 * will sync the queues.
476 */
477
478 /* need to set count to 1 for non-qebsm */
479 if (!is_qebsm(q))
480 count = 1;
481
482check_next:
483 if (q->first_to_check == stop) 472 if (q->first_to_check == stop)
484 goto out; 473 goto out;
485 474
475 /*
476 * No siga sync here, as a PCI or we after a thin interrupt
477 * already sync'ed the queues.
478 */
486 count = get_buf_states(q, q->first_to_check, &state, count, 1); 479 count = get_buf_states(q, q->first_to_check, &state, count, 1);
487 if (!count) 480 if (!count)
488 goto out; 481 goto out;
@@ -490,14 +483,9 @@ check_next:
490 switch (state) { 483 switch (state) {
491 case SLSB_P_INPUT_PRIMED: 484 case SLSB_P_INPUT_PRIMED:
492 inbound_primed(q, count); 485 inbound_primed(q, count);
493 /*
494 * No siga-sync needed for non-qebsm here, as the inbound queue
495 * will be synced on the next siga-r, resp.
496 * tiqdio_is_inbound_q_done will do the siga-sync.
497 */
498 q->first_to_check = add_buf(q->first_to_check, count); 486 q->first_to_check = add_buf(q->first_to_check, count);
499 atomic_sub(count, &q->nr_buf_used); 487 atomic_sub(count, &q->nr_buf_used);
500 goto check_next; 488 break;
501 case SLSB_P_INPUT_ERROR: 489 case SLSB_P_INPUT_ERROR:
502 announce_buffer_error(q, count); 490 announce_buffer_error(q, count);
503 /* process the buffer, the upper layer will take care of it */ 491 /* process the buffer, the upper layer will take care of it */
@@ -516,7 +504,7 @@ out:
516 return q->first_to_check; 504 return q->first_to_check;
517} 505}
518 506
519int qdio_inbound_q_moved(struct qdio_q *q) 507static int qdio_inbound_q_moved(struct qdio_q *q)
520{ 508{
521 int bufnr; 509 int bufnr;
522 510
@@ -524,35 +512,32 @@ int qdio_inbound_q_moved(struct qdio_q *q)
524 512
525 if ((bufnr != q->last_move) || q->qdio_error) { 513 if ((bufnr != q->last_move) || q->qdio_error) {
526 q->last_move = bufnr; 514 q->last_move = bufnr;
527 if (!need_siga_sync(q) && !pci_out_supported(q)) 515 if (!is_thinint_irq(q->irq_ptr) && !MACHINE_IS_VM)
528 q->u.in.timestamp = get_usecs(); 516 q->u.in.timestamp = get_usecs();
529
530 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in moved");
531 return 1; 517 return 1;
532 } else 518 } else
533 return 0; 519 return 0;
534} 520}
535 521
536static int qdio_inbound_q_done(struct qdio_q *q) 522static inline int qdio_inbound_q_done(struct qdio_q *q)
537{ 523{
538 unsigned char state = 0; 524 unsigned char state = 0;
539 525
540 if (!atomic_read(&q->nr_buf_used)) 526 if (!atomic_read(&q->nr_buf_used))
541 return 1; 527 return 1;
542 528
543 /*
544 * We need that one for synchronization with the adapter, as it
545 * does a kind of PCI avoidance.
546 */
547 qdio_siga_sync_q(q); 529 qdio_siga_sync_q(q);
548
549 get_buf_state(q, q->first_to_check, &state, 0); 530 get_buf_state(q, q->first_to_check, &state, 0);
531
550 if (state == SLSB_P_INPUT_PRIMED) 532 if (state == SLSB_P_INPUT_PRIMED)
551 /* we got something to do */ 533 /* more work coming */
552 return 0; 534 return 0;
553 535
554 /* on VM, we don't poll, so the q is always done here */ 536 if (is_thinint_irq(q->irq_ptr))
555 if (need_siga_sync(q) || pci_out_supported(q)) 537 return 1;
538
539 /* don't poll under z/VM */
540 if (MACHINE_IS_VM)
556 return 1; 541 return 1;
557 542
558 /* 543 /*
@@ -563,14 +548,11 @@ static int qdio_inbound_q_done(struct qdio_q *q)
563 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in done:%3d", 548 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in done:%3d",
564 q->first_to_check); 549 q->first_to_check);
565 return 1; 550 return 1;
566 } else { 551 } else
567 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in notd:%3d",
568 q->first_to_check);
569 return 0; 552 return 0;
570 }
571} 553}
572 554
573void qdio_kick_handler(struct qdio_q *q) 555static void qdio_kick_handler(struct qdio_q *q)
574{ 556{
575 int start = q->first_to_kick; 557 int start = q->first_to_kick;
576 int end = q->first_to_check; 558 int end = q->first_to_check;
@@ -619,7 +601,6 @@ again:
619 goto again; 601 goto again;
620} 602}
621 603
622/* inbound tasklet */
623void qdio_inbound_processing(unsigned long data) 604void qdio_inbound_processing(unsigned long data)
624{ 605{
625 struct qdio_q *q = (struct qdio_q *)data; 606 struct qdio_q *q = (struct qdio_q *)data;
@@ -642,11 +623,6 @@ static int get_outbound_buffer_frontier(struct qdio_q *q)
642 count = min(atomic_read(&q->nr_buf_used), QDIO_MAX_BUFFERS_MASK); 623 count = min(atomic_read(&q->nr_buf_used), QDIO_MAX_BUFFERS_MASK);
643 stop = add_buf(q->first_to_check, count); 624 stop = add_buf(q->first_to_check, count);
644 625
645 /* need to set count to 1 for non-qebsm */
646 if (!is_qebsm(q))
647 count = 1;
648
649check_next:
650 if (q->first_to_check == stop) 626 if (q->first_to_check == stop)
651 return q->first_to_check; 627 return q->first_to_check;
652 628
@@ -661,13 +637,7 @@ check_next:
661 637
662 atomic_sub(count, &q->nr_buf_used); 638 atomic_sub(count, &q->nr_buf_used);
663 q->first_to_check = add_buf(q->first_to_check, count); 639 q->first_to_check = add_buf(q->first_to_check, count);
664 /* 640 break;
665 * We fetch all buffer states at once. get_buf_states may
666 * return count < stop. For QEBSM we do not loop.
667 */
668 if (is_qebsm(q))
669 break;
670 goto check_next;
671 case SLSB_P_OUTPUT_ERROR: 641 case SLSB_P_OUTPUT_ERROR:
672 announce_buffer_error(q, count); 642 announce_buffer_error(q, count);
673 /* process the buffer, the upper layer will take care of it */ 643 /* process the buffer, the upper layer will take care of it */
@@ -797,8 +767,7 @@ void qdio_outbound_timer(unsigned long data)
797 tasklet_schedule(&q->tasklet); 767 tasklet_schedule(&q->tasklet);
798} 768}
799 769
800/* called from thinint inbound tasklet */ 770static inline void qdio_check_outbound_after_thinint(struct qdio_q *q)
801void qdio_check_outbound_after_thinint(struct qdio_q *q)
802{ 771{
803 struct qdio_q *out; 772 struct qdio_q *out;
804 int i; 773 int i;
@@ -811,6 +780,46 @@ void qdio_check_outbound_after_thinint(struct qdio_q *q)
811 tasklet_schedule(&out->tasklet); 780 tasklet_schedule(&out->tasklet);
812} 781}
813 782
783static void __tiqdio_inbound_processing(struct qdio_q *q)
784{
785 qdio_perf_stat_inc(&perf_stats.thinint_inbound);
786 qdio_sync_after_thinint(q);
787
788 /*
789 * The interrupt could be caused by a PCI request. Check the
790 * PCI capable outbound queues.
791 */
792 qdio_check_outbound_after_thinint(q);
793
794 if (!qdio_inbound_q_moved(q))
795 return;
796
797 qdio_kick_handler(q);
798
799 if (!qdio_inbound_q_done(q)) {
800 qdio_perf_stat_inc(&perf_stats.thinint_inbound_loop);
801 if (likely(q->irq_ptr->state != QDIO_IRQ_STATE_STOPPED))
802 tasklet_schedule(&q->tasklet);
803 }
804
805 qdio_stop_polling(q);
806 /*
807 * We need to check again to not lose initiative after
808 * resetting the ACK state.
809 */
810 if (!qdio_inbound_q_done(q)) {
811 qdio_perf_stat_inc(&perf_stats.thinint_inbound_loop2);
812 if (likely(q->irq_ptr->state != QDIO_IRQ_STATE_STOPPED))
813 tasklet_schedule(&q->tasklet);
814 }
815}
816
817void tiqdio_inbound_processing(unsigned long data)
818{
819 struct qdio_q *q = (struct qdio_q *)data;
820 __tiqdio_inbound_processing(q);
821}
822
814static inline void qdio_set_state(struct qdio_irq *irq_ptr, 823static inline void qdio_set_state(struct qdio_irq *irq_ptr,
815 enum qdio_irq_states state) 824 enum qdio_irq_states state)
816{ 825{
@@ -1488,18 +1497,13 @@ out:
1488 * @count: how many buffers to process 1497 * @count: how many buffers to process
1489 */ 1498 */
1490int do_QDIO(struct ccw_device *cdev, unsigned int callflags, 1499int do_QDIO(struct ccw_device *cdev, unsigned int callflags,
1491 int q_nr, int bufnr, int count) 1500 int q_nr, unsigned int bufnr, unsigned int count)
1492{ 1501{
1493 struct qdio_irq *irq_ptr; 1502 struct qdio_irq *irq_ptr;
1494 1503
1495 if ((bufnr > QDIO_MAX_BUFFERS_PER_Q) || 1504 if (bufnr >= QDIO_MAX_BUFFERS_PER_Q || count > QDIO_MAX_BUFFERS_PER_Q)
1496 (count > QDIO_MAX_BUFFERS_PER_Q) ||
1497 (q_nr >= QDIO_MAX_QUEUES_PER_IRQ))
1498 return -EINVAL; 1505 return -EINVAL;
1499 1506
1500 if (!count)
1501 return 0;
1502
1503 irq_ptr = cdev->private->qdio_data; 1507 irq_ptr = cdev->private->qdio_data;
1504 if (!irq_ptr) 1508 if (!irq_ptr)
1505 return -ENODEV; 1509 return -ENODEV;
diff --git a/drivers/s390/cio/qdio_thinint.c b/drivers/s390/cio/qdio_thinint.c
index c655d011a78d..981a77ea7ee2 100644
--- a/drivers/s390/cio/qdio_thinint.c
+++ b/drivers/s390/cio/qdio_thinint.c
@@ -43,9 +43,6 @@ struct indicator_t {
43}; 43};
44static struct indicator_t *q_indicators; 44static struct indicator_t *q_indicators;
45 45
46static void tiqdio_tasklet_fn(unsigned long data);
47static DECLARE_TASKLET(tiqdio_tasklet, tiqdio_tasklet_fn, 0);
48
49static int css_qdio_omit_svs; 46static int css_qdio_omit_svs;
50 47
51static inline unsigned long do_clear_global_summary(void) 48static inline unsigned long do_clear_global_summary(void)
@@ -103,11 +100,6 @@ void tiqdio_add_input_queues(struct qdio_irq *irq_ptr)
103 xchg(irq_ptr->dsci, 1); 100 xchg(irq_ptr->dsci, 1);
104} 101}
105 102
106/*
107 * we cannot stop the tiqdio tasklet here since it is for all
108 * thinint qdio devices and it must run as long as there is a
109 * thinint device left
110 */
111void tiqdio_remove_input_queues(struct qdio_irq *irq_ptr) 103void tiqdio_remove_input_queues(struct qdio_irq *irq_ptr)
112{ 104{
113 struct qdio_q *q; 105 struct qdio_q *q;
@@ -126,79 +118,39 @@ void tiqdio_remove_input_queues(struct qdio_irq *irq_ptr)
126 } 118 }
127} 119}
128 120
129static inline int tiqdio_inbound_q_done(struct qdio_q *q)
130{
131 unsigned char state = 0;
132
133 if (!atomic_read(&q->nr_buf_used))
134 return 1;
135
136 qdio_siga_sync_q(q);
137 get_buf_state(q, q->first_to_check, &state, 0);
138
139 if (state == SLSB_P_INPUT_PRIMED)
140 /* more work coming */
141 return 0;
142 return 1;
143}
144
145static inline int shared_ind(struct qdio_irq *irq_ptr) 121static inline int shared_ind(struct qdio_irq *irq_ptr)
146{ 122{
147 return irq_ptr->dsci == &q_indicators[TIQDIO_SHARED_IND].ind; 123 return irq_ptr->dsci == &q_indicators[TIQDIO_SHARED_IND].ind;
148} 124}
149 125
150static void __tiqdio_inbound_processing(struct qdio_q *q) 126/**
127 * tiqdio_thinint_handler - thin interrupt handler for qdio
128 * @ind: pointer to adapter local summary indicator
129 * @drv_data: NULL
130 */
131static void tiqdio_thinint_handler(void *ind, void *drv_data)
151{ 132{
152 qdio_perf_stat_inc(&perf_stats.thinint_inbound); 133 struct qdio_q *q;
153 qdio_sync_after_thinint(q); 134
135 qdio_perf_stat_inc(&perf_stats.thin_int);
154 136
155 /* 137 /*
156 * Maybe we have work on our outbound queues... at least 138 * SVS only when needed: issue SVS to benefit from iqdio interrupt
157 * we have to check the PCI capable queues. 139 * avoidance (SVS clears adapter interrupt suppression overwrite)
158 */ 140 */
159 qdio_check_outbound_after_thinint(q); 141 if (!css_qdio_omit_svs)
160 142 do_clear_global_summary();
161 if (!qdio_inbound_q_moved(q))
162 return;
163
164 qdio_kick_handler(q);
165
166 if (!tiqdio_inbound_q_done(q)) {
167 qdio_perf_stat_inc(&perf_stats.thinint_inbound_loop);
168 if (likely(q->irq_ptr->state != QDIO_IRQ_STATE_STOPPED))
169 tasklet_schedule(&q->tasklet);
170 }
171 143
172 qdio_stop_polling(q);
173 /* 144 /*
174 * We need to check again to not lose initiative after 145 * reset local summary indicator (tiqdio_alsi) to stop adapter
175 * resetting the ACK state. 146 * interrupts for now
176 */ 147 */
177 if (!tiqdio_inbound_q_done(q)) { 148 xchg((u8 *)ind, 0);
178 qdio_perf_stat_inc(&perf_stats.thinint_inbound_loop2);
179 if (likely(q->irq_ptr->state != QDIO_IRQ_STATE_STOPPED))
180 tasklet_schedule(&q->tasklet);
181 }
182}
183
184void tiqdio_inbound_processing(unsigned long data)
185{
186 struct qdio_q *q = (struct qdio_q *)data;
187
188 __tiqdio_inbound_processing(q);
189}
190
191/* check for work on all inbound thinint queues */
192static void tiqdio_tasklet_fn(unsigned long data)
193{
194 struct qdio_q *q;
195
196 qdio_perf_stat_inc(&perf_stats.tasklet_thinint);
197again:
198 149
199 /* protect tiq_list entries, only changed in activate or shutdown */ 150 /* protect tiq_list entries, only changed in activate or shutdown */
200 rcu_read_lock(); 151 rcu_read_lock();
201 152
153 /* check for work on all inbound thinint queues */
202 list_for_each_entry_rcu(q, &tiq_list, entry) 154 list_for_each_entry_rcu(q, &tiq_list, entry)
203 /* only process queues from changed sets */ 155 /* only process queues from changed sets */
204 if (*q->irq_ptr->dsci) { 156 if (*q->irq_ptr->dsci) {
@@ -226,37 +178,6 @@ again:
226 if (*tiqdio_alsi) 178 if (*tiqdio_alsi)
227 xchg(&q_indicators[TIQDIO_SHARED_IND].ind, 1); 179 xchg(&q_indicators[TIQDIO_SHARED_IND].ind, 1);
228 } 180 }
229
230 /* check for more work */
231 if (*tiqdio_alsi) {
232 xchg(tiqdio_alsi, 0);
233 qdio_perf_stat_inc(&perf_stats.tasklet_thinint_loop);
234 goto again;
235 }
236}
237
238/**
239 * tiqdio_thinint_handler - thin interrupt handler for qdio
240 * @ind: pointer to adapter local summary indicator
241 * @drv_data: NULL
242 */
243static void tiqdio_thinint_handler(void *ind, void *drv_data)
244{
245 qdio_perf_stat_inc(&perf_stats.thin_int);
246
247 /*
248 * SVS only when needed: issue SVS to benefit from iqdio interrupt
249 * avoidance (SVS clears adapter interrupt suppression overwrite)
250 */
251 if (!css_qdio_omit_svs)
252 do_clear_global_summary();
253
254 /*
255 * reset local summary indicator (tiqdio_alsi) to stop adapter
256 * interrupts for now, the tasklet will clean all dsci's
257 */
258 xchg((u8 *)ind, 0);
259 tasklet_hi_schedule(&tiqdio_tasklet);
260} 181}
261 182
262static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset) 183static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset)
@@ -376,5 +297,4 @@ void __exit tiqdio_unregister_thinints(void)
376 s390_unregister_adapter_interrupt(tiqdio_alsi, QDIO_AIRQ_ISC); 297 s390_unregister_adapter_interrupt(tiqdio_alsi, QDIO_AIRQ_ISC);
377 isc_unregister(QDIO_AIRQ_ISC); 298 isc_unregister(QDIO_AIRQ_ISC);
378 } 299 }
379 tasklet_kill(&tiqdio_tasklet);
380} 300}
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 9c148406b980..727a809636d8 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -54,6 +54,12 @@ static int ap_poll_thread_start(void);
54static void ap_poll_thread_stop(void); 54static void ap_poll_thread_stop(void);
55static void ap_request_timeout(unsigned long); 55static void ap_request_timeout(unsigned long);
56static inline void ap_schedule_poll_timer(void); 56static inline void ap_schedule_poll_timer(void);
57static int __ap_poll_device(struct ap_device *ap_dev, unsigned long *flags);
58static int ap_device_remove(struct device *dev);
59static int ap_device_probe(struct device *dev);
60static void ap_interrupt_handler(void *unused1, void *unused2);
61static void ap_reset(struct ap_device *ap_dev);
62static void ap_config_timeout(unsigned long ptr);
57 63
58/* 64/*
59 * Module description. 65 * Module description.
@@ -101,6 +107,10 @@ static struct hrtimer ap_poll_timer;
101 * If z/VM change to 1500000 nanoseconds to adjust to z/VM polling.*/ 107 * If z/VM change to 1500000 nanoseconds to adjust to z/VM polling.*/
102static unsigned long long poll_timeout = 250000; 108static unsigned long long poll_timeout = 250000;
103 109
110/* Suspend flag */
111static int ap_suspend_flag;
112static struct bus_type ap_bus_type;
113
104/** 114/**
105 * ap_using_interrupts() - Returns non-zero if interrupt support is 115 * ap_using_interrupts() - Returns non-zero if interrupt support is
106 * available. 116 * available.
@@ -617,10 +627,79 @@ static int ap_uevent (struct device *dev, struct kobj_uevent_env *env)
617 return retval; 627 return retval;
618} 628}
619 629
630static int ap_bus_suspend(struct device *dev, pm_message_t state)
631{
632 struct ap_device *ap_dev = to_ap_dev(dev);
633 unsigned long flags;
634
635 if (!ap_suspend_flag) {
636 ap_suspend_flag = 1;
637
638 /* Disable scanning for devices, thus we do not want to scan
639 * for them after removing.
640 */
641 del_timer_sync(&ap_config_timer);
642 if (ap_work_queue != NULL) {
643 destroy_workqueue(ap_work_queue);
644 ap_work_queue = NULL;
645 }
646 tasklet_disable(&ap_tasklet);
647 }
648 /* Poll on the device until all requests are finished. */
649 do {
650 flags = 0;
651 __ap_poll_device(ap_dev, &flags);
652 } while ((flags & 1) || (flags & 2));
653
654 ap_device_remove(dev);
655 return 0;
656}
657
658static int ap_bus_resume(struct device *dev)
659{
660 int rc = 0;
661 struct ap_device *ap_dev = to_ap_dev(dev);
662
663 if (ap_suspend_flag) {
664 ap_suspend_flag = 0;
665 if (!ap_interrupts_available())
666 ap_interrupt_indicator = NULL;
667 ap_device_probe(dev);
668 ap_reset(ap_dev);
669 setup_timer(&ap_dev->timeout, ap_request_timeout,
670 (unsigned long) ap_dev);
671 ap_scan_bus(NULL);
672 init_timer(&ap_config_timer);
673 ap_config_timer.function = ap_config_timeout;
674 ap_config_timer.data = 0;
675 ap_config_timer.expires = jiffies + ap_config_time * HZ;
676 add_timer(&ap_config_timer);
677 ap_work_queue = create_singlethread_workqueue("kapwork");
678 if (!ap_work_queue)
679 return -ENOMEM;
680 tasklet_enable(&ap_tasklet);
681 if (!ap_using_interrupts())
682 ap_schedule_poll_timer();
683 else
684 tasklet_schedule(&ap_tasklet);
685 if (ap_thread_flag)
686 rc = ap_poll_thread_start();
687 } else {
688 ap_device_probe(dev);
689 ap_reset(ap_dev);
690 setup_timer(&ap_dev->timeout, ap_request_timeout,
691 (unsigned long) ap_dev);
692 }
693
694 return rc;
695}
696
620static struct bus_type ap_bus_type = { 697static struct bus_type ap_bus_type = {
621 .name = "ap", 698 .name = "ap",
622 .match = &ap_bus_match, 699 .match = &ap_bus_match,
623 .uevent = &ap_uevent, 700 .uevent = &ap_uevent,
701 .suspend = ap_bus_suspend,
702 .resume = ap_bus_resume
624}; 703};
625 704
626static int ap_device_probe(struct device *dev) 705static int ap_device_probe(struct device *dev)
@@ -1066,7 +1145,7 @@ ap_config_timeout(unsigned long ptr)
1066 */ 1145 */
1067static inline void ap_schedule_poll_timer(void) 1146static inline void ap_schedule_poll_timer(void)
1068{ 1147{
1069 if (ap_using_interrupts()) 1148 if (ap_using_interrupts() || ap_suspend_flag)
1070 return; 1149 return;
1071 if (hrtimer_is_queued(&ap_poll_timer)) 1150 if (hrtimer_is_queued(&ap_poll_timer))
1072 return; 1151 return;
@@ -1384,6 +1463,8 @@ static int ap_poll_thread(void *data)
1384 1463
1385 set_user_nice(current, 19); 1464 set_user_nice(current, 19);
1386 while (1) { 1465 while (1) {
1466 if (ap_suspend_flag)
1467 return 0;
1387 if (need_resched()) { 1468 if (need_resched()) {
1388 schedule(); 1469 schedule();
1389 continue; 1470 continue;
@@ -1414,7 +1495,7 @@ static int ap_poll_thread_start(void)
1414{ 1495{
1415 int rc; 1496 int rc;
1416 1497
1417 if (ap_using_interrupts()) 1498 if (ap_using_interrupts() || ap_suspend_flag)
1418 return 0; 1499 return 0;
1419 mutex_lock(&ap_poll_thread_mutex); 1500 mutex_lock(&ap_poll_thread_mutex);
1420 if (!ap_poll_kthread) { 1501 if (!ap_poll_kthread) {
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 52574ce797b2..8c36eafcfbfe 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -1307,7 +1307,7 @@ static void netiucv_pm_complete(struct device *dev)
1307 */ 1307 */
1308static int netiucv_pm_freeze(struct device *dev) 1308static int netiucv_pm_freeze(struct device *dev)
1309{ 1309{
1310 struct netiucv_priv *priv = dev->driver_data; 1310 struct netiucv_priv *priv = dev_get_drvdata(dev);
1311 struct net_device *ndev = NULL; 1311 struct net_device *ndev = NULL;
1312 int rc = 0; 1312 int rc = 0;
1313 1313
@@ -1331,7 +1331,7 @@ out:
1331 */ 1331 */
1332static int netiucv_pm_restore_thaw(struct device *dev) 1332static int netiucv_pm_restore_thaw(struct device *dev)
1333{ 1333{
1334 struct netiucv_priv *priv = dev->driver_data; 1334 struct netiucv_priv *priv = dev_get_drvdata(dev);
1335 struct net_device *ndev = NULL; 1335 struct net_device *ndev = NULL;
1336 int rc = 0; 1336 int rc = 0;
1337 1337
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index bccb529dac08..ceb68aa51f7f 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -13,6 +13,12 @@
13#define cpu_relax() asm volatile ("" ::: "memory"); 13#define cpu_relax() asm volatile ("" ::: "memory");
14#endif 14#endif
15 15
16#ifdef __s390__
17#include "../../arch/s390/include/asm/unistd.h"
18#define rmb() asm volatile("bcr 15,0" ::: "memory")
19#define cpu_relax() asm volatile("" ::: "memory");
20#endif
21
16#include <time.h> 22#include <time.h>
17#include <unistd.h> 23#include <unistd.h>
18#include <sys/types.h> 24#include <sys/types.h>