]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
tty: hvc: udbg_hvc: retry putc on -EAGAIN
authorNathan Lynch <nathanl@linux.ibm.com>
Fri, 14 May 2021 21:44:22 +0000 (16:44 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 23 May 2021 10:51:36 +0000 (20:51 +1000)
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.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210514214422.3019105-1-nathanl@linux.ibm.com
drivers/tty/hvc/hvc_vio.c

index 798f27f40cc2d97302d68dda833ad502530a7f9f..72b11aa7e0a68e25f80908bde82e926c24d5ac2b 100644 (file)
@@ -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)