Commit 6faf4444 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

[S390] cio: use barrier() in stsch_reset.

Use barrier() in stsch_reset() instead of duplicating the stsch()
inline assembly and adding "memory" to the clobberlist.
Pointed out by Chuck Ebbert.

Real fix would be to add a fixup section to the stsch() and extend the
basic program check handler so it searches the exception tables in case
of a program check.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent dd401e2b
...@@ -880,19 +880,15 @@ static void cio_reset_pgm_check_handler(void) ...@@ -880,19 +880,15 @@ static void cio_reset_pgm_check_handler(void)
static int stsch_reset(struct subchannel_id schid, volatile struct schib *addr) static int stsch_reset(struct subchannel_id schid, volatile struct schib *addr)
{ {
int rc; int rc;
register struct subchannel_id reg1 asm ("1") = schid;
pgm_check_occured = 0; pgm_check_occured = 0;
s390_reset_pgm_handler = cio_reset_pgm_check_handler; s390_reset_pgm_handler = cio_reset_pgm_check_handler;
rc = stsch(schid, addr);
s390_reset_pgm_handler = NULL;
asm volatile( /* The program check handler could have changed pgm_check_occured */
" stsch 0(%2)\n" barrier();
" 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) if (pgm_check_occured)
return -EIO; return -EIO;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment