Skip to contentSkip to conversation

powerpc/udbg_hvc: retry putc on -EAGAIN

PATCH Applied Nathan Lynch 4 participants 5 messages May 14, 2021 – Jun 6, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/udbg_hvc: retry putc on -EAGAIN

hvterm_raw_put_chars() calls hvc_put_chars(), which may return -EAGAIN when the underlying hcall returns a "busy" status, but udbg_hvc_putc() doesn't handle this. When using xmon on a PowerVM guest, this can result in incomplete or garbled output when printing relatively large amounts of data quickly, such as when dumping the kernel log buffer.

Call again on -EAGAIN.

---
 drivers/tty/hvc/hvc_vio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/hvc/hvc_vio.c +1 -1
index 798f27f40cc2..76d2a7038095 100644
@@ -249,7 +249,7 @@ static void udbg_hvc_putc(char c)
 			count = hvterm_hvsi_put_chars(0, &c, 1);
 			break;
 		}
-	} while(count == 0);
+	} while(count == 0 || count == -EAGAIN);
 }
 
 static int udbg_hvc_getc_poll(void)
Signature · 1 line
2.30.2
maintainer
#1 lore raw
Quoted 11 lines · Nathan Lynch

hvterm_raw_put_chars() calls hvc_put_chars(), which may return -EAGAIN when the underlying hcall returns a "busy" status, but udbg_hvc_putc() doesn't handle this. When using xmon on a PowerVM guest, this can result in incomplete or garbled output when printing relatively large amounts of data quickly, such as when dumping the kernel log buffer.

Call again on -EAGAIN.

---
 drivers/tty/hvc/hvc_vio.c | 2 +-

Subject line does not match up with this file name.

Don't you want "tty" and "hvc" in there somewhere?

thanks,

greg k-h

#2 lore raw
Quoted 9 lines · Greg KH
Quoted 8 lines · Nathan Lynch

hvterm_raw_put_chars() calls hvc_put_chars(), which may return -EAGAIN when the underlying hcall returns a "busy" status, but udbg_hvc_putc() doesn't handle this. When using xmon on a PowerVM guest, this can result in incomplete or garbled output when printing relatively large amounts of data quickly, such as when dumping the kernel log buffer.

Call again on -EAGAIN.

Quoted 7 lines
Quoted 3 lines
---
 drivers/tty/hvc/hvc_vio.c | 2 +-

Subject line does not match up with this file name.

Don't you want "tty" and "hvc" in there somewhere?

It's a powerpc only driver, but I guess the subject should still be "tty: hvc: ..." to match convention.

I was planning to take this via the powerpc tree, but I can drop it if you'd rather take it.

cheers

maintainer
#3 lore raw
Quoted 16 lines · Michael Ellerman
Quoted 15 lines · Greg KH
Quoted 11 lines · Nathan Lynch

hvterm_raw_put_chars() calls hvc_put_chars(), which may return -EAGAIN when the underlying hcall returns a "busy" status, but udbg_hvc_putc() doesn't handle this. When using xmon on a PowerVM guest, this can result in incomplete or garbled output when printing relatively large amounts of data quickly, such as when dumping the kernel log buffer.

Call again on -EAGAIN.

---
 drivers/tty/hvc/hvc_vio.c | 2 +-

Subject line does not match up with this file name.

Quoted 7 lines
Quoted 1 line

Don't you want "tty" and "hvc" in there somewhere?

It's a powerpc only driver, but I guess the subject should still be "tty: hvc: ..." to match convention.

I was planning to take this via the powerpc tree, but I can drop it if you'd rather take it.

No problem, feel free to take it yourself!

greg k-h

#4 lore raw
In reply to Nathan Lynch
Quoted 7 lines · Nathan Lynch

hvterm_raw_put_chars() calls hvc_put_chars(), which may return -EAGAIN when the underlying hcall returns a "busy" status, but udbg_hvc_putc() doesn't handle this. When using xmon on a PowerVM guest, this can result in incomplete or garbled output when printing relatively large amounts of data quickly, such as when dumping the kernel log buffer.

Call again on -EAGAIN.

Applied to powerpc/next.

[1/1] powerpc/udbg_hvc: retry putc on -EAGAIN

      https://git.kernel.org/powerpc/c/027f55e87c3094270a3223f7331d033fe15a2b3f

cheers