mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 1/13] s390: fix I/O termination race in cio.
@ 2006-04-24 15:02 Martin Schwidefsky
  0 siblings, 0 replies; only message in thread
From: Martin Schwidefsky @ 2006-04-24 15:02 UTC (permalink / raw)
  To: linux-kernel, akpm, peter.oberparleiter

From: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>

[patch 1/13] s390: fix I/O termination race in cio.

Fix a race condition in the I/O termination logic. The race can
cause I/O to a dasd device to fail with no retry left after turning
one channel path to the device off and on multiple times. 

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 drivers/s390/cio/chsc.c |   26 ++++----------------------
 1 files changed, 4 insertions(+), 22 deletions(-)

diff -urpN linux-2.6/drivers/s390/cio/chsc.c linux-2.6-patched/drivers/s390/cio/chsc.c
--- linux-2.6/drivers/s390/cio/chsc.c	2006-04-24 16:47:00.000000000 +0200
+++ linux-2.6-patched/drivers/s390/cio/chsc.c	2006-04-24 16:47:18.000000000 +0200
@@ -242,28 +242,10 @@ s390_subchannel_remove_chpid(struct devi
 	if (sch->vpm == mask)
 		goto out_unreg;
 
-	if ((sch->schib.scsw.actl & (SCSW_ACTL_CLEAR_PEND |
-				     SCSW_ACTL_HALT_PEND |
-				     SCSW_ACTL_START_PEND |
-				     SCSW_ACTL_RESUME_PEND)) &&
-	    (sch->schib.pmcw.lpum == mask)) {
-		int cc = cio_cancel(sch);
-		
-		if (cc == -ENODEV)
-			goto out_unreg;
-
-		if (cc == -EINVAL) {
-			cc = cio_clear(sch);
-			if (cc == -ENODEV)
-				goto out_unreg;
-			/* Call handler. */
-			if (sch->driver && sch->driver->termination)
-				sch->driver->termination(&sch->dev);
-			goto out_unlock;
-		}
-	} else if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
-		   (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
-		   (sch->schib.pmcw.lpum == mask)) {
+	if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
+	    (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
+	    (sch->schib.pmcw.lpum == mask) &&
+	    (sch->vpm == 0)) {
 		int cc;
 
 		cc = cio_clear(sch);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-24 15:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-24 15:02 [patch 1/13] s390: fix I/O termination race in cio Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®