]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/s390/char/tape_core.c
[PATCH] s390: tape retry flooding by deferred CC in interrupt
[mirror_ubuntu-artful-kernel.git] / drivers / s390 / char / tape_core.c
index 6c52e8307dc54bdf009a853fead4619b38573ac8..c42f5e25024efab3535094f593004b3180deea17 100644 (file)
@@ -682,8 +682,7 @@ tape_alloc_request(int cplength, int datasize)
                request->cpdata = kmalloc(datasize, GFP_KERNEL | GFP_DMA);
                if (request->cpdata == NULL) {
                        DBF_EXCEPTION(1, "cqra nomem\n");
-                       if (request->cpaddr != NULL)
-                               kfree(request->cpaddr);
+                       kfree(request->cpaddr);
                        kfree(request);
                        return ERR_PTR(-ENOMEM);
                }
@@ -706,10 +705,8 @@ tape_free_request (struct tape_request * request)
        if (request->device != NULL) {
                request->device = tape_put_device(request->device);
        }
-       if (request->cpdata != NULL)
-               kfree(request->cpdata);
-       if (request->cpaddr != NULL)
-               kfree(request->cpaddr);
+       kfree(request->cpdata);
+       kfree(request->cpaddr);
        kfree(request);
 }
 
@@ -1067,15 +1064,16 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
        /*
         * If the condition code is not zero and the start function bit is
         * still set, this is an deferred error and the last start I/O did
-        * not succeed. Restart the request now.
+        * not succeed. At this point the condition that caused the deferred
+        * error might still apply. So we just schedule the request to be
+        * started later.
         */
        if (irb->scsw.cc != 0 && (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
                PRINT_WARN("(%s): deferred cc=%i. restaring\n",
                        cdev->dev.bus_id,
                        irb->scsw.cc);
-               rc = __tape_start_io(device, request);
-               if (rc)
-                       __tape_end_request(device, request, rc);
+               request->status = TAPE_REQUEST_QUEUED;
+               schedule_work(&device->tape_dnr);
                return;
        }
 
@@ -1242,7 +1240,7 @@ tape_init (void)
 #ifdef DBF_LIKE_HELL
        debug_set_level(TAPE_DBF_AREA, 6);
 #endif
-       DBF_EVENT(3, "tape init: ($Revision: 1.54 $)\n");
+       DBF_EVENT(3, "tape init\n");
        tape_proc_init();
        tapechar_init ();
        tapeblock_init ();
@@ -1266,8 +1264,7 @@ tape_exit(void)
 
 MODULE_AUTHOR("(C) 2001 IBM Deutschland Entwicklung GmbH by Carsten Otte and "
              "Michael Holzheu (cotte@de.ibm.com,holzheu@de.ibm.com)");
-MODULE_DESCRIPTION("Linux on zSeries channel attached "
-                  "tape device driver ($Revision: 1.54 $)");
+MODULE_DESCRIPTION("Linux on zSeries channel attached tape device driver");
 MODULE_LICENSE("GPL");
 
 module_init(tape_init);