Browse Source

[PATCH] s390: wrong interrupt delivered for hsch() or csch()

When cio waits for the interrupt for a basic sense, interrupts for hsch() or
csch() issued in the meantime are wrongly counted as interrupts for the basic
sense and the accumulated irb is passed to the device driver.  In
ccw_device_w4sense(), check for clear or halt function in the irb and pass the
irb for the csch() or hsch() to the device driver.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Cornelia Huck 19 years ago
parent
commit
3ba1998e90
1 changed files with 12 additions and 0 deletions
  1. 12 0
      drivers/s390/cio/device_fsm.c

+ 12 - 0
drivers/s390/cio/device_fsm.c

@@ -827,6 +827,17 @@ ccw_device_w4sense(struct ccw_device *cdev, enum dev_event dev_event)
 		}
 		}
 		return;
 		return;
 	}
 	}
+	/*
+	 * Check if a halt or clear has been issued in the meanwhile. If yes,
+	 * only deliver the halt/clear interrupt to the device driver as if it
+	 * had killed the original request.
+	 */
+	if (irb->scsw.fctl & (SCSW_FCTL_CLEAR_FUNC | SCSW_FCTL_HALT_FUNC)) {
+		cdev->private->flags.dosense = 0;
+		memset(&cdev->private->irb, 0, sizeof(struct irb));
+		ccw_device_accumulate_irb(cdev, irb);
+		goto call_handler;
+	}
 	/* Add basic sense info to irb. */
 	/* Add basic sense info to irb. */
 	ccw_device_accumulate_basic_sense(cdev, irb);
 	ccw_device_accumulate_basic_sense(cdev, irb);
 	if (cdev->private->flags.dosense) {
 	if (cdev->private->flags.dosense) {
@@ -834,6 +845,7 @@ ccw_device_w4sense(struct ccw_device *cdev, enum dev_event dev_event)
 		ccw_device_do_sense(cdev, irb);
 		ccw_device_do_sense(cdev, irb);
 		return;
 		return;
 	}
 	}
+call_handler:
 	cdev->private->state = DEV_STATE_ONLINE;
 	cdev->private->state = DEV_STATE_ONLINE;
 	/* Call the handler. */
 	/* Call the handler. */
 	if (ccw_device_call_handler(cdev) && cdev->private->flags.doverify)
 	if (ccw_device_call_handler(cdev) && cdev->private->flags.doverify)