From patchwork Tue Jan 28 20:12:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860415 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp542181wrx; Tue, 28 Jan 2025 12:14:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUs9K9YJYQt/ONncDCKFOJa8Ku9PZlGSqyDl7AmU2b4vo7lUEwXAxcc4P11iG8sJgA70oDb4A==@linaro.org X-Google-Smtp-Source: AGHT+IG4s3zqFgRpUSURtIstdbBIZrSERLu44KbfkIjTVZuqQoo5l9lNnmC8pccUxSl4WzGloM9Q X-Received: by 2002:a05:622a:5a11:b0:467:4bd4:866b with SMTP id d75a77b69052e-46fd0b6b674mr8569561cf.35.1738095289054; Tue, 28 Jan 2025 12:14:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738095289; cv=none; d=google.com; s=arc-20240605; b=hjHJdbkGIFuN8aCC0Wun6aQgvlBY6Qnry7nSmLcMOh4Drl45ilYAITGE6Vc9DUhYFr /ZThsQ+tGh0k+KPI6ZNaWRXoc5kbIImBIjJKL6qSAXPmriAzQ2BooyCFwYY9uEbFCehh OsZsI7ceJsplSDkIZ4Ch/LoGUBE1V5f1EHGbxJLeyYW0rVCqW7Hid9IpcCb77nlLKbHw 4BfJ5T3AfOhHpKw23neHPOMi3anzUlm17zBUIdvn+KWO6n0Cxf34pT+8JXAXGEiZUM/D SrGyI3uJsv++xl2fBf5ETPDkABcQCQrgHq8S5a2u1nz3/DN+NbYTNOTtLBgn3X9i51x7 0zoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:to:from :dkim-signature; bh=xIPqvChCUfqOgMcD+7liBSkFzj/Qghi4LvOlrz81nwo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=GnAtr3tVamEYmWsPPIgU9pR89LL33ZJOFVQLh5GSB7J8NC878z7DdyijPxGIdiofKC p5xfAnxa7WWO2DzqTDdIMa7BX86skE6tIOo07fd1GYvFVyUXFzyl6teGIK6KdNdARZ54 Gy9Xoo9t2+WQehPakvIZuaDJt1eHgjo7OJUcfniiEvnlpCjGsup2DS5wn5JGLsal7dx3 FBEBLygpkOcbTeCaPy//i1iOAlvI2q9PJw0En4yS2KQaQEtTe2IIEwwTXzrC4Ge5vYSp JBIDg9O15Rzab5IFeTzq+GqqAY7QyaX7jqlDTgZO9FgaUR+ENDivAlyBDSyVL3AIGjs4 ohCw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BHUaxAIH; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e66baa603si142159791cf.583.2025.01.28.12.14.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 12:14:49 -0800 (PST) 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=BHUaxAIH; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcrxh-00025M-6U; Tue, 28 Jan 2025 15:13:29 -0500 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 ) id 1tcrxe-00024X-EU for qemu-devel@nongnu.org; Tue, 28 Jan 2025 15:13:26 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcrxb-0001Ym-UR for qemu-devel@nongnu.org; Tue, 28 Jan 2025 15:13:25 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4368a293339so69453915e9.3 for ; Tue, 28 Jan 2025 12:13:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738095202; x=1738700002; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xIPqvChCUfqOgMcD+7liBSkFzj/Qghi4LvOlrz81nwo=; b=BHUaxAIHOQxf8L9EtAQkYls9ZRhuMh4QJPZAwxsoL9SmBR4gc93946kNtrrRBHA982 Dld/d2kPRphgbn3nEg+4d11Yf5M2wBlSm5LO+2ZN6GiT86/GSzCZVV7T+uyhsVnOAiHu NSdzPeGZM45Y0iF6/d/M1wv5dU6m0FL4gMmSTzw+QCiF/jmJszVgqRm52WxLx1XW2CEY syZj5K1k5BaSzF/ce1V4rtmxAoB5Zke2kS5ONd/Ly5ZCtjD6RrSBum95VGAZfCKxPOGY IgxU2xq3Qc5dkXUGI75xnBd8nMuShcXL5pvNfVKmYP6CWCpy4BlJBv8bkupLp1P0jr4q cLGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738095202; x=1738700002; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xIPqvChCUfqOgMcD+7liBSkFzj/Qghi4LvOlrz81nwo=; b=ngdUBYQ8vFpR+Ycp6HiIf/1yrDBq7xjaQUIseqWSB3jTsgYXZy7HSy4hbgnuJHmuIB YBivNb3DqV7kPaWmZk/e/woQQJAPGylf8K2eSAHxnKGBPtgRFUwGJTeTRNQGjExoqqE5 PIH+rQG4dhiAwjEuPiFspC4hJSKyByWgCmOTr78ZE4benGYkHuMEmjpgFdOixlhuo7ep pEDH5IE4bicyMhCHkoSW/PBeikySW6iUVuVxq05bzj9US1E2cqqdC69r1GiXK2ZYXJ5M NlfAC+O3G21bGpTsJKokuVPdrNKbBp55l8qBJGzjq/InIP2/VEZPkVh2uGf72N+WZXpY LsiQ== X-Gm-Message-State: AOJu0YyLE+EW9p7nwoCsThnvRgh/YhsysLyKRE+MAs8wm7Dx681TT/f4 smwzcnhBVvaCiUtQad3WuQ0Klf9d98a4gDMrUvVLqsjKE6qHG+shftsa/bDR65UlJpm915QAdlw d X-Gm-Gg: ASbGncv1STT3V3v+NpPQRGeMQqNQIqKxa0RzxBYb1iF3iGIVduuzO7QDxg/FwUyl6Pz Tz4A/YN5xqIL5xLh6UIoUJnPrwTc6iVSaDFraURL1KhbttPD3n8viTaWRHSJTgHdhRc7Fi/n45H oCOkMCrB4Ap/JA3fMvXYeH2yrVcodGoZFYEIWBAXhoKZyewgvLB7DLtfPUIlCXdLgbk9EqdHwLu PYgJNcoqmWTqczkPZXIRAFnMwLGa/k4+OJ36CRwxIKCvQhrn47OpbOGUfpftm+V3b0FJZSV6p+h VGai6ZY66DkPEqv6v8C6xtI71f28Yu5X X-Received: by 2002:a05:600c:1e20:b0:438:a1f4:3e9d with SMTP id 5b1f17b1804b1-438dc3c405dmr2360735e9.9.1738095202028; Tue, 28 Jan 2025 12:13:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4fa3efsm182524105e9.2.2025.01.28.12.13.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 12:13:21 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/36] hw/char/imx_serial: Update all state before restarting ageing timer Date: Tue, 28 Jan 2025 20:12:43 +0000 Message-Id: <20250128201314.44038-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128201314.44038-1-peter.maydell@linaro.org> References: <20250128201314.44038-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Fixes characters to be "echoed" after each keystroke rather than after every other since imx_serial_rx_fifo_ageing_timer_restart() would see ~UTS1_RXEMPTY only after every other keystroke. Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/char/imx_serial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c index cb6761d40e4..38b4865157e 100644 --- a/hw/char/imx_serial.c +++ b/hw/char/imx_serial.c @@ -401,14 +401,14 @@ static void imx_put_data(void *opaque, uint32_t value) if (fifo32_num_used(&s->rx_fifo) >= rxtl) { s->usr1 |= USR1_RRDY; } - - imx_serial_rx_fifo_ageing_timer_restart(s); - s->usr2 |= USR2_RDR; s->uts1 &= ~UTS1_RXEMPTY; if (value & URXD_BRK) { s->usr2 |= USR2_BRCD; } + + imx_serial_rx_fifo_ageing_timer_restart(s); + imx_update(s); }