fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / s390 / block / dasd_erp.c
index 9c91710..58a6509 100644 (file)
@@ -7,10 +7,8 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
  *
- * $Revision: 1.11 $
  */
 
-#include <linux/config.h>
 #include <linux/ctype.h>
 #include <linux/init.h>
 
@@ -33,13 +31,8 @@ dasd_alloc_erp_request(char *magic, int cplength, int datasize,
        int size;
 
        /* Sanity checks */
-       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);
+       BUG_ON( magic == NULL || datasize > PAGE_SIZE ||
+            (cplength*sizeof(struct ccw1)) > PAGE_SIZE);
 
        size = (sizeof(struct dasd_ccw_req) + 7L) & -8L;
        if (cplength > 0)
@@ -77,10 +70,6 @@ dasd_free_erp_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
 {
        unsigned long flags;
 
-       if (cqr->dstat != NULL)
-               kfree(cqr->dstat);
-       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->erp_chunks, cqr);
        spin_unlock_irqrestore(&device->mem_lock, flags);
@@ -100,14 +89,14 @@ dasd_default_erp_action(struct dasd_ccw_req * cqr)
 
         /* just retry - there is nothing to save ... I got no sense data.... */
         if (cqr->retries > 0) {
-                DEV_MESSAGE (KERN_DEBUG, device, 
+               DEV_MESSAGE (KERN_DEBUG, device,
                              "default ERP called (%i retries left)",
                              cqr->retries);
+               cqr->lpm    = LPM_ANYPATH;
                cqr->status = DASD_CQR_QUEUED;
         } else {
                 DEV_MESSAGE (KERN_WARNING, device, "%s",
                             "default ERP called (NO retry left)");
-               
                cqr->status = DASD_CQR_FAILED;
                cqr->stopclk = get_clock ();
         }
@@ -134,8 +123,7 @@ dasd_default_erp_postaction(struct dasd_ccw_req * cqr)
        struct dasd_device *device;
        int success;
 
-       if (cqr->refers == NULL || cqr->function == NULL)
-               BUG();
+       BUG_ON(cqr->refers == NULL || cqr->function == NULL);
 
        device = cqr->device;
        success = cqr->status == DASD_CQR_DONE;
@@ -166,7 +154,7 @@ dasd_default_erp_postaction(struct dasd_ccw_req * cqr)
 
 /*
  * Print the hex dump of the memory used by a request. This includes
- * all error recovery ccws that have been chained in from of the 
+ * all error recovery ccws that have been chained in from of the
  * real request.
  */
 static inline void
@@ -238,12 +226,12 @@ dasd_log_ccw(struct dasd_ccw_req * cqr, int caller, __u32 cpa)
                /*
                 * Log bytes arround failed CCW but only if we did
                 * not log the whole CP of the CCW is outside the
-                * logged CP. 
+                * logged CP.
                 */
                if (cplength > 40 ||
                    ((addr_t) cpa < (addr_t) lcqr->cpaddr &&
                     (addr_t) cpa > (addr_t) (lcqr->cpaddr + cplength + 4))) {
-                       
+
                        DEV_MESSAGE(KERN_ERR, device,
                                    "Failed CCW (%p) (area):",
                                    (void *) (long) cpa);