diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/block/dasd.c | 11 | ||||
-rw-r--r-- | drivers/s390/block/dasd_eckd.c | 98 | ||||
-rw-r--r-- | drivers/s390/block/scm_blk.c | 6 | ||||
-rw-r--r-- | drivers/s390/block/scm_blk.h | 2 | ||||
-rw-r--r-- | drivers/s390/char/monwriter.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/raw3270.c | 4 | ||||
-rw-r--r-- | drivers/s390/char/sclp.c | 4 | ||||
-rw-r--r-- | drivers/s390/char/sclp_cmd.c | 8 | ||||
-rw-r--r-- | drivers/s390/char/tty3270.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/vmlogrdr.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/zcore.c | 20 | ||||
-rw-r--r-- | drivers/s390/cio/airq.c | 19 | ||||
-rw-r--r-- | drivers/s390/cio/cio.c | 4 | ||||
-rw-r--r-- | drivers/s390/cio/eadm_sch.c | 29 | ||||
-rw-r--r-- | drivers/s390/cio/eadm_sch.h | 4 | ||||
-rw-r--r-- | drivers/s390/cio/qdio_debug.h | 8 | ||||
-rw-r--r-- | drivers/s390/cio/qdio_main.c | 12 | ||||
-rw-r--r-- | drivers/s390/crypto/zcrypt_debug.h | 12 | ||||
-rw-r--r-- | drivers/s390/net/claw.h | 8 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_dbug.c | 2 | ||||
-rw-r--r-- | drivers/s390/net/lcs.h | 8 | ||||
-rw-r--r-- | drivers/s390/net/netiucv.c | 8 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 8 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.h | 4 |
24 files changed, 164 insertions, 121 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 451bf99582ff..f302efa937ef 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 | /* |
@@ -2978,12 +2979,12 @@ static int dasd_alloc_queue(struct dasd_block *block) | |||
2978 | 2979 | ||
2979 | elevator_exit(block->request_queue->elevator); | 2980 | elevator_exit(block->request_queue->elevator); |
2980 | block->request_queue->elevator = NULL; | 2981 | block->request_queue->elevator = NULL; |
2982 | mutex_lock(&block->request_queue->sysfs_lock); | ||
2981 | rc = elevator_init(block->request_queue, "deadline"); | 2983 | rc = elevator_init(block->request_queue, "deadline"); |
2982 | if (rc) { | 2984 | if (rc) |
2983 | blk_cleanup_queue(block->request_queue); | 2985 | blk_cleanup_queue(block->request_queue); |
2984 | return rc; | 2986 | mutex_unlock(&block->request_queue->sysfs_lock); |
2985 | } | 2987 | return rc; |
2986 | return 0; | ||
2987 | } | 2988 | } |
2988 | 2989 | ||
2989 | /* | 2990 | /* |
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 5adb2042e824..cee7e2708a1f 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
@@ -2077,6 +2077,7 @@ dasd_eckd_build_format(struct dasd_device *base, | |||
2077 | int intensity = 0; | 2077 | int intensity = 0; |
2078 | int r0_perm; | 2078 | int r0_perm; |
2079 | int nr_tracks; | 2079 | int nr_tracks; |
2080 | int use_prefix; | ||
2080 | 2081 | ||
2081 | startdev = dasd_alias_get_start_dev(base); | 2082 | startdev = dasd_alias_get_start_dev(base); |
2082 | if (!startdev) | 2083 | if (!startdev) |
@@ -2106,28 +2107,46 @@ dasd_eckd_build_format(struct dasd_device *base, | |||
2106 | intensity = fdata->intensity; | 2107 | intensity = fdata->intensity; |
2107 | } | 2108 | } |
2108 | 2109 | ||
2110 | use_prefix = base_priv->features.feature[8] & 0x01; | ||
2111 | |||
2109 | switch (intensity) { | 2112 | switch (intensity) { |
2110 | case 0x00: /* Normal format */ | 2113 | case 0x00: /* Normal format */ |
2111 | case 0x08: /* Normal format, use cdl. */ | 2114 | case 0x08: /* Normal format, use cdl. */ |
2112 | cplength = 2 + (rpt*nr_tracks); | 2115 | cplength = 2 + (rpt*nr_tracks); |
2113 | datasize = sizeof(struct PFX_eckd_data) + | 2116 | if (use_prefix) |
2114 | sizeof(struct LO_eckd_data) + | 2117 | datasize = sizeof(struct PFX_eckd_data) + |
2115 | rpt * nr_tracks * sizeof(struct eckd_count); | 2118 | sizeof(struct LO_eckd_data) + |
2119 | rpt * nr_tracks * sizeof(struct eckd_count); | ||
2120 | else | ||
2121 | datasize = sizeof(struct DE_eckd_data) + | ||
2122 | sizeof(struct LO_eckd_data) + | ||
2123 | rpt * nr_tracks * sizeof(struct eckd_count); | ||
2116 | break; | 2124 | break; |
2117 | case 0x01: /* Write record zero and format track. */ | 2125 | case 0x01: /* Write record zero and format track. */ |
2118 | case 0x09: /* Write record zero and format track, use cdl. */ | 2126 | case 0x09: /* Write record zero and format track, use cdl. */ |
2119 | cplength = 2 + rpt * nr_tracks; | 2127 | cplength = 2 + rpt * nr_tracks; |
2120 | datasize = sizeof(struct PFX_eckd_data) + | 2128 | if (use_prefix) |
2121 | sizeof(struct LO_eckd_data) + | 2129 | datasize = sizeof(struct PFX_eckd_data) + |
2122 | sizeof(struct eckd_count) + | 2130 | sizeof(struct LO_eckd_data) + |
2123 | rpt * nr_tracks * sizeof(struct eckd_count); | 2131 | sizeof(struct eckd_count) + |
2132 | rpt * nr_tracks * sizeof(struct eckd_count); | ||
2133 | else | ||
2134 | datasize = sizeof(struct DE_eckd_data) + | ||
2135 | sizeof(struct LO_eckd_data) + | ||
2136 | sizeof(struct eckd_count) + | ||
2137 | rpt * nr_tracks * sizeof(struct eckd_count); | ||
2124 | break; | 2138 | break; |
2125 | case 0x04: /* Invalidate track. */ | 2139 | case 0x04: /* Invalidate track. */ |
2126 | case 0x0c: /* Invalidate track, use cdl. */ | 2140 | case 0x0c: /* Invalidate track, use cdl. */ |
2127 | cplength = 3; | 2141 | cplength = 3; |
2128 | datasize = sizeof(struct PFX_eckd_data) + | 2142 | if (use_prefix) |
2129 | sizeof(struct LO_eckd_data) + | 2143 | datasize = sizeof(struct PFX_eckd_data) + |
2130 | sizeof(struct eckd_count); | 2144 | sizeof(struct LO_eckd_data) + |
2145 | sizeof(struct eckd_count); | ||
2146 | else | ||
2147 | datasize = sizeof(struct DE_eckd_data) + | ||
2148 | sizeof(struct LO_eckd_data) + | ||
2149 | sizeof(struct eckd_count); | ||
2131 | break; | 2150 | break; |
2132 | default: | 2151 | default: |
2133 | dev_warn(&startdev->cdev->dev, | 2152 | dev_warn(&startdev->cdev->dev, |
@@ -2147,14 +2166,25 @@ dasd_eckd_build_format(struct dasd_device *base, | |||
2147 | 2166 | ||
2148 | switch (intensity & ~0x08) { | 2167 | switch (intensity & ~0x08) { |
2149 | case 0x00: /* Normal format. */ | 2168 | case 0x00: /* Normal format. */ |
2150 | prefix(ccw++, (struct PFX_eckd_data *) data, | 2169 | if (use_prefix) { |
2151 | fdata->start_unit, fdata->stop_unit, | 2170 | prefix(ccw++, (struct PFX_eckd_data *) data, |
2152 | DASD_ECKD_CCW_WRITE_CKD, base, startdev); | 2171 | fdata->start_unit, fdata->stop_unit, |
2153 | /* grant subsystem permission to format R0 */ | 2172 | DASD_ECKD_CCW_WRITE_CKD, base, startdev); |
2154 | if (r0_perm) | 2173 | /* grant subsystem permission to format R0 */ |
2155 | ((struct PFX_eckd_data *)data) | 2174 | if (r0_perm) |
2156 | ->define_extent.ga_extended |= 0x04; | 2175 | ((struct PFX_eckd_data *)data) |
2157 | data += sizeof(struct PFX_eckd_data); | 2176 | ->define_extent.ga_extended |= 0x04; |
2177 | data += sizeof(struct PFX_eckd_data); | ||
2178 | } else { | ||
2179 | define_extent(ccw++, (struct DE_eckd_data *) data, | ||
2180 | fdata->start_unit, fdata->stop_unit, | ||
2181 | DASD_ECKD_CCW_WRITE_CKD, startdev); | ||
2182 | /* grant subsystem permission to format R0 */ | ||
2183 | if (r0_perm) | ||
2184 | ((struct DE_eckd_data *) data) | ||
2185 | ->ga_extended |= 0x04; | ||
2186 | data += sizeof(struct DE_eckd_data); | ||
2187 | } | ||
2158 | ccw[-1].flags |= CCW_FLAG_CC; | 2188 | ccw[-1].flags |= CCW_FLAG_CC; |
2159 | locate_record(ccw++, (struct LO_eckd_data *) data, | 2189 | locate_record(ccw++, (struct LO_eckd_data *) data, |
2160 | fdata->start_unit, 0, rpt*nr_tracks, | 2190 | fdata->start_unit, 0, rpt*nr_tracks, |
@@ -2163,11 +2193,18 @@ dasd_eckd_build_format(struct dasd_device *base, | |||
2163 | data += sizeof(struct LO_eckd_data); | 2193 | data += sizeof(struct LO_eckd_data); |
2164 | break; | 2194 | break; |
2165 | case 0x01: /* Write record zero + format track. */ | 2195 | case 0x01: /* Write record zero + format track. */ |
2166 | prefix(ccw++, (struct PFX_eckd_data *) data, | 2196 | if (use_prefix) { |
2167 | fdata->start_unit, fdata->stop_unit, | 2197 | prefix(ccw++, (struct PFX_eckd_data *) data, |
2168 | DASD_ECKD_CCW_WRITE_RECORD_ZERO, | 2198 | fdata->start_unit, fdata->stop_unit, |
2169 | base, startdev); | 2199 | DASD_ECKD_CCW_WRITE_RECORD_ZERO, |
2170 | data += sizeof(struct PFX_eckd_data); | 2200 | base, startdev); |
2201 | data += sizeof(struct PFX_eckd_data); | ||
2202 | } else { | ||
2203 | define_extent(ccw++, (struct DE_eckd_data *) data, | ||
2204 | fdata->start_unit, fdata->stop_unit, | ||
2205 | DASD_ECKD_CCW_WRITE_RECORD_ZERO, startdev); | ||
2206 | data += sizeof(struct DE_eckd_data); | ||
2207 | } | ||
2171 | ccw[-1].flags |= CCW_FLAG_CC; | 2208 | ccw[-1].flags |= CCW_FLAG_CC; |
2172 | locate_record(ccw++, (struct LO_eckd_data *) data, | 2209 | locate_record(ccw++, (struct LO_eckd_data *) data, |
2173 | fdata->start_unit, 0, rpt * nr_tracks + 1, | 2210 | fdata->start_unit, 0, rpt * nr_tracks + 1, |
@@ -2176,10 +2213,17 @@ dasd_eckd_build_format(struct dasd_device *base, | |||
2176 | data += sizeof(struct LO_eckd_data); | 2213 | data += sizeof(struct LO_eckd_data); |
2177 | break; | 2214 | break; |
2178 | case 0x04: /* Invalidate track. */ | 2215 | case 0x04: /* Invalidate track. */ |
2179 | prefix(ccw++, (struct PFX_eckd_data *) data, | 2216 | if (use_prefix) { |
2180 | fdata->start_unit, fdata->stop_unit, | 2217 | prefix(ccw++, (struct PFX_eckd_data *) data, |
2181 | DASD_ECKD_CCW_WRITE_CKD, base, startdev); | 2218 | fdata->start_unit, fdata->stop_unit, |
2182 | data += sizeof(struct PFX_eckd_data); | 2219 | DASD_ECKD_CCW_WRITE_CKD, base, startdev); |
2220 | data += sizeof(struct PFX_eckd_data); | ||
2221 | } else { | ||
2222 | define_extent(ccw++, (struct DE_eckd_data *) data, | ||
2223 | fdata->start_unit, fdata->stop_unit, | ||
2224 | DASD_ECKD_CCW_WRITE_CKD, startdev); | ||
2225 | data += sizeof(struct DE_eckd_data); | ||
2226 | } | ||
2183 | ccw[-1].flags |= CCW_FLAG_CC; | 2227 | ccw[-1].flags |= CCW_FLAG_CC; |
2184 | locate_record(ccw++, (struct LO_eckd_data *) data, | 2228 | locate_record(ccw++, (struct LO_eckd_data *) data, |
2185 | fdata->start_unit, 0, 1, | 2229 | fdata->start_unit, 0, 1, |
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 | ||
108 | static inline void SCM_LOG_HEX(int level, void *data, int length) | 108 | static 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/sclp.c b/drivers/s390/char/sclp.c index a3aa374799dc..1fe264379e0d 100644 --- a/drivers/s390/char/sclp.c +++ b/drivers/s390/char/sclp.c | |||
@@ -486,7 +486,7 @@ sclp_sync_wait(void) | |||
486 | timeout = 0; | 486 | timeout = 0; |
487 | if (timer_pending(&sclp_request_timer)) { | 487 | if (timer_pending(&sclp_request_timer)) { |
488 | /* Get timeout TOD value */ | 488 | /* Get timeout TOD value */ |
489 | timeout = get_tod_clock() + | 489 | timeout = get_tod_clock_fast() + |
490 | sclp_tod_from_jiffies(sclp_request_timer.expires - | 490 | sclp_tod_from_jiffies(sclp_request_timer.expires - |
491 | jiffies); | 491 | jiffies); |
492 | } | 492 | } |
@@ -508,7 +508,7 @@ sclp_sync_wait(void) | |||
508 | while (sclp_running_state != sclp_running_state_idle) { | 508 | while (sclp_running_state != sclp_running_state_idle) { |
509 | /* Check for expired request timer */ | 509 | /* Check for expired request timer */ |
510 | if (timer_pending(&sclp_request_timer) && | 510 | if (timer_pending(&sclp_request_timer) && |
511 | get_tod_clock() > timeout && | 511 | get_tod_clock_fast() > timeout && |
512 | del_timer(&sclp_request_timer)) | 512 | del_timer(&sclp_request_timer)) |
513 | sclp_request_timer.function(sclp_request_timer.data); | 513 | sclp_request_timer.function(sclp_request_timer.data); |
514 | cpu_relax(); | 514 | cpu_relax(); |
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c index 8cd34bf644b3..77df9cb00688 100644 --- a/drivers/s390/char/sclp_cmd.c +++ b/drivers/s390/char/sclp_cmd.c | |||
@@ -145,9 +145,11 @@ bool __init sclp_has_linemode(void) | |||
145 | 145 | ||
146 | if (sccb->header.response_code != 0x20) | 146 | if (sccb->header.response_code != 0x20) |
147 | return 0; | 147 | return 0; |
148 | if (sccb->sclp_send_mask & (EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK)) | 148 | if (!(sccb->sclp_send_mask & (EVTYP_OPCMD_MASK | EVTYP_PMSGCMD_MASK))) |
149 | return 1; | 149 | return 0; |
150 | return 0; | 150 | if (!(sccb->sclp_receive_mask & (EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK))) |
151 | return 0; | ||
152 | return 1; | ||
151 | } | 153 | } |
152 | 154 | ||
153 | bool __init sclp_has_vt220(void) | 155 | bool __init sclp_has_vt220(void) |
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c index a0f47c83fd62..3f4ca4e09a4c 100644 --- a/drivers/s390/char/tty3270.c +++ b/drivers/s390/char/tty3270.c | |||
@@ -810,7 +810,7 @@ static void tty3270_resize_work(struct work_struct *work) | |||
810 | struct winsize ws; | 810 | struct winsize ws; |
811 | 811 | ||
812 | screen = tty3270_alloc_screen(tp->n_rows, tp->n_cols); | 812 | screen = tty3270_alloc_screen(tp->n_rows, tp->n_cols); |
813 | if (!screen) | 813 | if (IS_ERR(screen)) |
814 | return; | 814 | return; |
815 | /* Switch to new output size */ | 815 | /* Switch to new output size */ |
816 | spin_lock_bh(&tp->view.lock); | 816 | spin_lock_bh(&tp->view.lock); |
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index 9b3a24e8d3a0..cf31d3321dab 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c | |||
@@ -313,7 +313,7 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp) | |||
313 | int ret; | 313 | int ret; |
314 | 314 | ||
315 | dev_num = iminor(inode); | 315 | dev_num = iminor(inode); |
316 | if (dev_num > MAXMINOR) | 316 | if (dev_num >= MAXMINOR) |
317 | return -ENODEV; | 317 | return -ENODEV; |
318 | logptr = &sys_ser[dev_num]; | 318 | logptr = &sys_ser[dev_num]; |
319 | 319 | ||
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) | |||
246 | static int zcore_add_lc(char __user *buf, unsigned long start, size_t count) | 245 | static 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; |
277 | next: | ||
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 | */ |
195 | unsigned long airq_iv_alloc_bit(struct airq_iv *iv) | 195 | unsigned 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 | */ |
221 | void airq_iv_free_bit(struct airq_iv *iv, unsigned long bit) | 220 | void 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); | |||
251 | unsigned long airq_iv_scan(struct airq_iv *iv, unsigned long start, | 248 | unsigned 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 | } |
265 | EXPORT_SYMBOL(airq_iv_scan); | 260 | EXPORT_SYMBOL(airq_iv_scan); |
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index d7da67a31c77..88e35d85d205 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -878,9 +878,9 @@ static void css_reset(void) | |||
878 | atomic_inc(&chpid_reset_count); | 878 | atomic_inc(&chpid_reset_count); |
879 | } | 879 | } |
880 | /* Wait for machine check for all channel paths. */ | 880 | /* Wait for machine check for all channel paths. */ |
881 | timeout = get_tod_clock() + (RCHP_TIMEOUT << 12); | 881 | timeout = get_tod_clock_fast() + (RCHP_TIMEOUT << 12); |
882 | while (atomic_read(&chpid_reset_count) != 0) { | 882 | while (atomic_read(&chpid_reset_count) != 0) { |
883 | if (get_tod_clock() > timeout) | 883 | if (get_tod_clock_fast() > timeout) |
884 | break; | 884 | break; |
885 | cpu_relax(); | 885 | cpu_relax(); |
886 | } | 886 | } |
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 | ||
43 | static void EADM_LOG_HEX(int level, void *data, int length) | 44 | static 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 | ||
164 | static struct subchannel *eadm_get_idle_sch(void) | 168 | static struct subchannel *eadm_get_idle_sch(void) |
@@ -255,13 +259,32 @@ out: | |||
255 | 259 | ||
256 | static void eadm_quiesce(struct subchannel *sch) | 260 | static 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 | |||
281 | disable: | ||
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 | ||
267 | static int eadm_subchannel_remove(struct subchannel *sch) | 290 | static 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 @@ | |||
9 | struct eadm_private { | 10 | struct 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 @@ | |||
16 | extern debug_info_t *qdio_dbf_setup; | 16 | extern debug_info_t *qdio_dbf_setup; |
17 | extern debug_info_t *qdio_dbf_error; | 17 | extern debug_info_t *qdio_dbf_error; |
18 | 18 | ||
19 | /* sort out low debug levels early to avoid wasted sprints */ | ||
20 | static 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 8ed52aa49122..3e602e8affa7 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -338,10 +338,10 @@ again: | |||
338 | retries++; | 338 | retries++; |
339 | 339 | ||
340 | if (!start_time) { | 340 | if (!start_time) { |
341 | start_time = get_tod_clock(); | 341 | start_time = get_tod_clock_fast(); |
342 | goto again; | 342 | goto again; |
343 | } | 343 | } |
344 | if ((get_tod_clock() - start_time) < QDIO_BUSY_BIT_PATIENCE) | 344 | if (get_tod_clock_fast() - start_time < QDIO_BUSY_BIT_PATIENCE) |
345 | goto again; | 345 | goto again; |
346 | } | 346 | } |
347 | if (retries) { | 347 | if (retries) { |
@@ -504,7 +504,7 @@ static int get_inbound_buffer_frontier(struct qdio_q *q) | |||
504 | int count, stop; | 504 | int count, stop; |
505 | unsigned char state = 0; | 505 | unsigned char state = 0; |
506 | 506 | ||
507 | q->timestamp = get_tod_clock(); | 507 | q->timestamp = get_tod_clock_fast(); |
508 | 508 | ||
509 | /* | 509 | /* |
510 | * Don't check 128 buffers, as otherwise qdio_inbound_q_moved | 510 | * Don't check 128 buffers, as otherwise qdio_inbound_q_moved |
@@ -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); |
@@ -595,7 +595,7 @@ static inline int qdio_inbound_q_done(struct qdio_q *q) | |||
595 | * At this point we know, that inbound first_to_check | 595 | * At this point we know, that inbound first_to_check |
596 | * has (probably) not moved (see qdio_inbound_processing). | 596 | * has (probably) not moved (see qdio_inbound_processing). |
597 | */ | 597 | */ |
598 | if (get_tod_clock() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) { | 598 | if (get_tod_clock_fast() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) { |
599 | DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in done:%02x", | 599 | DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in done:%02x", |
600 | q->first_to_check); | 600 | q->first_to_check); |
601 | return 1; | 601 | return 1; |
@@ -728,7 +728,7 @@ static int get_outbound_buffer_frontier(struct qdio_q *q) | |||
728 | int count, stop; | 728 | int count, stop; |
729 | unsigned char state = 0; | 729 | unsigned char state = 0; |
730 | 730 | ||
731 | q->timestamp = get_tod_clock(); | 731 | q->timestamp = get_tod_clock_fast(); |
732 | 732 | ||
733 | if (need_siga_sync(q)) | 733 | if (need_siga_sync(q)) |
734 | if (((queue_type(q) != QDIO_IQDIO_QFMT) && | 734 | if (((queue_type(q) != QDIO_IQDIO_QFMT) && |
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 */ | ||
15 | static 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 */ | ||
118 | static 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 */ | ||
20 | static 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 | ||
106 | DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf); | 106 | DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf); |
107 | 107 | ||
108 | /* Allow to sort out low debug levels early to avoid wasted sprints */ | ||
109 | static 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..eb4e1f809feb 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -4451,7 +4451,7 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata) | |||
4451 | struct qeth_cmd_buffer *iob; | 4451 | struct qeth_cmd_buffer *iob; |
4452 | struct qeth_ipa_cmd *cmd; | 4452 | struct qeth_ipa_cmd *cmd; |
4453 | struct qeth_snmp_ureq *ureq; | 4453 | struct qeth_snmp_ureq *ureq; |
4454 | int req_len; | 4454 | unsigned int req_len; |
4455 | struct qeth_arp_query_info qinfo = {0, }; | 4455 | struct qeth_arp_query_info qinfo = {0, }; |
4456 | int rc = 0; | 4456 | int rc = 0; |
4457 | 4457 | ||
@@ -4467,6 +4467,10 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata) | |||
4467 | /* skip 4 bytes (data_len struct member) to get req_len */ | 4467 | /* skip 4 bytes (data_len struct member) to get req_len */ |
4468 | if (copy_from_user(&req_len, udata + sizeof(int), sizeof(int))) | 4468 | if (copy_from_user(&req_len, udata + sizeof(int), sizeof(int))) |
4469 | return -EFAULT; | 4469 | return -EFAULT; |
4470 | if (req_len > (QETH_BUFSIZE - IPA_PDU_HEADER_SIZE - | ||
4471 | sizeof(struct qeth_ipacmd_hdr) - | ||
4472 | sizeof(struct qeth_ipacmd_setadpparms_hdr))) | ||
4473 | return -EINVAL; | ||
4470 | ureq = memdup_user(udata, req_len + sizeof(struct qeth_snmp_ureq_hdr)); | 4474 | ureq = memdup_user(udata, req_len + sizeof(struct qeth_snmp_ureq_hdr)); |
4471 | if (IS_ERR(ureq)) { | 4475 | if (IS_ERR(ureq)) { |
4472 | QETH_CARD_TEXT(card, 2, "snmpnome"); | 4476 | QETH_CARD_TEXT(card, 2, "snmpnome"); |
@@ -5096,7 +5100,7 @@ void qeth_dbf_longtext(debug_info_t *id, int level, char *fmt, ...) | |||
5096 | char dbf_txt_buf[32]; | 5100 | char dbf_txt_buf[32]; |
5097 | va_list args; | 5101 | va_list args; |
5098 | 5102 | ||
5099 | if (level > id->level) | 5103 | if (!debug_level_enabled(id, level)) |
5100 | return; | 5104 | return; |
5101 | va_start(args, fmt); | 5105 | va_start(args, fmt); |
5102 | vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args); | 5106 | 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 { | |||
278 | static inline | 278 | static inline |
279 | void zfcp_dbf_hba_fsf_resp(char *tag, int level, struct zfcp_fsf_req *req) | 279 | void 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 | ||