From nobody Thu May 2 00:28:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516990280891792.6677514086996; Fri, 26 Jan 2018 10:11:20 -0800 (PST) Received: from localhost ([::1]:43135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef8TA-0004Od-3m for importer@patchew.org; Fri, 26 Jan 2018 13:11:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef879-0001R0-Qd for qemu-devel@nongnu.org; Fri, 26 Jan 2018 12:48:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ef879-0003o5-50 for qemu-devel@nongnu.org; Fri, 26 Jan 2018 12:48:35 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2082 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ef873-0003dj-OQ; Fri, 26 Jan 2018 12:48:30 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D6AAE7EFE6CC1; Sat, 27 Jan 2018 00:00:32 +0800 (CST) Received: from [127.0.0.1] (10.202.226.123) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.361.1; Sat, 27 Jan 2018 00:00:27 +0800 To: , From: Wei Xu Message-ID: <5A6B5091.8030601@hisilicon.com> Date: Fri, 26 Jan 2018 16:00:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.202.226.123] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 45.249.212.191 X-Mailman-Approved-At: Fri, 26 Jan 2018 13:07:00 -0500 Subject: [Qemu-devel] [Qemu-arm] [PATCH] pl011: do not put into fifo before enabled the interruption X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , "Chenxin \(Charles\)" , tiantao6@huawei.com, qemu-devel@nongnu.org, Shameerali Kolothum Thodi , Linuxarm , "Liuxinliang \(Matthew Liu\)" , qemu-arm@nongnu.org, Daode Huang , Jonathan Cameron , "Liguozhu \(Kenneth\)" , Zhangyi ac Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 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 --- 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 =3D (PL011State *)opaque; int r; + if (!s->int_enabled) + return 0; if (s->lcr & 0x10) { r =3D s->read_count < 16; } else { --=20 2.11.0