diff options
Diffstat (limited to 'drivers/s390/block/dasd_fba.c')
-rw-r--r-- | drivers/s390/block/dasd_fba.c | 77 |
1 files changed, 49 insertions, 28 deletions
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c index f1d176021694..a3eb6fd14673 100644 --- a/drivers/s390/block/dasd_fba.c +++ b/drivers/s390/block/dasd_fba.c | |||
@@ -6,6 +6,8 @@ | |||
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define KMSG_COMPONENT "dasd" | ||
10 | |||
9 | #include <linux/stddef.h> | 11 | #include <linux/stddef.h> |
10 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
11 | #include <asm/debug.h> | 13 | #include <asm/debug.h> |
@@ -128,17 +130,18 @@ dasd_fba_check_characteristics(struct dasd_device *device) | |||
128 | private = kzalloc(sizeof(struct dasd_fba_private), | 130 | private = kzalloc(sizeof(struct dasd_fba_private), |
129 | GFP_KERNEL | GFP_DMA); | 131 | GFP_KERNEL | GFP_DMA); |
130 | if (private == NULL) { | 132 | if (private == NULL) { |
131 | DEV_MESSAGE(KERN_WARNING, device, "%s", | 133 | dev_warn(&device->cdev->dev, |
132 | "memory allocation failed for private " | 134 | "Allocating memory for private DASD " |
133 | "data"); | 135 | "data failed\n"); |
134 | return -ENOMEM; | 136 | return -ENOMEM; |
135 | } | 137 | } |
136 | device->private = (void *) private; | 138 | device->private = (void *) private; |
137 | } | 139 | } |
138 | block = dasd_alloc_block(); | 140 | block = dasd_alloc_block(); |
139 | if (IS_ERR(block)) { | 141 | if (IS_ERR(block)) { |
140 | DEV_MESSAGE(KERN_WARNING, device, "%s", | 142 | DBF_EVENT(DBF_WARNING, "could not allocate dasd block " |
141 | "could not allocate dasd block structure"); | 143 | "structure for device: %s", |
144 | dev_name(&device->cdev->dev)); | ||
142 | device->private = NULL; | 145 | device->private = NULL; |
143 | kfree(private); | 146 | kfree(private); |
144 | return PTR_ERR(block); | 147 | return PTR_ERR(block); |
@@ -150,9 +153,9 @@ dasd_fba_check_characteristics(struct dasd_device *device) | |||
150 | rdc_data = (void *) &(private->rdc_data); | 153 | rdc_data = (void *) &(private->rdc_data); |
151 | rc = dasd_generic_read_dev_chars(device, "FBA ", &rdc_data, 32); | 154 | rc = dasd_generic_read_dev_chars(device, "FBA ", &rdc_data, 32); |
152 | if (rc) { | 155 | if (rc) { |
153 | DEV_MESSAGE(KERN_WARNING, device, | 156 | DBF_EVENT(DBF_WARNING, "Read device characteristics returned " |
154 | "Read device characteristics returned error %d", | 157 | "error %d for device: %s", |
155 | rc); | 158 | rc, dev_name(&device->cdev->dev)); |
156 | device->block = NULL; | 159 | device->block = NULL; |
157 | dasd_free_block(block); | 160 | dasd_free_block(block); |
158 | device->private = NULL; | 161 | device->private = NULL; |
@@ -160,15 +163,16 @@ dasd_fba_check_characteristics(struct dasd_device *device) | |||
160 | return rc; | 163 | return rc; |
161 | } | 164 | } |
162 | 165 | ||
163 | DEV_MESSAGE(KERN_INFO, device, | 166 | dev_info(&device->cdev->dev, |
164 | "%04X/%02X(CU:%04X/%02X) %dMB at(%d B/blk)", | 167 | "New FBA DASD %04X/%02X (CU %04X/%02X) with %d MB " |
165 | cdev->id.dev_type, | 168 | "and %d B/blk\n", |
166 | cdev->id.dev_model, | 169 | cdev->id.dev_type, |
167 | cdev->id.cu_type, | 170 | cdev->id.dev_model, |
168 | cdev->id.cu_model, | 171 | cdev->id.cu_type, |
169 | ((private->rdc_data.blk_bdsa * | 172 | cdev->id.cu_model, |
170 | (private->rdc_data.blk_size >> 9)) >> 11), | 173 | ((private->rdc_data.blk_bdsa * |
171 | private->rdc_data.blk_size); | 174 | (private->rdc_data.blk_size >> 9)) >> 11), |
175 | private->rdc_data.blk_size); | ||
172 | return 0; | 176 | return 0; |
173 | } | 177 | } |
174 | 178 | ||
@@ -180,7 +184,7 @@ static int dasd_fba_do_analysis(struct dasd_block *block) | |||
180 | private = (struct dasd_fba_private *) block->base->private; | 184 | private = (struct dasd_fba_private *) block->base->private; |
181 | rc = dasd_check_blocksize(private->rdc_data.blk_size); | 185 | rc = dasd_check_blocksize(private->rdc_data.blk_size); |
182 | if (rc) { | 186 | if (rc) { |
183 | DEV_MESSAGE(KERN_INFO, block->base, "unknown blocksize %d", | 187 | DBF_DEV_EVENT(DBF_WARNING, block->base, "unknown blocksize %d", |
184 | private->rdc_data.blk_size); | 188 | private->rdc_data.blk_size); |
185 | return rc; | 189 | return rc; |
186 | } | 190 | } |
@@ -215,7 +219,7 @@ dasd_fba_erp_postaction(struct dasd_ccw_req * cqr) | |||
215 | if (cqr->function == dasd_default_erp_action) | 219 | if (cqr->function == dasd_default_erp_action) |
216 | return dasd_default_erp_postaction; | 220 | return dasd_default_erp_postaction; |
217 | 221 | ||
218 | DEV_MESSAGE(KERN_WARNING, cqr->startdev, "unknown ERP action %p", | 222 | DBF_DEV_EVENT(DBF_WARNING, cqr->startdev, "unknown ERP action %p", |
219 | cqr->function); | 223 | cqr->function); |
220 | return NULL; | 224 | return NULL; |
221 | } | 225 | } |
@@ -233,9 +237,9 @@ static void dasd_fba_handle_unsolicited_interrupt(struct dasd_device *device, | |||
233 | } | 237 | } |
234 | 238 | ||
235 | /* check for unsolicited interrupts */ | 239 | /* check for unsolicited interrupts */ |
236 | DEV_MESSAGE(KERN_DEBUG, device, "%s", | 240 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
237 | "unsolicited interrupt received"); | 241 | "unsolicited interrupt received"); |
238 | device->discipline->dump_sense(device, NULL, irb); | 242 | device->discipline->dump_sense_dbf(device, NULL, irb, "unsolicited"); |
239 | dasd_schedule_device_bh(device); | 243 | dasd_schedule_device_bh(device); |
240 | return; | 244 | return; |
241 | }; | 245 | }; |
@@ -437,6 +441,25 @@ dasd_fba_fill_info(struct dasd_device * device, | |||
437 | } | 441 | } |
438 | 442 | ||
439 | static void | 443 | static void |
444 | dasd_fba_dump_sense_dbf(struct dasd_device *device, struct dasd_ccw_req *req, | ||
445 | struct irb *irb, char *reason) | ||
446 | { | ||
447 | int sl; | ||
448 | if (irb->esw.esw0.erw.cons) { | ||
449 | for (sl = 0; sl < 4; sl++) { | ||
450 | DBF_DEV_EVENT(DBF_EMERG, device, | ||
451 | "%s: %08x %08x %08x %08x", | ||
452 | reason, irb->ecw[8 * 0], irb->ecw[8 * 1], | ||
453 | irb->ecw[8 * 2], irb->ecw[8 * 3]); | ||
454 | } | ||
455 | } else { | ||
456 | DBF_DEV_EVENT(DBF_EMERG, device, "%s", | ||
457 | "SORRY - NO VALID SENSE AVAILABLE\n"); | ||
458 | } | ||
459 | } | ||
460 | |||
461 | |||
462 | static void | ||
440 | dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, | 463 | dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, |
441 | struct irb *irb) | 464 | struct irb *irb) |
442 | { | 465 | { |
@@ -446,7 +469,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, | |||
446 | 469 | ||
447 | page = (char *) get_zeroed_page(GFP_ATOMIC); | 470 | page = (char *) get_zeroed_page(GFP_ATOMIC); |
448 | if (page == NULL) { | 471 | if (page == NULL) { |
449 | DEV_MESSAGE(KERN_ERR, device, " %s", | 472 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
450 | "No memory to dump sense data"); | 473 | "No memory to dump sense data"); |
451 | return; | 474 | return; |
452 | } | 475 | } |
@@ -476,8 +499,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, | |||
476 | len += sprintf(page + len, KERN_ERR PRINTK_HEADER | 499 | len += sprintf(page + len, KERN_ERR PRINTK_HEADER |
477 | " SORRY - NO VALID SENSE AVAILABLE\n"); | 500 | " SORRY - NO VALID SENSE AVAILABLE\n"); |
478 | } | 501 | } |
479 | MESSAGE_LOG(KERN_ERR, "%s", | 502 | printk(KERN_ERR "%s", page); |
480 | page + sizeof(KERN_ERR PRINTK_HEADER)); | ||
481 | 503 | ||
482 | /* dump the Channel Program */ | 504 | /* dump the Channel Program */ |
483 | /* print first CCWs (maximum 8) */ | 505 | /* print first CCWs (maximum 8) */ |
@@ -498,8 +520,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, | |||
498 | len += sprintf(page + len, "\n"); | 520 | len += sprintf(page + len, "\n"); |
499 | act++; | 521 | act++; |
500 | } | 522 | } |
501 | MESSAGE_LOG(KERN_ERR, "%s", | 523 | printk(KERN_ERR "%s", page); |
502 | page + sizeof(KERN_ERR PRINTK_HEADER)); | ||
503 | 524 | ||
504 | 525 | ||
505 | /* print failing CCW area */ | 526 | /* print failing CCW area */ |
@@ -540,8 +561,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, | |||
540 | act++; | 561 | act++; |
541 | } | 562 | } |
542 | if (len > 0) | 563 | if (len > 0) |
543 | MESSAGE_LOG(KERN_ERR, "%s", | 564 | printk(KERN_ERR "%s", page); |
544 | page + sizeof(KERN_ERR PRINTK_HEADER)); | ||
545 | free_page((unsigned long) page); | 565 | free_page((unsigned long) page); |
546 | } | 566 | } |
547 | 567 | ||
@@ -576,6 +596,7 @@ static struct dasd_discipline dasd_fba_discipline = { | |||
576 | .build_cp = dasd_fba_build_cp, | 596 | .build_cp = dasd_fba_build_cp, |
577 | .free_cp = dasd_fba_free_cp, | 597 | .free_cp = dasd_fba_free_cp, |
578 | .dump_sense = dasd_fba_dump_sense, | 598 | .dump_sense = dasd_fba_dump_sense, |
599 | .dump_sense_dbf = dasd_fba_dump_sense_dbf, | ||
579 | .fill_info = dasd_fba_fill_info, | 600 | .fill_info = dasd_fba_fill_info, |
580 | }; | 601 | }; |
581 | 602 | ||