* [PATCH] drivers/tty/hvc/hvc_tile.c: properly return -EAGAIN
@ 2015-05-05 17:11 Chris Metcalf
2015-05-10 17:18 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Chris Metcalf @ 2015-05-05 17:11 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, linuxppc-dev, linux-kernel; +Cc: Chris Metcalf
We were returning zero if no bytes could be written to the Tilera
hypervisor console device, but this causes the output to be truncated.
By returning -EAGAIN the tty hvc driver will come back and try again,
which gives the semantics we want, and avoids dropping console output.
Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
---
I have queued this in the tile tree as a tile-specific device, but
if someone would prefer to pick it up for a tty or tty/hvc tree,
that's fine too; just let me know.
drivers/tty/hvc/hvc_tile.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/hvc/hvc_tile.c b/drivers/tty/hvc/hvc_tile.c
index 3f6cd3102db5..9da1e842bbe9 100644
--- a/drivers/tty/hvc/hvc_tile.c
+++ b/drivers/tty/hvc/hvc_tile.c
@@ -51,7 +51,8 @@ int tile_console_write(const char *buf, int count)
_SIM_CONTROL_OPERATOR_BITS));
return 0;
} else {
- return hv_console_write((HV_VirtAddr)buf, count);
+ /* Translate 0 bytes written to EAGAIN for hvc_console_print. */
+ return hv_console_write((HV_VirtAddr)buf, count) ?: -EAGAIN;
}
}
--
2.1.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/tty/hvc/hvc_tile.c: properly return -EAGAIN
2015-05-05 17:11 [PATCH] drivers/tty/hvc/hvc_tile.c: properly return -EAGAIN Chris Metcalf
@ 2015-05-10 17:18 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2015-05-10 17:18 UTC (permalink / raw)
To: Chris Metcalf; +Cc: Jiri Slaby, linuxppc-dev, linux-kernel
On Tue, May 05, 2015 at 01:11:28PM -0400, Chris Metcalf wrote:
> We were returning zero if no bytes could be written to the Tilera
> hypervisor console device, but this causes the output to be truncated.
> By returning -EAGAIN the tty hvc driver will come back and try again,
> which gives the semantics we want, and avoids dropping console output.
>
> Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
> ---
> I have queued this in the tile tree as a tile-specific device, but
> if someone would prefer to pick it up for a tty or tty/hvc tree,
> that's fine too; just let me know.
Sounds good to me, feel free to add:
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if you want it :)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/tty/hvc/hvc_tile.c: properly return -EAGAIN
@ 2015-05-10 17:18 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2015-05-10 17:18 UTC (permalink / raw)
To: Chris Metcalf; +Cc: linuxppc-dev, Jiri Slaby, linux-kernel
On Tue, May 05, 2015 at 01:11:28PM -0400, Chris Metcalf wrote:
> We were returning zero if no bytes could be written to the Tilera
> hypervisor console device, but this causes the output to be truncated.
> By returning -EAGAIN the tty hvc driver will come back and try again,
> which gives the semantics we want, and avoids dropping console output.
>
> Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
> ---
> I have queued this in the tile tree as a tile-specific device, but
> if someone would prefer to pick it up for a tty or tty/hvc tree,
> that's fine too; just let me know.
Sounds good to me, feel free to add:
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if you want it :)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-10 21:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-05 17:11 [PATCH] drivers/tty/hvc/hvc_tile.c: properly return -EAGAIN Chris Metcalf
2015-05-10 17:18 ` Greg Kroah-Hartman
2015-05-10 17:18 ` Greg Kroah-Hartman
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.