Skip to contentSkip to conversation

s390x/css: fix cc handling for XSCH

PATCH Applied Halil Pasic 3 participants 3 messages Aug 31, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390x/css: fix cc handling for XSCH

The function ioinst_handle_xsch is presenting cc 2 when it's supposed to present cc 1 and the other way around, because css_do_xsch has the error codes mixed up. Because cc 1 has precedence over cc 2 we also have to swap the two checks.

Let us fix this.

---

Was previously a part of a series (due to an accident the series had no name). This version also fixes the priority (aka precedence) problem.

---
 hw/s390x/css.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
hw/s390x/css.c +5 -5
index 1880b1a0ff..e04e0ea3a8 100644
@@ -1276,16 +1276,16 @@ int css_do_xsch(SubchDev *sch)
         goto out;
     }
 
+    if (s->ctrl & SCSW_CTRL_MASK_STCTL) {
+        ret = -EINPROGRESS;
+        goto out;
+    }
+
     if (!(s->ctrl & SCSW_CTRL_MASK_FCTL) ||
         ((s->ctrl & SCSW_CTRL_MASK_FCTL) != SCSW_FCTL_START_FUNC) ||
         (!(s->ctrl &
            (SCSW_ACTL_RESUME_PEND | SCSW_ACTL_START_PEND | SCSW_ACTL_SUSP))) ||
         (s->ctrl & SCSW_ACTL_SUBCH_ACTIVE)) {
-        ret = -EINPROGRESS;
-        goto out;
-    }
-
-    if (s->ctrl & SCSW_CTRL_MASK_STCTL) {
         ret = -EBUSY;
         goto out;
     }
Signature · 1 line
2.13.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 36 lines · Halil Pasic

The function ioinst_handle_xsch is presenting cc 2 when it's supposed to present cc 1 and the other way around, because css_do_xsch has the error codes mixed up. Because cc 1 has precedence over cc 2 we also have to swap the two checks.

Let us fix this.

---

Was previously a part of a series (due to an accident the series had no name). This version also fixes the priority (aka precedence) problem.

---
 hw/s390x/css.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
hw/s390x/css.c +5 -0
index 1880b1a0ff..e04e0ea3a8 100644
@@ -1276,16 +1276,16 @@ int css_do_xsch(SubchDev *sch)
         goto out;
     }
 
+    if (s->ctrl & SCSW_CTRL_MASK_STCTL) {
+        ret = -EINPROGRESS;
+        goto out;
+    }
+
     if (!(s->ctrl & SCSW_CTRL_MASK_FCTL) ||
         ((s->ctrl & SCSW_CTRL_MASK_FCTL) != SCSW_FCTL_START_FUNC) ||
         (!(s->ctrl &

hw/s390x/css.c int css_do_xsch(SubchDev *sch) · line 1291

Quoted 10 lines
hw/s390x/css.c +0 -5
            (SCSW_ACTL_RESUME_PEND | SCSW_ACTL_START_PEND | SCSW_ACTL_SUSP))) ||
         (s->ctrl & SCSW_ACTL_SUBCH_ACTIVE)) {
-        ret = -EINPROGRESS;
-        goto out;
-    }
-
-    if (s->ctrl & SCSW_CTRL_MASK_STCTL) {
         ret = -EBUSY;
         goto out;
     }
#2 lore raw
In reply to Halil Pasic
Quoted 11 lines · On Thu, 31 Aug 2017 14:18:28 +0200 Halil Pasic <[email protected]> wrote:

The function ioinst_handle_xsch is presenting cc 2 when it's supposed to present cc 1 and the other way around, because css_do_xsch has the error codes mixed up. Because cc 1 has precedence over cc 2 we also have to swap the two checks.

Let us fix this.

---

Quoted 7 lines

Was previously a part of a series (due to an accident the series had no name). This version also fixes the priority (aka precedence) problem.

---
 hw/s390x/css.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Thanks, applied.