From patchwork Fri Nov 18 14:54:59 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: 22368 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp239205wrr; Fri, 18 Nov 2022 06:56:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf4+rCKzCi61rK33aO1iGHptB6niUtHVsMKbtkp0A+1bQYu61jqtV1FSOL9Ya6YdkuDZZtq5 X-Received: by 2002:a63:38f:0:b0:470:79cb:6c5a with SMTP id 137-20020a63038f000000b0047079cb6c5amr6967819pgd.254.1668783380757; Fri, 18 Nov 2022 06:56:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783380; cv=none; d=google.com; s=arc-20160816; b=QI0QFAyBSbW9NeqvBp0/tmKu6r4ZPKQ0E1IqIzUWHKx/299AyE+24P7/1ZeuN5Q9pX UfxdUUqi2Jz5+bb7ond1xIyrTjHcYdGJZkUZL6Zo3MOcfsIv4mdrXX1iwQYPd0ES1sIL RIQgJ4e3RIAhbSw6X1Ic008pUG158T/q+zehpwSTKEUqP86hdfx1J7Z7DK8Ce8VzuUte eN+60rPpae2mcdRYwtE5pVIbiVYnhxXoFSXtfy019AnlQXKJ4tQl+k9xRxsI45ZHfDfq GvNog3WbgBzhwSq2xFCljlHoqLQkFxirFNClr7Iup5MkBEJ+AxXuuoJMmKaY/RaZoSY2 HrDA== 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=JAU15Qt8dODFyZbM3Bi0cEjuBp2f9R6Gn71YCZAfvJknvmqprQtR31GiDxHKOlPuY4 AHPMdh7EAHZB5gHiM8qBrU5yZRpBbOaqrbKl8+RSes4n2TP9+ruuOu3BM65paCrZ5Jaj NdrLX5Ohi0FqzV1fCHJTlKifZI/uUafwjrwiI5UUJRlap4iflDpG1OH3RQINYxQjOFA3 8gPuMtESDSqAq6ujw01v4i6o8A3uvm/BylKEizW3FC3bxfhvJwYQTOZxTaN/BAsnb/3R bNxVxkTTTBsk6LtG1zUbeim7iPiBdEYQG2I/PzQOGEVbXKDqIzaloa2JRAVoq625vks5 X7Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JxbL2TO9; 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 b17-20020a170902e95100b00188d892999esi3779251pll.521.2022.11.18.06.56.06; Fri, 18 Nov 2022 06:56: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=JxbL2TO9; 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 S241826AbiKROzb (ORCPT + 99 others); Fri, 18 Nov 2022 09:55:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235254AbiKROzY (ORCPT ); Fri, 18 Nov 2022 09:55:24 -0500 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48FE122B2D; Fri, 18 Nov 2022 06:55:22 -0800 (PST) Received: by mail-qv1-xf34.google.com with SMTP id j6so3456380qvn.12; Fri, 18 Nov 2022 06:55: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=XsrpgSLIetjSSjQsdPnxAm+guc7zGDde8lk1A/5OW7U=; b=JxbL2TO9MYg3jHvTXDWDKZM08/lu66n2AgnhlFtglU5DcxT8ymqJcGGSvjqLdBjl8L Hr0YNz8ivgAMv5S25GF7nZQOtvLm5yBH3YKTpDyZNtrst/pBcddc9CinYVsW6OAug8BL gMjVGZvWWlFhdTkqoyAdbV51oTYLYIJLRocAR1h3lpt0KuCYo4oVLm7bA5pGFvGaw2Oi lBy/AAvoSKP8m1VQeiXo3Byd8YOmM+TUrxqbRnVYBCSDi/SwnSACj5+YTVWhS0ubI2ux ZoTxDq3+eqeGwv/3W+Juq7JSk+eAuSlUXmNp9KggugeOdoGD7Re/rsO7y8BWCinLmR1v FRJQ== 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=zE74yWO2wLTPkAUr0v9Hb4ZVt+oUCrwCyVJHf8JaHa1hSklsOjSsI7wujTuuCzCfOO uqj6C5ZO2h3Gsge0S9nxpOsr1JGgVZ+8a4dqj1BM28Ny0cRnQ+gt4bfIreinn/txFJal 4Z/60C9DbTT09RQ+7rbmOWUjk0Z6qymSmrTWQnwM1euJdp/xEMFEpqjxzpY555YgWqn1 5B1xna/eI6PIyy85Tz416ZXG5Fe7jL+sy/Go1F+ECQ0cl1hd6KuV9WQSm4UZMORSA1v0 bwTQ90O1i4bRh89w10YU0G5KI7N1JussibSD70nDPbnryw43jA71Gf9i70ZDDxdisuyP svnQ== X-Gm-Message-State: ANoB5pngjii2rXFT3x3FwTfePwhVUDwLe5dMSrbLl6zBcSaGv0DBSBR0 sFlSGpKaMPU2LNJG7PAcanDAIoSBRGVZZw== X-Received: by 2002:a0c:e90a:0:b0:4b4:8037:1303 with SMTP id a10-20020a0ce90a000000b004b480371303mr7046931qvo.16.1668783321015; Fri, 18 Nov 2022 06:55:21 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55: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 v5 01/14] serial: liteuart: use KBUILD_MODNAME as driver name Date: Fri, 18 Nov 2022 09:54:59 -0500 Message-Id: <20221118145512.509950-2-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846202006785246?= X-GMAIL-MSGID: =?utf-8?q?1749846202006785246?= Replace hard-coded instances of "liteuart" with KBUILD_MODNAME. Signed-off-by: Gabriel Somlo Reviewed-by: Geert Uytterhoeven --- 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 Fri Nov 18 14:55:00 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: 22366 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp239134wrr; Fri, 18 Nov 2022 06:56:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Tj/X74sKmxK5rFsXiGm4n0vmsvGQdhzPae8JdbwEuKVymT02Lm3248blrfPIamVhMaGKJ X-Received: by 2002:a17:90a:307:b0:213:ff80:b37f with SMTP id 7-20020a17090a030700b00213ff80b37fmr14267560pje.118.1668783370510; Fri, 18 Nov 2022 06:56:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783370; cv=none; d=google.com; s=arc-20160816; b=z75UFp6HW0Mijv6HJGaR1MWOoMps6HoMQr+D6SdxdDhHkS1zd7e4pn5KvJeGQpKxcM GhUTeAyCZvQZnOux6xScnny/1mYINo+3BC0XyimbpGSsGEw97YS+/RCNwFmJ4XhPZyNw roYRUljBIq3t9vGiPMQlGVnTouBlBVSNxztTcAQFCADt0X5B23PHh819BmAUNUG8dR46 ZlhzxkUGy5huOaga9TnOR7vT/Qrm9E0Dbxhgc8SgXZtZR8ukfncXLQJm4wadGUMlOenN gPw1lv7L0yfZRsxYZ5EFjwcbKYN+T/F0Fxw3wTkvRDX8CB9oEVJSQotI3l3sWiLzJ4sA OSHw== 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=Tc4HY0VxnkrPwWL9SQWES+FDxkDFOlvOrzE7fQZCEi0=; b=kTvRheobnQiKMX5To4M+QW1P/r/5nyADMsg8DdWCUM8+66jmJbV+YF0Jv6f06zM5C4 vGgrZS7N1+cDrGuWTbv7n9BCiB7fRqQJdU8ptpIqDNzQvv7XGu9CJj0u6D69ia908Mdm yqOtbT3Oqthmk6EDmWRNFdEPY/TC08BkotxNJoFprC9UkHCia41P06rDMWnMcBzqXrVT QM/sth7YAKu2lzfGk45e1lazbJTA/rp93FjXT3CACdPkWgirDN5rOb+ijyhlF7/qSd1z 0QOC82KIxGrSIdegxaAHd/AtC5XN5UQEmNy2HGe0W8iuVaPyLSJ5fX5hGHmsocGatNLI KAdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="k/WRK8g2"; 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 nn10-20020a17090b38ca00b00214021e87d1si8192836pjb.173.2022.11.18.06.55.56; Fri, 18 Nov 2022 06:56:10 -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="k/WRK8g2"; 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 S241855AbiKROzf (ORCPT + 99 others); Fri, 18 Nov 2022 09:55:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235204AbiKROzY (ORCPT ); Fri, 18 Nov 2022 09:55:24 -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 6FFDA240AA; Fri, 18 Nov 2022 06:55:23 -0800 (PST) Received: by mail-qv1-xf36.google.com with SMTP id h10so3468997qvq.7; Fri, 18 Nov 2022 06:55: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=Tc4HY0VxnkrPwWL9SQWES+FDxkDFOlvOrzE7fQZCEi0=; b=k/WRK8g2SEfJ5O9BGJ55V/tUDmsRuk+S0Tth9ZspZbygnYVlV+bGlt/eujeVr1Wibj WprtDDRss0y3sZJb4vvnelUeql8LflbUiV8JjpaLp6j16iC2/Lx3q5AeYo5z6bJfylNN a+QtDK5fgo06thjzayOKfUPE7efXXC9Ibk8C0ucY8xzzj4a7B326HhG1fhehDuJKSaPz 3a0/5g1Xz6ibqVg3y269dVeBrDD1CK9T4Xxs8//u7w3WvNu7Dnu4ftTmvNziA+SeRCzj cC+aB2R+shxZ6yCbS2aZP/W6+Al/ApayA2fdGEGUlfZlqJ4PGVBs+2FdwZIpifkM+JDq fq6g== 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=Tc4HY0VxnkrPwWL9SQWES+FDxkDFOlvOrzE7fQZCEi0=; b=ocfyJTSENHXUwb/kj76tE5J1hkn3M3lfKv9XPCUpYJ+aA9OeDxH5oEdh7x867dvMTj a9Odb1AGcBWinjUGAJ1AOXpsPB4/uvD+2XEoUoFN4bKa8f/fP0xIix3xN5FUKbC0kzEf dkj+Gp++I0aje+PmX6HfvzY/vSBqW7Z9muCUMOiE6UpQOh72jI4SWZtmEvmN21uTLmif lIjDaEHoueejTNgHGb6mere32hA3f5HCRb2I+XwddR9EUKRp5stBRQt6RE0LBvFBnlf+ qTNh8qDvj3ivgFptXzeGpHqWAbgEC6cxEWfo6NGk2qx0IZ/v6Z5oSL2QQNHFjykLOVaR zTLg== X-Gm-Message-State: ANoB5pltDe2So82EJ2yH6JV9CTAato1jE1BXxpURs2Wq5qCGGBs7oIZG +9gI2p7I2yUwKCIk1e0dKWyJX+Ql/yW+FQ== X-Received: by 2002:a05:6214:328f:b0:4c6:82cd:92d1 with SMTP id mu15-20020a056214328f00b004c682cd92d1mr6940562qvb.82.1668783322306; Fri, 18 Nov 2022 06:55:22 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55: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 v5 02/14] serial: liteuart: use bit number macros Date: Fri, 18 Nov 2022 09:55:00 -0500 Message-Id: <20221118145512.509950-3-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846191522906960?= X-GMAIL-MSGID: =?utf-8?q?1749846191522906960?= Replace magic bit constants (e.g., 1, 2, 4) with BIT(x) expressions. Signed-off-by: Gabriel Somlo Reviewed-by: Geert Uytterhoeven --- 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 Fri Nov 18 14:55:01 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: 22367 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp239153wrr; Fri, 18 Nov 2022 06:56:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf57fPx3XHCTM5uGVB7XPyT8wFTQtiAnRP/XLoXJyphKiWo3lnDsxPuPAu9tXG9NMvOalyBl X-Received: by 2002:a63:5cf:0:b0:476:c303:521d with SMTP id 198-20020a6305cf000000b00476c303521dmr7076888pgf.276.1668783372263; Fri, 18 Nov 2022 06:56:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783372; cv=none; d=google.com; s=arc-20160816; b=LSHXFLZiob35xhR7XKz1O/+yKv4RzwOlFo7Xekd7XK1lBKEpRPVTYJ8XYAhBLVBzRc TQPezHZOPNwtpsP2dtovbXEJkD50tTvLNw+kSiS8KwvChlEJvD4KCROIDA2B9T1WfxhA BvsOMGLCk8EKs7wqbTOdnEBypCqh8pl9w/JlNuh3CmAJpGJrYAammHcqP+zVrzBpQmvX tvohRKLr2j76EICD0RR2L66twGahjvf+Y0kDIZMyNIbFcrCzxBr6HvEy8PF6dbsixaV1 NvVoJM33XhXNepKAiljsSsGbSi2k9B5B870/yIKgF/qdlA5Cj56WF8ixli4xqloRX/FN 8hjA== 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=SBWlKsdKtevcy3cCWMNuX45X8cNraoMHYPlpt2EEsVk=; b=whtPclddEXe55CSXzdRRFxDRRw/gn/CstEbw+9enPJfC88lTxZkBUG3KTd3eLQZYT8 jIn30tZIuRXIl29187ANJ+9YVdnQw5J9e6tT2GiMJH5pHiDarnGoHfTM+EoV5lJ3SLn+ oPaR0ctTvgOcnGhq2g3dDmckGKb/CoJb3ShwLV6KydnqPilvwdZ+UVpGL+UtspM8QgFV xj4rHRLvSEF+xOS69ETMZ9feS8exOvaETN85FzFO/kd1w39TwzM0Ktydh85UZEbM9qTc NFnR2fGT1IpNYVY8qTKahhtIIxtLU4t+hx80kmQcDHxyZYHPTvJs8+8dXkBT52L9uVyn geeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GCr97RO+; 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 r17-20020a63ce51000000b0046ecbfda052si3963405pgi.389.2022.11.18.06.55.59; Fri, 18 Nov 2022 06:56:12 -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=GCr97RO+; 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 S241915AbiKROzk (ORCPT + 99 others); Fri, 18 Nov 2022 09:55:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235383AbiKROzZ (ORCPT ); Fri, 18 Nov 2022 09:55:25 -0500 Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89E9D11C20; Fri, 18 Nov 2022 06:55:24 -0800 (PST) Received: by mail-qv1-xf2a.google.com with SMTP id e15so3481807qvo.4; Fri, 18 Nov 2022 06:55: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=SBWlKsdKtevcy3cCWMNuX45X8cNraoMHYPlpt2EEsVk=; b=GCr97RO+onYFVnUovGH3O4JpLweqijtv9xIGpaU/MpRKY1fIz4a7L6W31SQlqMpeId 5I3sZgT72Pdycfliczk5CjtKPt9QmBeXEF9Hg0eH7eBfCCgDx7DohoHGWnCmexpzRz0G RCrzQFjSia6nN+SpipCjYpe5EI+0XRhalMR3WghYxVrwC/b/7HOJccT0YJeWEkQMM5Wz mDHjoO1WX5xGhyRaN0Zl1eXsxlvvRcQsZYhR/7So4vC91pnDAWeMQUHm4lHnp/yYKBwK GysULF8uC4aREYOWIUeaLXkVkZBHjEchUsf/0Ct3VPxgwCKK+M14jU2Tq/QEwYuZlaM1 drwg== 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=SBWlKsdKtevcy3cCWMNuX45X8cNraoMHYPlpt2EEsVk=; b=N/jILMoV3YrREfQ1h71UV9nUwx8Yl2gXFfIkrYF7wvQE0p6mkgKVbjCBoZGJ50hDOQ aDCuZHA98qQi1eBJFkKC/hDFqw1MZxzuCc7AvdlPTKNUh7p93r8Qy+MVQe6eEw4jk4F2 zo0XSF1uX/CkBLGMeeBDWTXJTzLNWTUdpVFECKUI/PdV6xtQuo0arKPhzRtQ/LZUhZwk jcYJKD3Zag2wwyemoEz5m9hPLsSyhOJEcAN8Z0PA28tNK9Dkn2m0tpV0fiGjieJyNtQI A+iCALI2ikciozDaAbtjKaXc0Ltu1RJG9bBSJwfCJD0wlhZb4e7cEYTeL/UE2EAgAC9o 2ogg== X-Gm-Message-State: ANoB5plg1kA2vUsCTyhxkpPfxcxaj27tXYoDiTWJoOZjBTO2xFgry4Bs GgyadXz9DFmo/GxqofjKxfM/H0DyhWYyHw== X-Received: by 2002:ad4:4d53:0:b0:4bb:6692:a5a6 with SMTP id m19-20020ad44d53000000b004bb6692a5a6mr6903198qvm.108.1668783323386; Fri, 18 Nov 2022 06:55:23 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55: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 v5 03/14] serial: liteuart: remove unused uart_ops stubs Date: Fri, 18 Nov 2022 09:55:01 -0500 Message-Id: <20221118145512.509950-4-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846193098624245?= X-GMAIL-MSGID: =?utf-8?q?1749846193098624245?= Remove stub uart_ops methods that are not called unconditionally from serial_core. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen Reviewed-by: Geert Uytterhoeven --- 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 Fri Nov 18 14:55:02 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: 22372 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp239509wrr; Fri, 18 Nov 2022 06:57:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf5OuwyGHfHdpOBTpPa+eZWdObYhBn5y3LSXILPjShSQ80ZIO6jwBcnmgWInJiljqPh6ll67 X-Received: by 2002:a17:906:29cc:b0:78d:a836:1d88 with SMTP id y12-20020a17090629cc00b0078da8361d88mr6307985eje.470.1668783421902; Fri, 18 Nov 2022 06:57:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783421; cv=none; d=google.com; s=arc-20160816; b=chE4FbpKHOszQPNcCIS+xPlTnV2Ffhy/7V2ioDBWM6VnwPLhWPptAhv2MqkCxBopVN 2ZY9HahYoY8PnlIvfsCW6B0NpKkO49KnZTYeI5Y/MyLB5HWAx3Lb/GBbBiQJEMEt3QK8 4E8zQ0hqYnuVgghXWx0OsvTGwtB0dkyAG54668hn60qvp8K9W7CXnSM6Gbggrx2WSaHq 75RYZ6gR/uR8sgQ0h0kyTE03emP++aypFUpnmfqWgR/IPZOSgNToL7rDKIwfAK68StjX UB02fBFfl8hUEQ24ND6x+P58qGoURA6FGWWuh/ETGHYW/Rt8/RKbaQ3ZtIfsgBJuW3Es 1qsQ== 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=xHnuObkNTLxes1mxERJoDeAMQzEyuatuK7WPXF5mNMQQoiBTBazRIBP8qlm6JGazVl HCnRV4zhH8dpbMyysf3C+vSYbZMb4SA+d1I3F7LQJRzyXFlbsJv4Wb3XuyOq58Q8IM7G QOppr7zUQZw5WGF984BfkC65iI5NYL9D1Sde6FXoqaoB1t02KKZcXF6BSlCNWQdiKbC9 2TU77/GiANnonuUctS9jqkcc+oUfCvhKAur7iv1fZw587pHbMJ2/0xp2nmxNLJEi/G6p GSh6u9MVv/Nt/nU3GJ7cWAErWoX4wqeciqJ4lnb2oLPY7nd9W8It4+/b48wy6iDIu5kw sdNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=G9tTwOup; 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 jt24-20020a170906dfd800b007317274bb0dsi2648626ejc.979.2022.11.18.06.56.36; Fri, 18 Nov 2022 06:57:01 -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=G9tTwOup; 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 S242045AbiKROzz (ORCPT + 99 others); Fri, 18 Nov 2022 09:55:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241758AbiKROz0 (ORCPT ); Fri, 18 Nov 2022 09:55:26 -0500 Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E510D8FE7B; Fri, 18 Nov 2022 06:55:25 -0800 (PST) Received: by mail-qv1-xf2f.google.com with SMTP id s18so1875993qvo.9; Fri, 18 Nov 2022 06:55:25 -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=G9tTwOupRAJgQot7o/e3aZbJ2VlrhFzVvSQJqfH5Xr3X3zIYmwia13I6H5GzRQnefQ TuSpAuBcT2U8k7sA7YEGEH4w9eGmqkt3imQWrMvxHxjPT3W0zlEFLOnGbYWOy9P6GD9h VDsq6xfyShlnmr1YnPvDZQxTSEFTaUYwnkEGoL7qQeEhtKEylRBwvY+MLd1gD1zmxitj yKjG0ePTf7T2vvlHl0jiD3tSRGr4ugdqgprzwkTj2n0tdPUHHcKNcNaE63h6+nAKsdLX sx31au5oly+kwHDCfPDSKqRTRSth7HtIlgUhlQcyK5IqYTXLPPXotQnWH8xc019aVGqu NC8Q== 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=36xi7fgtUtLKs86iT55nizMa+K5ULXmEbDaRdkTVS6etRvnikAPF2PWv3lYnms3w7w 6ZzPQdhf0q9FkQLv7OfEbPFgdRQ2kjU08YA24vd97Y7ntEIcc6ILU4dw39OEJawZqUll cKbMxYsTlihGj5Vi1uaAR4QAOO5XjeMTlyd6z5Lpq1CXSNiCi2zzcHO7swRkc3yCVDtA Ld6SefbE9RrTjlbTUvhkZ7EpOL3sxId1ow0N0jpDuFB5oJsRXygk9OgHp453UMxwS2Bb CbIn0tcTy4RcaikWy25MP9uv/SO27Kt8kLt5lFTM9nEiGnZynjCYRZ8Hae5oGI2HJntg 5vCw== X-Gm-Message-State: ANoB5pl0XF1FVxpthUf2U8UIK7+tZRqnm6KZ++kXznTnDCPKIwwS8c7J g/jZy+iDhuC47FVF9NJyc6o/VqauV3dp3w== X-Received: by 2002:a0c:e70d:0:b0:496:6092:9f0f with SMTP id d13-20020a0ce70d000000b0049660929f0fmr7059215qvn.32.1668783324777; Fri, 18 Nov 2022 06:55:24 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55:24 -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 v5 04/14] serial: liteuart: don't set unused port fields Date: Fri, 18 Nov 2022 09:55:02 -0500 Message-Id: <20221118145512.509950-5-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846245172058583?= X-GMAIL-MSGID: =?utf-8?q?1749846245172058583?= Remove regshift and iobase port fields, since they are unused by the driver. Signed-off-by: Gabriel Somlo Reviewed-by: Geert Uytterhoeven --- 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 Fri Nov 18 14:55: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: 22370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp239385wrr; Fri, 18 Nov 2022 06:56:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf7PLUa3hoTSwiy65PRo5Lp+OfPqtwnV1nwO02tW//Vsz6toFr2ZaTkiANqZTs7CR0Ydycdb X-Received: by 2002:a63:d117:0:b0:447:ed69:761 with SMTP id k23-20020a63d117000000b00447ed690761mr6815231pgg.181.1668783406882; Fri, 18 Nov 2022 06:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783406; cv=none; d=google.com; s=arc-20160816; b=NNwVJvun8gQWJ7tzohHgh+v1JPzt+lfj1l6iKn3GL71xVKGqcBP+FFA7AQtk8KvGCK DiqpOcCIyQmT1wcw+wOIye/EvszFHxCrz1dr7b2GYrs6BIPdSFpQ3KIgs2timKmdIxbW mEgy4avCoibgxUmdprg9OutVKHjzIEokptVOg3ARH2f6UiCbNqQDJUSgb7wMPhjH0tvD tyopf/2OOejJATga9hxrdmtNaa4VhVwWrSsKjbHNcwT3HQqn8sdUjgHZS8PdCjIEhzkJ hSVTZuYT8Bw8Vqr+Lvo5muoTsbbXH0aQ7LTqSruSOAyHfqVf11s6Zqy5NLcau1QNrIiZ 8EBw== 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=KvdtIdnYILML3uc7Nr2joBUrH/hxOgtQFp+Q3HUkF/8ZvBQ2swtZp82Td0XQorbS7I lryD8OjzA4qVRA/VQZWjIeLdHszCy3Q+bVpuROUCcyL9u052xS7QOA5ZOAJtrA2q4AMk k+ERyiCZa2amSSXUp6NfvRk5vhi2JbH18tqincwwxk2LxGwkyhEP9/FlPgylM8LfddHk srkKSWiIXvVAxby5+KZo5d5SIQMDNOT3z/++/K5PNeuD5qqxouEvCNBaO7s+YIATfraP FxUG2d9zAnrfbc6pD8UDqubPR1EjRCcEYvWD0ZPBOp31QAOKNjylNVpmpEUaTPx17l3v 2D/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LwCD4TSO; 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 k9-20020a170902d58900b0017f59ed2dfasi4252741plh.63.2022.11.18.06.56.33; Fri, 18 Nov 2022 06:56:46 -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=LwCD4TSO; 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 S241622AbiKRO4D (ORCPT + 99 others); Fri, 18 Nov 2022 09:56:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241956AbiKROzp (ORCPT ); Fri, 18 Nov 2022 09:55:45 -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 340C56D4BB; Fri, 18 Nov 2022 06:55:27 -0800 (PST) Received: by mail-qt1-x829.google.com with SMTP id l2so3220613qtq.11; Fri, 18 Nov 2022 06:55: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=zatoQ8/a+60T2AmPXnfE9c4vLIYDpN6MzKVzyD4F9Ww=; b=LwCD4TSOe13o84ZJbI4EQqySqnhs8SOlAzjGAXtXrhXlRTy4QzkzYb8pJot6uRcgqg Xriz+j/vyhewZfJp0VtqsRaWvDpPz2SCC0NqBoUCZcAOcZiu9N22U5FJ0OWgFmdP89yw 2ldmPpdXe7VD9hoN2rgLVWX9Fjs3CjefIKffF3MIaubvNdAEYtKdEuZV54CXfDuv7xaS MFg64dxU70q3nP51bDs/bl2EhLGpA6B0psYwZ/hPnWoicRJfk2H/4xco5RZvB1wTWfsZ xkMCvbeIsf5xkWkzeZANAMOFDooW1lAvs2Mrv0YOYUrRX3FGMftucaXq6dP3t87WhBPO UtMw== 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=0qdJdebxGS4U5+nBagYbHHzB3NdG3aHPGXDsU0i+kInnX4HEI/N8Fn17hTh8rwOnjf VhePV+VWcH1zkRxB3Gk9KKi26VUIKGZrk2K492wpPB91MufBys31a8fwXtoCU6uUo4Zz yT/Cjf8TFOI5w/yqRSFid64C3H1QzcfR4K3QRcMfYg2LE9ev434J6AK1IPPHeSeWU7yl 5rkjqZFMMnM8oX4chQghMoluc/N3V+X3GFsYuoMkNV86Kh6bJQHLqe9JTD9D/8ghy314 vfgihYbqrwasLVIaggHRvHK8qTlzCcXyDTuxeTBGEAX0y+2hg/pvpbsw8pabPu1CVqqa vMvQ== X-Gm-Message-State: ANoB5pkSJMiw1jfDKMjORi99/zHPvt9kI/Pk/IQJgMwznfjXw7boqs0B bHcE1mpcdMisHz1Jl2fvrvsk7NFYAfx2XQ== X-Received: by 2002:ac8:5483:0:b0:399:4a68:c578 with SMTP id h3-20020ac85483000000b003994a68c578mr6686834qtq.202.1668783326029; Fri, 18 Nov 2022 06:55:26 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55: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 v5 05/14] serial: liteuart: minor style fix in liteuart_init() Date: Fri, 18 Nov 2022 09:55:03 -0500 Message-Id: <20221118145512.509950-6-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846229811202257?= X-GMAIL-MSGID: =?utf-8?q?1749846229811202257?= Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen Reviewed-by: Geert Uytterhoeven --- 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 Fri Nov 18 14:55: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: 22369 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp239322wrr; Fri, 18 Nov 2022 06:56:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf4EzTYdS8ZByBL2fhYKECONfz7EqGRoSz1YJbth/mSvpa+w/Kej5rFt9E2Vz55sOlUGMPf3 X-Received: by 2002:a63:c41:0:b0:46f:81cc:5ecb with SMTP id 1-20020a630c41000000b0046f81cc5ecbmr6965353pgm.459.1668783398083; Fri, 18 Nov 2022 06:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783398; cv=none; d=google.com; s=arc-20160816; b=Wq2BZ33ji2aWTqfq/aYQLv1wushxfVW8UuFD/g146NrInn6048iCpIcYRQivpNNaD0 aGOUTUIWKNMTciU/No2uxDYT/5Uic/taCp88LH1CWhEKfpg8Uv/f0FV8LPewSOri2v7W gOEJry7rUiTcdGpBP5M6rDQbpHEsrSsDHd1B96paWAuVgVhfh7Oo13M3A48BlK0C6+12 IU3mGJFaiEBSPqiCUx9ZU2yX9QUUpIYMcOMBAZb/gMhLhuvEQADf5pQJXmTrmsurzCoE cjZx4KkFsmCl8f+XWon2FSKrMsAq6oi+LWSIXbWpQKTUp0B9aEgZlv0SZIn5r8N/5Vr4 yK8A== 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=a4giT5dO/zR/3pjYg+B8T2TkSEngC1WCJelpRy8sBnNkGA0QkwFJ4WBd/Rg90HIhOX 4XCcaQkgDOsoBZEtoI0f5V+4QykAi58M8Pb8kYGVl4khOfw1PWI5pZidxoZsbBRPq81d FzeqSjoHabpZ16aEyXyB96msGhAfUnGbu+ZygZAT+w4/BqYnIZ6wI4CT+lWHwBXNQNEY wB3vazIwr491gZh94iZzqbM48QSQHkOud00zBlSkQZBcr/yIQc2kYET6jD40G8ZfI4ae UaM5kL3ntJ8fcrvqJp9BOqPP39/mR2VQTUvWM5WbquJkd5KUs55j5HeFvbwKnAgqHbCi 9W+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WJCV8JBR; 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 b7-20020a63e707000000b0046f71a7292dsi4122112pgi.384.2022.11.18.06.56.24; Fri, 18 Nov 2022 06:56:38 -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=WJCV8JBR; 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 S241608AbiKRO4H (ORCPT + 99 others); Fri, 18 Nov 2022 09:56:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241701AbiKROzx (ORCPT ); Fri, 18 Nov 2022 09:55:53 -0500 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DD19240AA; Fri, 18 Nov 2022 06:55:28 -0800 (PST) Received: by mail-qt1-x82c.google.com with SMTP id h21so3250419qtu.2; Fri, 18 Nov 2022 06:55: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=D1hUB1CG0ZAd5p0bPUclNpK4BZ15p3GlgtAxgJ6lCak=; b=WJCV8JBRN9CY1n6C0ycMywErBCrs4UW7PhljBaHhnABbcN77s6DiHy+ieq3Keho7Fh hSgxsXpdiJ9p56AI0ZoSlrwIglziuz2OmnZO2q5bsguwe0BZQ4bqjWye+Sg7QVj0lSbd IkT+Ha+UMXXek3ykGxm8M83Ku7RtnypSxoWWcKGb8RWfEeAPWEkvfErWltE1yRtvdVUE yLe5C80j6OPHRGuuUPEYZa6F1evdUzBlB4FcHvQ5PiuyNOdsRwvpCrFOZ4gsqOqpfzh5 EdL45pH2raanZZHr6hZ+tf3fjqeKCFbujSCD45yVttWd0YHLyiR850GGyhThMYkn3K50 PGmw== 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=6wn1DMpZ/WeIvx+K/BvRyhg4f14iE9qaQYZ+d8SlgT+WpJ/ICW4L6sK+rKuB1kj7nP GeuKKlZfgjp9Cx9pulF87BpYbQ8J+dpLpzKtfHLPCMYROcJ57666jSQFZxybk31hDOFJ YSgYqmGIHPEo9ftJAbAKdye/VcfknyhPBpZAqE/d3cvVgPUg47LFFJjBHeDF7EjgeJUZ OTR0XdL+Pzidab0rX7Bgk7p2ASq5+yLXMX2xZH7nRMoARgt3CHfRJEdYzR3sF+en3b35 Zkd+WLJpzZc1FNOSl/KebnAaBii7c+GpprYKVurF775JWHtdkMBFgMYOHx7ttYITx/e1 yVag== X-Gm-Message-State: ANoB5pkMiNBqOWHGUvyuJrc/0pBAJx2jr+bWfDYyKygblrAawISAbalu UYiO+mQjZbG/PkSzXudIqv86jR3tmaAhDQ== X-Received: by 2002:ac8:498a:0:b0:3a5:1c61:230c with SMTP id f10-20020ac8498a000000b003a51c61230cmr6965266qtq.29.1668783327307; Fri, 18 Nov 2022 06:55:27 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55: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 v5 06/14] serial: liteuart: move tty_flip_buffer_push() out of rx loop Date: Fri, 18 Nov 2022 09:55:04 -0500 Message-Id: <20221118145512.509950-7-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846220587502313?= X-GMAIL-MSGID: =?utf-8?q?1749846220587502313?= 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 Reviewed-by: Geert Uytterhoeven --- 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 Fri Nov 18 14:55:05 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: 22371 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp239426wrr; Fri, 18 Nov 2022 06:56:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf734jDbD/bJM5zrL8rErNnEpTN6/5lxXNdeVL1MIMMRjzWTTEXXDeG39pH7OA8JQM4cOu8A X-Received: by 2002:a17:902:ccca:b0:181:6c64:6dd3 with SMTP id z10-20020a170902ccca00b001816c646dd3mr7954544ple.123.1668783411046; Fri, 18 Nov 2022 06:56:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783411; cv=none; d=google.com; s=arc-20160816; b=Kz/w+tLR79IhE5j0mrGUsr/fWNR7wDm3T63VOq1VJIeIXKl0YCremAuKOV90QhiinU HAfocgRxHwacmLh98Zthf6J74h5fEzdyTJfMLZvdRl5BQJZaTCH5R8tFbUDaIe/YxZUB 69+/L+iDXc5aRya1txGP3tlQ3swQ3hTDbIaZZyjagERnG06lR5JUja9CzOu2Uq1/McpX asj/klVBJxB5NuxPah76DDAZQR5BuwtMd15QWQb0ap0hLpTBLJVau0ro0qO0YATlGIvB 2dPem2zYcqCEXyn8z5MmiYQdK9GvbOg9UPuDT8o6Knba6Pl9DNuOzl8dBM8QBTnch9BO rnDg== 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=Lfz/IKUxEZeKCMuDc3EDAjHXZtxviH53A5X63vkUXfqfjnrRbHrgpYzAKDnEx8j8nV C0HE6UWgBkYrYyR9Ni317GDKPpGEhNLK9eOxV/sDE0t1hOuWw8NtkXPvWY48rBzTzQMN +/6vSsdUrCvEPC6ZhM9z9TJCMqIqFhlloF7RJRBXhkU/fseKDE9g220OQopddkeKV7CE ZNfr1DflpXFFhw0ixA4JGTRjhXmy4pvNaBO4A46fi7KKYk1BMEDOGQx1uDHBf5PwXI0o f9IcAR57hkD5bEbyBI4/V8qAoRb5oCFqBxHLD+i69UyEIO1uNI9ZefIoWSZBa/r2WZvH 1Bag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=R9Bgyj8b; 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 j4-20020a170903028400b001755f43df36si3666336plr.479.2022.11.18.06.56.37; Fri, 18 Nov 2022 06:56:51 -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=R9Bgyj8b; 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 S242118AbiKRO4Q (ORCPT + 99 others); Fri, 18 Nov 2022 09:56:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241975AbiKROzy (ORCPT ); Fri, 18 Nov 2022 09:55:54 -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 AF81F4D5DF; Fri, 18 Nov 2022 06:55:29 -0800 (PST) Received: by mail-qt1-x829.google.com with SMTP id c15so3228730qtw.8; Fri, 18 Nov 2022 06:55: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=b0pSt1+sCUSY6i1VSOZXSpAW8agas2OEhVBqCQWzkeE=; b=R9Bgyj8bVN0gqArNwUY85N4usQBEGIvGapXuruakZ5sxlcrzsL8LSW/iWF+a/kfMco 7F8NJrhdPoT7p7Huv6Aijfl//LqBc0FqFUUTTJc6eho51zd2AwDXax3SpJDBhcblSUr8 tcOkTuJxhri/65tPWWHusz8nylYgEwAZ+jE0VvvW2zU4YNb6Psr3WEQ8Ybu4fw8Nen4P nsgj6V9iw80FMCX2CJZh6/d05R4t5IHJ9UtDDVrSWtDZjyjXqH6aC9VdT8KIPhnmoOky dgBouW0QdV2XWubg7D6IQYK1/nRe1q7KrXXvHSABmnRIwSW8RPbLX7/Ip4VolGu4liar Q8QQ== 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=lVqvvhJpxG582Jb537kXFWLmD0W/4WBoq2hRVfQcLf8vM8HTMuO1YoJLA4iqpi0rbw qy/Lx1gWrdmQSEBaj1AMzcMKGa9iLl8dJK854mQ/mjM3akH2kbIDA+NuIJwwT+Ez1XO9 BEyV5Bl8bndhsh7ZJUSiEnKlThgZnj9bvrZJyACeHPWlmJxVh+iCAKYIXstUfO4NU2DW Bs2XNrT0UDne4rErOxBUinE0JQFtDBxNbIHwwsXu3F936RZ7WGswq65MMmY4gywe68+u jlzs8YMMGLRUrWWu3MS+P/PSaHJY/aoTHnjHXvna9e9KfN9zo6yqllTZC/c00It08rFI crqg== X-Gm-Message-State: ANoB5pnnXiwbX1jtFxJVNKa8uySYIJ+6fH/7HgXf4qT2Ly0rP11SRqla l+YU4orNB+1xZgx8zECnV7b8K/t6RTLgxA== X-Received: by 2002:a05:622a:4d94:b0:3a5:fb6c:d96a with SMTP id ff20-20020a05622a4d9400b003a5fb6cd96amr6939954qtb.185.1668783328614; Fri, 18 Nov 2022 06:55:28 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55: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 v5 07/14] serial: liteuart: rx loop should only ack rx events Date: Fri, 18 Nov 2022 09:55:05 -0500 Message-Id: <20221118145512.509950-8-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846234053716297?= X-GMAIL-MSGID: =?utf-8?q?1749846234053716297?= 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 Fri Nov 18 14:55: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: 22373 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp239661wrr; Fri, 18 Nov 2022 06:57:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf7jrp6WLl2m/3ZL9lxkKscBU2j323THyw5l34wLgMm5LIljqI11WT2Phcjto3RtNudT++Dx X-Received: by 2002:a65:6808:0:b0:43c:758:5190 with SMTP id l8-20020a656808000000b0043c07585190mr6945195pgt.339.1668783443021; Fri, 18 Nov 2022 06:57:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783443; cv=none; d=google.com; s=arc-20160816; b=gCrh179qdUNHc3cjo4EHl/+uyHK+ZnLz9PL9XQU/QYNXIvyzdb+ugYIp2YycOsPT+G wACDhnUSKUP1keDABxhl/CDy6oa2MIO6qM9LAwF/kOoVwB/bvZsF7V4NhPnVoAxcLrBF wute4rBk4LNYs4Z1p9Dwt9O4RoA1GEuL74yudLqlCgsTj20H9Pxf5hrmcqy4/Fkj6Lp/ Jm2LfbDLW9ka4BNSiy8K1Z/qFjRuMSHY/8/Dka/ew3B5iEeTWU2KZQSeAsOsUHtDEN5v RhfqCOxKdv8r4rGs5AM21WdV5Domewe1y0AixReKebwauWLh3C448AuPRBKbDtfOlsHF lXzw== 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=i71W3ibj2Q89qWEIFrK0rGLhcaJU+k4rT8dhzycS4iLillmDPwTutQn59JhfibeHQi 2rOXSrbaWWewoslg92niQuxQ0GLSU1Ejx5EejcYifDZL8zsQvcFNF2LlXUu2aiKpwHA8 SqF0nQCzqqNWE91ZAOUUPScabplN56n+jAlLwJnOFlbO23AcTkyu6qPdLq/xcHM8nqmY TP/X4DQSsK9FezbO63dHcUc7OgI7VTfurNuMp1l8WAOZtmz3YFfshmGP4lprjA4vK/ix p8uqaaWJsVEGxTyxqrjgeY+mtNWBiejA3yyS2AJOErE+o1P78hFp7KHirrUVxMAD9MNH gAgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GO5XIRVY; 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 l19-20020a170902e2d300b0016bea2a8b16si3470780plc.364.2022.11.18.06.57.09; Fri, 18 Nov 2022 06:57:23 -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=GO5XIRVY; 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 S242196AbiKRO4g (ORCPT + 99 others); Fri, 18 Nov 2022 09:56:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242014AbiKROzz (ORCPT ); Fri, 18 Nov 2022 09:55:55 -0500 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CE5F9039B; Fri, 18 Nov 2022 06:55:31 -0800 (PST) Received: by mail-qt1-x82e.google.com with SMTP id z6so3234573qtv.5; Fri, 18 Nov 2022 06:55: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=zbM5jPqWMW+ZSl/JSR0+XTeoHUgjIND5CEiOvEuQtSk=; b=GO5XIRVY3x9RdL55NnA8PngWVaDXsqI9T1T/b11sfZgpJngu5v08iloaPW19QQeifV yxem8RM3oI0zCrOGX9rFOWu9Rw64mCx6XzV2hpXwuB/dNbm9JiaVlU/xIlXM0ldWMKpw eZCIG0JOBIx36PAdMVGBTvP9zNAUI8KevkTuedMV7aP1fJxZAxv4HSj/GnRyQfwSmVgi cQFaCgmqjNxRmOQXUXwJt7WGZNEtVDNa7/mDDwUKXfXsakhnEe631N8iVeBcUKHIX0K+ QucWCFxoABT8BP1MXrZC1tZrM4Jlts9uCRGp+U1IFgpGduehWI7OElSTClEJOlVZUPE6 lh/w== 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=WUGgyzkP+tRuHaVHEKs8iom24OW+k4AemT2MAI6Rpd3PuMyeXnN49IXzFpJKZ/KGo0 UlhdIeQz8bPZkNsSproZMPb/ok2Xjx+IFL/LfgsKU8NN1GaAV/TSsMuEYSnH8aUDplo0 XXNTe5+w7fULpfxmiPKzhiNEZstUYlqsOftNAdrOZSGGnwMgP4GqC/X3Nfvx+vjTCNoC TUEETtqx43KGLXvbaDbHKWx/vbvfd9FQCvyj1QRbvVEOTUe7MIasxM7mJAO9cel4y2gK /RpqUjSQLXRYniNU7nPz095eMid6NPM3W0pk7etuOKzPpNVCpNk4faeOjiAD2V/prujq +tAA== X-Gm-Message-State: ANoB5pkufEEhBnhbAiZTqjbyUVMIrs3xNRUVeBfNGupQGEFPRIN2qGyr 9f378oGhIXcAe4P1Ph6FCwEz2r/vUOZl6g== X-Received: by 2002:ac8:43ca:0:b0:3a5:4c53:8923 with SMTP id w10-20020ac843ca000000b003a54c538923mr6891308qtn.267.1668783330005; Fri, 18 Nov 2022 06:55:30 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55: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 v5 08/14] serial: liteuart: simplify passing of uart_insert_char() flag Date: Fri, 18 Nov 2022 09:55:06 -0500 Message-Id: <20221118145512.509950-9-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846267614299571?= X-GMAIL-MSGID: =?utf-8?q?1749846267614299571?= 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 Reviewed-by: Geert Uytterhoeven --- 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 Fri Nov 18 14:55: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: 22378 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp240493wrr; Fri, 18 Nov 2022 06:59:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gFg2R9Bav33KbKHNuUscN1dndARJnZ2Kc8HKj8UUxTSrtFhmdLYkDjDaLopgY9CHH7xjS X-Received: by 2002:a17:907:11c5:b0:7b1:316c:38f7 with SMTP id va5-20020a17090711c500b007b1316c38f7mr6389224ejb.387.1668783559905; Fri, 18 Nov 2022 06:59:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783559; cv=none; d=google.com; s=arc-20160816; b=kGkfCaG4HqUpWBl2TeJ/EZOOWx1zdqwz06AqcLNgpdR1gFJJ32H3NKgnp3+K+6aleq k9bAhZ/ulBEGz91/X5KWtOjtbPeZ4od9KAGh40BjjRiapubijiOFLrdylNXuYGOzLs+l xP+ulbMiEXkTWSf1b9+xJ+6D5DC64Fkr8pZFHS/lKmT4UN6KiC35b5X3gwzn7rRyvOzS vmtrP1cssg8gdQYqZgmpsKTAxEmlj9hKWNJFwIrCp98JY7Ege861PtU2II6+vInMMvvh XYGdLb7RWP2V2qJBCOk1CKkvez7xx8cTz1GHp+BBy4B9w/CnsWFWIMJ7B+Ek75elbrXg uiDA== 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=Me2yuizWF9FcL2II4PyQT9Xk12rhiaUCaK8bcKEFrBTvYEwoEjZV4CLGWjmlJPeijP 6lTehs3XlGiU94uJGUZkqJwqlLAcwWdIvVWswzGFBs5zmYbf8E0vRr67AMZRLFCkAsAz feeV6NiVJjB2N/OvQWrxTTqNR4rUy0vggqadFlVSYmUFipwposmW5dnHCiehUknsfPA0 1YiL42bT9SUxeQuQCm2EfPQRFHf0EP/7so4JOIiJIBkGsAQLnP0OUY0/o3ef/C+SJPoG Tbv5A775TQalR9bNO+loMz6hh8e903wvQBizrwhK0S0xE1EuzbIjdcb42HlmD23yzHcv mE2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RVtZ+axm; 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 l9-20020a170906794900b0079ddb52369bsi3428466ejo.61.2022.11.18.06.58.55; Fri, 18 Nov 2022 06:59: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=RVtZ+axm; 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 S242227AbiKRO4r (ORCPT + 99 others); Fri, 18 Nov 2022 09:56:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242049AbiKROzz (ORCPT ); Fri, 18 Nov 2022 09:55:55 -0500 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64A508FF87; Fri, 18 Nov 2022 06:55:32 -0800 (PST) Received: by mail-qt1-x82c.google.com with SMTP id w4so3275473qts.0; Fri, 18 Nov 2022 06:55:32 -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=RVtZ+axm8f/78K4x9m6u9WdDEV/snwwvJz9dYQG56lAmbBWPx8E4OQHsw/xQfItmKZ WCdx3EAm1/TT9laCmVqYWGZv5dx7k0lYgww8spab9/GZeVMoiJf0Fn0csTzulhP16PHI WSppyPBpE1gAy0xNBzEMkJQ4mHU7tUn0qVfNfkbq3yE0c/uqDJYdLUdScMzNijAG+ttS AXaliMknQ+wUHZrtE2ABhkI5zqHhwRdFXUy9sOOpN/4Xv/kQgpFpbTu24xWfzULaMJmY J0Xd92IBfQeBdRYW+iLb1C/lpL516CHqqsE9iNLb9RbmoPjPR5yZhAUT7gZoazlgM167 wC0A== 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=RpSSbugdosshtImb8DhvbLYyKmcJFgVGn4Iek1LWPiCvpb2FzLUro4npvD/L6o0Hnw E5D85VnDbJEs+nV1W/Uw6v7YndP3D04IYWUqgNSQrFKq5HXJieoNfqNDdbkwpSFpdQzr WAvjN1A0PXkQhhzW7m/h8HHfOdkpyyyCcG49mxKYJr+7aGONrzw3+Jo9fCufsTgmyqFi Oyo6+4x3GodM7PxY0BRuW5e5Z38gx5GtjZqEDBzW8++YTKV986TOEXdgBt1yFPo0GMfv bdQVVMob5GF1zA4Z/4mx82Ee79JKLzZVXuJIgvTyj6XwTmWHTYgeTWRsGGv4/rKxDE1h Fzww== X-Gm-Message-State: ANoB5pmxTsj308MWLIFABheZTD7l3+JQC9XlnY5J3W94nSpDT6DJGklV y6HN04J2/jFgbrU5gmHvqdnAdyjKK1w9fg== X-Received: by 2002:ac8:6701:0:b0:3a5:280a:3c9b with SMTP id e1-20020ac86701000000b003a5280a3c9bmr6922441qtp.8.1668783331173; Fri, 18 Nov 2022 06:55:31 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55: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 v5 09/14] serial: liteuart: fix rx loop variable types Date: Fri, 18 Nov 2022 09:55:07 -0500 Message-Id: <20221118145512.509950-10-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846390088659502?= X-GMAIL-MSGID: =?utf-8?q?1749846390088659502?= 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 Fri Nov 18 14:55: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: 22375 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp239832wrr; Fri, 18 Nov 2022 06:57:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf79L92iPqyrhdxa2Sop4TS3+zdlzoHEIYe9V1y8uEOy5mH5d27l34OEg3MtiqccGpIo1scY X-Received: by 2002:a63:ec46:0:b0:456:5024:e6ae with SMTP id r6-20020a63ec46000000b004565024e6aemr6775859pgj.466.1668783469641; Fri, 18 Nov 2022 06:57:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783469; cv=none; d=google.com; s=arc-20160816; b=NWMJ3FWRIi6+ikzH7KGr2iyYImUNRxeMuEbsMdVCVijx2hDxQKHscBdNsx9ncFtEc4 HgDRVwYUDrZoPHdVw28KbibDw1953NIw1ttQce1rCzF818Udz6NutjFo3nLXPpk0tS86 SMcuA4gynPnBKADEVGVJe68NcaW7IPageS2W/Z764scBP4zS0WQIADpg3plZIjY+OJ1q UOGR89xYZ4Z2+CVRFWzzbfbJ1hANqL5nzdeufW1lX6GNiBvj63DoIhn+Mlatx9uiAsfN 4tDdnTzCQSDjDf++DSupOyA5PEdCL7MWjlA1+XmGPa+afwaHPXgxBtyEhOT6qLN+n2C/ Oi+w== 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=gds++B2ZXTcIdDgJvy34lgpc1Y57AZobb+5qel+BMP3rWkAae0FYxsV9m+LN5DrESJ JVqo73CYF2iZGab9X7IdsfJYplqvVh22x6OjH+/BPGxqsAoH1LqZcVc333ECx17hxxsy 8+GV0AyiWaIILnR0+JDeoeQvBktufwlMadBE4RhWG52w+AELumdyyVUC97kPfF4ls4BO /H1X84cGdBOjYEOP4HiJns7Us2UKW1xlIKU1L9cEpVUItoB0bNqrn1exzEgjfXtLx3k0 XVWUPTqfuUZ8LxEC0UGXfe/zWbskEib0sh+REsujgnoBSbzSyZZr8W2/ef2gWXSXE2uY AorA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pJItifKO; 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 w11-20020a170902e88b00b00176d347e9aesi4521775plg.366.2022.11.18.06.57.36; Fri, 18 Nov 2022 06:57: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=pJItifKO; 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 S242290AbiKRO44 (ORCPT + 99 others); Fri, 18 Nov 2022 09:56:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242083AbiKRO4N (ORCPT ); Fri, 18 Nov 2022 09:56:13 -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 DF47D2B260; Fri, 18 Nov 2022 06:55:33 -0800 (PST) Received: by mail-qt1-x831.google.com with SMTP id fz10so3243378qtb.3; Fri, 18 Nov 2022 06:55:33 -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=pJItifKORV0QiH4EedBo3e0jCaeBPHJknDLFUbBzxThnTSLNfvepzwhfg1Wgsx5HW6 9zxRC2H5EyiP3t6BzbQQ7TxSAMisT7TFc8IUfHyRpoecD2oJcBVGm0LlsJYkkRf8op/Q 1nLB4ELIBqhJBxd+iq863TcAQTgjMZHDkIkX4r21nmjrjMv/GfmsTD8ziOwvc1/pxRdi bN7qYIpubW9hsKDnm2Fuz/n8MRkWpTRtKBQNuMk+LmyrFkfczdkZCJJI8NBumCaQmgrm f/93Lg99z7fA5ourQ4DrJlGs2dUBw+442MDZM/V/w2c3kfX0Mree3UCXRNtxOTmF3Zu6 gRtg== 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=nlRX3GAyWkzBuamVrkJN+iO9d/9ObpZ6dTzOe7X/HfYkb9ktrPXndSlf09PRnQX0To TrljS/gTlq+V8qiG2RxcF5YRJPF680nGI5AJZsgeEfRoyAxAcwRWj4ER9UHj14FgMJBV 9onfZIhPuF2Qi5sfcgaVKbzxKSLTlb3U5ZHP2L4gW7+2oG4tDJRpE4Avw4cam9TES+fx MzxZKpSgop2nCskZmVEQSNk6rEqmedLiDs1f/TsPdDuDLjT+wA986Jpzx5NPu6lG2x8V gJvRj1INnsLBb++ZXaeVjSChpnef36miani/eGquXVBtsaNY4TqXpesjIWYhXaBfnBY9 emOw== X-Gm-Message-State: ANoB5pkXoqzitzWXsBxb6WG1GJRxsjKDRBWUAmUulzHQMYoHYdZgPOQH TgRVqPbD01IMTR7J5BXp7/dPPzOZeXmqVg== X-Received: by 2002:ac8:4906:0:b0:399:7cda:9ad2 with SMTP id e6-20020ac84906000000b003997cda9ad2mr6895973qtq.485.1668783332610; Fri, 18 Nov 2022 06:55:32 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55:32 -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 v5 10/14] serial: liteuart: separate rx loop from poll timer Date: Fri, 18 Nov 2022 09:55:08 -0500 Message-Id: <20221118145512.509950-11-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846295793758122?= X-GMAIL-MSGID: =?utf-8?q?1749846295793758122?= 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 Reviewed-by: Geert Uytterhoeven --- 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 Fri Nov 18 14:55:09 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: 22374 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp239706wrr; Fri, 18 Nov 2022 06:57:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Fs9F86+E2u9xLyTqxgLrpya3cvv4bdk09liEdmLfjXTT/G4xhVvAbGc9gcj/31nB3ELgY X-Received: by 2002:a62:198d:0:b0:572:5a7f:9f4a with SMTP id 135-20020a62198d000000b005725a7f9f4amr8141478pfz.33.1668783451060; Fri, 18 Nov 2022 06:57:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783451; cv=none; d=google.com; s=arc-20160816; b=vh5JbkYqouz1WeP1SHa6d1/r9a2OKgKuld7397HeGBzm4dMXPma4a7pJpMT43w3crZ HfF5tShunIjjKuwYuCzG2r3uoJYxSNNw8XSedDNV1VZEQxMudveSl9TuscN+nYOj5cWh g0cNtGuQpvNDnnVGjXo60DaSx1dWpIlgn65/3rip4DKL4GZ+WVaSZps6cE/a3z/BoIFR AFlldy0HL+j4D5SXWh6XpFSe26md13x7WAOvJwbwPuZuwuucKYSWQelgi7vyiqo765kg v6yMSbTvULhWB9CwxsDHciVT8Ctj1MkhpoaVPijJXRWzKM67YaAMtIXrrQWeaBlCAxNZ UR4Q== 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=aOPibX0NhTkeY+GEETH8iJLCUPA8qsGOV5IfTpmCIAoIV4T6VX7FIIW8v3L2MFP7J9 Ryn6UCAZf7T6aDUjcJWa0gKZxF5lPhrz4pBYrsdB/bqI8rENxnZ2KGU/Dge821ywltIy THozmU/5J4nfzmJC1jDyF5EVyd5pkVVoci8TYlhNKjw3oQOUxRJrgGtSV5ZT7CgNAaJx Bj7KVWHD5EiJ8+r8TvbmpATxmSGeeewtmAnPpRJEMNcZakXRRXbwvWNrT4p14tk8jggx DmQP46rir/9A/zuc7QbWEIxLzl437dcQuZxJAv6ff9QJFtrLq1vTjO5W/LiSCGhga/G3 iqqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=n8CjLEpy; 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 l5-20020a056a00140500b00563ab8e5e83si531434pfu.370.2022.11.18.06.57.17; Fri, 18 Nov 2022 06:57:31 -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=n8CjLEpy; 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 S242130AbiKRO4t (ORCPT + 99 others); Fri, 18 Nov 2022 09:56:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242103AbiKRO4O (ORCPT ); Fri, 18 Nov 2022 09:56:14 -0500 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3139F903B0; Fri, 18 Nov 2022 06:55:35 -0800 (PST) Received: by mail-qk1-x731.google.com with SMTP id z17so3521418qki.11; Fri, 18 Nov 2022 06:55:35 -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=n8CjLEpyMMypMvrOR56LqMpSVaojyD46sOcMUYJx+0FWmmryO4Mhunao5oBcb2/ZF9 0JFN60k3k+R5BOHSyYWLUTWf3jdMXgd5Jws3WEcYaXirV7y8R3xCDwKUhxGajyocQYTW UI3SCnvaSxUPHtmE373/M9iRNdmai2GH57+DECiBcvTlAMvheLRKCFZNqg0aNL+/pqUR TmZB9QosMtFYri3KGjQP6fvrBtBnOVnFyrqiHtZpEjNsEHnaL4vKLAflI29YhUfmxJdI d2zikxyEQFke2ySzzV6RPFiZ0cf0XyJ+dA6SnheBq/Xs1csz7NYJ1C72UsLDcFn+EtUQ rotA== 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=FlgeBoTxj/dPcB2+fn5JLtyg7pc2EWsmleujee2eDQjTys4dJfrdBdRrDKet2DpmT3 RRoPZkXHEcGahTc5Oi4V3oKUEk5xtbqDSolwxWPFRKQcksXda/m8NWNWtktwXJSaqlVq nxBUE5fnkm7OC0VBfPMmjDKaLgPkm5Iwep+A5TWfQrDOoh5adDGVDeQeX5iZPp2p3RAe 5AO8lDbtdPguIiOe9Z1M41WSw66D2aZzieODnw24Ra/1u1x5m3HshkbPihJnLnL5Vcpm 0LOdgX9YrZK+V9bTJXkNvui1QzVJZztmDXg9+76Sq7+9IcL0fcnraR850EZoStWjRa4c ib9g== X-Gm-Message-State: ANoB5pmoT4mZgnVztxKQypkVHhz/d9J2YTJE72mwf3/ACXeM58N/4GzR Iqyly8oTV86FmVEyzZAaEaPzN0v0AiBLKA== X-Received: by 2002:a37:a806:0:b0:6fa:88d:521d with SMTP id r6-20020a37a806000000b006fa088d521dmr5917911qke.317.1668783333970; Fri, 18 Nov 2022 06:55:33 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55:33 -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 v5 11/14] serial: liteuart: move function definitions Date: Fri, 18 Nov 2022 09:55:09 -0500 Message-Id: <20221118145512.509950-12-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846275910005543?= X-GMAIL-MSGID: =?utf-8?q?1749846275910005543?= 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 Reviewed-by: Geert Uytterhoeven --- 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 Fri Nov 18 14:55:10 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: 22377 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp240371wrr; Fri, 18 Nov 2022 06:59:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf7FnFRtCzwgFQG3YJKj3Jzea9czJqTnycEG6dsj3i3y4IbbdsRLtk2+rn5vKOD1hG2Lw46Z X-Received: by 2002:a17:906:b250:b0:7b2:86d5:8b14 with SMTP id ce16-20020a170906b25000b007b286d58b14mr6357046ejb.230.1668783542700; Fri, 18 Nov 2022 06:59:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783542; cv=none; d=google.com; s=arc-20160816; b=Mt5/n6njn9BO/zUQmgShZyvCXww24B29CI5p9pFitVoBwekH7sY8I3NCOEPLT2iiN1 6iDCyoGsh3hmVXgMc12R2M9F72kGU4ZcVOIstSZVkz51woX620xlXPS6ce8F8CpWMz+d K4bSGxh2PzM1bcKpxHpeqhUw4AHgNfrB/CWxJ6XCiOvbNyK2WleZRbV7r7b9HAA9eBQN mm5IroeONj9XH3GIhyMrSaiHmB4FcHsbeEsEtvGkP8hb4sfIMvOm8Z7Y263zgNr3BqUN S9pqgdjeKKfA10V7DPzAkQmpeoR0lnjdHMH1tMLUAqT92gIJTHOUtME7I13gk6MH0XUE ctig== 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=nrG3U4P8tnDM4SCWDYONLDPgsN83+RRu4eA0i7Q0lE8=; b=Ue0ZFTT0PAaf0f8DUzFKSGYa7qLovSRl3VXhSUfJNvgLIAb5CvyKYllnlIfkn48S5X ie2VQ4UcWoRnDtQDbZ/eHxYT7VB+Dj6vHHk1h1G1VBBfGbNg0F7K60o81ES67lKGBnB2 gue1wt0Qdj3F87Va74JQS0eMqeEuHWZ/X5j/rrCsttJq7D0Mt9zpfqTcnI+Zra4+SJI2 UDS2ffSvP9/HhndEgoV4WnWWRVgPdL7jXMe5hTy7cuvFGslRiGzXo4/MCwRtDb2SIvXv HMGk1KELtbL4mwL/mfhoCaMt3dKQKg67zk69j/WX//y7/vs+VACJo6YW3yr4Q9CXs84v 7+BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XPczYzmI; 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 c17-20020aa7c751000000b0046329e2724dsi3147952eds.86.2022.11.18.06.58.37; Fri, 18 Nov 2022 06:59:02 -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=XPczYzmI; 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 S242154AbiKRO5K (ORCPT + 99 others); Fri, 18 Nov 2022 09:57:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242145AbiKRO4c (ORCPT ); Fri, 18 Nov 2022 09:56:32 -0500 Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BBE3903BB; Fri, 18 Nov 2022 06:55:37 -0800 (PST) Received: by mail-qv1-xf2c.google.com with SMTP id c8so3458991qvn.10; Fri, 18 Nov 2022 06:55:37 -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=nrG3U4P8tnDM4SCWDYONLDPgsN83+RRu4eA0i7Q0lE8=; b=XPczYzmI7T958Ohirzr9OISoe0OA3mMrj3KmiR1oHYoNd+2Kx7FemEYeiBT5GjGSFp w2ttPETiLoFs3ysNof7dvniSnfaGve6wHDb87qUt19UcyJgyJAP0R000bep5SlygwqTh o4M4sSk/JDdbpMPOY03kyHZ4AvsvotliHbbMCFuV7jDOuawRVSXyjBkyvbijF8FNn/UE /DsoF+rxWWEbdl/mZNaeDFBS4BSQlzbEEbtXegJ1bg+iFIKDJ7jxrv6Qoy7vESwV/q8k HflrZotVOg/JP6poLgjAYmrchvJmq7FGm+66MQt6b20IBWcERZdwt50oTmbh/V8nJmdS V40A== 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=nrG3U4P8tnDM4SCWDYONLDPgsN83+RRu4eA0i7Q0lE8=; b=DMhzGwzUwSa25OueuLgY0bsoE0g3KjmlvD3C/CFdanhHmQnJyxCup+8HWz+1eBPhod jL5Hsb3YKmjDeXslHgfDk+yp6iTG91l+Qy/Pi4Da4GMdhJ1hOCtvSfGmKFCJDc9J7Owr T2QJNSsHf/UQC4vBUG/6nANWb2pTuYBDWfI/j40dODhLTyyNYucYrFsSRR5mMDpDB23n uzF4n6CgUDOhUWGEUoUjqyBLrW6ip88P7gEAF+po6PifKvZqCdrcYRYEdS00ISBe+P7U ekGmale+LPyPXk71Q7ntHsAU2eZjWcCQs3Y9P8+LNq5AeAoRq3RUpVkICF/82kXk7Eaa lMug== X-Gm-Message-State: ANoB5pk1kqkwSO6B6lBfrFPXbQrDl2zUnOgz7yNeF7dBvUaJDW3mos+k LTX0CaY9v6ULk+x8Jw6G94RhRA87OTpmKg== X-Received: by 2002:a05:6214:3984:b0:4bb:e31f:a56e with SMTP id ny4-20020a056214398400b004bbe31fa56emr6869841qvb.76.1668783335940; Fri, 18 Nov 2022 06:55:35 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55:34 -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 v5 12/14] serial: liteuart: add IRQ support for the RX path Date: Fri, 18 Nov 2022 09:55:10 -0500 Message-Id: <20221118145512.509950-13-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846372009089334?= X-GMAIL-MSGID: =?utf-8?q?1749846372009089334?= 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 v4: - using dev_err() instead of a combo of pr_err() and pr_fmt() - dropped "get irq" comment in probe() > 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..678c37c952cf 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,46 @@ 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) { + dev_err(port->dev, + "line %d irq %d failed: switch to 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 +318,12 @@ static int liteuart_probe(struct platform_device *pdev) goto err_erase_id; } + 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 Fri Nov 18 14:55:11 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: 22376 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp240293wrr; Fri, 18 Nov 2022 06:58:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ScFqmJlf0t5m7fEsaQkcANPuOGdpvueqKVjj4OqFKNTRucQ9X3xoemjiUZPjv7IkLqL83 X-Received: by 2002:a17:90b:4b89:b0:213:d2c:1923 with SMTP id lr9-20020a17090b4b8900b002130d2c1923mr14369343pjb.234.1668783533427; Fri, 18 Nov 2022 06:58:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668783533; cv=none; d=google.com; s=arc-20160816; b=hEjxOFGYDm0Tu6pYs5dq6I2NH4kJpJKOenPRZ7jE0FJ7DFRPD4B1BWoXt6LyGn0WEk CsxlzFLKHXI2OIfUKl79YLEVRgBjpM3PBXqOh0wi+KqAnC0R1V3XHsY8FtsRz7a8RpQV dT6Xd6OsksXFS1jyMcmT1LVNb9hoTgv1AyE2sLiD0ocusX1PulXScVLDdk7kUnj1OgFf jYEzCHb4UAZzsXXtgSfKSSoUXvXU4gl68RkDbmgTlvq1c1qTRq/Wpf8qsFGwg6IhYXIJ xXxG/CmWRnibTL+ozwb5m6rvesK/S/y1ZCpqeRu5MuKpZci/QWo63cDtJ7fwpnZgj7tD s33A== 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=H85ZBilTG0+9LONYH8WQbu/RytIoy2zs4o7WBsneFmU=; b=jW4VGUSMwROCKNgzpJYfMiFxdch3lpZP6vfJGhLmFCwL0WGnxRO8x+l8xzlWF/HIrH JFG80S0iz6Vlhxmm6pE8UmxVCL4wnRYE76eAWOUAPLjlp/rynw1xnunLbKeAeTsgG17W IorIFoqD5KD7ls3eDiu2mvTDhuntE9bLpKvVCQDtbIAwlWohkzIOQe0wMiLZpML16y4u gUm7nAur/hrvy3RBs3DvhmMYT04EQHusCjO/FCI9JVyij6YS8qB/2RD4E9+EalTmXSuz tENnDBqjde+Ep+e1NTe5P/llI5wGivbg6bikpqmfSJCuT77+WEY0rWrfhHCdja9ircxm znjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LhhyMUdV; 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 c4-20020a170903234400b0016ee19bc5f9si1897981plh.553.2022.11.18.06.58.39; Fri, 18 Nov 2022 06:58:53 -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=LhhyMUdV; 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 S242162AbiKRO5M (ORCPT + 99 others); Fri, 18 Nov 2022 09:57:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242160AbiKRO4e (ORCPT ); Fri, 18 Nov 2022 09:56:34 -0500 Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57D209150E; Fri, 18 Nov 2022 06:55:38 -0800 (PST) Received: by mail-qk1-x735.google.com with SMTP id x18so3543901qki.4; Fri, 18 Nov 2022 06:55:38 -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=H85ZBilTG0+9LONYH8WQbu/RytIoy2zs4o7WBsneFmU=; b=LhhyMUdVDLul1ydHHrS6RZygPfgsb9WLi8RzPvcrcuEFUHygkpO7cPiUTwe0kNowqO 6nEygirPATdptLzsTN3KSUmnvFS8xfFcpbjN8tgit+65xbSMko3dgNEXHSLUsL896Fqr /IU0W9jv0vBQluLZYX36TRLdbsNRkcTf6pbGShO3TWOW1IFJqDXSFiQLv7xk9sSxVPDA FY0JDoTULWHJGzmtmoxoYL6HVkDgu4HFu2NyuMIsHm45LZLPEmhCxcCtLWLvorM5bMID lCm0eekLEWH0+moRRJaxSDLabpHiqNltQ5UGYnGHIjX0Fjk2qDaK2z0cGxvrcJ4PCxeP ZxpQ== 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=H85ZBilTG0+9LONYH8WQbu/RytIoy2zs4o7WBsneFmU=; b=6qwEa0cVFlTvNabvHXzA4HPXhzLiG2QCq9qDgTOHWnBth0bvCWWnNOZ8XNie0zkqJy CUQlLucDs/BYPDqb73gNGaVeyqDPgzyGm3T2lRF25M3Z5X2bdkDmz31JN10MMgd4gJuw fU4Z5Fdm/tUI4b1CyeVyRrq+cX//phVZtEcTDB57ua1DzXMdg+xHoT23xe3qomPGGm+c KW99QRYC2jy9rKXtVvpBHHEO1Yxo4k06iXrkqYEhc9boN1FMQya1qbwT+iVr3YJ1iFXQ 3z72Mu+oSkJfLbgXxaztgKwUFSgulosLyYKfLu+OWhVcQ09gsg6K+gdJfEXtUpwDHFcM TJHA== X-Gm-Message-State: ANoB5pngzgJamhnQAwuTYCOgPLx0k2c5s61LAT3xkg0/7uFbjJv5WCii +2p+TzUCfyuXt9fbbzJaCV/WFg5tm6VnVg== X-Received: by 2002:ae9:ef92:0:b0:6fa:11fd:5861 with SMTP id d140-20020ae9ef92000000b006fa11fd5861mr6110181qkg.726.1668783337181; Fri, 18 Nov 2022 06:55:37 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55:36 -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 v5 13/14] serial: liteuart: add IRQ support for the TX path Date: Fri, 18 Nov 2022 09:55:11 -0500 Message-Id: <20221118145512.509950-14-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846362459705279?= X-GMAIL-MSGID: =?utf-8?q?1749846362459705279?= 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 --- 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 678c37c952cf..850125870efb 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 Fri Nov 18 14:55:12 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: 22379 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp246583wrr; Fri, 18 Nov 2022 07:08:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf6EY/1B0t+wf54ky8XegQ1pvlZr8xipkCQxU6lcwtBVSpOkX6h9xey8iLyWQwKl4sOK07o+ X-Received: by 2002:a17:90a:d157:b0:211:710e:7d03 with SMTP id t23-20020a17090ad15700b00211710e7d03mr2495088pjw.56.1668784082525; Fri, 18 Nov 2022 07:08:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668784082; cv=none; d=google.com; s=arc-20160816; b=AC9J8pVWZPZxxD0AgvaWgacxDNf6hhmM/I0GMj08Zub9YDvABplNrjd6pNH2GDFsq+ iuml1uqZdFnszqcaVxcTZY2yvgieQZJu0QlTtsM2sOnEK4crL/vM0exhtUNB/VbSLhdn njYHXcQVpU0UlBAknzxJQ+Ep+qR0CNPlvplOHO48gPBDagiqwkyyNqAN86TNoRvjPhRL 9lB1sAIBBETYp5JMxKT2hXTAovnE+H5SxBMG3opS6OxMqSaVFjMfukhmZo0r0+H3wZL4 VMQhB7Xw/OhtmPOgrYUKFnJes8yyu3vb6VNIG1SLQ/xvnje7kbA2J/b4lujCEwtV/wsl 3y8w== 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=BliqB5y9lA08eGEUpUyNwFtHyZtVgSAM/9v6990Yi+I=; b=ajJ3V9Pivowj9POnAt59FNiMxDOShfhLQHyKaEGYLc5eJKSMLpWFZDsz7EGAQqM8TY c9+M0bz/7vsiiT8Nks9yKT4+katgpEVoh40efwQkXK9Z79bNh3rr6SEVWHte9nBBEet6 eZXTHy/e/P1pMGUIQTSk/gWN1BEa7k4/+ISzd3hetDFnj6j/LvWBeXV9o/KJl/Psv1WP kHGUoCO5XPwAYlM46AJicHMobU0ZzLNV5u27BXcxOqY+k5DMjqS62LDe7ycZvK7hC7c2 62TpmgtoV4g/AsRgJCDNU/c9QmlXIKQ8O4MV8jvbZfyOPqrvtsN4iv1tv6s4CExaALyr 4HZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aJW4brjk; 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 e5-20020a170902784500b0017857e4e6easi3641481pln.343.2022.11.18.07.07.44; Fri, 18 Nov 2022 07:08:02 -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=aJW4brjk; 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 S242093AbiKRO5Q (ORCPT + 99 others); Fri, 18 Nov 2022 09:57:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242178AbiKRO4f (ORCPT ); Fri, 18 Nov 2022 09:56:35 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C42F7920A2; Fri, 18 Nov 2022 06:55:39 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id a27so3225764qtw.10; Fri, 18 Nov 2022 06:55:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BliqB5y9lA08eGEUpUyNwFtHyZtVgSAM/9v6990Yi+I=; b=aJW4brjkSIkLfQZLvYXAq8qVsqz1uAFSncEJoomTSS2e/GovkwHLlDuuY0QR4ekMPM Y9iDI8US+1xSf3pdQktgzTovRTsLThmd2jYBO7lYVvXXn19Mp8/0M8VPpLFqZhssrlnO 6/cikSGa1wcjc1AzxKMNQNLT+BPcOTi0LTL8gPJHGYBurBR9FMkJI4N4LFG8VK5ge25Q yweJ7ahBWsnSVtWJJ0lhdHHu+1UQuGRKMBerXyUUfhnNMxNcZB3T6sXcAfFofvXDz42A tKL0WgBai79Y+CcOFdqAVgpbre0beTTZxJ3uKeXOg6jVazATVvecZV0+2bfgCuOxa9/n PPHA== 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=BliqB5y9lA08eGEUpUyNwFtHyZtVgSAM/9v6990Yi+I=; b=EKMkWRS3dcTgvnXZDnZ8hkyiVWUcw5o0+m6VE6kULC8yiMbpLdhM+MeIXNKhHk1YCG f4xk0SgZhGFgtUKh7goXUDzGRIEjppMMOshGapnKK1/KmmRA4luxgGvhXrR0mzTitYe8 6drhQZLXCPFYrsiHbheTzTxwPc/Lgbapxk8h6b3U9s1i5WwcRo/ILUOGQvk8D0T19M3g CGsiIRQ+A6ErZ9CgbsxRW1AeNSiJWCT8cyPvWTrP71Z1DZg7Zihdk2TnXvw3bwMNX06p /+EPehxt0YXKobJUcfGHHa2Shdxv/PKw6Skk6tGe6kUmTOIpBEgOpmNx8E0Cfv+4Yb71 T0kQ== X-Gm-Message-State: ANoB5pnkiF8c3P1ZA7oaJyv/0/NIi8tJX0GYMGPVeW3rmKqGb0ZL55id qdFlEQm2Zq7o/9RcNHJH6yMpoNZq4u9dcA== X-Received: by 2002:a05:622a:260d:b0:3a5:829a:7e92 with SMTP id ci13-20020a05622a260d00b003a5829a7e92mr6710164qtb.528.1668783338604; Fri, 18 Nov 2022 06:55:38 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id m125-20020a378a83000000b006cbc6e1478csm2397269qkd.57.2022.11.18.06.55.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 06:55:37 -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 v5 14/14] serial: liteuart: move polling putchar() function Date: Fri, 18 Nov 2022 09:55:12 -0500 Message-Id: <20221118145512.509950-15-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118145512.509950-1-gsomlo@gmail.com> References: <20221118145512.509950-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?1749846938064710303?= X-GMAIL-MSGID: =?utf-8?q?1749846938064710303?= 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 850125870efb..47d12bb1b9e0 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) {