From: Nathan Lynch <nathanl@linux.ibm.com> To: linuxppc-dev@lists.ozlabs.org Cc: mpe@ellerman.id.au, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org Subject: [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN Date: Fri, 14 May 2021 16:44:22 -0500 [thread overview] Message-ID: <20210514214422.3019105-1-nathanl@linux.ibm.com> (raw) 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> --- drivers/tty/hvc/hvc_vio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c index 798f27f40cc2..76d2a7038095 100644 --- a/drivers/tty/hvc/hvc_vio.c +++ b/drivers/tty/hvc/hvc_vio.c @@ -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) -- 2.30.2
WARNING: multiple messages have this Message-ID (diff)
From: Nathan Lynch <nathanl@linux.ibm.com> To: linuxppc-dev@lists.ozlabs.org Cc: jirislaby@kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Subject: [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN Date: Fri, 14 May 2021 16:44:22 -0500 [thread overview] Message-ID: <20210514214422.3019105-1-nathanl@linux.ibm.com> (raw) 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> --- drivers/tty/hvc/hvc_vio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c index 798f27f40cc2..76d2a7038095 100644 --- a/drivers/tty/hvc/hvc_vio.c +++ b/drivers/tty/hvc/hvc_vio.c @@ -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) -- 2.30.2
next reply other threads:[~2021-05-14 21:44 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-14 21:44 Nathan Lynch [this message] 2021-05-14 21:44 ` [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN Nathan Lynch 2021-05-21 12:47 ` Greg KH 2021-05-21 12:47 ` Greg KH 2021-05-23 10:51 ` Michael Ellerman 2021-05-23 10:51 ` Michael Ellerman 2021-05-27 11:10 ` Greg KH 2021-05-27 11:10 ` Greg KH 2021-06-06 12:08 ` Michael Ellerman
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210514214422.3019105-1-nathanl@linux.ibm.com \ --to=nathanl@linux.ibm.com \ --cc=gregkh@linuxfoundation.org \ --cc=jirislaby@kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linuxppc-dev@lists.ozlabs.org \ --cc=mpe@ellerman.id.au \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.