linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN
@ 2021-05-14 21:44 Nathan Lynch
  2021-05-21 12:47 ` Greg KH
  2021-06-06 12:08 ` Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Nathan Lynch @ 2021-05-14 21:44 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mpe, linux-kernel, gregkh, jirislaby

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN
  2021-05-14 21:44 [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN Nathan Lynch
@ 2021-05-21 12:47 ` Greg KH
  2021-05-23 10:51   ` Michael Ellerman
  2021-06-06 12:08 ` Michael Ellerman
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2021-05-21 12:47 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: linuxppc-dev, mpe, linux-kernel, jirislaby

On Fri, May 14, 2021 at 04:44:22PM -0500, Nathan Lynch wrote:
> 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 +-

Subject line does not match up with this file name.

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

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN
  2021-05-21 12:47 ` Greg KH
@ 2021-05-23 10:51   ` Michael Ellerman
  2021-05-27 11:10     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2021-05-23 10:51 UTC (permalink / raw)
  To: Greg KH, Nathan Lynch; +Cc: linuxppc-dev, linux-kernel, jirislaby

Greg KH <gregkh@linuxfoundation.org> writes:
> On Fri, May 14, 2021 at 04:44:22PM -0500, Nathan Lynch wrote:
>> 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 +-
>
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN
  2021-05-23 10:51   ` Michael Ellerman
@ 2021-05-27 11:10     ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2021-05-27 11:10 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Nathan Lynch, linuxppc-dev, linux-kernel, jirislaby

On Sun, May 23, 2021 at 08:51:09PM +1000, Michael Ellerman wrote:
> Greg KH <gregkh@linuxfoundation.org> writes:
> > On Fri, May 14, 2021 at 04:44:22PM -0500, Nathan Lynch wrote:
> >> 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 +-
> >
> > 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.

No problem, feel free to take it yourself!

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN
  2021-05-14 21:44 [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN Nathan Lynch
  2021-05-21 12:47 ` Greg KH
@ 2021-06-06 12:08 ` Michael Ellerman
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2021-06-06 12:08 UTC (permalink / raw)
  To: linuxppc-dev, Nathan Lynch; +Cc: gregkh, jirislaby, linux-kernel

On Fri, 14 May 2021 16:44:22 -0500, Nathan Lynch wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-06 12:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 21:44 [PATCH] powerpc/udbg_hvc: retry putc on -EAGAIN Nathan Lynch
2021-05-21 12:47 ` Greg KH
2021-05-23 10:51   ` Michael Ellerman
2021-05-27 11:10     ` Greg KH
2021-06-06 12:08 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).