Skip to content

Commit

Permalink
[PATCH] s390: fix I/O termination race in cio
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Peter Oberparleiter authored and Linus Torvalds committed Apr 28, 2006
1 parent bcff5cd commit 329b785
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions drivers/s390/cio/chsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,28 +242,10 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
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);
Expand Down

0 comments on commit 329b785

Please sign in to comment.