X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fs390%2Fblock%2Fdasd_diag.c;h=fb81ea4950a45f015d5ba0484d4046387cf93036;hb=f1227cd3e0e73c48b93368800aa89f4341103a00;hp=127699830fa18a46ee98836af72ebdbf16d89f1e;hpb=340e2b1a4c74f653454348914c408420d5d3c28a;p=linux-2.6.git diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index 127699830..fb81ea495 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c @@ -6,7 +6,7 @@ * Bugreports.to..: * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * - * $Revision: 1.42 $ + * $Revision: 1.39 $ */ #include @@ -138,7 +138,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr) rc = dia250(&private->iob, RW_BIO); if (rc > 8) { - DEV_MESSAGE(KERN_WARNING, device, "dia250 returned CC %d", rc); + MESSAGE(KERN_WARNING, "dia250 returned CC %d", rc); cqr->status = DASD_CQR_ERROR; } else if (rc == 0) { cqr->status = DASD_CQR_DONE; @@ -201,9 +201,8 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code) if (dasd_start_diag(next) == 0) expires = next->expires; else - DEV_MESSAGE(KERN_WARNING, device, "%s", - "Interrupt fastpath " - "failed!"); + MESSAGE(KERN_WARNING, "%s", + "Interrupt fastpath failed!"); } } } else @@ -232,7 +231,7 @@ dasd_diag_check_device(struct dasd_device *device) if (private == NULL) { private = kmalloc(sizeof(struct dasd_diag_private),GFP_KERNEL); if (private == NULL) { - DEV_MESSAGE(KERN_WARNING, device, "%s", + MESSAGE(KERN_WARNING, "%s", "memory allocation failed for private data"); return -ENOMEM; } @@ -259,11 +258,11 @@ dasd_diag_check_device(struct dasd_device *device) return -ENOTSUPP; } - DBF_DEV_EVENT(DBF_INFO, device, - "%04X: %04X on real %04X/%02X", - rdc_data->dev_nr, - rdc_data->vdev_type, - rdc_data->rdev_type, rdc_data->rdev_model); + DBF_EVENT(DBF_INFO, + "%04X: %04X on real %04X/%02X", + rdc_data->dev_nr, + rdc_data->vdev_type, + rdc_data->rdev_type, rdc_data->rdev_model); /* terminate all outstanding operations */ mdsk_term_io(device); @@ -271,11 +270,10 @@ dasd_diag_check_device(struct dasd_device *device) /* figure out blocksize of device */ label = (long *) get_zeroed_page(GFP_KERNEL); if (label == NULL) { - DEV_MESSAGE(KERN_WARNING, device, "%s", - "No memory to allocate initialization request"); + MESSAGE(KERN_WARNING, "%s", + "No memory to allocate initialization request"); return -ENOMEM; } - /* try all sizes - needed for ECKD devices */ for (bsize = 512; bsize <= PAGE_SIZE; bsize <<= 1) { mdsk_init_io(device, bsize, 0, 64); memset(&bio, 0, sizeof (struct dasd_diag_bio)); @@ -293,9 +291,8 @@ dasd_diag_check_device(struct dasd_device *device) break; mdsk_term_io(device); } - if (bsize <= PAGE_SIZE && label[0] == 0xc3d4e2f1) { - /* get formatted blocksize from label block */ - bsize = (int) label[3]; + if (bsize <= PAGE_SIZE && label[3] == bsize && + label[0] == 0xc3d4e2f1) { device->blocks = label[7]; device->bp_block = bsize; device->s2b_shift = 0; /* bits to shift 512 to get a block */ @@ -308,12 +305,8 @@ dasd_diag_check_device(struct dasd_device *device) (device->blocks << device->s2b_shift) >> 1); rc = 0; } else { - if (bsize > PAGE_SIZE) - DEV_MESSAGE(KERN_WARNING, device, "%s", - "DIAG access failed"); - else - DEV_MESSAGE(KERN_WARNING, device, "%s", - "volume is not CMS formatted"); + DEV_MESSAGE(KERN_WARNING, device, "%s", + "volume has incompatible disk layout"); rc = -EMEDIUMTYPE; } free_page((long) label); @@ -452,8 +445,20 @@ static void dasd_diag_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, struct irb *stat) { - DEV_MESSAGE(KERN_ERR, device, "%s", - "dump sense not available for DIAG data"); + char *page; + + page = (char *) get_zeroed_page(GFP_KERNEL); + if (page == NULL) { + MESSAGE(KERN_ERR, "%s", "No memory to dump sense data"); + return; + } + sprintf(page, KERN_WARNING PRINTK_HEADER + "device %s: I/O status report:\n", + device->cdev->dev.bus_id); + + MESSAGE(KERN_ERR, "Sense data:\n%s", page); + + free_page((unsigned long) page); } /* @@ -489,10 +494,9 @@ static int __init dasd_diag_init(void) { if (!MACHINE_IS_VM) { - MESSAGE_LOG(KERN_INFO, - "Machine is not VM: %s " - "discipline not initializing", - dasd_diag_discipline.name); + MESSAGE(KERN_INFO, + "Machine is not VM: %s discipline not initializing", + dasd_diag_discipline.name); return -EINVAL; } ASCEBC(dasd_diag_discipline.ebcname, 4); @@ -507,10 +511,9 @@ static void __exit dasd_diag_cleanup(void) { if (!MACHINE_IS_VM) { - MESSAGE_LOG(KERN_INFO, - "Machine is not VM: %s " - "discipline not cleaned", - dasd_diag_discipline.name); + MESSAGE(KERN_INFO, + "Machine is not VM: %s discipline not initializing", + dasd_diag_discipline.name); return; } unregister_external_interrupt(0x2603, dasd_ext_handler);