diff mbox

[1/1] s390x/css: fix cc handling for XSCH

Message ID 20170831121828.85885-1-pasic@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Halil Pasic Aug. 31, 2017, 12:18 p.m. UTC
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.

Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Reported-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
---

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(-)

Comments

Thomas Huth Aug. 31, 2017, 12:53 p.m. UTC | #1
On 31.08.2017 14:18, Halil Pasic 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.
> 
> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
> Reported-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
> ---
> 
> 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(-)
> 
> diff --git a/hw/s390x/css.c b/hw/s390x/css.c
> index 1880b1a0ff..e04e0ea3a8 100644
> --- a/hw/s390x/css.c
> +++ b/hw/s390x/css.c
> @@ -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;
>      }
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>
Cornelia Huck Aug. 31, 2017, 1:24 p.m. UTC | #2
On Thu, 31 Aug 2017 14:18:28 +0200
Halil Pasic <pasic@linux.vnet.ibm.com> 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.
> 
> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
> Reported-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
> ---
> 
> 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.
diff mbox

Patch

diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 1880b1a0ff..e04e0ea3a8 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -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;
     }