Message ID | 20231013141131.1531-8-philmd@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1489987wrv; Fri, 13 Oct 2023 07:13:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+liiJR+xxtxeygxisYtNIsPgUijkeaw7PIMO8u6yyjJfYipx/9bTJcgdl/41Xq+Jd+FcW X-Received: by 2002:ac8:7f49:0:b0:417:b975:6d85 with SMTP id g9-20020ac87f49000000b00417b9756d85mr406278qtk.5.1697206432280; Fri, 13 Oct 2023 07:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697206432; cv=none; d=google.com; s=arc-20160816; b=TtQPBCmBr1he88HtLXR4STqGro/OXpUhZutnSnwUoeoCAZKNl1TkrY1xTOYgMwqdZ2 s3plYL4v+wawmo7plBFp/SonXWFq1Dcgev6whuXIjsCRCU+6N2HIRP9uygJ6SdW13uAR nzmSjMV60TdRnuqA+EZBxjiRaQC+RwxPEhNv1ED/lttyS4Mvv58N2rv3WS3vznvNjTqI 8+bBowi3lL2DRMdlHPbtcJboqr7NRjTGzK2EPrSXn010HyfeqChMkSSVz+s7e8v88u04 jP3g6ML5sVhR1Kl2C/XCUVg1ZYR9DJ7icWgn42p4wo2KYUZQ4BbeUuOkeOjXP2sY41bQ M9jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FHrHAGB/EmMRyrEmXuczDQ4ZEQoq+gXqneExLSOiqGU=; fh=MusjSs7gXCZ/MKYOlww+3pkKR+FOAC+Wy5x6PlCIutc=; b=d/l9/StoJwYKB1PYzeeqFC6yDUihoalKwCx92a9BZ5AztFvL+FWmoqhBitQE0mStdH D+ghF2AUfhXOJikn+softVairpp7B5gKjw5vB4w6AQoo69ESVEztnK4Ah3OwRNeLKxG9 RUFrcjvQxBxrAXIlQTFggX/OLNjEwVamHj2nwBNcZOhcyA0IMk7mVhY/JJ8N/HptvKqI 6x8zy+dkfFUtDQGnMDttYMpTOCi54DrBA05OoBtcGryg/mZBeiUnRnXoTaU4cQOshkx7 KNyjCIp/jLXpKcdgJuqz6ukAbI/B2b0ljfjZYNXpBoAkjE+usGZhZCU4K/hIqZq98zmD XKPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l4LTrDoI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w14-20020ac87e8e000000b00411838ef9d3si1213970qtj.552.2023.10.13.07.13.52 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 07:13:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l4LTrDoI; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1qrIu5-0000e4-Bw; Fri, 13 Oct 2023 10:12:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1qrItu-0000Uo-RH for qemu-devel@nongnu.org; Fri, 13 Oct 2023 10:12:27 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1qrItt-0004aD-EO for qemu-devel@nongnu.org; Fri, 13 Oct 2023 10:12:26 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-53d8320f0easo3615077a12.3 for <qemu-devel@nongnu.org>; Fri, 13 Oct 2023 07:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697206343; x=1697811143; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FHrHAGB/EmMRyrEmXuczDQ4ZEQoq+gXqneExLSOiqGU=; b=l4LTrDoIAZJWVT43yCCbr8T2C1CHBzuzb2SiOp3AyEzBEaeJ42bWEaFTZaSb8eScH7 rt5uFQj3PJwUlK9APa/hOw4slO5UIE+WtgIlDvgbqNWIkvuCmMMBr4qXsSfrgTCAs36c TT1CzS49gZ8CFN3xYAeqUqGQoPhRFX7IxB5uaQQ4UtdStENGf6R/kT4ORkfhcPqiSM0f uyWjIapXEbKFYmLUsLG3ZGQB+4j5V/OV/fURZPR3XjKtLFy15fVgJYJ2FK3FVLlWsyNS yPtB6EPOugQMTp0U+EX8r2aqfmsd992IJT2OujTV6+6UQHIGa08UOwxEUdaSVbO8q44O 5/1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697206343; x=1697811143; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FHrHAGB/EmMRyrEmXuczDQ4ZEQoq+gXqneExLSOiqGU=; b=YZrPpss1fhffsKCUEpgjzVcEvNS2WGQe7g4sC6ntAXTISfzU+h6d6BSH/0nc8BYIDD qrJlBcpEcN0AUc0L/c7paPHjYZCJW3Tc8bj+JjBXNolvMPKBfOGP5BN1Fh6AAwIiFqrl wN/qqjMTzpcvBc2z3i/6RMujFIsqIzKoV82SCfMyK7Qx+O8fRhFABLYy6OdAtXW1t/Sr 0ShRnxpa2MofHyFve/i+Y6av5du+UbBIqRpb3GvZLMQgZRC6qUM8o9SLZtPuSAJ4YcZf tXCRqbbcuhHLJtYxa9ViXfAkfZMr8IVeZYr/KVPiODsm1thUryUc4fg1Y/ZudZvL5cGQ UXWQ== X-Gm-Message-State: AOJu0Yyl1iwO7x+idL1EYRMC2JgRAnbDfGIDYld/0PD51rmXE1YYRFPj K9HLvTO7k2b9KUmoesL3Mld9ZH3NN3n96fqHNPY= X-Received: by 2002:a50:ef0d:0:b0:522:2782:537 with SMTP id m13-20020a50ef0d000000b0052227820537mr23076679eds.15.1697206343741; Fri, 13 Oct 2023 07:12:23 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.168]) by smtp.gmail.com with ESMTPSA id r19-20020a056402035300b00522828d438csm11613766edw.7.2023.10.13.07.12.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Oct 2023 07:12:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Paolo Bonzini <pbonzini@redhat.com>, Evgeny Iakovlev <eiakovlev@linux.microsoft.com>, =?utf-8?q?Marc-Andr=C3=A9_?= =?utf-8?q?Lureau?= <marcandre.lureau@redhat.com>, Gavin Shan <gshan@redhat.com>, =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>, qemu-arm@nongnu.org, Peter Maydell <peter.maydell@linaro.org>, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= <philmd@linaro.org>, Richard Henderson <richard.henderson@linaro.org> Subject: [PATCH v3 7/10] hw/char/pl011: Check if receiver is enabled Date: Fri, 13 Oct 2023 16:11:28 +0200 Message-ID: <20231013141131.1531-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013141131.1531-1-philmd@linaro.org> References: <20231013141131.1531-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
hw/char/pl011: Implement TX (async) FIFO to avoid blocking the main loop
|
expand
|
diff --git a/hw/char/pl011.c b/hw/char/pl011.c index 9c43cb47bf..ca931be139 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -77,6 +77,7 @@ DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr) #define LCR_BRK (1 << 0) /* Control Register, UARTCR */ +#define CR_RXE (1 << 9) #define CR_TXE (1 << 8) #define CR_UARTEN (1 << 0) @@ -359,9 +360,11 @@ static void pl011_write(void *opaque, hwaddr offset, static int pl011_can_receive(void *opaque) { PL011State *s = (PL011State *)opaque; - int r; + int r = 0; - r = s->read_count < pl011_get_fifo_depth(s); + if ((s->cr & CR_UARTEN) && (s->cr & CR_RXE)) { + r = s->read_count < pl011_get_fifo_depth(s); + } trace_pl011_can_receive(s->lcr, s->read_count, r); return r; }