- patches.fixes/patch-2.6.11-rc1: 2.6.11-rc1.
[linux-flexiantxendom0-3.2.10.git] / drivers / s390 / block / dasd.c
index be8ce08..fd54f73 100644 (file)
@@ -7,7 +7,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
  *
- * $Revision: 1.151 $
+ * $Revision: 1.154 $
  */
 
 #include <linux/config.h>
@@ -179,7 +179,7 @@ dasd_state_known_to_basic(struct dasd_device * device)
        device->debug_area = debug_register(device->cdev->dev.bus_id, 0, 2,
                                            8 * sizeof (long));
        debug_register_view(device->debug_area, &debug_sprintf_view);
-       debug_set_level(device->debug_area, DBF_ERR);
+       debug_set_level(device->debug_area, DBF_DEBUG);
        DBF_DEV_EVENT(DBF_EMERG, device, "%s", "debug area created");
 
        device->state = DASD_STATE_BASIC;
@@ -520,10 +520,6 @@ dasd_kmalloc_request(char *magic, int cplength, int datasize,
        if ( magic == NULL || datasize > PAGE_SIZE ||
             (cplength*sizeof(struct ccw1)) > PAGE_SIZE)
                BUG();
-       debug_text_event ( dasd_debug_area, 1, "ALLC");
-       debug_text_event ( dasd_debug_area, 1, magic);
-       debug_int_event ( dasd_debug_area, 1, cplength);
-       debug_int_event ( dasd_debug_area, 1, datasize);
 
        cqr = kmalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC);
        if (cqr == NULL)
@@ -570,10 +566,6 @@ dasd_smalloc_request(char *magic, int cplength, int datasize,
        if ( magic == NULL || datasize > PAGE_SIZE ||
             (cplength*sizeof(struct ccw1)) > PAGE_SIZE)
                BUG();
-       debug_text_event ( dasd_debug_area, 1, "ALLC");
-       debug_text_event ( dasd_debug_area, 1, magic);
-       debug_int_event ( dasd_debug_area, 1, cplength);
-       debug_int_event ( dasd_debug_area, 1, datasize);
 
        size = (sizeof(struct dasd_ccw_req) + 7L) & -8L;
        if (cplength > 0)
@@ -623,8 +615,6 @@ dasd_kfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
                clear_normalized_cda(ccw);
        } while (ccw++->flags & (CCW_FLAG_CC | CCW_FLAG_DC));
 #endif
-       debug_text_event ( dasd_debug_area, 1, "FREE");
-       debug_int_event ( dasd_debug_area, 1, (long) cqr);
        if (cqr->cpaddr != NULL)
                kfree(cqr->cpaddr);
        if (cqr->data != NULL)
@@ -638,8 +628,6 @@ dasd_sfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
 {
        unsigned long flags;
 
-       debug_text_event(dasd_debug_area, 1, "FREE");
-       debug_int_event(dasd_debug_area, 1, (long) cqr);
        spin_lock_irqsave(&device->mem_lock, flags);
        dasd_free_chunk(&device->ccw_chunks, cqr);
        spin_unlock_irqrestore(&device->mem_lock, flags);
@@ -696,6 +684,9 @@ dasd_term_IO(struct dasd_ccw_req * cqr)
                        } else
                                cqr->status = DASD_CQR_FAILED;
                        cqr->stopclk = get_clock();
+                       DBF_DEV_EVENT(DBF_DEBUG, device,
+                                     "terminate cqr %p successful",
+                                     cqr);
                        break;
                case -ENODEV:
                        DBF_DEV_EVENT(DBF_ERR, device, "%s",
@@ -754,6 +745,8 @@ dasd_start_IO(struct dasd_ccw_req * cqr)
        switch (rc) {
        case 0:
                cqr->status = DASD_CQR_IN_IO;
+               DBF_DEV_EVENT(DBF_DEBUG, device, "%s",
+                             "start_IO: request %p started successful");
                break;
        case -EBUSY:
                DBF_DEV_EVENT(DBF_ERR, device, "%s",
@@ -964,8 +957,8 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
                        cdev->dev.bus_id, cqr->status);
                return;
        }
-       DBF_DEV_EVENT(DBF_DEBUG, device, "Int: CS/DS 0x%04x",
-                     ((irb->scsw.cstat << 8) | irb->scsw.dstat));
+       DBF_DEV_EVENT(DBF_DEBUG, device, "Int: CS/DS 0x%04x for cqr %p",
+                     ((irb->scsw.cstat << 8) | irb->scsw.dstat), cqr);
 
        /* Find out the appropriate era_action. */
        if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) 
@@ -1080,7 +1073,8 @@ restart:
                                cqr->stopclk = get_clock();
                        } else {
                                if (cqr->irb.esw.esw0.erw.cons) {
-                                       erp_fn = device->discipline->erp_action(cqr);
+                                       erp_fn = device->discipline->
+                                               erp_action(cqr);
                                        erp_fn(cqr);
                                } else
                                        dasd_default_erp_action(cqr);
@@ -1153,10 +1147,9 @@ __dasd_process_blk_queue(struct dasd_device * device)
                req = elv_next_request(queue);
                if (test_bit(DASD_FLAG_RO, &device->flags) &&
                    rq_data_dir(req) == WRITE) {
-                       DBF_EVENT(DBF_ERR,
-                                 "(%s) Rejecting write request %p",
-                                 device->cdev->dev.bus_id,
-                                 req);
+                       DBF_DEV_EVENT(DBF_ERR, device,
+                                     "Rejecting write request %p",
+                                     req);
                        blkdev_dequeue_request(req);
                        dasd_end_request(req, 0);
                        continue;
@@ -1170,10 +1163,10 @@ __dasd_process_blk_queue(struct dasd_device * device)
                if (IS_ERR(cqr)) {
                        if (PTR_ERR(cqr) == -ENOMEM)
                                break;  /* terminate request queue loop */
-                       DBF_EVENT(DBF_ERR,
-                                 "(%s) CCW creation failed on request %p",
-                                 device->cdev->dev.bus_id,
-                                 req);
+                       DBF_DEV_EVENT(DBF_ERR, device,
+                                     "CCW creation failed (rc=%ld) "
+                                     "on request %p",
+                                     PTR_ERR(cqr), req);
                        blkdev_dequeue_request(req);
                        dasd_end_request(req, 0);
                        continue;
@@ -1678,9 +1671,8 @@ dasd_open(struct inode *inp, struct file *filp)
        }
 
        if (dasd_probeonly) {
-               MESSAGE(KERN_INFO,
-                       "No access to device %s due to probeonly mode",
-                       disk->disk_name);
+               DEV_MESSAGE(KERN_INFO, device, "%s",
+                           "No access to device due to probeonly mode");
                rc = -EPERM;
                goto out;
        }
@@ -1970,8 +1962,8 @@ dasd_init(void)
                rc = -ENOMEM;
                goto failed;
        }
-       debug_register_view(dasd_debug_area, &debug_hex_ascii_view);
-       debug_set_level(dasd_debug_area, DBF_ERR);
+       debug_register_view(dasd_debug_area, &debug_sprintf_view);
+       debug_set_level(dasd_debug_area, DBF_DEBUG);
 
        DBF_EVENT(DBF_EMERG, "%s", "debug area created");