From patchwork Fri Jan 26 16:00:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Xu X-Patchwork-Id: 126007 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp516470ljd; Fri, 26 Jan 2018 10:10:01 -0800 (PST) X-Google-Smtp-Source: AH8x226j7OwdDBpSD6BjxtgW5vgz9wEPyiwJ02EYDzamaxbUtAzovLvxhWDyiQhTOFot8C5MCfN6 X-Received: by 10.129.200.73 with SMTP id k9mr12363604ywl.496.1516990200971; Fri, 26 Jan 2018 10:10:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516990200; cv=none; d=google.com; s=arc-20160816; b=EWbVgYlT3mck3iS0GwAWvC29GQbji4BNzP3ds1ovpn3aIZIchhW87KfsK1+AB91IvI oRqSP54FnZ1Crr0akKqJVZGU01sgQ+2QuAL68h4Lg9wELkGy7xrpBqSnFS36i1/6dTXm 389aNcUk0Rzh7fyH07DO5lrLff9MXtP5Cx9hv6AH5bJVQpsFr2us4i9scZZE3W5aqlio B8pPJgzoN74qrtemIl1uQWD8Iqd5CYhqqFx3vAnbTzrzkli0qY75PQx1O4Y1Afhk5Cac FIU+9yOEtTSwUdCMxLYeoiHWMm+e9COW07QDM29pUHwj6MNlhGAHZUpGw955q/ohrSiP kXmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:user-agent:date:message-id :from:to:arc-authentication-results; bh=1Q+Ay3Uc8Jz9eSDUFgsIIjdhm6rtRpGq9DDiLJnORO8=; b=LoRoNg3H2MsF2WrPGH7hpCxt8Cpbf7XSiThhJ2SIug2M3NZNdkkQuU7mLzldfeYXR2 GSXb9LjYCWfizCBfZEv8rRNoAJw0FxR3xPowb/q1Z06/pjp6NTXruQ9sMcBWyq1/dIws xbVC6i/XrxKy3ctNUZgz9zeGEqzb2PTjZx6yilKH5pB74epdQ+8Y6l+MjBQPS5PmdPzU NLmE/h9T9pNVxaPY5uIw1qjxmPXqiTqeBic96p7+vEqF4XWzixBh3qSM/5WzQdVvPZKk s2DibCXcWjsN/M1ZIRBhY/Knhjt7V6vIMjtAODLyn8cUbH36U8ZXv0glK5JafVbN1Ict uapw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l8si3599938ybk.766.2018.01.26.10.10.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 26 Jan 2018 10:10:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:43059 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ef8Rs-0003FA-85 for patch@linaro.org; Fri, 26 Jan 2018 13:10:00 -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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(+) -- 2.11.0 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 {