diff options
author | Stefan Haberland <stefan.haberland@de.ibm.com> | 2009-03-26 10:23:49 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-26 10:24:05 -0400 |
commit | fc19f381b3828aa4f8a3417dbefc3418ec6bbe10 (patch) | |
tree | 521d7537e5929de141ba4b616ccc2ab191d4b9fe /drivers/s390/block/dasd_diag.c | |
parent | f3eb5384cf0325c02e306b1d81e70f81a03d7432 (diff) |
[S390] dasd: message cleanup
Moved some Messages into s390 debug feature and changed remaining
messages to use the dev_xxx and pr_xxx macros.
Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/block/dasd_diag.c')
-rw-r--r-- | drivers/s390/block/dasd_diag.c | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index ef2a56952054..b9a7f7733446 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c | |||
@@ -8,6 +8,8 @@ | |||
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #define KMSG_COMPONENT "dasd" | ||
12 | |||
11 | #include <linux/stddef.h> | 13 | #include <linux/stddef.h> |
12 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
13 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
@@ -144,8 +146,8 @@ dasd_diag_erp(struct dasd_device *device) | |||
144 | mdsk_term_io(device); | 146 | mdsk_term_io(device); |
145 | rc = mdsk_init_io(device, device->block->bp_block, 0, NULL); | 147 | rc = mdsk_init_io(device, device->block->bp_block, 0, NULL); |
146 | if (rc) | 148 | if (rc) |
147 | DEV_MESSAGE(KERN_WARNING, device, "DIAG ERP unsuccessful, " | 149 | dev_warn(&device->cdev->dev, "DIAG ERP failed with " |
148 | "rc=%d", rc); | 150 | "rc=%d\n", rc); |
149 | } | 151 | } |
150 | 152 | ||
151 | /* Start a given request at the device. Return zero on success, non-zero | 153 | /* Start a given request at the device. Return zero on success, non-zero |
@@ -160,7 +162,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr) | |||
160 | 162 | ||
161 | device = cqr->startdev; | 163 | device = cqr->startdev; |
162 | if (cqr->retries < 0) { | 164 | if (cqr->retries < 0) { |
163 | DEV_MESSAGE(KERN_WARNING, device, "DIAG start_IO: request %p " | 165 | DBF_DEV_EVENT(DBF_ERR, device, "DIAG start_IO: request %p " |
164 | "- no retry left)", cqr); | 166 | "- no retry left)", cqr); |
165 | cqr->status = DASD_CQR_ERROR; | 167 | cqr->status = DASD_CQR_ERROR; |
166 | return -EIO; | 168 | return -EIO; |
@@ -195,7 +197,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr) | |||
195 | break; | 197 | break; |
196 | default: /* Error condition */ | 198 | default: /* Error condition */ |
197 | cqr->status = DASD_CQR_QUEUED; | 199 | cqr->status = DASD_CQR_QUEUED; |
198 | DEV_MESSAGE(KERN_WARNING, device, "dia250 returned rc=%d", rc); | 200 | DBF_DEV_EVENT(DBF_WARNING, device, "dia250 returned rc=%d", rc); |
199 | dasd_diag_erp(device); | 201 | dasd_diag_erp(device); |
200 | rc = -EIO; | 202 | rc = -EIO; |
201 | break; | 203 | break; |
@@ -243,13 +245,14 @@ dasd_ext_handler(__u16 code) | |||
243 | return; | 245 | return; |
244 | } | 246 | } |
245 | if (!ip) { /* no intparm: unsolicited interrupt */ | 247 | if (!ip) { /* no intparm: unsolicited interrupt */ |
246 | MESSAGE(KERN_DEBUG, "%s", "caught unsolicited interrupt"); | 248 | DBF_EVENT(DBF_NOTICE, "%s", "caught unsolicited " |
249 | "interrupt"); | ||
247 | return; | 250 | return; |
248 | } | 251 | } |
249 | cqr = (struct dasd_ccw_req *) ip; | 252 | cqr = (struct dasd_ccw_req *) ip; |
250 | device = (struct dasd_device *) cqr->startdev; | 253 | device = (struct dasd_device *) cqr->startdev; |
251 | if (strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) { | 254 | if (strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) { |
252 | DEV_MESSAGE(KERN_WARNING, device, | 255 | DBF_DEV_EVENT(DBF_WARNING, device, |
253 | " magic number of dasd_ccw_req 0x%08X doesn't" | 256 | " magic number of dasd_ccw_req 0x%08X doesn't" |
254 | " match discipline 0x%08X", | 257 | " match discipline 0x%08X", |
255 | cqr->magic, *(int *) (&device->discipline->name)); | 258 | cqr->magic, *(int *) (&device->discipline->name)); |
@@ -281,15 +284,11 @@ dasd_ext_handler(__u16 code) | |||
281 | rc = dasd_start_diag(next); | 284 | rc = dasd_start_diag(next); |
282 | if (rc == 0) | 285 | if (rc == 0) |
283 | expires = next->expires; | 286 | expires = next->expires; |
284 | else if (rc != -EACCES) | ||
285 | DEV_MESSAGE(KERN_WARNING, device, "%s", | ||
286 | "Interrupt fastpath " | ||
287 | "failed!"); | ||
288 | } | 287 | } |
289 | } | 288 | } |
290 | } else { | 289 | } else { |
291 | cqr->status = DASD_CQR_QUEUED; | 290 | cqr->status = DASD_CQR_QUEUED; |
292 | DEV_MESSAGE(KERN_WARNING, device, "interrupt status for " | 291 | DBF_DEV_EVENT(DBF_DEBUG, device, "interrupt status for " |
293 | "request %p was %d (%d retries left)", cqr, status, | 292 | "request %p was %d (%d retries left)", cqr, status, |
294 | cqr->retries); | 293 | cqr->retries); |
295 | dasd_diag_erp(device); | 294 | dasd_diag_erp(device); |
@@ -322,8 +321,9 @@ dasd_diag_check_device(struct dasd_device *device) | |||
322 | if (private == NULL) { | 321 | if (private == NULL) { |
323 | private = kzalloc(sizeof(struct dasd_diag_private),GFP_KERNEL); | 322 | private = kzalloc(sizeof(struct dasd_diag_private),GFP_KERNEL); |
324 | if (private == NULL) { | 323 | if (private == NULL) { |
325 | DEV_MESSAGE(KERN_WARNING, device, "%s", | 324 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
326 | "memory allocation failed for private data"); | 325 | "Allocating memory for private DASD data " |
326 | "failed\n"); | ||
327 | return -ENOMEM; | 327 | return -ENOMEM; |
328 | } | 328 | } |
329 | ccw_device_get_id(device->cdev, &private->dev_id); | 329 | ccw_device_get_id(device->cdev, &private->dev_id); |
@@ -331,7 +331,7 @@ dasd_diag_check_device(struct dasd_device *device) | |||
331 | } | 331 | } |
332 | block = dasd_alloc_block(); | 332 | block = dasd_alloc_block(); |
333 | if (IS_ERR(block)) { | 333 | if (IS_ERR(block)) { |
334 | DEV_MESSAGE(KERN_WARNING, device, "%s", | 334 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
335 | "could not allocate dasd block structure"); | 335 | "could not allocate dasd block structure"); |
336 | device->private = NULL; | 336 | device->private = NULL; |
337 | kfree(private); | 337 | kfree(private); |
@@ -347,7 +347,7 @@ dasd_diag_check_device(struct dasd_device *device) | |||
347 | 347 | ||
348 | rc = diag210((struct diag210 *) rdc_data); | 348 | rc = diag210((struct diag210 *) rdc_data); |
349 | if (rc) { | 349 | if (rc) { |
350 | DEV_MESSAGE(KERN_WARNING, device, "failed to retrieve device " | 350 | DBF_DEV_EVENT(DBF_WARNING, device, "failed to retrieve device " |
351 | "information (rc=%d)", rc); | 351 | "information (rc=%d)", rc); |
352 | rc = -EOPNOTSUPP; | 352 | rc = -EOPNOTSUPP; |
353 | goto out; | 353 | goto out; |
@@ -362,8 +362,8 @@ dasd_diag_check_device(struct dasd_device *device) | |||
362 | private->pt_block = 2; | 362 | private->pt_block = 2; |
363 | break; | 363 | break; |
364 | default: | 364 | default: |
365 | DEV_MESSAGE(KERN_WARNING, device, "unsupported device class " | 365 | dev_warn(&device->cdev->dev, "Device type %d is not supported " |
366 | "(class=%d)", private->rdc_data.vdev_class); | 366 | "in DIAG mode\n", private->rdc_data.vdev_class); |
367 | rc = -EOPNOTSUPP; | 367 | rc = -EOPNOTSUPP; |
368 | goto out; | 368 | goto out; |
369 | } | 369 | } |
@@ -380,7 +380,7 @@ dasd_diag_check_device(struct dasd_device *device) | |||
380 | /* figure out blocksize of device */ | 380 | /* figure out blocksize of device */ |
381 | label = (struct vtoc_cms_label *) get_zeroed_page(GFP_KERNEL); | 381 | label = (struct vtoc_cms_label *) get_zeroed_page(GFP_KERNEL); |
382 | if (label == NULL) { | 382 | if (label == NULL) { |
383 | DEV_MESSAGE(KERN_WARNING, device, "%s", | 383 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
384 | "No memory to allocate initialization request"); | 384 | "No memory to allocate initialization request"); |
385 | rc = -ENOMEM; | 385 | rc = -ENOMEM; |
386 | goto out; | 386 | goto out; |
@@ -404,8 +404,8 @@ dasd_diag_check_device(struct dasd_device *device) | |||
404 | private->iob.flaga = DASD_DIAG_FLAGA_DEFAULT; | 404 | private->iob.flaga = DASD_DIAG_FLAGA_DEFAULT; |
405 | rc = dia250(&private->iob, RW_BIO); | 405 | rc = dia250(&private->iob, RW_BIO); |
406 | if (rc == 3) { | 406 | if (rc == 3) { |
407 | DEV_MESSAGE(KERN_WARNING, device, "%s", | 407 | dev_warn(&device->cdev->dev, |
408 | "DIAG call failed"); | 408 | "A 64-bit DIAG call failed\n"); |
409 | rc = -EOPNOTSUPP; | 409 | rc = -EOPNOTSUPP; |
410 | goto out_label; | 410 | goto out_label; |
411 | } | 411 | } |
@@ -414,8 +414,8 @@ dasd_diag_check_device(struct dasd_device *device) | |||
414 | break; | 414 | break; |
415 | } | 415 | } |
416 | if (bsize > PAGE_SIZE) { | 416 | if (bsize > PAGE_SIZE) { |
417 | DEV_MESSAGE(KERN_WARNING, device, "device access failed " | 417 | dev_warn(&device->cdev->dev, "Accessing the DASD failed because" |
418 | "(rc=%d)", rc); | 418 | " of an incorrect format (rc=%d)\n", rc); |
419 | rc = -EIO; | 419 | rc = -EIO; |
420 | goto out_label; | 420 | goto out_label; |
421 | } | 421 | } |
@@ -433,15 +433,15 @@ dasd_diag_check_device(struct dasd_device *device) | |||
433 | block->s2b_shift++; | 433 | block->s2b_shift++; |
434 | rc = mdsk_init_io(device, block->bp_block, 0, NULL); | 434 | rc = mdsk_init_io(device, block->bp_block, 0, NULL); |
435 | if (rc) { | 435 | if (rc) { |
436 | DEV_MESSAGE(KERN_WARNING, device, "DIAG initialization " | 436 | dev_warn(&device->cdev->dev, "DIAG initialization " |
437 | "failed (rc=%d)", rc); | 437 | "failed with rc=%d\n", rc); |
438 | rc = -EIO; | 438 | rc = -EIO; |
439 | } else { | 439 | } else { |
440 | DEV_MESSAGE(KERN_INFO, device, | 440 | dev_info(&device->cdev->dev, |
441 | "(%ld B/blk): %ldkB", | 441 | "New DASD with %ld byte/block, total size %ld KB\n", |
442 | (unsigned long) block->bp_block, | 442 | (unsigned long) block->bp_block, |
443 | (unsigned long) (block->blocks << | 443 | (unsigned long) (block->blocks << |
444 | block->s2b_shift) >> 1); | 444 | block->s2b_shift) >> 1); |
445 | } | 445 | } |
446 | out_label: | 446 | out_label: |
447 | free_page((long) label); | 447 | free_page((long) label); |
@@ -595,7 +595,7 @@ static void | |||
595 | dasd_diag_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, | 595 | dasd_diag_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, |
596 | struct irb *stat) | 596 | struct irb *stat) |
597 | { | 597 | { |
598 | DEV_MESSAGE(KERN_ERR, device, "%s", | 598 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
599 | "dump sense not available for DIAG data"); | 599 | "dump sense not available for DIAG data"); |
600 | } | 600 | } |
601 | 601 | ||
@@ -621,10 +621,8 @@ static int __init | |||
621 | dasd_diag_init(void) | 621 | dasd_diag_init(void) |
622 | { | 622 | { |
623 | if (!MACHINE_IS_VM) { | 623 | if (!MACHINE_IS_VM) { |
624 | MESSAGE_LOG(KERN_INFO, | 624 | pr_info("Discipline %s cannot be used without z/VM\n", |
625 | "Machine is not VM: %s " | 625 | dasd_diag_discipline.name); |
626 | "discipline not initializing", | ||
627 | dasd_diag_discipline.name); | ||
628 | return -ENODEV; | 626 | return -ENODEV; |
629 | } | 627 | } |
630 | ASCEBC(dasd_diag_discipline.ebcname, 4); | 628 | ASCEBC(dasd_diag_discipline.ebcname, 4); |