All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Qemu-arm] [PATCH] pl011: do not put into fifo before enabled the interruption
@ 2018-01-26 16:00 Wei Xu
  2018-01-26 16:36 ` Peter Maydell
  2018-01-26 18:14 ` no-reply
  0 siblings, 2 replies; 13+ messages in thread
From: Wei Xu @ 2018-01-26 16:00 UTC (permalink / raw)
  To: peter.maydell, pbonzini
  Cc: qemu-arm, qemu-devel, Linuxarm, Rob Herring, Daode Huang,
	Chenxin (Charles), Zhangyi ac, Liguozhu (Kenneth),
	Jonathan Cameron, Shameerali Kolothum Thodi,
	Liuxinliang (Matthew Liu),
	tiantao6

If the user pressed some keys in the console during the guest booting,
the console will be hanged after entering the shell.
Because in the above case the pl011_can_receive will return 0 that
the pl011_receive will not be called. That means no interruption will
be injected in to the kernel and the pl011 state could not be driven
further.

This patch fixed that issue by checking the interruption is enabled or
not before putting into the fifo.

Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
---
 hw/char/pl011.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/char/pl011.c b/hw/char/pl011.c
index 2aa277fc4f..6296de9527 100644
--- a/hw/char/pl011.c
+++ b/hw/char/pl011.c
@@ -229,6 +229,8 @@ static int pl011_can_receive(void *opaque)
     PL011State *s = (PL011State *)opaque;
     int r;

+    if (!s->int_enabled)
+	return 0;
     if (s->lcr & 0x10) {
         r = s->read_count < 16;
     } else {
-- 
2.11.0

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

end of thread, other threads:[~2018-01-29 13:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-26 16:00 [Qemu-devel] [Qemu-arm] [PATCH] pl011: do not put into fifo before enabled the interruption Wei Xu
2018-01-26 16:36 ` Peter Maydell
2018-01-26 17:05   ` Wei Xu
2018-01-26 17:15     ` Peter Maydell
2018-01-26 17:33       ` Wei Xu
2018-01-26 18:01         ` Peter Maydell
2018-01-29 10:29           ` Andrew Jones
2018-01-29 11:10             ` Peter Maydell
2018-01-29 11:37             ` Wei Xu
2018-01-29 12:57               ` Andrew Jones
2018-01-29 12:18           ` Wei Xu
2018-01-29 13:36             ` Peter Maydell
2018-01-26 18:14 ` no-reply

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.