From patchwork Sat Nov 12 21:21:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 19249 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432523wru; Sat, 12 Nov 2022 13:23:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf730AxAX76gBabYMXAUAef6Kr06QYeDGYeJCKhPN3BGEd8bHq2ZM/93wwIH0hhA92fjMeCO X-Received: by 2002:a17:906:6c8d:b0:7ad:f2f9:2b49 with SMTP id s13-20020a1709066c8d00b007adf2f92b49mr5760116ejr.94.1668288225855; Sat, 12 Nov 2022 13:23:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288225; cv=none; d=google.com; s=arc-20160816; b=w0TLGfaufy/01AZD/t3vwJgZ7qYlko6DzIJ1FCi5Pfm1/fEMqijzIOt/NaW7NKyuRs 7fHo+FX4ASm2pcoIb5vIG4t3QM+Y9VwVkS+yiMFGD6lmACkwqveSMXBytJIgEedsdNWX 8MH481Jefmez1nAl8naEWOo9cz8exQFDuCP/c1rAjZ9G5bI6C/y4nRHoEejbKV2Ijkqd av9CMze1d9GW1PkzMsQwJ/2jGcfqwOF6vtm6jXM4SOtRTlsp+DXgOtjXNFFnCCubqON2 o9T6gXg1uLoNtJdMGonMYsczIkMy3LG6v2PmuGxk8XwwvvpQijvCOEJHS64zDDhaAM7z Vk6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lj3jgN94Up18U7wVvpj0Zgp4+ZbcXYE4CuLEGeta7KA=; b=a/I/iQvL8h/QD0BLL9OV5S134/FC6/QOhi9HqiBWE9gzPSlOqAFHsC0mocJsG9zHPs AW688TkrNNLZwDlDsPlZIIMC5BySZCT0gqya5VxNWHxP4ewi6dtc5vydOtApxBzBHHeL EVyhNlM3U1dZ3TYZ+QL8UcJC7Hh6g/2P0AT7BbrswvYrSFJePWmtVSCWtpv8582/k9hB C9KjlGkHzx3Jc5Qc0EeNz+YdBdkaEEju6lI40c0jwyHEBLGrUC8HJVDNTchSPSdgWIR2 hF2g5zCN/UBkf8ilQOMLSia2HM3Dd3UuC9p1YsFAR7R8Ty+f0iFLJTL7wBISF/nwZjum wSNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hT5YiZaC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a50c242000000b0046721c5b7e0si5170514edf.511.2022.11.12.13.23.21; Sat, 12 Nov 2022 13:23:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hT5YiZaC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235176AbiKLVWC (ORCPT + 99 others); Sat, 12 Nov 2022 16:22:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235092AbiKLVVl (ORCPT ); Sat, 12 Nov 2022 16:21:41 -0500 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F2B715A1D; Sat, 12 Nov 2022 13:21:39 -0800 (PST) Received: by mail-qt1-x82f.google.com with SMTP id l15so4874485qtv.4; Sat, 12 Nov 2022 13:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=lj3jgN94Up18U7wVvpj0Zgp4+ZbcXYE4CuLEGeta7KA=; b=hT5YiZaCxVZ1nPy9zMoXb3qQqnPNsZ7o9pju+19OsVVMRh096IvhsGw3wrI3WyLprx qdPk33wgAo8ELhrFTjh2rJ6nwlND9hL1trHMue0kGpziwDe/aXDdF5A2OAztsgcbx0KP Devs53QoRNOxuZgtr9LpArCBscEp1EFIfWc+Wyv3CtrjVMAZaawDoetYCdxvKkAIXK+p 9bltTnJY5s/ewqlCSBZchvfwRncppJ3X2Q13ZUWTkSl1J1V1hikyiJ7EuSqzDPfs6J42 fk4qATFyjlt2NIP+fFBwR1ezjd70Ex5775RmWUNZKvqFjJYSuQJMGm3sO+iqGRD2Oco2 2lVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=lj3jgN94Up18U7wVvpj0Zgp4+ZbcXYE4CuLEGeta7KA=; b=esRuAhsIkXxasbv3VU+/CPPofmVzwoyrT/cBYNwuG1l0SpbpwmrQwVsv5YZwFv8Kw6 Dx1rD15Y3z4JMOB/7pozgKyzADyOOM8ptoM3ziK93ncBMae2Gg57FgwzkabPVPo+DvMg S3v4SzG4nosa8KPjigJKEg10yGTaqGVs2sOVD9aN4hsUMDRDZNGn8z9x7NxFIRgM9o8r PsDyChdt2w32tlGISkXUf2Tx7BKSI0vYykpapOmaywcVi22C50jp4Lsn0J58pkomD4VE 8SeZ5l0VDM28AVPm+4FR4bxNVkkgxdPqN6EXi4uRi+4xUcwekd8Y+RodIwQzqWV5FIae 8oyQ== X-Gm-Message-State: ANoB5pnrD9wbFNQv0L+A565zHMdQeLMGTE0WMvhSeuPQYqcjgRnRvxZz VyNcmTzY6vLVGV4DgOvyeA9W1LnBTwAYHQ== X-Received: by 2002:ac8:474b:0:b0:3a5:177d:d9cb with SMTP id k11-20020ac8474b000000b003a5177dd9cbmr6770535qtp.64.1668288098440; Sat, 12 Nov 2022 13:21:38 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:38 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 07/14] serial: liteuart: rx loop should only ack rx events Date: Sat, 12 Nov 2022 16:21:18 -0500 Message-Id: <20221112212125.448824-8-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749326994866173518?= X-GMAIL-MSGID: =?utf-8?q?1749326994866173518?= While receiving characters, it is necessary to acknowledge each one by writing to the EV_PENDING register's EV_RX bit. Ensure we do not also gratuitously set the EV_TX bit in the process. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index ff3486860989..b5ab48aa35cf 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -81,7 +81,7 @@ static void liteuart_timer(struct timer_list *t) port->icount.rx++; /* necessary for RXEMPTY to refresh its value */ - litex_write8(membase + OFF_EV_PENDING, EV_TX | EV_RX); + litex_write8(membase + OFF_EV_PENDING, EV_RX); /* no overflow bits in status */ if (!(uart_handle_sysrq_char(port, ch)))