public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [S390] cio: fix stsch_reset.
@ 2006-12-31  6:31 Chuck Ebbert
  2006-12-31 12:07 ` Martin Schwidefsky
  2006-12-31 12:22 ` Heiko Carstens
  0 siblings, 2 replies; 5+ messages in thread
From: Chuck Ebbert @ 2006-12-31  6:31 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: Michael Holzheu, linux-kernel

In-Reply-To: <20061228103925.GB6270@skybase>

On Thu, 28 Dec 2006 11:39:25 +0100, Martin Schwidefsky wrote:

> @@ -881,10 +880,18 @@ static void cio_reset_pgm_check_handler(
>  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;


Can't you just put a barrier() before the stsch() call?

-- 
MBTI: IXTP


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [S390] cio: fix stsch_reset.
@ 2006-12-28 10:39 Martin Schwidefsky
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Schwidefsky @ 2006-12-28 10:39 UTC (permalink / raw)
  To: linux-kernel, holzheu

From: Michael Holzheu <holzheu@de.ibm.com>

[S390] cio: fix stsch_reset.

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 |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff -urpN linux-2.6/drivers/s390/cio/cio.c linux-2.6-patched/drivers/s390/cio/cio.c
--- linux-2.6/drivers/s390/cio/cio.c	2006-12-28 00:33:22.000000000 +0100
+++ linux-2.6-patched/drivers/s390/cio/cio.c	2006-12-28 00:33:36.000000000 +0100
@@ -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(
 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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-01-08  9:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-31  6:31 [S390] cio: fix stsch_reset Chuck Ebbert
2006-12-31 12:07 ` Martin Schwidefsky
2006-12-31 12:22 ` Heiko Carstens
2007-01-08  9:54   ` Michael Holzheu
  -- strict thread matches above, loose matches on Subject: below --
2006-12-28 10:39 Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox