s390x/css: reflect cpa in scsw
We neglected to update the the channel-program-address field of the scsw after completion of the start or the halt function: Fortunately, Linux didn't miss it so far. Let's update it for the cases where the cpa is expected to be valid; in some cases, the cpa is 'unpredictable', so we leave it untouched. Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
32a02d070b
commit
2ed982b6a9
@ -200,6 +200,7 @@ static void sch_handle_halt_func(SubchDev *sch)
|
|||||||
|
|
||||||
PMCW *p = &sch->curr_status.pmcw;
|
PMCW *p = &sch->curr_status.pmcw;
|
||||||
SCSW *s = &sch->curr_status.scsw;
|
SCSW *s = &sch->curr_status.scsw;
|
||||||
|
hwaddr curr_ccw = sch->channel_prog;
|
||||||
int path;
|
int path;
|
||||||
|
|
||||||
/* Path management: In our simple css, we always choose the only path. */
|
/* Path management: In our simple css, we always choose the only path. */
|
||||||
@ -216,6 +217,10 @@ static void sch_handle_halt_func(SubchDev *sch)
|
|||||||
(s->ctrl & SCSW_ACTL_SUSP))) {
|
(s->ctrl & SCSW_ACTL_SUSP))) {
|
||||||
s->dstat = SCSW_DSTAT_DEVICE_END;
|
s->dstat = SCSW_DSTAT_DEVICE_END;
|
||||||
}
|
}
|
||||||
|
if ((s->ctrl & (SCSW_ACTL_SUBCH_ACTIVE | SCSW_ACTL_DEVICE_ACTIVE)) ||
|
||||||
|
(s->ctrl & SCSW_ACTL_SUSP)) {
|
||||||
|
s->cpa = curr_ccw + 8;
|
||||||
|
}
|
||||||
s->cstat = 0;
|
s->cstat = 0;
|
||||||
p->lpum = path;
|
p->lpum = path;
|
||||||
|
|
||||||
@ -398,6 +403,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
|
|||||||
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
||||||
SCSW_STCTL_STATUS_PEND;
|
SCSW_STCTL_STATUS_PEND;
|
||||||
s->dstat = SCSW_DSTAT_CHANNEL_END | SCSW_DSTAT_DEVICE_END;
|
s->dstat = SCSW_DSTAT_CHANNEL_END | SCSW_DSTAT_DEVICE_END;
|
||||||
|
s->cpa = sch->channel_prog + 8;
|
||||||
break;
|
break;
|
||||||
case -ENOSYS:
|
case -ENOSYS:
|
||||||
/* unsupported command, generate unit check (command reject) */
|
/* unsupported command, generate unit check (command reject) */
|
||||||
@ -408,6 +414,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
|
|||||||
s->ctrl &= ~SCSW_CTRL_MASK_STCTL;
|
s->ctrl &= ~SCSW_CTRL_MASK_STCTL;
|
||||||
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
||||||
SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND;
|
SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND;
|
||||||
|
s->cpa = sch->channel_prog + 8;
|
||||||
break;
|
break;
|
||||||
case -EFAULT:
|
case -EFAULT:
|
||||||
/* memory problem, generate channel data check */
|
/* memory problem, generate channel data check */
|
||||||
@ -416,6 +423,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
|
|||||||
s->ctrl &= ~SCSW_CTRL_MASK_STCTL;
|
s->ctrl &= ~SCSW_CTRL_MASK_STCTL;
|
||||||
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
||||||
SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND;
|
SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND;
|
||||||
|
s->cpa = sch->channel_prog + 8;
|
||||||
break;
|
break;
|
||||||
case -EBUSY:
|
case -EBUSY:
|
||||||
/* subchannel busy, generate deferred cc 1 */
|
/* subchannel busy, generate deferred cc 1 */
|
||||||
@ -436,6 +444,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb)
|
|||||||
s->ctrl &= ~SCSW_CTRL_MASK_STCTL;
|
s->ctrl &= ~SCSW_CTRL_MASK_STCTL;
|
||||||
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
|
||||||
SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND;
|
SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND;
|
||||||
|
s->cpa = sch->channel_prog + 8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (ret == -EAGAIN);
|
} while (ret == -EAGAIN);
|
||||||
|
Loading…
Reference in New Issue
Block a user