From patchwork Wed Nov 16 14:48:55 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: 21097 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp183375wru; Wed, 16 Nov 2022 06:55:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf6rq7XmxG2vl2sXZHKhj9y913H0uIADtzNFXbU6O/XbJg6iioKvce3srk5J57TEJDT8hkF6 X-Received: by 2002:a17:906:2a1b:b0:7ae:4a7f:3280 with SMTP id j27-20020a1709062a1b00b007ae4a7f3280mr18422264eje.265.1668610519146; Wed, 16 Nov 2022 06:55:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610519; cv=none; d=google.com; s=arc-20160816; b=Z+eMGGQz5ju6nBWlymakk1UbVhvbjfRjCQybyGc2M3RBc7KnZg1WqrZwQ1s5n8ZeBs ducGtE9IEff91roNCnhLAVfgbYTJp9ThNoVcKRzSQNmFfrflXMPWjTi3GGLvVu5Pz42e Fwmsal9ko/C3xmSdrt1pCrbe7dAbWDNy/Y/Pqq5YLOe5gOKFUMDeTwGxivRsP+GSZHDz B2g0D08DoXTYeZgCTw3tcvpg4XNaieqBpgZq1YVr+5+P7IxLe7j1J5gOHZ8o1iJgCK2J 8XzcnWtHUXv2O9dibjRj2+pL2WywUXN5YnVtpeFQP4xugf8ZCO1lk+4k33murAQ+C5Xg kz1Q== 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=XsrpgSLIetjSSjQsdPnxAm+guc7zGDde8lk1A/5OW7U=; b=wJnI+lMW8BH8UXFFw8aKu4l2lXcTNQ0LTMc/s+h+SmNKDT4BYVhZH1+7HjH8FHo72A mLuDWzf/mL2HxKkc3ltkq3yZSGXb8qanwyFB4++t5AJY7phvcdmkwW3bvVcg5+FutSu7 VduOgnEps81YuEoYKELNJa+V/neKC5k1cy5d/AiF6ptvpkr5yjpfcO7Veu4n1fH0yT++ F4/jGwxfFjVp5AMh7kL6IviO6F6p3c6llTmT+kVDXlChuBmz9Y5HFqHg8ysa/0saevhP RVSYIbWLupvNJPhIVdNZQEsUbedqy8RsoFH7w8U2RRNF8wKgpKIyN4nIFEQC2tEzy09v LUrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a8l5Of2O; 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 hs23-20020a1709073e9700b0078dc7f7d0ebsi14239600ejc.822.2022.11.16.06.54.53; Wed, 16 Nov 2022 06:55:19 -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=a8l5Of2O; 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 S233652AbiKPOtc (ORCPT + 99 others); Wed, 16 Nov 2022 09:49:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233335AbiKPOtT (ORCPT ); Wed, 16 Nov 2022 09:49:19 -0500 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D7FB1839A; Wed, 16 Nov 2022 06:49:18 -0800 (PST) Received: by mail-qt1-x830.google.com with SMTP id h24so10778389qta.9; Wed, 16 Nov 2022 06:49:18 -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=XsrpgSLIetjSSjQsdPnxAm+guc7zGDde8lk1A/5OW7U=; b=a8l5Of2Om1feIWNCKzQH67SgP3fBhHzdklPrgX75i7Id2LsWRr78OydLo5MG2dNerv aFlGof0i7l0Sv0tPuEDe3VdkvN1qzI87+mz+yfuhotVsQApuJHz1cHTSorBnUVeGy74p lDJOj5v1kzjejl9JsWAN/kBPQEBXvDA4Jigf7hAha+W1laHl2nsDkUwHta4Qphg6qswi KZ6dpaXZjXjPkG9jXwrCQDnnPVeJRpuVosrom6NN9Q3QjNpgChjpMtMPCapbm1pEOcAM gw5ns7q9mZwHzMljLuXY7jL3ryU9Hg/hAIgCcDJVRcS3/lFMU+8/wPzSxCWtcyW+axaw EXFA== 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=XsrpgSLIetjSSjQsdPnxAm+guc7zGDde8lk1A/5OW7U=; b=e3VZjnIonbe88pBizd9vLriqaq5Wubq4mC8l26O6rQc1NQdgpVpbzXq9JydNGLShJN VXdx8FW5zyKi1MVZTTZyCCysXByJnjQrovAcRwnsvKgGN5zdZcCKsFM/PVAirEeZYIyI IbkmJIFLe8TV8lyAyhVeqzt/IIwTUeCseTqCeMgcUDaa1kzDv0RXfAVffZZWi0cv9cWB /93TmB1qIz/YxqxVjJ72o0G8nSOQP3vitrE8dtIYP7N/yXZvjV6ej4unpb68X0AqHrjI oQUCCOyBZH0LJ8FlHHgwqyH0mQ5VyAp9DfSgtcSUgt/kXl788jftge76upZ+06t9IHxO kr4Q== X-Gm-Message-State: ANoB5pnMpk/AQQDtgs70utxsTGhlkaFFMMPCKX81UqCuZpV2oRyntpjW RpBg5ZzN6EBRoUm5Wy6URpodtA9hEJP5HA== X-Received: by 2002:ac8:6b12:0:b0:39c:c865:2f79 with SMTP id w18-20020ac86b12000000b0039cc8652f79mr21165191qts.360.1668610157026; Wed, 16 Nov 2022 06:49:17 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:16 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 01/14] serial: liteuart: use KBUILD_MODNAME as driver name Date: Wed, 16 Nov 2022 09:48:55 -0500 Message-Id: <20221116144908.234154-2-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664943891212605?= X-GMAIL-MSGID: =?utf-8?q?1749664943891212605?= Replace hard-coded instances of "liteuart" with KBUILD_MODNAME. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 062812fe1b09..db898751ffe3 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -57,7 +57,7 @@ static struct console liteuart_console; static struct uart_driver liteuart_driver = { .owner = THIS_MODULE, - .driver_name = "liteuart", + .driver_name = KBUILD_MODNAME, .dev_name = "ttyLXU", .major = 0, .minor = 0, @@ -321,7 +321,7 @@ static struct platform_driver liteuart_platform_driver = { .probe = liteuart_probe, .remove = liteuart_remove, .driver = { - .name = "liteuart", + .name = KBUILD_MODNAME, .of_match_table = liteuart_of_match, }, }; @@ -367,7 +367,7 @@ static int liteuart_console_setup(struct console *co, char *options) } static struct console liteuart_console = { - .name = "liteuart", + .name = KBUILD_MODNAME, .write = liteuart_console_write, .device = uart_console_device, .setup = liteuart_console_setup, From patchwork Wed Nov 16 14:48:56 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: 21092 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp182574wru; Wed, 16 Nov 2022 06:53:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf42cDRXxfzpF6d2RFAMEBJtWOeFBDzav9uH9bbEvPedAiwnO4NHPbno+DywHVXUCcqrGCUc X-Received: by 2002:a17:906:bc97:b0:7b1:6b94:129a with SMTP id lv23-20020a170906bc9700b007b16b94129amr6455955ejb.328.1668610400979; Wed, 16 Nov 2022 06:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610400; cv=none; d=google.com; s=arc-20160816; b=mYP11AKbDOsp57Efv1oX8sYcLsNslBkjxxobRhBAp+t0NbKTnP/oxRBNYfxMyQDAem 7ImMveQt7R86L2EHcY9Cmp6tMrVISzSEhP/NcCMUCndk7Od8kUuwvJOEa3amG4TGwBWk muSvyn2HF4s+hXBDb7fLiSoBOOFTP3X5l4f7YhoMnVTlkjPK+GxJF1aLOVrj4xLNZqK1 2mOBXrQUO8FxwVidrwBsXrnOvNMFus4UGme50+8HBu04Pqd6X6KBzShdYwvxS09cAEfF ZOu80ZPQ+dskAj4YXDRD14F/MNzloX0a544srMF6CXcd5YxAASQwZUr3xFN3kqr3Allz b7tA== 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=xhR7eY/FHUNkamlu87P06c2sFlG0j+sFMpgEhxSGbjE=; b=K/3p1YXUHDInVn2DQkfUYi9B/FwivgyrNP2Cj0m4cbpJCICknLI7R0sSK56g8YGm0t SnKZPiC0qXE7tjGK1UwkUym9Mi+z67NMa1POrZL0g8MI3QMp0G0nR+g2eoo/ycl/OGCR iJrCrzA+tZFBseitnONPeGcCizBGDZjefKSiq1jQ58Bqlct6ZyJwK2Ds6aZpxnGmtLMc HTbhGhEoszVCV3HdZeG53XJa3yuXFDJtjuzYsm3OQ5YFpsjiwbcrkPxgDSy0u5JeM1Go ngF1duEHFdg+6NzuuoQx7BzQ6COVRyb1Hl63rPQpr8NPe40PuiDxELGmmVZOD2DBIzfy /xnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z8AEhLrj; 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 nd5-20020a170907628500b007aea2b23905si15692490ejc.812.2022.11.16.06.52.56; Wed, 16 Nov 2022 06:53:20 -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=Z8AEhLrj; 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 S233421AbiKPOtV (ORCPT + 99 others); Wed, 16 Nov 2022 09:49:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233311AbiKPOtT (ORCPT ); Wed, 16 Nov 2022 09:49:19 -0500 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AD651A218; Wed, 16 Nov 2022 06:49:19 -0800 (PST) Received: by mail-qk1-x72a.google.com with SMTP id i9so11718925qki.10; Wed, 16 Nov 2022 06:49:19 -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=xhR7eY/FHUNkamlu87P06c2sFlG0j+sFMpgEhxSGbjE=; b=Z8AEhLrjv453G4hwPs1L5mhG7GbIvre6FObGi8TKYbrjzVV0Z/cPvFGjtqKKIVjFEZ WenvBmMN9WZ691aONBMHBR7YVW25qnB50D6vBJedMXs8MY3WcZpjbp/f4X67hEdltbp7 7q475laYXvWLLcpqU0oW04fbwSbxK74DBNUwjO5aLRsj7xPfCguq3E54WtVXWk5AvrWL Lq124W/b7eAUDNibkkl6kN5LWVU2TZ8dgTyzs0s1f7YPHBW7bIUPGyax+RxHo0rUqLhE t5spOsmpxSx4YQYwHb1hhtwjRmEiPvTo2JR0+SyS14qiFjthfwpy5ZwQuCy83bOFl0vL u4yA== 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=xhR7eY/FHUNkamlu87P06c2sFlG0j+sFMpgEhxSGbjE=; b=465dlKJ6EM/iFllbjhs37nW2AR9wt38MYhq6rIfRm0u2P0wIdS4Nv9CZGTiWxkj3XD 6E6nL9f+YYq3w4JTwv7Usq6fWG4XvfcnQNhTwKeCZh3mJ8vCwqs6lSxjYZFCSyNc0K8A JcCULrRC7JNBL3XwhORaESr1ujjplEHPfXAJ/pYFwJ7CaXvZLl9L8J/i/LZP+YOHORrx sDJ9lfM0V7q6XXRhY448KqhF8FujAlxSTuAD7FkLJWRTiB+AQLNLj8AAQe1u/0J5X3i2 0+4y8Fc0R3aoP7F10YzoVDMdi/hswrweNV1EQ3jJRMee8CrZgieoFGmDtFBjpcQsoC7H ia0w== X-Gm-Message-State: ANoB5plUBxqr3WhH1Y1jdgqZX7hHjhGpynU0fUTR/KWQ9V78SipApplj 5YjSVulnvlaZt12cEFwyrwnyCVEdKp8Few== X-Received: by 2002:a05:620a:20cb:b0:6f9:26a0:53af with SMTP id f11-20020a05620a20cb00b006f926a053afmr19127501qka.768.1668610158036; Wed, 16 Nov 2022 06:49:18 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:17 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 02/14] serial: liteuart: use bit number macros Date: Wed, 16 Nov 2022 09:48:56 -0500 Message-Id: <20221116144908.234154-3-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664819646414097?= X-GMAIL-MSGID: =?utf-8?q?1749664819646414097?= Replace magic bit constants (e.g., 1, 2, 4) with BIT(x) expressions. Signed-off-by: Gabriel Somlo --- New in v4: - explicitly include drivers/tty/serial/liteuart.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index db898751ffe3..18c1eb315ee9 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -5,6 +5,7 @@ * Copyright (C) 2019-2020 Antmicro */ +#include #include #include #include @@ -38,8 +39,8 @@ #define OFF_EV_ENABLE 0x14 /* events */ -#define EV_TX 0x1 -#define EV_RX 0x2 +#define EV_TX BIT(0) +#define EV_RX BIT(1) struct liteuart_port { struct uart_port port; From patchwork Wed Nov 16 14:48:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 21099 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp183445wru; Wed, 16 Nov 2022 06:55:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf40Uy3fQncH57W2k/GMaCY96MhwQD+P33mVocv6/apWyZmoddNIjs74OASVeZxJU3DmgwBD X-Received: by 2002:aa7:dc16:0:b0:467:7026:515e with SMTP id b22-20020aa7dc16000000b004677026515emr18316026edu.26.1668610528891; Wed, 16 Nov 2022 06:55:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610528; cv=none; d=google.com; s=arc-20160816; b=pCmpj/laGEt/iVEgSXpj+szF7ryfrXiStawN0KK2jr0214YwTfNVTlyNpAw1CYw3E+ XetzWRO1oAIeywUSVLnbIwCX39f5Rc2zHmA+CKwOrj7ohH5ki2O3vAlHgsrX4vkljTWw OVYz1nEdoNUlkQzhm0XKchGBNRnxdKxRExkSaR1qBg0yugH9HHsdpbT2oF8Kqnv3751F a34Be6rn+5+yvJbla5/7g27aPLjcSaQcopXNnZX8R4sC9vtFDzBTsna9e2A48Mtp/RKX op+xsZD8fyqWZ7AO27Sz2vwpD9MX8Cqoseaz/r+82aHH/EIGGFG53uq9lFAfmyk8+/1o 20+A== 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=h8oSxODvpRIImTN9WHVpow16OveWT9zKoAdC7TS4/4Y=; b=bQ04PljpsIPksU8VQjiKJfKBLDjfXiujJWvJDBCbK0HUfV5Il0nTn3ACeZVY1d59ks pttCBCf6V9JQoc20Kt/r3BZR+bpC4JLipgdMvRjATkTxuVn7n+aBigNPGlkEhW5GOT// +p2ZP06T1djuXL5OONle3ihUqcl81knueBRhgrcyQZWGL27kIcMd7iXDK6Z+DIaRv3dK AxWCrLdZ0M2phyBtHGUSshqpdTeLaSBYOWUdCDMqATUoGWmOPLpgTB4hl57twBYbN4PG vSPVVp6DKPFqpfCc7AfcCJMaL4serTJ4UE7hBVJmrvRlX+Tp3PAlWrgLoYfGMtggPR4p mvBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Z/dN35ea"; 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 di6-20020a170906730600b00782c6ab6f01si15645580ejc.410.2022.11.16.06.55.05; Wed, 16 Nov 2022 06:55:28 -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="Z/dN35ea"; 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 S233677AbiKPOtg (ORCPT + 99 others); Wed, 16 Nov 2022 09:49:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233423AbiKPOtV (ORCPT ); Wed, 16 Nov 2022 09:49:21 -0500 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ADFF17591; Wed, 16 Nov 2022 06:49:20 -0800 (PST) Received: by mail-qt1-x831.google.com with SMTP id l2so10778276qtq.11; Wed, 16 Nov 2022 06:49:20 -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=h8oSxODvpRIImTN9WHVpow16OveWT9zKoAdC7TS4/4Y=; b=Z/dN35ea+TIYbEA+K48zz3U7DxsC/uAXx0Ruizd5Ilc247/2QqRuu1uFgJLcUoTjQ3 bbK0cR187nnwQ+ynN52KiR4plFCNl2M4EQRdzaw+8FZDec7GfI96xXtiGxfSWWyDIVeI UJamh4pZ9ZJQ4w8Kbt9gVElJMmFe1Srkbn+v6ZMhauJdrdxsJ15YGeMHDAWG7jBZACo/ WfsaknvZ+/DWOZGR+OV9mERYM6R/79Jkc7UCZ4kV5yFGuTPmeZF51mkiASDshOakoRuf 4mCi6I26hdtLYF13O1zdBhzlPJbZPraf95XPXQ0DSqkCblkDd6RlVw8nRwvbYmrXEU8u eFuA== 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=h8oSxODvpRIImTN9WHVpow16OveWT9zKoAdC7TS4/4Y=; b=Pfq287c7BcvP3pBn98d+Mu453GxFSXT8eLnSl3UWhbwLx3uAoxYU3KiIjyjrSFBv5T i/y5qXg1T0Vnwr8sNfeR3fKhJ42eV9zSDPSBL/JqViINxU3GfXX4fw8O73m9ZKVJnNqp 0qFRkc0vjdqBX0cKqjSwaVrFcDd/oV9CQhM504++Ia1uhljMCL3y0Axh/zkOmC8Zx1lD jdpeMYIOkCzjBDrH3/t/p4nsYf0dvNSuyCQKkQsCjlK+ZYiuvHEZyAHGDDqj9f8Ldwhp YMRxYOw/sAPUbFPLN2sEEmoTSIfUlmSN/al04d8YK9UAQnQIVs3WwBTYB96P3pQ/Cmwp w7CQ== X-Gm-Message-State: ANoB5pk5lfV/RHXldJ4oS1IAyXYOJqdqKjtwsyUrJr2dshnPkjwWAf29 6Vi/bnewn6R+cetZIEMVhYi/kpZb+OUJAw== X-Received: by 2002:ac8:1411:0:b0:3a5:4a19:c543 with SMTP id k17-20020ac81411000000b003a54a19c543mr20576044qtj.126.1668610159040; Wed, 16 Nov 2022 06:49:19 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:18 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 03/14] serial: liteuart: remove unused uart_ops stubs Date: Wed, 16 Nov 2022 09:48:57 -0500 Message-Id: <20221116144908.234154-4-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664954145177842?= X-GMAIL-MSGID: =?utf-8?q?1749664954145177842?= Remove stub uart_ops methods that are not called unconditionally from serial_core. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- Changes since v3: - no longer adding gratuitous comment to liteuart_stop_tx, removed later on in the series drivers/tty/serial/liteuart.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 18c1eb315ee9..989a4f8d5bd4 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -154,11 +154,6 @@ static void liteuart_stop_rx(struct uart_port *port) del_timer(&uart->timer); } -static void liteuart_break_ctl(struct uart_port *port, int break_state) -{ - /* LiteUART doesn't support sending break signal */ -} - static int liteuart_startup(struct uart_port *port) { struct liteuart_port *uart = to_liteuart_port(port); @@ -197,15 +192,6 @@ static const char *liteuart_type(struct uart_port *port) return "liteuart"; } -static void liteuart_release_port(struct uart_port *port) -{ -} - -static int liteuart_request_port(struct uart_port *port) -{ - return 0; -} - static void liteuart_config_port(struct uart_port *port, int flags) { /* @@ -232,13 +218,10 @@ static const struct uart_ops liteuart_ops = { .stop_tx = liteuart_stop_tx, .start_tx = liteuart_start_tx, .stop_rx = liteuart_stop_rx, - .break_ctl = liteuart_break_ctl, .startup = liteuart_startup, .shutdown = liteuart_shutdown, .set_termios = liteuart_set_termios, .type = liteuart_type, - .release_port = liteuart_release_port, - .request_port = liteuart_request_port, .config_port = liteuart_config_port, .verify_port = liteuart_verify_port, }; From patchwork Wed Nov 16 14:48:58 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: 21093 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp182629wru; Wed, 16 Nov 2022 06:53:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf6v/Jr14wxL0SC7eKHjijVBosAeqaVN2lf5pWoOTgb2aT+JeWS92B4u/LuBuBYsQuxd26ad X-Received: by 2002:a17:907:9a85:b0:7ad:b45c:dbca with SMTP id km5-20020a1709079a8500b007adb45cdbcamr18289562ejc.388.1668610407684; Wed, 16 Nov 2022 06:53:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610407; cv=none; d=google.com; s=arc-20160816; b=trDswoWBt04EhjT2g0SBeEDPLON3ODR1anSJ0Uehbc8asPoptxN9ZPOFNLVfvRHA2l vKuON63aS07JzvKUiDHMZA8iKyW77GbMka5WYCZeWCWfjbW2wvp/vYknwMlWKpH/mlAj IlyrXLHNuvc4p/XOEInY4XJhFwkncxVKsERcBmmh0DOOL6X2oQuF1i10j6tf+JlXtzwg pUvNNiz0WOtk28Z32EeFnroitD6u/4QiDH9jUVCTL6Ff9Xmk5ecYD2Kovbcao41whHj8 JUTt2CR1W5AJpo0GIrT8cCmXAPnAFcqlU9DLQUtkwK23al2iUj3xGxEx755wR1pmgemk XV5A== 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=QYR5NsE6sy8TKuNQHq0fl0E+u87DDSloXcW16PVAy78=; b=eL5VgELVfpxPPu6s/wG+aPj93zCJf/+8PgbarcgblKcISKOQfs2aANOwcYvoWIIG6x O8cnedS1W/iUqjJ36qPJokW0RX4GlnVYo89vF23nA1AbpyS34O1lTShG1Afw4MfESbHi bYskfqkM17ODENrWLCcS8xh9wHD1a4SiMYVQBntCdHrQIJrqHtedozM59Os2vZJ7wt5d kZ9ZuXDw0lpVHdDpDMjqyO+C+CA5zJad4KiplhAShHK4TAUHsyzVFAnei5QzPbEG4tWe oa7OCZFY7VPcZzkoxn+bbZwbjm8y2VI/oWxM04bnyBHgbz5uMmJSgcWXg9QQaaAOljRb Vr1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KFZjEdCF; 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 js21-20020a17090797d500b0078ddff4b3absi16584979ejc.423.2022.11.16.06.53.03; Wed, 16 Nov 2022 06:53:27 -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=KFZjEdCF; 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 S233759AbiKPOtk (ORCPT + 99 others); Wed, 16 Nov 2022 09:49:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233430AbiKPOtV (ORCPT ); Wed, 16 Nov 2022 09:49:21 -0500 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C69417A9E; Wed, 16 Nov 2022 06:49:21 -0800 (PST) Received: by mail-qk1-x734.google.com with SMTP id x21so11768785qkj.0; Wed, 16 Nov 2022 06:49:21 -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=QYR5NsE6sy8TKuNQHq0fl0E+u87DDSloXcW16PVAy78=; b=KFZjEdCF9CSmeIEcZe3xg8TnfR8mwCMghzzJIOyPI0pb9AnQvsZniKUNSpSIZttKP+ YnsXySbsYtu/5Px/nZd/AdT02IaXnxWsL2xKNNHHGIjfUokwJ0n3+GyOcx5nQGzI8Pdj JN+cmxfnWngMD7qpqEPwENiAjBTof6/I0f3Zv/1XEqrqaD9RzpwE0BJlSecyAfk+2Jau IQAhj9qwGVOqT1QKEcNFzyoPmKToL9cdmQdYAI1lIFqTPndC46tRXtJKkOzSXiFt8qJZ K6Dzu3PvBrZOPxGBvgS1jUKi3Tg5u93ygIYJS2CQDwhIjQrKoBU8ZZwshtTEnjgtUiuR 1i8g== 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=QYR5NsE6sy8TKuNQHq0fl0E+u87DDSloXcW16PVAy78=; b=5AIB3e3cg3oVXzr1eN77t9fQJ2vwuZIApg0wzDp4BkJo6Befq3Aeeu7qg876YhglRS s+4DdcZ6Dqo4qsJi4Qj/tFRJJ76QWiGYVyc+C2nuOzraV01AG8Bt5siYjMN69GVGsjJF xgaJ6MaFgRNiCCDWC30MD2UBj12UvVYK0Ttz9v0k2usqEVvwtNn/nzHnl5YHdAv46dfs 0Yu5JMBAcDVdyQ1EX2kXDe8mnMzc+Biq6IiP2vQFalKOxKbqrJ926c/kmghZtFAqtX91 j51wF8qSANOGaGvqm+lClsLb+VQwI7BKU8+Las0W7Izj4xMWXj9xE5/759kVjTjTIWav XTOQ== X-Gm-Message-State: ANoB5pmLrx/1VmVWmtbsQHoltX8iV06bBqxUkgrA7nfFv3hcYQqgI2lc OfgoNT9eI8FrucCbQm+tRo/9rl+ihy86pQ== X-Received: by 2002:a05:620a:2044:b0:6fa:89:6642 with SMTP id d4-20020a05620a204400b006fa00896642mr19607031qka.284.1668610160080; Wed, 16 Nov 2022 06:49:20 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:19 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 04/14] serial: liteuart: don't set unused port fields Date: Wed, 16 Nov 2022 09:48:58 -0500 Message-Id: <20221116144908.234154-5-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664826812658787?= X-GMAIL-MSGID: =?utf-8?q?1749664826812658787?= Remove regshift and iobase port fields, since they are unused by the driver. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 989a4f8d5bd4..c6eb7eba5af8 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -263,9 +263,7 @@ static int liteuart_probe(struct platform_device *pdev) port->iotype = UPIO_MEM; port->flags = UPF_BOOT_AUTOCONF; port->ops = &liteuart_ops; - port->regshift = 2; port->fifosize = 16; - port->iobase = 1; port->type = PORT_UNKNOWN; port->line = dev_id; spin_lock_init(&port->lock); From patchwork Wed Nov 16 14:48:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 21100 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp183552wru; Wed, 16 Nov 2022 06:55:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf7LbVKRcwqLj3ieHIsCbDM0zEIhCBk9kDAViDGGrUMfR8o47E21+KFpHjLfEnX8MRsYv3CP X-Received: by 2002:aa7:d691:0:b0:468:74:9668 with SMTP id d17-20020aa7d691000000b0046800749668mr10098183edr.394.1668610543406; Wed, 16 Nov 2022 06:55:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610543; cv=none; d=google.com; s=arc-20160816; b=ssAE812KIGP1qt4FI0Xayzfjc2c1iBbZMXBONzRmOFB3fHavbt7zitw5Qskwc2+oUJ xZ8XYZFUMcpCIs+RPlIdebbaisaiHOruOGjmNAgOieu6DYdGuxGkVOTcxswMaqiim4pR OpCzGZVs8EGJ97iOHovSo0YK4N/5Q90CecBAolCA51MCI8zoGhWPLXnyhxHwJszHBaBZ 1zka2BLBxUPJD7GKZddk23jBsLdSdjTI5erNnIF7XfTFaWgRqfhRcG7qCc58UCnNecWl zLBHUrWWFl22x1mIws9WsDz7BzZgo7QfOKxMIC5aSvSvJWn4UV2Hz7RNTTZLysgyJqJE mLQA== 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=zatoQ8/a+60T2AmPXnfE9c4vLIYDpN6MzKVzyD4F9Ww=; b=GYjtjYLAPo1pAE3Dh+IuxIFHsopLDHtGCQECZlHdePzqWzZGoCbca75h+tqHIOS8+u vNE3c440tqsTDDIkWwXJbOkYQ6JZ0xEdEVaqIiW74nFa4ztf/2LgKq/bAb9iGxLxw4zw zakNw74H6QFYiNv3Q1yY3yDtTlawPQgw1b9GrsEEqXrUDRXz4wle3u5Z+FbMC32D4UxF BQAYc8dLLsPIHEsYHVOTiIA+ec+FonsjJSEunTREJn3e/kvO8zSqic6zgjeGzrtOKTqW 9OIPPaM/zitdt+ksY0762FVEz6HiS88MqlSddblv0cKBfJCoLx6b9MNMDPLk4rOitcUw nlJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LrbuARdq; 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 hs38-20020a1709073ea600b007ac60b83407si14930328ejc.725.2022.11.16.06.55.16; Wed, 16 Nov 2022 06:55:43 -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=LrbuARdq; 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 S233430AbiKPOto (ORCPT + 99 others); Wed, 16 Nov 2022 09:49:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231806AbiKPOtX (ORCPT ); Wed, 16 Nov 2022 09:49:23 -0500 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6911D1CB2A; Wed, 16 Nov 2022 06:49:22 -0800 (PST) Received: by mail-qk1-x72c.google.com with SMTP id z1so11723202qkl.9; Wed, 16 Nov 2022 06:49:22 -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=zatoQ8/a+60T2AmPXnfE9c4vLIYDpN6MzKVzyD4F9Ww=; b=LrbuARdq6SFzMwJAQQC0f/+7AU6V4HH0DWEhvf24Odg7fYKrq07HsMHcSZWyFXZgn6 srh6Ys0opE9worUgikHmBph2tdgAEC74sryJOixXQ0nnGLr2jLyZ8oTre2i9b3uEkyL0 5Zu+woROpu3r3tUwnvwY2vWDZ8RYjCtOvcrUrXqDhudskSLEF6bxBgI7tx0HU7kjPD+7 E/JoMxf6bH9A7WFBcdFU92Ix6hWUQeEVaE5AzCO6o/ax9/9WlCQKr+dgtLn52oVlIcmq NGob1zMzoU3OnlT+9JZ8yinkCEAOGJpJzbH4smXKoVmzye5N9lo/IzxG2dCjBCyfSE6P KfWw== 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=zatoQ8/a+60T2AmPXnfE9c4vLIYDpN6MzKVzyD4F9Ww=; b=5RGcPGIuA8UOjCG8iJWxlYBp3kh2WghNvoxrcO8Hdkq6zEDBEgn6HE7MBYCWLjaoPi Ji9+kJDBPwVnnoPqWfBTZIcjNTRg3L0x+wVqXTAkQWhQicEwSjmKMx6x9z9twhJyIb4g Ig3pJhegLVt8mNK2VP0LsMJorEQ5ATF20ihDmvo1ymYEWRXtZmQauoLj28LKMslPXpdZ xLxTzmheN7cJDjr6bGTTkkIQ5lO5SRgPPo7wqs2MPXB/1dhMYXYfXLwd1YI1gBF22qlG wxJiv8YOGmnbJ6TheR0sc+a9AHPqO0gYXGATjI13WrFRmqgW8fwVsEBku64Qxnr4S8dx kaPw== X-Gm-Message-State: ANoB5pnZmH0KtIYZIXUWjm2/vsUUSqzjutSzB/7WK4dBz9Wx85YhozhX h0GHVuDhkkoGS6DeWZ7OOvYMPP9DLn6lDg== X-Received: by 2002:a05:620a:68e:b0:6fa:124e:d8aa with SMTP id f14-20020a05620a068e00b006fa124ed8aamr19945966qkh.604.1668610161101; Wed, 16 Nov 2022 06:49:21 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:20 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 05/14] serial: liteuart: minor style fix in liteuart_init() Date: Wed, 16 Nov 2022 09:48:59 -0500 Message-Id: <20221116144908.234154-6-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664969045391543?= X-GMAIL-MSGID: =?utf-8?q?1749664969045391543?= Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index c6eb7eba5af8..1e3429bcc2ad 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -397,12 +397,10 @@ static int __init liteuart_init(void) return res; res = platform_driver_register(&liteuart_platform_driver); - if (res) { + if (res) uart_unregister_driver(&liteuart_driver); - return res; - } - return 0; + return res; } static void __exit liteuart_exit(void) From patchwork Wed Nov 16 14:49:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 21101 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp183557wru; Wed, 16 Nov 2022 06:55:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf5u6vjIq+SVOpbI0q7WQI9eVefUaoowm6b4LFm/eqYfoOA6rYM64vxWPwuvNPV+jm4gr4ZF X-Received: by 2002:a17:906:1f14:b0:7ad:79c0:5482 with SMTP id w20-20020a1709061f1400b007ad79c05482mr17214934ejj.730.1668610544675; Wed, 16 Nov 2022 06:55:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610544; cv=none; d=google.com; s=arc-20160816; b=Zz2wDRExmdO8wiD+Q9JQQIUKbkKXI7tGSPx0JNRmwRahhv8wJ6ePpIpRF0hzoralHQ jR+/ciNQvYCoAPYm4dUVYzSncNPFLHUj5xG9wYc3ECUWipUHhamvllceNq1VNzeA1DCf XoEPM0wLn1KStXvLZoevVRcQAeZLn41HPkr4f6VDtZAaMVcC87uhQmXQOb29jJ8r6r+5 jlVKPWahs1iYN0zmyujmfHhK9pvYFlsKoQFBrdREW+sXguBk3NZ3pV2TCMuIPARGLVDT jGOiWMim/IyrqEE8/I5uVFVlpG3Mv2E8O+K+GJp+f1HeeE4tYvG3EeMgicuzqKcn1vNu DsFg== 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=D1hUB1CG0ZAd5p0bPUclNpK4BZ15p3GlgtAxgJ6lCak=; b=KYT8G2ZZVLOTPuPnLElC4wSoZR3liK+qK5qQoD5ntnow3OnahAccrmasnVoTIJ/Ybf vOvl5KM+p/kvfieUaMIMvtLvH7xSz8k0GwKctkG3B7jBSKg38WuXRz/871dufMHJ+sZB Ermb4Bp8HM3my1WCoiFGNvZe4qakcfWXhvu0GObUmUbteCaAS/JNWWE8Gy5hQjjzZQ/W 9qWynFFnw30JOJBG4AsahN0tPpYdQEFyTpKhQknAZihorJMZxZ4QGRIsBOD1/qmVph17 WXKgDTUn6Gy6IzQh1C1KdbKLVzN7fE/37c7m70YcQ9znFdCmrTAG4h+sY22yJjQnEVRw rP5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WbrkarbY; 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 cq22-20020a056402221600b0045fca739593si12113927edb.188.2022.11.16.06.55.20; Wed, 16 Nov 2022 06:55:44 -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=WbrkarbY; 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 S229456AbiKPOtu (ORCPT + 99 others); Wed, 16 Nov 2022 09:49:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233459AbiKPOtY (ORCPT ); Wed, 16 Nov 2022 09:49:24 -0500 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73D8A2D1C7; Wed, 16 Nov 2022 06:49:23 -0800 (PST) Received: by mail-qk1-x733.google.com with SMTP id v8so11715355qkg.12; Wed, 16 Nov 2022 06:49:23 -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=D1hUB1CG0ZAd5p0bPUclNpK4BZ15p3GlgtAxgJ6lCak=; b=WbrkarbYRAipvYkcAzjHvEMKaXGegCTc2uv+unvZycfM2jKpbqhhxtEoo3npceJIgy iaZ+ccJlQNGyWtx22hVeX3ljjW2T5ygfoWpGYwBMDsnYAIVJQM1Gbl4k2CyEqbBp534S 3+v6EtLyVmWy3FLsN5Jtw/oBpelIlJgtRWf7cthl17gH9s4cGb6ZpC+u1K8GFvzi/Q3Y QVkvBW+pEjskqdsaO+X4x4L6ZTiTICAK58tVq33t1KNew1nZcIma5dAGjiTP9pcvuolS cEn0ZOAK4Xiq/cZAPG7KhWf0jPOqsrcRc2vr13WIeZ076Z1VPebixf4aJxvwF7+1k6Dl qimw== 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=D1hUB1CG0ZAd5p0bPUclNpK4BZ15p3GlgtAxgJ6lCak=; b=AFBQWJ78A1CrxWPo6/gh6GKiUDfMjWt7F6ddbJqKf4A2DgRCx3Jd99nmQNB6RCwgqm i/amFgjs0FInxF6+vmJrrfyQBqzNrfLvPhQm611S8dAlSzYOLTF6m56ByPPLXWSI3gpg v2Io3KB3cMKgDgoVQc0ql9W63Qyw/wIVFpK90Hwvgl7dmLIyPHnmvT2zuwZpNx+TphE1 ckxDR2TkjCccqgLyrOhZkqCDhjdYhCK8AMyeocPfoBNFRrwDa9aYGKuaOaVeefjgl+6w 5uVnsVG6xKVqiTXFwCFlM/Zoru1tFMCQdo7zDi5mSvkRrtTj11OhF7Z+4gUEBbk1nZ7f yY/w== X-Gm-Message-State: ANoB5pkBT8jvo+hNntSfwtmT2HKwBCccNJqgN2II/hNVtdkDGJsxB6sB WoPe7zBH2rs3FnM1mgZKtKYLuAfhcp73uw== X-Received: by 2002:a37:92c6:0:b0:6fb:5561:40a8 with SMTP id u189-20020a3792c6000000b006fb556140a8mr16479070qkd.669.1668610162272; Wed, 16 Nov 2022 06:49:22 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:21 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 06/14] serial: liteuart: move tty_flip_buffer_push() out of rx loop Date: Wed, 16 Nov 2022 09:49:00 -0500 Message-Id: <20221116144908.234154-7-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664970835759737?= X-GMAIL-MSGID: =?utf-8?q?1749664970835759737?= Calling tty_flip_buffer_push() for each individual received character is overkill. Move it out of the rx loop, and only call it once per set of characters received together. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 1e3429bcc2ad..81a86c5eb393 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -87,10 +87,10 @@ static void liteuart_timer(struct timer_list *t) /* no overflow bits in status */ if (!(uart_handle_sysrq_char(port, ch))) uart_insert_char(port, status, 0, ch, flg); - - tty_flip_buffer_push(&port->state->port); } + tty_flip_buffer_push(&port->state->port); + mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); } From patchwork Wed Nov 16 14:49:01 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: 21094 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp182692wru; Wed, 16 Nov 2022 06:53:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf7L7NqsFKGWEhhPs5B+kpglW6YQk26B8ESTO3NrKyrXdKqIlEh9t+dywtkewpmWieQdW8Yn X-Received: by 2002:a05:6402:3717:b0:467:374e:5f9b with SMTP id ek23-20020a056402371700b00467374e5f9bmr19440643edb.283.1668610421399; Wed, 16 Nov 2022 06:53:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610421; cv=none; d=google.com; s=arc-20160816; b=Inila0yhKqHnJl2IjbVaoikIbih7LMEcM8Pdws8Dg04cLJlQvr39/A3tUV+VcgbiR0 ayym91b4/0XAvLbfi7xNQwwPQW3ujIxCZeFY9OumQrr8iRtvXrvZ2bHp4JLA2F0iSupH 3QvlEoRYF5R6lxMjgVdYHnSrtMBBkzoFxIrwGx86tHUmNlnp6Dimy9kw866260IpHeGl ZImcqm/52heERusJHzvrybi+DZgRnulG8XuJrAxxcRFZsSlmFdOErV0q8bub2Y+SpDeh mYysvBz6eJAwGBFi83ds4RMldlyhtoCibyM+bBZjlPBzYdp3lefZ83/l//BWszuQaqZj NWAw== 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=b0pSt1+sCUSY6i1VSOZXSpAW8agas2OEhVBqCQWzkeE=; b=URZpXIWpPLVBaai+txBeveIasrQ1D7yeA5WYMFaax9yEYbXi+ZsHxIc6S0fkyOYgYk owng7UgfwTv2XbFv1iGKNLyBe4nChFZngUWN4vmCrrqrEmSrHnVLmOIkwUcZsqiO24k8 Cd7JjWvuO5IU80SHQYD8A/50Kgiq+7lzNwkc3n768v54ZLKU6x+keheXcDJLHDAesoXs FpGsJhAsFvcWuPX5Yw4Bpnt64QMngWcUW/OOznTCRGXNIiSavZ4/vQbOxG3+sWEP8iop OuWcWldj+IEomDaazgRRIeVs5f/BJpDoBb7HJwnaQ9zT3l6uoOmUnT/jDzLRkabpZ+il EDiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BWmkADy+; 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 qf36-20020a1709077f2400b0078034101c0esi15809933ejc.978.2022.11.16.06.53.17; Wed, 16 Nov 2022 06:53:41 -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=BWmkADy+; 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 S233791AbiKPOt5 (ORCPT + 99 others); Wed, 16 Nov 2022 09:49:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233545AbiKPOt0 (ORCPT ); Wed, 16 Nov 2022 09:49:26 -0500 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 698372E9DE; Wed, 16 Nov 2022 06:49:24 -0800 (PST) Received: by mail-qv1-xf36.google.com with SMTP id ml12so12068039qvb.0; Wed, 16 Nov 2022 06:49:24 -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=b0pSt1+sCUSY6i1VSOZXSpAW8agas2OEhVBqCQWzkeE=; b=BWmkADy+pa4FoNb6SR2sVqHODzqe/raSSVOBjqVntv9+B75MvCutUtPgQLlxjYQ2tD jkHfi2ZdCZQ9bWASl5dg3ea+PNon+WClGeIDWlNAFxwOYn1wU43S508gaIqCDD/4r+sM y7DIk/d6ucGoXCm+jHYnfuNOhY7t3BgUs8Ja51saTD6gm7Liez/1LnlX5OkK0D0/TYZb a5yJe1DBE1OGniPw7uutN/w4afmjaKlWwDsdn0vk840ODL4AXm+HzL0zTpaYmlEY5UuR OIitmDV3E38KjlY40QC/BSGZ3PZK/DZ7I06ML6ZYzZihHueyRYAlnu9VvkD8zzGa/EKq SAPw== 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=b0pSt1+sCUSY6i1VSOZXSpAW8agas2OEhVBqCQWzkeE=; b=NqDiWDW3RWDQWm8Umm1C9A65363GJ4FybnQcJUEsBFHmn9W8p1ukzc3xZjoEaE+eRY fciCj3jubCSP6A61LYgujCSZNctVPzvcivEh4ws+CsmKbqxHqTKGxES79HKLeJpYKv5i //O9FMuj2iFyI8NHNwY9P6q4EOpKkRJKhIapa9iTTc2qEVUDeQxfcgIEdJs+myb+M4P9 K6f8Ya6QyCF9JgG9xCOzb+N6y1t71y4XjST0Xl1XsDHihPEghi1fUZMd3bTc7yRH/GBX vz1XGl6bGuADr23g+Ko+Pl46bLCogN9lPSUZwws/eQTITV3LNPdYD7zJlwWoYXTuFawU OgUQ== X-Gm-Message-State: ANoB5pldyZXaUu88ymFPwfX9hg/JVqb27mVLQZT05IIS1XeZT3XqORy1 VlVBCT0rSpvZ+NxzjS4aCYC6fXvodvyylQ== X-Received: by 2002:ad4:450d:0:b0:4c6:5a5f:3063 with SMTP id k13-20020ad4450d000000b004c65a5f3063mr6790531qvu.4.1668610163228; Wed, 16 Nov 2022 06:49:23 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:22 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 07/14] serial: liteuart: rx loop should only ack rx events Date: Wed, 16 Nov 2022 09:49:01 -0500 Message-Id: <20221116144908.234154-8-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664841494321095?= X-GMAIL-MSGID: =?utf-8?q?1749664841494321095?= 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 81a86c5eb393..c90ab65fbdcf 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -82,7 +82,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))) From patchwork Wed Nov 16 14:49:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 21095 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp182709wru; Wed, 16 Nov 2022 06:53:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7/oPA7m1GJLPAXJQEkymRZgEEX4uAOlzRNb6oOTKWiew+TSoMfYMDxVHujGb8fOczDyAdV X-Received: by 2002:a17:906:7c07:b0:7b2:804f:a31c with SMTP id t7-20020a1709067c0700b007b2804fa31cmr3368438ejo.523.1668610424760; Wed, 16 Nov 2022 06:53:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610424; cv=none; d=google.com; s=arc-20160816; b=lbHYW1Hf+NDE5mKhcFUcS9K+fXxJ9g8vjo4c0hj1ieN85AYKnATKLkgzK1uXKkVi4t ZHCtBPLRh+0baPOBzYKoYDcAPy0zBB+rwrZvna2oMvySUkQT72pJOxCBntoFIrsGM9zZ A8lrlljJnumLR/sUjRrT6KsO3eAk/4oCbvARdRi3sAa1+2tL/9PUlt+F+tkN197bv0zo AF8HgZHVwudYWGbGxeyisAX68LoQmV04KE6j+D0G2O/PoSoNS6TOl66Xd8Lo7j7mG9bG uirzetGdjQ58EIbphsDkIgIoA5zkBXxt/k0PU+PavfxZs0Y/pGarntP9Y+rCmgyJwtOE 0mpw== 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=zbM5jPqWMW+ZSl/JSR0+XTeoHUgjIND5CEiOvEuQtSk=; b=fXHg92cCBRpMWDOX5dgqRJ21wi/EbX+IBmM1K0qBj8AMO8DK6UxdQY7wUkPuAR8as3 ysN9x5HZ/Ajz5MMgdq8YOKeFVkgLuyN1mEvpb+nSIn+YxWhtHwI1favvSyZA3SqU2Gi4 KpEEWRkhPZUs5dOHYH9KaDDLBaGXsTHXNPWKliC+MJy1MZ3HuEVeKzNzFGKwz2VwHIVh KCNionELfN42GQR5Vt2ak1/Dp9VRdbU1oM9AIJpJ/SBe7QdTNu+wKYiYERwurEsea6ZQ rquGXe1vmNytu1TJcRvqwjwnWlgx885WExJHWKkWsRwh5EpU+RxgejEuGkq24rDo55ea yTYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PRWc0U7J; 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 nc7-20020a1709071c0700b007ae165c79c8si16260166ejc.940.2022.11.16.06.53.20; Wed, 16 Nov 2022 06:53:44 -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=PRWc0U7J; 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 S233765AbiKPOuC (ORCPT + 99 others); Wed, 16 Nov 2022 09:50:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233561AbiKPOt0 (ORCPT ); Wed, 16 Nov 2022 09:49:26 -0500 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB7A432B8B; Wed, 16 Nov 2022 06:49:24 -0800 (PST) Received: by mail-qk1-x733.google.com with SMTP id v8so11715408qkg.12; Wed, 16 Nov 2022 06:49:24 -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=zbM5jPqWMW+ZSl/JSR0+XTeoHUgjIND5CEiOvEuQtSk=; b=PRWc0U7J5pAZNRoK7CPP+L+WKOUezRC7GcfZGc/EkY9Oecm/u4DIcjZYj+Yyipg6sS 178IvYFnqI1hnjr/OrvAoAgqOBmL306RkNSmdyhFWym+EKqXfwgmN8am4I/DLZs5ARpB ZR2CQnaskTci2KGFuk0gA+s+cRzngvkBJ2WLuV9NVelmKprPuPXee18Mfm3Z0Js4bUG/ ZHVKd7Bunhvg7VWT8AHzqaHXUr9pk20jfFbuAxE8YNwWtNMT+INF3yo8Eh06RjJFm/xC RelO8ogc5Ndh7K/jqMYrTZdw2KmBzec5b2xnrUdCxa+hOczfCkyZ3pxmhCdaYeMh60je GaMA== 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=zbM5jPqWMW+ZSl/JSR0+XTeoHUgjIND5CEiOvEuQtSk=; b=1yFuP4mU42pRTTV3En9kpHndyNms2ZAqkUZNeNG7JJfUK4JLD7HijLMdIgIM5YOUT6 liT+8aNn+6kT7w9pjNue4nfzGhaIjjrOQ3Y20ScEsEtcSdXSRFwJ+ZbD8Ke863s3rJr1 +ryslLXg5oMOV2eOMuAbCEcFcbCPu7dkkm30tRfOJp46LC+Drswc84VADKDZBgNPTwpA I1Y6+DpuDDluPDcPoJUUH4niopXhMg7FyvIC97M8PCnR8jjAWkWNuiToM/svMQ+Zt6g6 8fX3ejbcU7Dw10MDkjbpjJ82OTKW3n3qhCsMzxR/hC+wx2SV6qxuWL+G1IAL4YMNUd1Y x+1w== X-Gm-Message-State: ANoB5pmzFTFDYkaYvQNXhUl4TpPi13vumlMXzG1MorVGXJpc/GdTsV9i c9a+j9wafbAfwgQTnAJ9n7BWwwEE+vf6Mg== X-Received: by 2002:a05:620a:3708:b0:6fa:88c:50e5 with SMTP id de8-20020a05620a370800b006fa088c50e5mr19318464qkb.186.1668610164217; Wed, 16 Nov 2022 06:49:24 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:23 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 08/14] serial: liteuart: simplify passing of uart_insert_char() flag Date: Wed, 16 Nov 2022 09:49:02 -0500 Message-Id: <20221116144908.234154-9-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664844426877745?= X-GMAIL-MSGID: =?utf-8?q?1749664844426877745?= Simply provide the hard-coded TTY_NORMAL flag to uart_insert_char() directly -- no need to dedicate a variable for that exclusive purpose. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index c90ab65fbdcf..81aa7c1da73c 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -73,7 +73,6 @@ static void liteuart_timer(struct timer_list *t) struct liteuart_port *uart = from_timer(uart, t, timer); struct uart_port *port = &uart->port; unsigned char __iomem *membase = port->membase; - unsigned int flg = TTY_NORMAL; int ch; unsigned long status; @@ -86,7 +85,7 @@ static void liteuart_timer(struct timer_list *t) /* no overflow bits in status */ if (!(uart_handle_sysrq_char(port, ch))) - uart_insert_char(port, status, 0, ch, flg); + uart_insert_char(port, status, 0, ch, TTY_NORMAL); } tty_flip_buffer_push(&port->state->port); From patchwork Wed Nov 16 14:49:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 21103 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp183658wru; Wed, 16 Nov 2022 06:55:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf6+Ibyij1TPGO6S1h/Y5rOJ7dwiaW2hpx7lPAQlvj68dtEiookyFJ+Ln2hteK8MYv078K9j X-Received: by 2002:a17:906:ae8b:b0:7ad:9892:921a with SMTP id md11-20020a170906ae8b00b007ad9892921amr17530652ejb.506.1668610557456; Wed, 16 Nov 2022 06:55:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610557; cv=none; d=google.com; s=arc-20160816; b=bWKm0HZDTkjtdKLH5BuwYL/R+QWEh7FUuf5D81i1RMZkQ4LhsDOyu3qIJeVAinCB1U f1dgZQqc+CkNU75sgYqHVOUjygqZn3aHcjK6H7oHRY2agllmWRBw1efE9DLWsCPJ7kUL uvt9SYgMBvSP6JbHzhG32QxDCwWivsAmAtXZbEfcclTBM057eYMOAuT7Bg1mP5Vi7Oum PU5sFfq5C3LNesdyOZOrED4YVcebLUKCWkZ2I/fNAQEDhuvzDEQCdKiA/L45JLSY7GsN ErYHg2tWV4k5jUqgxuciZaecnjVimBLeoXA/fjPK/PberLy2g9LbSoHK8MtIQSGhvgRe +JMQ== 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=AUJ4wmyHldmie0gv1i5ed1iRJzoHABMpIHKKor6rIMU=; b=XfU0GJixRQRfmZ9kg7nN2eiO+jNbkMFNdTVLOUoYttPpf12MdRMatIjVL2fohpmThy ozY+iRGk1ls83rAZ2HZWG2X7/cu+tUP4dkRocrH/TsraF8FqVK1HzTzBtExxbuYrsMaZ Hqak+RspRo5VOiPeiVYvSji3nm5MYMDhzbx/kuN2OFNaw17mEC3HYgOaVVXzFPIAxSTI cXRBnvvgWlkU+huKyLYe88p6pIxu6bLUWp2UXQ7Bk1DQMgaHkkIHixYWzJkjLfrTP5P7 82B0bF4J4NlNThkoc6TErUcreWSaX+tR/dYPopI/2d+B3uZf902yaT8gnnuTFy+8/sok /+Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="UK+4W/tZ"; 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 b14-20020a1709063f8e00b007815e9c5b80si12015345ejj.617.2022.11.16.06.55.32; Wed, 16 Nov 2022 06:55:57 -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="UK+4W/tZ"; 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 S233877AbiKPOuJ (ORCPT + 99 others); Wed, 16 Nov 2022 09:50:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233643AbiKPOtc (ORCPT ); Wed, 16 Nov 2022 09:49:32 -0500 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A79F52D1C7; Wed, 16 Nov 2022 06:49:26 -0800 (PST) Received: by mail-qt1-x829.google.com with SMTP id jr19so10777826qtb.7; Wed, 16 Nov 2022 06:49:26 -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=AUJ4wmyHldmie0gv1i5ed1iRJzoHABMpIHKKor6rIMU=; b=UK+4W/tZnQ3nJx2fg8CxMw5okEpDI1+RbjMzW+k0vTeDQzjRo9kFVFA4+y6qMvjtjk ofKKesMCD7H6VOpH0acPm19dlRhPC0R29sj6VmzG/PmKmXnBd2Rl88FJmCVAREDXjhIF 8NBXQSMpXWWwv867j3rKzigzm655q6iMz626SZR0unzDlRNVqTKqfZKVqEXR2HhJZzls UU0EwSg4Hm4GPdyXXhIMwGUM34MAeWowo+usiruyHxW9gIDNENxtFhiwJRhY6RUUif3d pZ37m7EtqH4qKSUDDk03ccF7u0899nB7ZucmDbgDonMPOnzFU5cW+REeNSCWfnF3FIpI ptpg== 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=AUJ4wmyHldmie0gv1i5ed1iRJzoHABMpIHKKor6rIMU=; b=ZrWBauAjb8NzP/5urQqGrZ9fyj60LVlEdQMcnn+MCBwTRSL25B3YVDumpn5EJx/hRr jBGmJsijXpIgb+WPaYC1Ay0IWG2XVGS1enj+BZe0ryP9szRfc6upxTclvGukKNzrCNtH n011HY1jXVcMBrfEuqkjK19gdEoPPRI4/iORBYPt1VpopjnWOGW8zma0Caf7kkLXFb+X 81nms98sWDRwR9Dd3VfbMc30e7xP0/K2tzz7RcG5Vh0eWOdTSZpF0J3dcmlf9JLH4/zC oJACveWivyczUK/+05RbrxDvxdXf/3RfxapBzYJdA4Ng9QXVGkb3gbvBAate9JckFd87 H12A== X-Gm-Message-State: ANoB5pmnwE24RBI6bcmQBA47ZM0Bk3yg982ZAHBHMPdl32eAoFkiuj2f zXhvg7Hde/BPCBQkH+mxt9i/YqHR/ATddA== X-Received: by 2002:a05:622a:a0b:b0:3a5:4fdb:ac40 with SMTP id bv11-20020a05622a0a0b00b003a54fdbac40mr21241113qtb.268.1668610165509; Wed, 16 Nov 2022 06:49:25 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:25 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 09/14] serial: liteuart: fix rx loop variable types Date: Wed, 16 Nov 2022 09:49:03 -0500 Message-Id: <20221116144908.234154-10-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664984189560688?= X-GMAIL-MSGID: =?utf-8?q?1749664984189560688?= Update variable types to match the signature of uart_insert_char() which consumes them. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 81aa7c1da73c..42ac9aee050a 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -73,8 +73,7 @@ static void liteuart_timer(struct timer_list *t) struct liteuart_port *uart = from_timer(uart, t, timer); struct uart_port *port = &uart->port; unsigned char __iomem *membase = port->membase; - int ch; - unsigned long status; + unsigned int status, ch; while ((status = !litex_read8(membase + OFF_RXEMPTY)) == 1) { ch = litex_read8(membase + OFF_RXTX); From patchwork Wed Nov 16 14:49:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 21104 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp183672wru; Wed, 16 Nov 2022 06:56:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf6b1jUaeublxXdQ5H8NnuYmseAhr4GJU38NyhCXrTZ0pLOvNGznCiwEdjd9ITAFyYpb2KYM X-Received: by 2002:a50:ec8c:0:b0:462:719:3372 with SMTP id e12-20020a50ec8c000000b0046207193372mr19538734edr.361.1668610560308; Wed, 16 Nov 2022 06:56:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610560; cv=none; d=google.com; s=arc-20160816; b=rSub+s8uuZ/X8r8M8IVXxH5WtJetBlwZIwYPqCBcd7BAsR9ljdSUfKSjuzus12pxTd tmdCLqYo3hCFweYJFC7b1Kc5iJKjcmCCGEjuhuHWY+oFXGbgGL4NqUG61xy00BcqcbwF Qq2jLwTdDjQWZeaQmIuyCxQn3ZGVD4mue6v2s1nQXbXs+2MGvDW9sZAsFI57E7jE7t2b 3hzwwKX8HVRVERTs4PD84fVMpQjHgNK16++s+1PlvRt5/5reBgVbfNu9VB/4j0FhHVPb O+9RU9QlnM+2N/CKfd0iLX9vmCWh9nEmlhhkTz0hibc/aI77coIwMdxHbYgpJeMYdq+i hrJA== 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=I7E1AL+Zmws98336Eqgx5BGd+1bmMfsNL2UgCg2pcHE=; b=zPzHzS56pQ+1xVGQpicA8wj7ElfQUQM/Eei1/0VhXbgSW0ZstEfAv7T5hyGuJ0MJZn melapj4tAmO0886vttTOIBnZSKE4yHtpuJn+EgVFZDZMcauQt6nvYNrXK+Pv3/ALBUAb 67EqKCTtnWbmeGMBRNdgY5r3GEMLoWor6eafb/P1lpS/v+R34dKI7ryjXCUQopIMNvz/ qkF1D2r/9OOz65fhjFl0R8bs0/UncMs+8Ao3O2w8Q4gta8eDAVH8TnGCIvgPfS/12XzU qhcxMpjZ6GsNfb3MglldE2nFSOVTQohkEThp27Uuxx+HVN4OM6rgfR4wa+5ZlFkxutPK IvuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZKwMXYAs; 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 hu9-20020a170907a08900b007ae0db0c454si14368468ejc.635.2022.11.16.06.55.35; Wed, 16 Nov 2022 06:56:00 -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=ZKwMXYAs; 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 S233697AbiKPOuP (ORCPT + 99 others); Wed, 16 Nov 2022 09:50:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233646AbiKPOtc (ORCPT ); Wed, 16 Nov 2022 09:49:32 -0500 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2675F391C2; Wed, 16 Nov 2022 06:49:27 -0800 (PST) Received: by mail-qk1-x734.google.com with SMTP id x21so11769008qkj.0; Wed, 16 Nov 2022 06:49:27 -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=I7E1AL+Zmws98336Eqgx5BGd+1bmMfsNL2UgCg2pcHE=; b=ZKwMXYAsBcmAgWdCUpSDxHcOrSAXlYOV7PAff/y6tTwJgXKL2kko/HH+3zquX9d+Sw FaHlyQZJgCf41nMo5DShHj+ZzRrxgnmlwpaCfxRqos7D8hyJRt7P9zmZb85iwTa6+6ja 6+4ofDmcoy8y6nBB+AFYXGTmnF8tqgbYlGPGKQhT2iqEHqvvT++4xBdSPe0xvGfWUra5 +y0mwVPtBQ5efqDQHPeTf+IU8/m+5bNruvn0r/1xmn0ZvRDvShe2mZT0H5by3tHOcjzw jMIKUH3jj9CrJ7IH+aqQUuCdKABzCp97neG+Hq/FQk7KEZkHUVek3a1yfDsMwcGvnJli a6Iw== 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=I7E1AL+Zmws98336Eqgx5BGd+1bmMfsNL2UgCg2pcHE=; b=kHTK6MLSurpldSe2I4UKe7DzZMLB5qTb37Yzw1Z+RO825tgcYCnbNl93U8dOBrCIkx 4AckTxQ9aFQYNaLo5EnlZPK8mtAcQad9mM8bvfX3YBlYd/ptfs3C81HEn3nG3BBe6O0+ JHNoAE4BiZrL/bOZOphi57ZdZlwOCbNrxIKN1yipFcq0cUAf/2U0uYkIjAWgWqkgE3xo 0OZy4xevvoLthIqVMD9msBQ6nD6wlRaRLDs6/NZLpOApDLWGzHgHWzkhXe90hDWkBxis Tl3N9Ocj29Do2lnTRi739FV1j4NJ0Owf6EbMw3Vk0kK9ZqSyPYdjYrk5cHHwcqvQKZ5u ZVzQ== X-Gm-Message-State: ANoB5pl5M6oBth7bkySlJP8GjEhcCzGqZcd6GF2ziaIOAmDz97MNK19P 8n3xUU+tlKGVNde84N4CqqECd4yES8Ds0Q== X-Received: by 2002:a37:63d0:0:b0:6cf:5fa1:15f8 with SMTP id x199-20020a3763d0000000b006cf5fa115f8mr19666482qkb.748.1668610166484; Wed, 16 Nov 2022 06:49:26 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:26 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 10/14] serial: liteuart: separate rx loop from poll timer Date: Wed, 16 Nov 2022 09:49:04 -0500 Message-Id: <20221116144908.234154-11-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664986821569292?= X-GMAIL-MSGID: =?utf-8?q?1749664986821569292?= Convert the rx loop into its own dedicated function, and (for now) call it from the poll timer. This is in preparation for adding irq support to the receive path. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 42ac9aee050a..76f8a09b82cd 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -68,10 +68,8 @@ static struct uart_driver liteuart_driver = { #endif }; -static void liteuart_timer(struct timer_list *t) +static void liteuart_rx_chars(struct uart_port *port) { - struct liteuart_port *uart = from_timer(uart, t, timer); - struct uart_port *port = &uart->port; unsigned char __iomem *membase = port->membase; unsigned int status, ch; @@ -88,6 +86,14 @@ static void liteuart_timer(struct timer_list *t) } tty_flip_buffer_push(&port->state->port); +} + +static void liteuart_timer(struct timer_list *t) +{ + struct liteuart_port *uart = from_timer(uart, t, timer); + struct uart_port *port = &uart->port; + + liteuart_rx_chars(port); mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); } From patchwork Wed Nov 16 14:49:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 21096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp183004wru; Wed, 16 Nov 2022 06:54:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gimFDOMz5ZyM91u1PgtLc9AAngy3hY4j98P0nXT1QfGFtb+TD+vJbjZXqx3kzkGQMaCm7 X-Received: by 2002:aa7:d697:0:b0:461:dbcc:5176 with SMTP id d23-20020aa7d697000000b00461dbcc5176mr19376398edr.53.1668610469171; Wed, 16 Nov 2022 06:54:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610469; cv=none; d=google.com; s=arc-20160816; b=se+zWYvEE2J925IKhWXbkW09w5leao2WIUHagD3nE5+ULgvWzKZ5Pfb38Fy0vmUL5p YLfWa4hLZdq0o2qwgAWIKIG24RZRgRdrFI2MQg/tZ/abhn5/lKeoJrUaBOPIzUD3VyoN fSlTpYWHcyG2bYIJbF8P12cXFYyCS0IK4bvIgEF6/YkQ+jFXTZIvLRWsvO/p1MkviEpj yuApnxqdmbPpMQpflhzp/vSOvHKEalGQKnSjn8ugG0ZuMvauc0vAjjyCBa54TppA+sUl IE9AXiityXglQSiFdr8h3nyt0DD5v/Tn8NEfA+CXQpwOQ/t9VgSWCodsVLqVO/SlXGkZ UlmQ== 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=21klUdbfGDRjcluKPkIVpLANgI2deNdmI4jgyQps/O0=; b=lJ6x0x8od8xGJTdIzd6S0mJL2SQTWJNLjaNW5ChpPxoh4oDX9VWwDH1TGHj19Zb0q+ qmHo4C8tFrf/n0SF+e0e5dHLS2STDK6/6hsWlpFsrf6Yew3gLhaGSz+XJFsuflCMddkz VpDrKIdB23UVicChsmh0dMywFfZrjGauooSLCugjN7iFdZ39MqrRtuWgRjTq9S5pRzzC 47uTxtIKSKETCF/IuCbDCtyThoRr/m52yb1F0I+9jcX/b9YMeEwb7nbelCnP6HVySvVP s9bFXKdhll34iBG731gna7Xa+WWYZsT1Jv6K4DDvWUImymhRt1GLyY0Lxa+NdiiLAV54 UZ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EYgqspdi; 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 wu10-20020a170906eeca00b007a9b7e68634si13426243ejb.515.2022.11.16.06.54.05; Wed, 16 Nov 2022 06:54:29 -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=EYgqspdi; 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 S233721AbiKPOuS (ORCPT + 99 others); Wed, 16 Nov 2022 09:50:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233707AbiKPOth (ORCPT ); Wed, 16 Nov 2022 09:49:37 -0500 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E98003F051; Wed, 16 Nov 2022 06:49:28 -0800 (PST) Received: by mail-qk1-x736.google.com with SMTP id d8so8516338qki.13; Wed, 16 Nov 2022 06:49:28 -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=21klUdbfGDRjcluKPkIVpLANgI2deNdmI4jgyQps/O0=; b=EYgqspdiucuTWsvjn5S6eUubn/RonJlGGr6XQH9udQo5oPwaxVDlPnph7Uqr9uT43c jnddqrU9VZOGOAvSZCyhXOjg0QLntF8hRsx5fPxddi2x3KtN0sXQJi6ephoD/4pBAjQJ R13YdcKGMhbNobLjaC6zy7shjKf7dNtCVNfcDhopeGbavJ+HgFHOHpJhtQNe2Ko+/HEu rINoCnFKpAjrZ3Ns3uEcRh1RdJ0Ymm3JWkqNHhsPhmxdNahffUIYzkRkf81MWH0IImOW FtHKeabx8H3RisP0G/FMgfj+3rqCq6P3JL+RpTMeKzjPR6/D3Y26xOfNZ8FoOn92epsS a1OQ== 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=21klUdbfGDRjcluKPkIVpLANgI2deNdmI4jgyQps/O0=; b=xfN/h+t9kz2QwqNC/JM3g9XYNG0rRbEvJyy+1n/2lM7PmbvCx3+iPhhqOsj7ku7zHf fn/caGdddmbdLA8QjFSTnx3r8T7N8ggMXhLF/t58DqaqWbczhXL7A2Oved8XIcmF6lDU 6McgvC4MhWxXTWZ7/sBzlGRP115m1PL/9kGDjU8DTPAvsIP6Aibmq5ZZrM4fhQ6HcTPP dN3atEznWZ1oDFyW4hekQJULXLABjLLOJ7p9jil/w0vqjiFU4BSemF5UAHmFScExTvnq DE0o0bndVB4lhaZsVXVpl57Wwl64WuImHY+TwvYFOrIzPiAKDCkYPkVny1OAURAhCG6s 1wgw== X-Gm-Message-State: ANoB5plTejUeEQ7IrRCvqmNuFFuSu9cAkH7Vl+JSr6kCuypQ7NVQWOfS WKxyAHBLJ43oP+zL+VtXvqdiQiO+E21Qdg== X-Received: by 2002:a37:a9c6:0:b0:6fa:752a:496 with SMTP id s189-20020a37a9c6000000b006fa752a0496mr19217958qke.428.1668610167537; Wed, 16 Nov 2022 06:49:27 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:27 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 11/14] serial: liteuart: move function definitions Date: Wed, 16 Nov 2022 09:49:05 -0500 Message-Id: <20221116144908.234154-12-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664891113261459?= X-GMAIL-MSGID: =?utf-8?q?1749664891113261459?= Move definitions for liteuart_[stop|start]_tx(), liteuart_stop_rx(), and liteuart_putchar() to a more convenient location in preparation for adding IRQ support. This patch contains no functional changes. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 82 +++++++++++++++++------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 76f8a09b82cd..8a6e176be08e 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -68,6 +68,47 @@ static struct uart_driver liteuart_driver = { #endif }; +static void liteuart_putchar(struct uart_port *port, unsigned char ch) +{ + while (litex_read8(port->membase + OFF_TXFULL)) + cpu_relax(); + + litex_write8(port->membase + OFF_RXTX, ch); +} + +static void liteuart_stop_tx(struct uart_port *port) +{ +} + +static void liteuart_start_tx(struct uart_port *port) +{ + struct circ_buf *xmit = &port->state->xmit; + unsigned char ch; + + if (unlikely(port->x_char)) { + litex_write8(port->membase + OFF_RXTX, port->x_char); + port->icount.tx++; + port->x_char = 0; + } else if (!uart_circ_empty(xmit)) { + while (xmit->head != xmit->tail) { + ch = xmit->buf[xmit->tail]; + uart_xmit_advance(port, 1); + liteuart_putchar(port, ch); + } + } + + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) + uart_write_wakeup(port); +} + +static void liteuart_stop_rx(struct uart_port *port) +{ + struct liteuart_port *uart = to_liteuart_port(port); + + /* just delete timer */ + del_timer(&uart->timer); +} + static void liteuart_rx_chars(struct uart_port *port) { unsigned char __iomem *membase = port->membase; @@ -98,14 +139,6 @@ static void liteuart_timer(struct timer_list *t) mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); } -static void liteuart_putchar(struct uart_port *port, unsigned char ch) -{ - while (litex_read8(port->membase + OFF_TXFULL)) - cpu_relax(); - - litex_write8(port->membase + OFF_RXTX, ch); -} - static unsigned int liteuart_tx_empty(struct uart_port *port) { /* not really tx empty, just checking if tx is not full */ @@ -125,39 +158,6 @@ static unsigned int liteuart_get_mctrl(struct uart_port *port) return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; } -static void liteuart_stop_tx(struct uart_port *port) -{ -} - -static void liteuart_start_tx(struct uart_port *port) -{ - struct circ_buf *xmit = &port->state->xmit; - unsigned char ch; - - if (unlikely(port->x_char)) { - litex_write8(port->membase + OFF_RXTX, port->x_char); - port->icount.tx++; - port->x_char = 0; - } else if (!uart_circ_empty(xmit)) { - while (xmit->head != xmit->tail) { - ch = xmit->buf[xmit->tail]; - uart_xmit_advance(port, 1); - liteuart_putchar(port, ch); - } - } - - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) - uart_write_wakeup(port); -} - -static void liteuart_stop_rx(struct uart_port *port) -{ - struct liteuart_port *uart = to_liteuart_port(port); - - /* just delete timer */ - del_timer(&uart->timer); -} - static int liteuart_startup(struct uart_port *port) { struct liteuart_port *uart = to_liteuart_port(port); From patchwork Wed Nov 16 14:49:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 21105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp183764wru; Wed, 16 Nov 2022 06:56:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf7xwWBKBCisaWp0fgGvc0xnrnNAGczwHe0jHdsPOVV7UIlYZiKbVeiplk1eZNuFR+7cNKsZ X-Received: by 2002:a17:906:7692:b0:7ae:3fa3:d7c6 with SMTP id o18-20020a170906769200b007ae3fa3d7c6mr16755598ejm.494.1668610571052; Wed, 16 Nov 2022 06:56:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610571; cv=none; d=google.com; s=arc-20160816; b=TBF1Zfx1Ygb806dtxUJ1Eu7yxBwnJNAk0Ryykao3RGbCmM1gFxSoRRxkC9Q0Vvwl+X ClERzzbUI9MUkbQt1HIcvkxBEKyNtAIeJggoilBWXlAj2feMPzsil+GAkxW4COac6Ctf 5M9WcskxxraASWoslniPNJGdyWD0Ot5kXTegDSOmpX6nFY23Pmk/cbKrUXm9kRrz5hwj 6tf2FVuNryh9hpbEcnOEBUmVuNxuqu4eWSK9OpsyY6h623IuAq5WaurhTTgs346K2LCE VdmFJFEU79whS3ErRxTyUb+zBwd+yGu/7YVMNcYKeHkz63LYsk8T3tA3QALxP9R2VUvz b1fA== 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=Q079jILUgJW/NMjEmrvfvn4MUn8PyV68OVRL5iIezGU=; b=pKtu0kb7P4ixndsEtAnvfD2H9bR2A2IkhE+mjIfGlwS5bjWyq1bems9O+3z8qui2CS V554TmitSKWSMXaIo8X33Xq82RoSvMWNF/RKIBlwdVdiE7vhZUM9KEEtvWdmpl7Lv5Zu o0Jj0GqZRx/VZrHqA4a2L+V/M9JvnUOG6vvYlczxSusQZFFqd2bt6gL1KA1VdV3MBQ3e mLDxUToDoc8b6C4vtnKebkSgvhtaC3XduPUQVCDtAmCQm3IizZ4moQUVvRSb6OaFXTij pS4SeYvZBqDDlpmRADFwa4GqKld6SxlAwYXXEdXnxy9vfzxg0iow7k4WvHVYaTJpYOJ+ 6ptw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IS+Kjccq; 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 y5-20020a50e605000000b0046154f0f866si13823555edm.159.2022.11.16.06.55.46; Wed, 16 Nov 2022 06:56:11 -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=IS+Kjccq; 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 S233818AbiKPOuW (ORCPT + 99 others); Wed, 16 Nov 2022 09:50:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233536AbiKPOth (ORCPT ); Wed, 16 Nov 2022 09:49:37 -0500 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B16E4326F4; Wed, 16 Nov 2022 06:49:29 -0800 (PST) Received: by mail-qk1-x72a.google.com with SMTP id d8so8516381qki.13; Wed, 16 Nov 2022 06:49:29 -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=Q079jILUgJW/NMjEmrvfvn4MUn8PyV68OVRL5iIezGU=; b=IS+KjccqnuPoIzcQEkomczag9QgHfGynGlUwJ2nIhaMz4Vdg/WgUqo3cc5tCAVoqr8 TpD7lEv4IQmTALgSSRiE+IPITTJ4yQ/c20a2EsgvjN6sTDDEmsRIHGAYhDFA8gTHPRnZ 8MN4B2iX7ah9wp9/FnPfN9dL0NLD0O0+hV64fkBPIpLltf2J3mdyKYqWWP5M39371em9 4MGauV5FkwJ711919tCxjA38fiPDve4XVxX97yhrGg3/oU/+hB49FLHHUUGPURIX12ZN UMnc8P1/uJZ5V+SOugeSfzJjQfzG6lo8LJdLhsXAB0EWKzrbdYYom1xS5FuGZS1Hqntv dXGw== 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=Q079jILUgJW/NMjEmrvfvn4MUn8PyV68OVRL5iIezGU=; b=bpqWrzHgn9z6unctevWJJNZVeS0f+m1XZsMIKE60xq1Na++2Izp8Dc13s+cR7B9T/A 7GuORt0+lXv0cIE4jJ598L62qnUZKB0XIOI10ymxjpUtvYCQ2+vjGlF2Nm487NSFNvvn kiL65RjjYU3ax/IQNczv1MNYYDtsi037xiXdzQ6PxnSWDo2F33qjJGF3OMUoMUTswhFC gslkG6ov9sq/loiCwrJv7AdAXGmbNZRscLfCTtLDD6GPGAZhviEUgYUTZX0dgjQCv1WY 22Y90BtSbKC6dwoU6aPytZiLbDHr6RC7BMTQi8syo/jSPkn9Ai6hdtSwOrT9bdsvYtiV fYcw== X-Gm-Message-State: ANoB5plBROUM9OdpuTZvk9JDPLVPV6GOBMRacys6R3vaU3HLxLj1XF4J KeGwpfnQbYkb9y5bLo20W0N1b1CSR/8LXg== X-Received: by 2002:ae9:f718:0:b0:6f9:7535:dedd with SMTP id s24-20020ae9f718000000b006f97535deddmr15549922qkg.635.1668610168518; Wed, 16 Nov 2022 06:49:28 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:28 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 12/14] serial: liteuart: add IRQ support for the RX path Date: Wed, 16 Nov 2022 09:49:06 -0500 Message-Id: <20221116144908.234154-13-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749664998081154887?= X-GMAIL-MSGID: =?utf-8?q?1749664998081154887?= Add support for IRQ-driven RX. Support for the TX path will be added in a separate commit. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- Changes from v3: - add shadow irq register to support polling mode and avoid reading hardware mmio irq register to learn which irq flags are enabled - this also simplifies both liteuart_interrupt() and liteuart_startup() drivers/tty/serial/liteuart.c | 76 +++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 8a6e176be08e..fad778578986 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -46,6 +47,7 @@ struct liteuart_port { struct uart_port port; struct timer_list timer; u32 id; + u8 irq_reg; }; #define to_liteuart_port(port) container_of(port, struct liteuart_port, port) @@ -76,6 +78,19 @@ static void liteuart_putchar(struct uart_port *port, unsigned char ch) litex_write8(port->membase + OFF_RXTX, ch); } +static void liteuart_update_irq_reg(struct uart_port *port, bool set, u8 mask) +{ + struct liteuart_port *uart = to_liteuart_port(port); + + if (set) + uart->irq_reg |= mask; + else + uart->irq_reg &= ~mask; + + if (port->irq) + litex_write8(port->membase + OFF_EV_ENABLE, uart->irq_reg); +} + static void liteuart_stop_tx(struct uart_port *port) { } @@ -129,13 +144,27 @@ static void liteuart_rx_chars(struct uart_port *port) tty_flip_buffer_push(&port->state->port); } +static irqreturn_t liteuart_interrupt(int irq, void *data) +{ + struct liteuart_port *uart = data; + struct uart_port *port = &uart->port; + u8 isr; + + spin_lock(&port->lock); + isr = litex_read8(port->membase + OFF_EV_PENDING) & uart->irq_reg; + if (isr & EV_RX) + liteuart_rx_chars(port); + spin_unlock(&port->lock); + + return IRQ_RETVAL(isr); +} + static void liteuart_timer(struct timer_list *t) { struct liteuart_port *uart = from_timer(uart, t, timer); struct uart_port *port = &uart->port; - liteuart_rx_chars(port); - + liteuart_interrupt(0, port); mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); } @@ -161,19 +190,45 @@ static unsigned int liteuart_get_mctrl(struct uart_port *port) static int liteuart_startup(struct uart_port *port) { struct liteuart_port *uart = to_liteuart_port(port); + unsigned long flags; + int ret; - /* disable events */ - litex_write8(port->membase + OFF_EV_ENABLE, 0); + if (port->irq) { + ret = request_irq(port->irq, liteuart_interrupt, 0, + KBUILD_MODNAME, uart); + if (ret) { + pr_err(pr_fmt("line %d irq %d failed: using polling\n"), + port->line, port->irq); + port->irq = 0; + } + } - /* prepare timer for polling */ - timer_setup(&uart->timer, liteuart_timer, 0); - mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); + spin_lock_irqsave(&port->lock, flags); + /* only enabling rx irqs during startup */ + liteuart_update_irq_reg(port, true, EV_RX); + spin_unlock_irqrestore(&port->lock, flags); + + if (!port->irq) { + timer_setup(&uart->timer, liteuart_timer, 0); + mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); + } return 0; } static void liteuart_shutdown(struct uart_port *port) { + struct liteuart_port *uart = to_liteuart_port(port); + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); + liteuart_update_irq_reg(port, false, EV_RX | EV_TX); + spin_unlock_irqrestore(&port->lock, flags); + + if (port->irq) + free_irq(port->irq, port); + else + del_timer_sync(&uart->timer); } static void liteuart_set_termios(struct uart_port *port, struct ktermios *new, @@ -262,6 +317,13 @@ static int liteuart_probe(struct platform_device *pdev) goto err_erase_id; } + /* get irq */ + ret = platform_get_irq_optional(pdev, 0); + if (ret < 0 && ret != -ENXIO) + return ret; + if (ret > 0) + port->irq = ret; + /* values not from device tree */ port->dev = &pdev->dev; port->iotype = UPIO_MEM; From patchwork Wed Nov 16 14:49:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 21106 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp183827wru; Wed, 16 Nov 2022 06:56:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf5fMXCpR3PSo1KBuvsEvDbmAYT6BltqYOOnlUkEMXKb6R5rVUhX2DJplXp3ndeuqcyQrkze X-Received: by 2002:a17:906:280c:b0:7ad:88f8:761f with SMTP id r12-20020a170906280c00b007ad88f8761fmr17048468ejc.417.1668610579081; Wed, 16 Nov 2022 06:56:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610579; cv=none; d=google.com; s=arc-20160816; b=AziZWDKHj/megr25LWErgDVKJP2dccjX/5/GjAJaVZ3scWq8VjJXvjLU7kOTFr7x9j EkACdZ5fJapz+e69Ae/aJJP9xk0j3Ap1eh5o1rNoEGJkk/10nzELQ0a7Htpkys5Ath/X u5U17zW+JPBq2XuNXRbtc8nBmuTNif+jf/+vUVggLaknFOpwDR/ahX82Ku+XINqNxn7z PtA3X2rZbTL7HRm3bNM7IY5S4DaNHRIVEb83jIgjoKuob8jChx0VJqTY69N1ZZVHdwy7 sPK805meAyowtUhKylSyiqr5fDTTcuiTdbDDsuoVgQJknguCe4573x97t82utXVOUKUn eetQ== 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=bD7MdS5vDL9626kuFaCs08bkmWREVcZginG5UxkUB7M=; b=lcE6WVCfTLgKQCBuCB/jlBkgeYt8uEecNsWGNZQ/74xMFVBK7+6iLu3VguuqQuTQus leTuMmZttpOS3vexG6l6d6zpjOhcEejJsq9Y97LCx0JOUJQ3GwmT6IVuVy3o4LsEe2W+ Ou+f+ypsoioaq2K/YXDKP7c12AZM58ZhKzGSQ5WAQdwqjEGb5Cjk0TCdpjVji8ZboqGy mmYGmg/+RLsX2ThX8bS/5I9cV4lrMuLux255qSQ3EiCqmSpMy3Ds+lRZbJx3z5fIyXJu R3LGlU2SlsQLAVYi1pqUw9tAc3zTpByXF2UG9wegt8jQ81dCFRkD2jUqIUiAtov0bYL6 AspQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pH88cF+6; 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 sb2-20020a1709076d8200b00780e89aecd1si14747224ejc.849.2022.11.16.06.55.54; Wed, 16 Nov 2022 06:56:19 -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=pH88cF+6; 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 S233969AbiKPOu1 (ORCPT + 99 others); Wed, 16 Nov 2022 09:50:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbiKPOtk (ORCPT ); Wed, 16 Nov 2022 09:49:40 -0500 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8CF83FBBE; Wed, 16 Nov 2022 06:49:30 -0800 (PST) Received: by mail-qk1-x72b.google.com with SMTP id i9so11719332qki.10; Wed, 16 Nov 2022 06:49:30 -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=bD7MdS5vDL9626kuFaCs08bkmWREVcZginG5UxkUB7M=; b=pH88cF+6+fCCO8t2vnymPV45Mzm/I5WpC0TiRTmOrXy6ff5gi3fXdgDC00/f1djz04 4dPmABNZYkvNQeXWUYlliMOAjk2McGALqtk4OoGencURYqCgybr9OEYHlzHrYDsfQuSe ZVaO8K06t5cmk58K3RFmwSIS8ZX6G7arXO5QIMRBo9kt83YVOPkgca63u72Yxwg7T49e 6vGzaTkxp9CAUnDFA930tf/U8YRbbWXK1pLikdt7XzpfgSLbxBlEVYS2g6zAD9wbuZUE rObMeo1H0R5ttDPPKkiTVPHjWlZT1gSfpz++BT+e/UW3UMMbjKE/pjn8gQoNYwRhEFpm ejuA== 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=bD7MdS5vDL9626kuFaCs08bkmWREVcZginG5UxkUB7M=; b=tS1hllbGLbuynRYs3mDlUxLfcra6QlZYoSS0XDRZnRjFC2+fqXwh7C/jATLXrhuKZ6 IbTbHOlsJgO+ts+LYQpkz/1bzcqU8QatsoJZgfur/JXnMsAXsoecfSk1DC3sIO8Cj+mo OQD4rRwHvpauveVpTquVnfy8LqWtixpglRHJJnmg7cKG1q5tGG7OBMuUQ/b5EcnUAzan Xbg66NGkYoTPVazOv1CxsKq2tR/VB9mgpJQqeBzYCIDCNDbuR/9ogH/vHX+8bRlAfmKv HCselrj4t0alFfIf1vHGB9Xv8Ks2ZywuzdAmnQqIyltpyKw8v+iD3bwRuiurCuBjWsWq YPqA== X-Gm-Message-State: ANoB5pmQa3K1MFRODqw/ztjM4ZzBCt6CT0khw8qKYNU+HvGkB43HHYYB yTq+Q2XO19F3jP6OnpX03mUk6kxwbX7vfQ== X-Received: by 2002:a05:620a:c43:b0:6fa:6423:65b6 with SMTP id u3-20020a05620a0c4300b006fa642365b6mr12498013qki.324.1668610169549; Wed, 16 Nov 2022 06:49:29 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:29 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 13/14] serial: liteuart: add IRQ support for the TX path Date: Wed, 16 Nov 2022 09:49:07 -0500 Message-Id: <20221116144908.234154-14-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749665006443961055?= X-GMAIL-MSGID: =?utf-8?q?1749665006443961055?= Switch the TX path to IRQ-driven operation, while maintaining support for polling mode via the poll timer. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- Changes from v3: - remove superfluous curly braces from liteuart_interrupt() - simplified [start|stop]_tx() by using shadow irq register from patch 12/14 - simplified liteuart_tx_chars() by rebasing on top of tty-next tree drivers/tty/serial/liteuart.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index fad778578986..977fc4349b47 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -93,27 +93,12 @@ static void liteuart_update_irq_reg(struct uart_port *port, bool set, u8 mask) static void liteuart_stop_tx(struct uart_port *port) { + liteuart_update_irq_reg(port, false, EV_TX); } static void liteuart_start_tx(struct uart_port *port) { - struct circ_buf *xmit = &port->state->xmit; - unsigned char ch; - - if (unlikely(port->x_char)) { - litex_write8(port->membase + OFF_RXTX, port->x_char); - port->icount.tx++; - port->x_char = 0; - } else if (!uart_circ_empty(xmit)) { - while (xmit->head != xmit->tail) { - ch = xmit->buf[xmit->tail]; - uart_xmit_advance(port, 1); - liteuart_putchar(port, ch); - } - } - - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) - uart_write_wakeup(port); + liteuart_update_irq_reg(port, true, EV_TX); } static void liteuart_stop_rx(struct uart_port *port) @@ -144,6 +129,15 @@ static void liteuart_rx_chars(struct uart_port *port) tty_flip_buffer_push(&port->state->port); } +static void liteuart_tx_chars(struct uart_port *port) +{ + u8 ch; + + uart_port_tx(port, ch, + !litex_read8(port->membase + OFF_TXFULL), + litex_write8(port->membase + OFF_RXTX, ch)); +} + static irqreturn_t liteuart_interrupt(int irq, void *data) { struct liteuart_port *uart = data; @@ -154,6 +148,8 @@ static irqreturn_t liteuart_interrupt(int irq, void *data) isr = litex_read8(port->membase + OFF_EV_PENDING) & uart->irq_reg; if (isr & EV_RX) liteuart_rx_chars(port); + if (isr & EV_TX) + liteuart_tx_chars(port); spin_unlock(&port->lock); return IRQ_RETVAL(isr); From patchwork Wed Nov 16 14:49:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 21107 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp184070wru; Wed, 16 Nov 2022 06:56:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf49YASvsMHY50EjIYvniLKRW7X6RYHiT+xakRj9mBYzqV80rno1V3CPuWzyQacRKQyldX6o X-Received: by 2002:a05:6402:747:b0:459:9dd3:2217 with SMTP id p7-20020a056402074700b004599dd32217mr19192107edy.163.1668610609124; Wed, 16 Nov 2022 06:56:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610609; cv=none; d=google.com; s=arc-20160816; b=X0KRaYXeQ44eW2n2RTMrzW2jL+sOnmtNCxEGD2F5gwEpd9yHrxH1hQytCVadg0Rmvv 5fDgoEjwnSG6EclRlqIyYUA+bro9AjUhAG4ttL/8eNX+kngyN2j08uJlLS+9v2KLEpPC elZzobCALVX9iSG3I5eQqabgme/R3XAMqN5uh6HceY69+rADJZMSWBJ1WEZSED38xXJE klUnD6phZlf7vKMozeRxSgEGqriK6JD41a0aBXlrDMk1oM7VMx78Xk1j69JggIPpYx8c eWr6kXmCUTaxoSwQ0WnVA9P9IUGRaAw+WLXScKeAWhKGf0AuS/FM7ODuvImnM3devhOv 1sNg== 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=GsRGGaIiBoJlwl/45zB6BAECaPWQUSVeGqaE9kAVQrI=; b=KNZ2s0TsbS8kNxv3IbF/v33EcNVXbP/aGfxfP+8YPIMRA9gwioe5B9QH0A6WhYs8uj 9rykGN+fMve2e8s/TK1tqn65gz2RgznCGZ46UP9EVri+l2JqIcbN2TRCaRIJU3sjFkko c2UK8J6ibvVwSA1rC6IgFGl1lQAJk7/dNUbahUUMmZ6UtOII5bAmAZJM2LUhAEERlD4s P0+Pg16K6TrRb1jv2KDHnjYNF6NlNQ94BlrmkpkGFSvMDOBCfTtdKkR04xaRSBAbmjTG NhIrx2tL4yT+CAyLwoxWJuS5QXaWoBQIrmn80bjgWyMegdeD9bjGOv/s1mDyV2CGnghD +45w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CqrrIl3u; 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 sy8-20020a1709076f0800b007ae4ed48290si13464993ejc.279.2022.11.16.06.56.24; Wed, 16 Nov 2022 06:56:49 -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=CqrrIl3u; 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 S233836AbiKPOud (ORCPT + 99 others); Wed, 16 Nov 2022 09:50:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233770AbiKPOtl (ORCPT ); Wed, 16 Nov 2022 09:49:41 -0500 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBB9E17A9E; Wed, 16 Nov 2022 06:49:31 -0800 (PST) Received: by mail-qv1-xf29.google.com with SMTP id u7so12003003qvn.13; Wed, 16 Nov 2022 06:49:31 -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=GsRGGaIiBoJlwl/45zB6BAECaPWQUSVeGqaE9kAVQrI=; b=CqrrIl3uMqf9NCB5q4CLw/Pa8BCbWfgMrW1s9jDsDO0IemRCQGuS1bWJnczyJEz4yv sSzpnT2kKzIrTl4xHRy6MuaGNn4SYXg5fPxuSXtaZvP4CPLvgFmhMtqi5ouDKYYD1Kyl 2QKrrtN/XU1QXctfCpfvsqxQxigLLro4miqSM0JVDHd5YDAlc5+DGPZUW96wJ1s85mE4 VjHj/3V8++CJPw5A3x660GYei74pQ8yyorgP79WHClIW00NWC3RH0on+zHo/JrT3nN/o qaojdX1Rbi+azeYmSoA0e1fqTfQjq7Yd62hTSyTbb8yFapevogH9pQgQKjyXdK0NXWVA leLg== 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=GsRGGaIiBoJlwl/45zB6BAECaPWQUSVeGqaE9kAVQrI=; b=tLrRNeCt9UajBy8AfNxCHY+kloSy50SQNXGINjpPnM1yyN0H9raTMATDkCAFgHSifQ awGBs/WVIBRz768Tbd7CpUPTLpa2Me17Q6C+3MWd62lQ9Gls55iNO9Vx2tEWv1Ft9JCx HrB19qufbgLyXLdhNTo9q+YWom1fdkjTNpGO9AqponmeQ1Kn1HbiOhz0xA32F7b/zH8m 3p02kt3HYoQ5LPvvHlFyHajPJcWcmaX+XH8Us0zISm9vYvdlLFbFDkNoNIghePGn9Yvf vpocaDvxh3xOZdLj/Ij3BRevF+7E15xKD6p2aTKPigBKxRCBROJksRxK55k0XiTwakVV VbEg== X-Gm-Message-State: ANoB5pk6zD7N1PLLHBaLnuegO/YRNDTBrx8dEFZZTbJI61tRi60MV4v8 fdaJtaNEisBzah7o704uxrKN0N5LKOZXtA== X-Received: by 2002:a05:6214:370c:b0:4bb:64f7:dce5 with SMTP id np12-20020a056214370c00b004bb64f7dce5mr20740663qvb.15.1668610170609; Wed, 16 Nov 2022 06:49:30 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:30 -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, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 14/14] serial: liteuart: move polling putchar() function Date: Wed, 16 Nov 2022 09:49:08 -0500 Message-Id: <20221116144908.234154-15-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-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?1749665037796981029?= X-GMAIL-MSGID: =?utf-8?q?1749665037796981029?= The polling liteuart_putchar() function is only called from methods conditionally enabled by CONFIG_SERIAL_LITEUART_CONSOLE. Move its definition closer to the console code where it is dependent on the same config option. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 977fc4349b47..238f615cb80e 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -70,14 +70,6 @@ static struct uart_driver liteuart_driver = { #endif }; -static void liteuart_putchar(struct uart_port *port, unsigned char ch) -{ - while (litex_read8(port->membase + OFF_TXFULL)) - cpu_relax(); - - litex_write8(port->membase + OFF_RXTX, ch); -} - static void liteuart_update_irq_reg(struct uart_port *port, bool set, u8 mask) { struct liteuart_port *uart = to_liteuart_port(port); @@ -372,6 +364,14 @@ static struct platform_driver liteuart_platform_driver = { #ifdef CONFIG_SERIAL_LITEUART_CONSOLE +static void liteuart_putchar(struct uart_port *port, unsigned char ch) +{ + while (litex_read8(port->membase + OFF_TXFULL)) + cpu_relax(); + + litex_write8(port->membase + OFF_RXTX, ch); +} + static void liteuart_console_write(struct console *co, const char *s, unsigned int count) {