aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-07 18:24:38 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-07 18:24:38 -0500
commit280c84d1c1726be7ada045735858acdc8cfdd65a (patch)
treeb9afa3fb97b08272b6952d5c8d1fe31f6a8092fa /drivers
parent8efdf2b759409f85953b84d52a14ea4d39c80474 (diff)
parentde9587a2f54d2d0063f0dbc775328129b9daaaa2 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Martin Schwidefsky: "The bulk of the patches for the 3.13 merge window. Heiko spent quite a bit of work to improve the code generation for the kernel. That includes the exploitation of the interlocked-access facility for the atomics and bitops implementation and the improvement for the -march and -mtune compiler settings. Another important change is the removal of the user_mode=home option, user processes now always run in primary space. The storage keys are not initialized at system startup any more, with that the storage key removal work is complete. For the PCI support the hibernation hooks have been implemented. And as usual cleanup and fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (62 commits) s390/scm_blk: fix endless loop for requests != REQ_TYPE_FS s390/mm,tlb: correct tlb flush on page table upgrade s390/mm: page_table_realloc returns failure s390: allow to set gcc -mtune flag s390/percpu: remove this_cpu_xor() implementation s390/vtime: correct idle time calculation s390/time: fix get_tod_clock_ext inline assembly tty/hvc_iucv: remove redundant NULL check s390/dasd: Write to profile data area only if it is available s390: convert use of typedef ctl_table to struct ctl_table s390/pci: cleanup function information block s390/pci: remove CONFIG_PCI_DEBUG dependancy s390/pci: message cleanup Update default configuration s390: add a couple of useful defconfigs s390/percpu: make use of interlocked-access facility 1 instructions s390/percpu: use generic percpu ops for CONFIG_32BIT s390/compat: make psw32_user_bits a constant value again s390: fix handling of runtime instrumentation psw bit s390: fix save and restore of the floating-point-control register ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/hotplug/s390_pci_hpc.c6
-rw-r--r--drivers/s390/block/dasd.c3
-rw-r--r--drivers/s390/block/scm_blk.c6
-rw-r--r--drivers/s390/block/scm_blk.h2
-rw-r--r--drivers/s390/char/monwriter.c2
-rw-r--r--drivers/s390/char/raw3270.c4
-rw-r--r--drivers/s390/char/zcore.c20
-rw-r--r--drivers/s390/cio/airq.c19
-rw-r--r--drivers/s390/cio/eadm_sch.c29
-rw-r--r--drivers/s390/cio/eadm_sch.h4
-rw-r--r--drivers/s390/cio/qdio_debug.h8
-rw-r--r--drivers/s390/cio/qdio_main.c2
-rw-r--r--drivers/s390/crypto/zcrypt_debug.h12
-rw-r--r--drivers/s390/net/claw.h8
-rw-r--r--drivers/s390/net/ctcm_dbug.c2
-rw-r--r--drivers/s390/net/lcs.h8
-rw-r--r--drivers/s390/net/netiucv.c8
-rw-r--r--drivers/s390/net/qeth_core_main.c2
-rw-r--r--drivers/s390/scsi/zfcp_dbf.h4
-rw-r--r--drivers/tty/hvc/hvc_iucv.c3
20 files changed, 71 insertions, 81 deletions
diff --git a/drivers/pci/hotplug/s390_pci_hpc.c b/drivers/pci/hotplug/s390_pci_hpc.c
index 66e505ca24ef..3c7eb5dd91c6 100644
--- a/drivers/pci/hotplug/s390_pci_hpc.c
+++ b/drivers/pci/hotplug/s390_pci_hpc.c
@@ -133,7 +133,6 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
133{ 133{
134 struct slot *slot = hotplug_slot->private; 134 struct slot *slot = hotplug_slot->private;
135 135
136 pr_debug("%s - physical_slot = %s\n", __func__, hotplug_slot_name(hotplug_slot));
137 kfree(slot->hotplug_slot->info); 136 kfree(slot->hotplug_slot->info);
138 kfree(slot->hotplug_slot); 137 kfree(slot->hotplug_slot);
139 kfree(slot); 138 kfree(slot);
@@ -183,10 +182,9 @@ int zpci_init_slot(struct zpci_dev *zdev)
183 snprintf(name, SLOT_NAME_SIZE, "%08x", zdev->fid); 182 snprintf(name, SLOT_NAME_SIZE, "%08x", zdev->fid);
184 rc = pci_hp_register(slot->hotplug_slot, zdev->bus, 183 rc = pci_hp_register(slot->hotplug_slot, zdev->bus,
185 ZPCI_DEVFN, name); 184 ZPCI_DEVFN, name);
186 if (rc) { 185 if (rc)
187 pr_err("pci_hp_register failed with error %d\n", rc);
188 goto error_reg; 186 goto error_reg;
189 } 187
190 list_add(&slot->slot_list, &s390_hotplug_slot_list); 188 list_add(&slot->slot_list, &s390_hotplug_slot_list);
191 return 0; 189 return 0;
192 190
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 451bf99582ff..244f77f844f0 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -698,10 +698,11 @@ static void dasd_profile_start(struct dasd_block *block,
698 } 698 }
699 699
700 spin_lock(&block->profile.lock); 700 spin_lock(&block->profile.lock);
701 if (block->profile.data) 701 if (block->profile.data) {
702 block->profile.data->dasd_io_nr_req[counter]++; 702 block->profile.data->dasd_io_nr_req[counter]++;
703 if (rq_data_dir(req) == READ) 703 if (rq_data_dir(req) == READ)
704 block->profile.data->dasd_read_nr_req[counter]++; 704 block->profile.data->dasd_read_nr_req[counter]++;
705 }
705 spin_unlock(&block->profile.lock); 706 spin_unlock(&block->profile.lock);
706 707
707 /* 708 /*
diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c
index 5d73e6e49af6..548209a9c43c 100644
--- a/drivers/s390/block/scm_blk.c
+++ b/drivers/s390/block/scm_blk.c
@@ -223,8 +223,12 @@ static void scm_blk_request(struct request_queue *rq)
223 int ret; 223 int ret;
224 224
225 while ((req = blk_peek_request(rq))) { 225 while ((req = blk_peek_request(rq))) {
226 if (req->cmd_type != REQ_TYPE_FS) 226 if (req->cmd_type != REQ_TYPE_FS) {
227 blk_start_request(req);
228 blk_dump_rq_flags(req, KMSG_COMPONENT " bad request");
229 blk_end_request_all(req, -EIO);
227 continue; 230 continue;
231 }
228 232
229 if (!scm_permit_request(bdev, req)) { 233 if (!scm_permit_request(bdev, req)) {
230 scm_ensure_queue_restart(bdev); 234 scm_ensure_queue_restart(bdev);
diff --git a/drivers/s390/block/scm_blk.h b/drivers/s390/block/scm_blk.h
index 8b387b32fd62..e59331e6c2e5 100644
--- a/drivers/s390/block/scm_blk.h
+++ b/drivers/s390/block/scm_blk.h
@@ -107,7 +107,7 @@ extern debug_info_t *scm_debug;
107 107
108static inline void SCM_LOG_HEX(int level, void *data, int length) 108static inline void SCM_LOG_HEX(int level, void *data, int length)
109{ 109{
110 if (level > scm_debug->level) 110 if (!debug_level_enabled(scm_debug, level))
111 return; 111 return;
112 while (length > 0) { 112 while (length > 0) {
113 debug_event(scm_debug, level, data, length); 113 debug_event(scm_debug, level, data, length);
diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c
index 4600aa10a1c6..668b32b0dc1d 100644
--- a/drivers/s390/char/monwriter.c
+++ b/drivers/s390/char/monwriter.c
@@ -60,7 +60,7 @@ static int monwrite_diag(struct monwrite_hdr *myhdr, char *buffer, int fcn)
60 struct appldata_product_id id; 60 struct appldata_product_id id;
61 int rc; 61 int rc;
62 62
63 strcpy(id.prod_nr, "LNXAPPL"); 63 strncpy(id.prod_nr, "LNXAPPL", 7);
64 id.prod_fn = myhdr->applid; 64 id.prod_fn = myhdr->applid;
65 id.record_nr = myhdr->record_num; 65 id.record_nr = myhdr->record_num;
66 id.version_nr = myhdr->version; 66 id.version_nr = myhdr->version;
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 24a08e8f19e1..2cdec21e8924 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -615,10 +615,10 @@ raw3270_reset_device_cb(struct raw3270_request *rq, void *data)
615 615
616 if (rp->state != RAW3270_STATE_RESET) 616 if (rp->state != RAW3270_STATE_RESET)
617 return; 617 return;
618 if (rq && rq->rc) { 618 if (rq->rc) {
619 /* Reset command failed. */ 619 /* Reset command failed. */
620 rp->state = RAW3270_STATE_INIT; 620 rp->state = RAW3270_STATE_INIT;
621 } else if (0 && MACHINE_IS_VM) { 621 } else if (MACHINE_IS_VM) {
622 raw3270_size_device_vm(rp); 622 raw3270_size_device_vm(rp);
623 raw3270_size_device_done(rp); 623 raw3270_size_device_done(rp);
624 } else 624 } else
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c
index 794820a123d0..ffb1fcf0bf5b 100644
--- a/drivers/s390/char/zcore.c
+++ b/drivers/s390/char/zcore.c
@@ -151,7 +151,7 @@ static int __init init_cpu_info(enum arch_id arch)
151 151
152 /* get info for boot cpu from lowcore, stored in the HSA */ 152 /* get info for boot cpu from lowcore, stored in the HSA */
153 153
154 sa = kmalloc(sizeof(*sa), GFP_KERNEL); 154 sa = dump_save_area_create(0);
155 if (!sa) 155 if (!sa)
156 return -ENOMEM; 156 return -ENOMEM;
157 if (memcpy_hsa_kernel(sa, sys_info.sa_base, sys_info.sa_size) < 0) { 157 if (memcpy_hsa_kernel(sa, sys_info.sa_base, sys_info.sa_size) < 0) {
@@ -159,7 +159,6 @@ static int __init init_cpu_info(enum arch_id arch)
159 kfree(sa); 159 kfree(sa);
160 return -EIO; 160 return -EIO;
161 } 161 }
162 zfcpdump_save_areas[0] = sa;
163 return 0; 162 return 0;
164} 163}
165 164
@@ -246,24 +245,25 @@ static int copy_lc(void __user *buf, void *sa, int sa_off, int len)
246static int zcore_add_lc(char __user *buf, unsigned long start, size_t count) 245static int zcore_add_lc(char __user *buf, unsigned long start, size_t count)
247{ 246{
248 unsigned long end; 247 unsigned long end;
249 int i = 0; 248 int i;
250 249
251 if (count == 0) 250 if (count == 0)
252 return 0; 251 return 0;
253 252
254 end = start + count; 253 end = start + count;
255 while (zfcpdump_save_areas[i]) { 254 for (i = 0; i < dump_save_areas.count; i++) {
256 unsigned long cp_start, cp_end; /* copy range */ 255 unsigned long cp_start, cp_end; /* copy range */
257 unsigned long sa_start, sa_end; /* save area range */ 256 unsigned long sa_start, sa_end; /* save area range */
258 unsigned long prefix; 257 unsigned long prefix;
259 unsigned long sa_off, len, buf_off; 258 unsigned long sa_off, len, buf_off;
259 struct save_area *save_area = dump_save_areas.areas[i];
260 260
261 prefix = zfcpdump_save_areas[i]->pref_reg; 261 prefix = save_area->pref_reg;
262 sa_start = prefix + sys_info.sa_base; 262 sa_start = prefix + sys_info.sa_base;
263 sa_end = prefix + sys_info.sa_base + sys_info.sa_size; 263 sa_end = prefix + sys_info.sa_base + sys_info.sa_size;
264 264
265 if ((end < sa_start) || (start > sa_end)) 265 if ((end < sa_start) || (start > sa_end))
266 goto next; 266 continue;
267 cp_start = max(start, sa_start); 267 cp_start = max(start, sa_start);
268 cp_end = min(end, sa_end); 268 cp_end = min(end, sa_end);
269 269
@@ -272,10 +272,8 @@ static int zcore_add_lc(char __user *buf, unsigned long start, size_t count)
272 len = cp_end - cp_start; 272 len = cp_end - cp_start;
273 273
274 TRACE("copy_lc for: %lx\n", start); 274 TRACE("copy_lc for: %lx\n", start);
275 if (copy_lc(buf + buf_off, zfcpdump_save_areas[i], sa_off, len)) 275 if (copy_lc(buf + buf_off, save_area, sa_off, len))
276 return -EFAULT; 276 return -EFAULT;
277next:
278 i++;
279 } 277 }
280 return 0; 278 return 0;
281} 279}
@@ -637,8 +635,8 @@ static void __init zcore_header_init(int arch, struct zcore_header *hdr,
637 hdr->num_pages = mem_size / PAGE_SIZE; 635 hdr->num_pages = mem_size / PAGE_SIZE;
638 hdr->tod = get_tod_clock(); 636 hdr->tod = get_tod_clock();
639 get_cpu_id(&hdr->cpu_id); 637 get_cpu_id(&hdr->cpu_id);
640 for (i = 0; zfcpdump_save_areas[i]; i++) { 638 for (i = 0; i < dump_save_areas.count; i++) {
641 prefix = zfcpdump_save_areas[i]->pref_reg; 639 prefix = dump_save_areas.areas[i]->pref_reg;
642 hdr->real_cpu_cnt++; 640 hdr->real_cpu_cnt++;
643 if (!prefix) 641 if (!prefix)
644 continue; 642 continue;
diff --git a/drivers/s390/cio/airq.c b/drivers/s390/cio/airq.c
index d028fd800c9c..f055df0b167f 100644
--- a/drivers/s390/cio/airq.c
+++ b/drivers/s390/cio/airq.c
@@ -194,15 +194,14 @@ EXPORT_SYMBOL(airq_iv_release);
194 */ 194 */
195unsigned long airq_iv_alloc_bit(struct airq_iv *iv) 195unsigned long airq_iv_alloc_bit(struct airq_iv *iv)
196{ 196{
197 const unsigned long be_to_le = BITS_PER_LONG - 1;
198 unsigned long bit; 197 unsigned long bit;
199 198
200 if (!iv->avail) 199 if (!iv->avail)
201 return -1UL; 200 return -1UL;
202 spin_lock(&iv->lock); 201 spin_lock(&iv->lock);
203 bit = find_first_bit_left(iv->avail, iv->bits); 202 bit = find_first_bit_inv(iv->avail, iv->bits);
204 if (bit < iv->bits) { 203 if (bit < iv->bits) {
205 clear_bit(bit ^ be_to_le, iv->avail); 204 clear_bit_inv(bit, iv->avail);
206 if (bit >= iv->end) 205 if (bit >= iv->end)
207 iv->end = bit + 1; 206 iv->end = bit + 1;
208 } else 207 } else
@@ -220,19 +219,17 @@ EXPORT_SYMBOL(airq_iv_alloc_bit);
220 */ 219 */
221void airq_iv_free_bit(struct airq_iv *iv, unsigned long bit) 220void airq_iv_free_bit(struct airq_iv *iv, unsigned long bit)
222{ 221{
223 const unsigned long be_to_le = BITS_PER_LONG - 1;
224
225 if (!iv->avail) 222 if (!iv->avail)
226 return; 223 return;
227 spin_lock(&iv->lock); 224 spin_lock(&iv->lock);
228 /* Clear (possibly left over) interrupt bit */ 225 /* Clear (possibly left over) interrupt bit */
229 clear_bit(bit ^ be_to_le, iv->vector); 226 clear_bit_inv(bit, iv->vector);
230 /* Make the bit position available again */ 227 /* Make the bit position available again */
231 set_bit(bit ^ be_to_le, iv->avail); 228 set_bit_inv(bit, iv->avail);
232 if (bit == iv->end - 1) { 229 if (bit == iv->end - 1) {
233 /* Find new end of bit-field */ 230 /* Find new end of bit-field */
234 while (--iv->end > 0) 231 while (--iv->end > 0)
235 if (!test_bit((iv->end - 1) ^ be_to_le, iv->avail)) 232 if (!test_bit_inv(iv->end - 1, iv->avail))
236 break; 233 break;
237 } 234 }
238 spin_unlock(&iv->lock); 235 spin_unlock(&iv->lock);
@@ -251,15 +248,13 @@ EXPORT_SYMBOL(airq_iv_free_bit);
251unsigned long airq_iv_scan(struct airq_iv *iv, unsigned long start, 248unsigned long airq_iv_scan(struct airq_iv *iv, unsigned long start,
252 unsigned long end) 249 unsigned long end)
253{ 250{
254 const unsigned long be_to_le = BITS_PER_LONG - 1;
255 unsigned long bit; 251 unsigned long bit;
256 252
257 /* Find non-zero bit starting from 'ivs->next'. */ 253 /* Find non-zero bit starting from 'ivs->next'. */
258 bit = find_next_bit_left(iv->vector, end, start); 254 bit = find_next_bit_inv(iv->vector, end, start);
259 if (bit >= end) 255 if (bit >= end)
260 return -1UL; 256 return -1UL;
261 /* Clear interrupt bit (find left uses big-endian bit numbers) */ 257 clear_bit_inv(bit, iv->vector);
262 clear_bit(bit ^ be_to_le, iv->vector);
263 return bit; 258 return bit;
264} 259}
265EXPORT_SYMBOL(airq_iv_scan); 260EXPORT_SYMBOL(airq_iv_scan);
diff --git a/drivers/s390/cio/eadm_sch.c b/drivers/s390/cio/eadm_sch.c
index d9eddcba7e88..aca7bfc113aa 100644
--- a/drivers/s390/cio/eadm_sch.c
+++ b/drivers/s390/cio/eadm_sch.c
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <linux/kernel_stat.h> 8#include <linux/kernel_stat.h>
9#include <linux/completion.h>
9#include <linux/workqueue.h> 10#include <linux/workqueue.h>
10#include <linux/spinlock.h> 11#include <linux/spinlock.h>
11#include <linux/device.h> 12#include <linux/device.h>
@@ -42,7 +43,7 @@ static debug_info_t *eadm_debug;
42 43
43static void EADM_LOG_HEX(int level, void *data, int length) 44static void EADM_LOG_HEX(int level, void *data, int length)
44{ 45{
45 if (level > eadm_debug->level) 46 if (!debug_level_enabled(eadm_debug, level))
46 return; 47 return;
47 while (length > 0) { 48 while (length > 0) {
48 debug_event(eadm_debug, level, data, length); 49 debug_event(eadm_debug, level, data, length);
@@ -159,6 +160,9 @@ static void eadm_subchannel_irq(struct subchannel *sch)
159 } 160 }
160 scm_irq_handler((struct aob *)(unsigned long)scsw->aob, error); 161 scm_irq_handler((struct aob *)(unsigned long)scsw->aob, error);
161 private->state = EADM_IDLE; 162 private->state = EADM_IDLE;
163
164 if (private->completion)
165 complete(private->completion);
162} 166}
163 167
164static struct subchannel *eadm_get_idle_sch(void) 168static struct subchannel *eadm_get_idle_sch(void)
@@ -255,13 +259,32 @@ out:
255 259
256static void eadm_quiesce(struct subchannel *sch) 260static void eadm_quiesce(struct subchannel *sch)
257{ 261{
262 struct eadm_private *private = get_eadm_private(sch);
263 DECLARE_COMPLETION_ONSTACK(completion);
258 int ret; 264 int ret;
259 265
266 spin_lock_irq(sch->lock);
267 if (private->state != EADM_BUSY)
268 goto disable;
269
270 if (eadm_subchannel_clear(sch))
271 goto disable;
272
273 private->completion = &completion;
274 spin_unlock_irq(sch->lock);
275
276 wait_for_completion_io(&completion);
277
278 spin_lock_irq(sch->lock);
279 private->completion = NULL;
280
281disable:
282 eadm_subchannel_set_timeout(sch, 0);
260 do { 283 do {
261 spin_lock_irq(sch->lock);
262 ret = cio_disable_subchannel(sch); 284 ret = cio_disable_subchannel(sch);
263 spin_unlock_irq(sch->lock);
264 } while (ret == -EBUSY); 285 } while (ret == -EBUSY);
286
287 spin_unlock_irq(sch->lock);
265} 288}
266 289
267static int eadm_subchannel_remove(struct subchannel *sch) 290static int eadm_subchannel_remove(struct subchannel *sch)
diff --git a/drivers/s390/cio/eadm_sch.h b/drivers/s390/cio/eadm_sch.h
index 2779be093982..9664e4653f98 100644
--- a/drivers/s390/cio/eadm_sch.h
+++ b/drivers/s390/cio/eadm_sch.h
@@ -1,6 +1,7 @@
1#ifndef EADM_SCH_H 1#ifndef EADM_SCH_H
2#define EADM_SCH_H 2#define EADM_SCH_H
3 3
4#include <linux/completion.h>
4#include <linux/device.h> 5#include <linux/device.h>
5#include <linux/timer.h> 6#include <linux/timer.h>
6#include <linux/list.h> 7#include <linux/list.h>
@@ -9,9 +10,10 @@
9struct eadm_private { 10struct eadm_private {
10 union orb orb; 11 union orb orb;
11 enum {EADM_IDLE, EADM_BUSY, EADM_NOT_OPER} state; 12 enum {EADM_IDLE, EADM_BUSY, EADM_NOT_OPER} state;
13 struct completion *completion;
14 struct subchannel *sch;
12 struct timer_list timer; 15 struct timer_list timer;
13 struct list_head head; 16 struct list_head head;
14 struct subchannel *sch;
15} __aligned(8); 17} __aligned(8);
16 18
17#define get_eadm_private(n) ((struct eadm_private *)dev_get_drvdata(&n->dev)) 19#define get_eadm_private(n) ((struct eadm_private *)dev_get_drvdata(&n->dev))
diff --git a/drivers/s390/cio/qdio_debug.h b/drivers/s390/cio/qdio_debug.h
index 647b422bb22a..dfac9bfefea3 100644
--- a/drivers/s390/cio/qdio_debug.h
+++ b/drivers/s390/cio/qdio_debug.h
@@ -16,12 +16,6 @@
16extern debug_info_t *qdio_dbf_setup; 16extern debug_info_t *qdio_dbf_setup;
17extern debug_info_t *qdio_dbf_error; 17extern debug_info_t *qdio_dbf_error;
18 18
19/* sort out low debug levels early to avoid wasted sprints */
20static inline int qdio_dbf_passes(debug_info_t *dbf_grp, int level)
21{
22 return (level <= dbf_grp->level);
23}
24
25#define DBF_ERR 3 /* error conditions */ 19#define DBF_ERR 3 /* error conditions */
26#define DBF_WARN 4 /* warning conditions */ 20#define DBF_WARN 4 /* warning conditions */
27#define DBF_INFO 6 /* informational */ 21#define DBF_INFO 6 /* informational */
@@ -65,7 +59,7 @@ static inline void DBF_ERROR_HEX(void *addr, int len)
65#define DBF_DEV_EVENT(level, device, text...) \ 59#define DBF_DEV_EVENT(level, device, text...) \
66 do { \ 60 do { \
67 char debug_buffer[QDIO_DBF_LEN]; \ 61 char debug_buffer[QDIO_DBF_LEN]; \
68 if (qdio_dbf_passes(device->debug_area, level)) { \ 62 if (debug_level_enabled(device->debug_area, level)) { \
69 snprintf(debug_buffer, QDIO_DBF_LEN, text); \ 63 snprintf(debug_buffer, QDIO_DBF_LEN, text); \
70 debug_text_event(device->debug_area, level, debug_buffer); \ 64 debug_text_event(device->debug_area, level, debug_buffer); \
71 } \ 65 } \
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index bbd3e511c771..3e602e8affa7 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -528,7 +528,7 @@ static int get_inbound_buffer_frontier(struct qdio_q *q)
528 case SLSB_P_INPUT_PRIMED: 528 case SLSB_P_INPUT_PRIMED:
529 inbound_primed(q, count); 529 inbound_primed(q, count);
530 q->first_to_check = add_buf(q->first_to_check, count); 530 q->first_to_check = add_buf(q->first_to_check, count);
531 if (atomic_sub(count, &q->nr_buf_used) == 0) 531 if (atomic_sub_return(count, &q->nr_buf_used) == 0)
532 qperf_inc(q, inbound_queue_full); 532 qperf_inc(q, inbound_queue_full);
533 if (q->irq_ptr->perf_stat_enabled) 533 if (q->irq_ptr->perf_stat_enabled)
534 account_sbals(q, count); 534 account_sbals(q, count);
diff --git a/drivers/s390/crypto/zcrypt_debug.h b/drivers/s390/crypto/zcrypt_debug.h
index 841ea72e4a4e..28d9349de1ad 100644
--- a/drivers/s390/crypto/zcrypt_debug.h
+++ b/drivers/s390/crypto/zcrypt_debug.h
@@ -11,12 +11,6 @@
11/* that gives us 15 characters in the text event views */ 11/* that gives us 15 characters in the text event views */
12#define ZCRYPT_DBF_LEN 16 12#define ZCRYPT_DBF_LEN 16
13 13
14/* sort out low debug levels early to avoid wasted sprints */
15static inline int zcrypt_dbf_passes(debug_info_t *dbf_grp, int level)
16{
17 return (level <= dbf_grp->level);
18}
19
20#define DBF_ERR 3 /* error conditions */ 14#define DBF_ERR 3 /* error conditions */
21#define DBF_WARN 4 /* warning conditions */ 15#define DBF_WARN 4 /* warning conditions */
22#define DBF_INFO 6 /* informational */ 16#define DBF_INFO 6 /* informational */
@@ -25,7 +19,7 @@ static inline int zcrypt_dbf_passes(debug_info_t *dbf_grp, int level)
25 19
26#define ZCRYPT_DBF_COMMON(level, text...) \ 20#define ZCRYPT_DBF_COMMON(level, text...) \
27 do { \ 21 do { \
28 if (zcrypt_dbf_passes(zcrypt_dbf_common, level)) { \ 22 if (debug_level_enabled(zcrypt_dbf_common, level)) { \
29 char debug_buffer[ZCRYPT_DBF_LEN]; \ 23 char debug_buffer[ZCRYPT_DBF_LEN]; \
30 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \ 24 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
31 debug_text_event(zcrypt_dbf_common, level, \ 25 debug_text_event(zcrypt_dbf_common, level, \
@@ -35,7 +29,7 @@ static inline int zcrypt_dbf_passes(debug_info_t *dbf_grp, int level)
35 29
36#define ZCRYPT_DBF_DEVICES(level, text...) \ 30#define ZCRYPT_DBF_DEVICES(level, text...) \
37 do { \ 31 do { \
38 if (zcrypt_dbf_passes(zcrypt_dbf_devices, level)) { \ 32 if (debug_level_enabled(zcrypt_dbf_devices, level)) { \
39 char debug_buffer[ZCRYPT_DBF_LEN]; \ 33 char debug_buffer[ZCRYPT_DBF_LEN]; \
40 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \ 34 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
41 debug_text_event(zcrypt_dbf_devices, level, \ 35 debug_text_event(zcrypt_dbf_devices, level, \
@@ -45,7 +39,7 @@ static inline int zcrypt_dbf_passes(debug_info_t *dbf_grp, int level)
45 39
46#define ZCRYPT_DBF_DEV(level, device, text...) \ 40#define ZCRYPT_DBF_DEV(level, device, text...) \
47 do { \ 41 do { \
48 if (zcrypt_dbf_passes(device->dbf_area, level)) { \ 42 if (debug_level_enabled(device->dbf_area, level)) { \
49 char debug_buffer[ZCRYPT_DBF_LEN]; \ 43 char debug_buffer[ZCRYPT_DBF_LEN]; \
50 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \ 44 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
51 debug_text_event(device->dbf_area, level, \ 45 debug_text_event(device->dbf_area, level, \
diff --git a/drivers/s390/net/claw.h b/drivers/s390/net/claw.h
index 1bc5904df19f..3339b9b607b3 100644
--- a/drivers/s390/net/claw.h
+++ b/drivers/s390/net/claw.h
@@ -114,15 +114,9 @@ do { \
114 debug_event(claw_dbf_##name,level,(void*)(addr),len); \ 114 debug_event(claw_dbf_##name,level,(void*)(addr),len); \
115} while (0) 115} while (0)
116 116
117/* Allow to sort out low debug levels early to avoid wasted sprints */
118static inline int claw_dbf_passes(debug_info_t *dbf_grp, int level)
119{
120 return (level <= dbf_grp->level);
121}
122
123#define CLAW_DBF_TEXT_(level,name,text...) \ 117#define CLAW_DBF_TEXT_(level,name,text...) \
124 do { \ 118 do { \
125 if (claw_dbf_passes(claw_dbf_##name, level)) { \ 119 if (debug_level_enabled(claw_dbf_##name, level)) { \
126 sprintf(debug_buffer, text); \ 120 sprintf(debug_buffer, text); \
127 debug_text_event(claw_dbf_##name, level, \ 121 debug_text_event(claw_dbf_##name, level, \
128 debug_buffer); \ 122 debug_buffer); \
diff --git a/drivers/s390/net/ctcm_dbug.c b/drivers/s390/net/ctcm_dbug.c
index 6514e1cb3f1c..8363f1c966ef 100644
--- a/drivers/s390/net/ctcm_dbug.c
+++ b/drivers/s390/net/ctcm_dbug.c
@@ -66,7 +66,7 @@ void ctcm_dbf_longtext(enum ctcm_dbf_names dbf_nix, int level, char *fmt, ...)
66 char dbf_txt_buf[64]; 66 char dbf_txt_buf[64];
67 va_list args; 67 va_list args;
68 68
69 if (level > (ctcm_dbf[dbf_nix].id)->level) 69 if (!debug_level_enabled(ctcm_dbf[dbf_nix].id, level))
70 return; 70 return;
71 va_start(args, fmt); 71 va_start(args, fmt);
72 vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args); 72 vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args);
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index 8c03392ac833..150fcb4cebc3 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -16,15 +16,9 @@ do { \
16 debug_event(lcs_dbf_##name,level,(void*)(addr),len); \ 16 debug_event(lcs_dbf_##name,level,(void*)(addr),len); \
17} while (0) 17} while (0)
18 18
19/* Allow to sort out low debug levels early to avoid wasted sprints */
20static inline int lcs_dbf_passes(debug_info_t *dbf_grp, int level)
21{
22 return (level <= dbf_grp->level);
23}
24
25#define LCS_DBF_TEXT_(level,name,text...) \ 19#define LCS_DBF_TEXT_(level,name,text...) \
26 do { \ 20 do { \
27 if (lcs_dbf_passes(lcs_dbf_##name, level)) { \ 21 if (debug_level_enabled(lcs_dbf_##name, level)) { \
28 sprintf(debug_buffer, text); \ 22 sprintf(debug_buffer, text); \
29 debug_text_event(lcs_dbf_##name, level, debug_buffer); \ 23 debug_text_event(lcs_dbf_##name, level, debug_buffer); \
30 } \ 24 } \
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 279ad504ec3c..9b333fcf1a4c 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -105,15 +105,9 @@ MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver");
105 105
106DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf); 106DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf);
107 107
108/* Allow to sort out low debug levels early to avoid wasted sprints */
109static inline int iucv_dbf_passes(debug_info_t *dbf_grp, int level)
110{
111 return (level <= dbf_grp->level);
112}
113
114#define IUCV_DBF_TEXT_(name, level, text...) \ 108#define IUCV_DBF_TEXT_(name, level, text...) \
115 do { \ 109 do { \
116 if (iucv_dbf_passes(iucv_dbf_##name, level)) { \ 110 if (debug_level_enabled(iucv_dbf_##name, level)) { \
117 char* __buf = get_cpu_var(iucv_dbf_txt_buf); \ 111 char* __buf = get_cpu_var(iucv_dbf_txt_buf); \
118 sprintf(__buf, text); \ 112 sprintf(__buf, text); \
119 debug_text_event(iucv_dbf_##name, level, __buf); \ 113 debug_text_event(iucv_dbf_##name, level, __buf); \
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 0a328d0d11be..d7b66a28fe75 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -5096,7 +5096,7 @@ void qeth_dbf_longtext(debug_info_t *id, int level, char *fmt, ...)
5096 char dbf_txt_buf[32]; 5096 char dbf_txt_buf[32];
5097 va_list args; 5097 va_list args;
5098 5098
5099 if (level > id->level) 5099 if (!debug_level_enabled(id, level))
5100 return; 5100 return;
5101 va_start(args, fmt); 5101 va_start(args, fmt);
5102 vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args); 5102 vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args);
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h
index 3ac7a4b30dd9..0be3d48681ae 100644
--- a/drivers/s390/scsi/zfcp_dbf.h
+++ b/drivers/s390/scsi/zfcp_dbf.h
@@ -278,7 +278,7 @@ struct zfcp_dbf {
278static inline 278static inline
279void zfcp_dbf_hba_fsf_resp(char *tag, int level, struct zfcp_fsf_req *req) 279void zfcp_dbf_hba_fsf_resp(char *tag, int level, struct zfcp_fsf_req *req)
280{ 280{
281 if (level <= req->adapter->dbf->hba->level) 281 if (debug_level_enabled(req->adapter->dbf->hba, level))
282 zfcp_dbf_hba_fsf_res(tag, req); 282 zfcp_dbf_hba_fsf_res(tag, req);
283} 283}
284 284
@@ -317,7 +317,7 @@ void _zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *scmd,
317 struct zfcp_adapter *adapter = (struct zfcp_adapter *) 317 struct zfcp_adapter *adapter = (struct zfcp_adapter *)
318 scmd->device->host->hostdata[0]; 318 scmd->device->host->hostdata[0];
319 319
320 if (level <= adapter->dbf->scsi->level) 320 if (debug_level_enabled(adapter->dbf->scsi, level))
321 zfcp_dbf_scsi(tag, scmd, req); 321 zfcp_dbf_scsi(tag, scmd, req);
322} 322}
323 323
diff --git a/drivers/tty/hvc/hvc_iucv.c b/drivers/tty/hvc/hvc_iucv.c
index fd17a9b804b8..db19a38c8c69 100644
--- a/drivers/tty/hvc/hvc_iucv.c
+++ b/drivers/tty/hvc/hvc_iucv.c
@@ -1354,8 +1354,7 @@ out_error_memory:
1354 mempool_destroy(hvc_iucv_mempool); 1354 mempool_destroy(hvc_iucv_mempool);
1355 kmem_cache_destroy(hvc_iucv_buffer_cache); 1355 kmem_cache_destroy(hvc_iucv_buffer_cache);
1356out_error: 1356out_error:
1357 if (hvc_iucv_filter) 1357 kfree(hvc_iucv_filter);
1358 kfree(hvc_iucv_filter);
1359 hvc_iucv_devices = 0; /* ensure that we do not provide any device */ 1358 hvc_iucv_devices = 0; /* ensure that we do not provide any device */
1360 return rc; 1359 return rc;
1361} 1360}