[S390] cio: fix stsch_reset.
authorMichael Holzheu <holzheu@de.ibm.com>
Wed, 27 Dec 2006 23:35:36 +0000 (00:35 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 27 Dec 2006 23:35:36 +0000 (00:35 +0100)
Copy inline assembly of stsch and add "memory" to clobber list in order
to prevent gcc from optimizing away the checking of the global variable
"pgm_check_occured".

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/cio.c

index 3a403f195cf832f1b7a533d59c79d75c32b1c8d6..b471ac4a1bf66a1a50b4a33a1f8ca5619648a1ae 100644 (file)
@@ -2,8 +2,7 @@
  *  drivers/s390/cio/cio.c
  *   S/390 common I/O routines -- low level i/o calls
  *
- *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
- *                           IBM Corporation
+ *    Copyright (C) IBM Corp. 1999,2006
  *    Author(s): Ingo Adlung (adlung@de.ibm.com)
  *              Cornelia Huck (cornelia.huck@de.ibm.com)
  *              Arnd Bergmann (arndb@de.ibm.com)
@@ -881,10 +880,18 @@ static void cio_reset_pgm_check_handler(void)
 static int stsch_reset(struct subchannel_id schid, volatile struct schib *addr)
 {
        int rc;
+       register struct subchannel_id reg1 asm ("1") = schid;
 
        pgm_check_occured = 0;
        s390_reset_pgm_handler = cio_reset_pgm_check_handler;
-       rc = stsch(schid, addr);
+
+       asm volatile(
+               "       stsch   0(%2)\n"
+               "       ipm     %0\n"
+               "       srl     %0,28"
+               : "=d" (rc)
+               : "d" (reg1), "a" (addr), "m" (*addr) : "memory", "cc");
+
        s390_reset_pgm_handler = NULL;
        if (pgm_check_occured)
                return -EIO;