Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xtensa: ISS: fix rs_put_char

ISS serial console prints garbage instead of symbols printed via
rs_put_char. gcc optimizes away putting prined symbol into memory buffer
because there's no evidence that the buffer is used afterwards.

Make rs_put_char and rs_write use simc_write that has explicit wmb.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>

authored by

Max Filippov and committed by
Chris Zankel
c88d8df0 50c08f8e

+2 -7
+2 -7
arch/xtensa/platforms/iss/console.c
··· 91 91 { 92 92 /* see drivers/char/serialX.c to reference original version */ 93 93 94 - __simc (SYS_write, 1, (unsigned long)buf, count, 0, 0); 94 + simc_write(1, buf, count); 95 95 return count; 96 96 } 97 97 ··· 122 122 123 123 static int rs_put_char(struct tty_struct *tty, unsigned char ch) 124 124 { 125 - char buf[2]; 126 - 127 - buf[0] = ch; 128 - buf[1] = '\0'; /* Is this NULL necessary? */ 129 - __simc (SYS_write, 1, (unsigned long) buf, 1, 0, 0); 130 - return 1; 125 + return rs_write(tty, &ch, 1); 131 126 } 132 127 133 128 static void rs_flush_chars(struct tty_struct *tty)