From patchwork Sat Nov 12 21:21:12 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: 19243 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432190wru; Sat, 12 Nov 2022 13:22:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf6zdgsRJCHZ8Aqnx4bbGtQTzF27/gf9SQai+aTUvUCU0IDl3MEwk3MFl+VebxaLEC8Bnf2Y X-Received: by 2002:aa7:ccc7:0:b0:458:9925:fb74 with SMTP id y7-20020aa7ccc7000000b004589925fb74mr6505478edt.330.1668288147750; Sat, 12 Nov 2022 13:22:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288147; cv=none; d=google.com; s=arc-20160816; b=so+HBLpbc+q/MIUJVSoLSvzJ2wiWyDUsFZsiAenZreMF9EliEqzfugh7Ghmb2+NA66 mQdH96adefhluGKamlINZaJT4MOUVMixDE/8VEflaZkrRy3VKtJUcLSOsvaJenf6qp6C fSoA4irQz9VxpPqgVd8KqSDqSlOuOHvU4Wfxm9B/Qj/HULwm+bmCwbnMCJAZBuBQ+CiI zQJGfN/BUcebz7ECn3M0SmFqlc3sVApFdYqzIruyt7/YyPa0Y+x4OwJmRjgDKBN6W2WS 02dH0WqkQquBYB4HL6PKTtoeaDKQlmrVEmlS4PmuQKxUCqOtZ3PIC1t+vaS/4obs4K0V X9Gg== 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=IQFfyExI23+erN827zqnus+ZsfTP6ThOACFwJyPon2s=; b=yEH3csdhJ6ekroIxT61m0hZQdYmHTYKP+yQP+TEYtVhXGnskRIwWdaxv1LXYmLrmTD FnNUlNWUcrj70Kl4PYAM14wtS3lA3hytppgMQS6GpVwN8JhTFUzQUHbZ+HBto6O0OuE5 +e0AY1QQ8U1fO7cogLsx5pNJEJp+t1Vr4Mh8E71t9tqCYprWtSqjbBAWTxAebJjfd2TT lEjg639MeLtFL0OAoZjj5WKknMikX47BNIr6QA58+vg1ZBKbv6OYH1IUzQqnhllxNL6l qFrs5DfQxUqABsH50N12YOLHMzumoALLP5ssYM5AKt/k6impX3+ZeKQxD6W/WROXaFId DOqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UCtUwLwV; 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 go14-20020a1709070d8e00b007ae63fe980dsi6271639ejc.931.2022.11.12.13.22.03; Sat, 12 Nov 2022 13:22:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UCtUwLwV; 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 S235079AbiKLVVi (ORCPT + 99 others); Sat, 12 Nov 2022 16:21:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235050AbiKLVVe (ORCPT ); Sat, 12 Nov 2022 16:21:34 -0500 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83BB815805; Sat, 12 Nov 2022 13:21:33 -0800 (PST) Received: by mail-qk1-x72e.google.com with SMTP id g10so5333772qkl.6; Sat, 12 Nov 2022 13:21: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=IQFfyExI23+erN827zqnus+ZsfTP6ThOACFwJyPon2s=; b=UCtUwLwVmjQTkvMKmyJiNoDcBXr9dYQHOD9QEoW9/jb3JDLVq81xuclgbQVti+hvhH A6omZZIxoEmUd+vrSCcsIfjfjlhVgV2sj5hc/ZeGSFizKmhwwzDBEPha6gdjYtQDFUgZ KYFQQCsyTJLuOZ3ixLkxCYzsnJN5rrzm+wAqzyXGj98vJKSyP0ISuzl3G2S9G8JNuinw XELTeQDb5/GlzSmIjQMjXpFocijdOmvBS7jFtyHwpFl/PLLSqQLJFbWeyK+xPCND2n/X Yw8tpDdRaL/Kx6Cb9ZUVPZQ2Jtbtlx5nAvIbcApBZ7jPaz8MYcCSbVnZa6JI41ZpOg1S eikg== 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=IQFfyExI23+erN827zqnus+ZsfTP6ThOACFwJyPon2s=; b=d4+iZ61ZdXMH8t9YrXYgAyHMT+9IrBRcYhsrKpvp+AMxstA36UsS9tDZTdPQ7AEwi5 E1X+/Am7TJvtyqrkZzM5WBkowp2SFqBFm5/Byluw/jLZTFtax/Era2eelcko1rdOx7qn 6+Y1f88EEtUWL3jbDqadYjZzo+6iay/fTlfiWaz/Q/0Z/7x8sVD3duc5Ch2CBGo6hMnl rfX7GvPndjhPhmQVCek5itG8S8sR3uLzrAdcZjLnPb6IqBxb8XJHAw+LfNJBwcfHlzTM 3lnMnW1LJDo3qetGPv4cKJYrmQUvW1vHFr8F51jTJWLozTQHLWijgMLG8VWvL1SnHYkY pSmA== X-Gm-Message-State: ANoB5pnWP7RRnj1FIXMhhuQm3/K7vy3aCZFWMo3bJLkYCaeMWJr9KI3l oifXoHYtCXxghcyBX2Oe/B1w7GYcLgYxLg== X-Received: by 2002:a37:54c3:0:b0:6fa:4749:cbe3 with SMTP id i186-20020a3754c3000000b006fa4749cbe3mr6106929qkb.171.1668288092320; Sat, 12 Nov 2022 13:21:32 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:31 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 01/14] serial: liteuart: use KBUILD_MODNAME as driver name Date: Sat, 12 Nov 2022 16:21:12 -0500 Message-Id: <20221112212125.448824-2-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749326912934039236?= X-GMAIL-MSGID: =?utf-8?q?1749326912934039236?= Replace hard-coded instances of "liteuart" with KBUILD_MODNAME. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 4c0604325ee9..32b81bd03d0c 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, @@ -322,7 +322,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, }, }; @@ -368,7 +368,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 Sat Nov 12 21:21:13 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: 19247 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432297wru; Sat, 12 Nov 2022 13:22:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf4FSK6Eez0C1Vfycs1JOR3kOASpA4AsW2viSfQnlhbzK8cCjLR0wJTseLcnWum3isDClRSj X-Received: by 2002:a05:6402:604:b0:458:d1c4:106f with SMTP id n4-20020a056402060400b00458d1c4106fmr6288379edv.408.1668288178129; Sat, 12 Nov 2022 13:22:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288178; cv=none; d=google.com; s=arc-20160816; b=IPw+Tz/fYb/Nf2TfbgBi/D7M5pSaBx98yUcMki3qWAZqNSnq1A3kyLmmcNNoixr/S/ jriKrjrwn+WsT5lH5/BTt3NAilJrgjPZl6MxL7RcKkzusPHzm7f/ZQrB5eo20wuqPd4q 3h+B4MiKUP7H/+1PoGlaCniv6ikFvWCTeua2X6LvEr3aG3kN6Do5FXo8cmX5/68z3Gjr T15RAbLCigVAb4Sx8LAAZ2M60uoyUJRCpXPUIcHfGPisB0d2vPtRYXOYx3jYy/TqjK1D gknhOj4iPcwkNp1uifgFVz/rpmAUDkP2yWyksZEeNr2LfL3t8RRHMlmHUPCVf86Uvycp jaDw== 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=h9s8/P3zcC35a/7U8wwUtQnHUttoN7Pw9xSfTjSoDyA=; b=d8q5vu2MHhU2ie1pzIJsVbswPjWlNAsQwgUSJYXVwtUZgxqLs5h8Uwx5aO9mSQdm+M QJ8P/rKQ598kUVu5R/yd6/CJZZ/AN+GU8KBMA67XYN2rxJm+lBbRdK8sno5+1zWsknYF cQlKU2qduTGRSVXL64+amZ3M18xEKs7q9nmfDsxmon0enpkllyjQiMPiolePpsgk7AoC ZddpA3ivjkDyZm9o25QKHV/IqURpt4b0RKDCp+mnWXjaoezHKATixkGPxfjrKcZ3dgR3 Q5y1pMADsJZyJsQ1abXOk/Tyv/m4QON+E4zKZV6rEVgxXyzq6+tNGkP+Btg6sGqWNKaU IQAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lS7cf1+1; 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 dz19-20020a0564021d5300b00458ab54baa5si5752006edb.503.2022.11.12.13.22.33; Sat, 12 Nov 2022 13:22:58 -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=lS7cf1+1; 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 S235097AbiKLVVl (ORCPT + 99 others); Sat, 12 Nov 2022 16:21:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230170AbiKLVVf (ORCPT ); Sat, 12 Nov 2022 16:21:35 -0500 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB2A116E; Sat, 12 Nov 2022 13:21:34 -0800 (PST) Received: by mail-qv1-xf32.google.com with SMTP id u7so5645079qvn.13; Sat, 12 Nov 2022 13:21:34 -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=h9s8/P3zcC35a/7U8wwUtQnHUttoN7Pw9xSfTjSoDyA=; b=lS7cf1+1z6f/If/JJO2IahlbNk2YHn+QDZi2DLAe50NrMq6e9i7W/+gNE8pm8R+tCj rBFr0PRY2lSXCq0+qjR6j7EKo6RgeOKtdjbwn8iqEmM5FZZ3XkILmTkr9eEJk3sitOqb XT55PetzmpaYeX15oVC1VmTD6Jf4SEY+Qqm19TnlBLZB+1vLsGOjYmmFoIrulEzkO5Jl SfTTj9Vien8cfb97+pjJNlDiV1A+XXbHPgMB6R3gBFsgvZBawMSR3fJOJNsVUNvuisND fwGNxUaLocC7X8UN6k9SlgTQslxmqF1cOEbslU5sSvKUB0+idTP9gHWtWbLbpd+YdKbE SpmQ== 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=h9s8/P3zcC35a/7U8wwUtQnHUttoN7Pw9xSfTjSoDyA=; b=0gxjIZhBYKHQxYc6yu0/45tWAs1l80PvaNRd8KDEJguGKtkQS1HqxxoZ2gzKCyOiDo qp8bANcxVeNLfs+PPNAI615b6UXY7ir73SHiVnRMAIkG4Wu6hibcpL12wuehRrPFIqxQ pXNbXxKrTmA1cgzxX70o0Uoe9O8kd/xfxnbmU1CNWnUaATQpLN2Nu0ivFQl58ZPmSHNr WZ8tpnb1Xfs2n3VmLKv1JGNZpmGvwdr6fLSEM7ToiXlh87GHx7Czo40Ti8o0VRdu8hYc lVEm13nBgFD3GzrX9buDd3TpNYNbSUb55+f5JMzyxLAcLtM0lnMRFc2WEZ0c5SVMdrJp T6Ww== X-Gm-Message-State: ANoB5pmFHRzWJS+th4Hin2x2Vc+7aGWpfwHW7r7aPT404gL9UtEbuAOQ eM1SED8lPOyK0KMRr10V67/Q002kC5zlLA== X-Received: by 2002:ad4:4f11:0:b0:4bb:7436:49de with SMTP id fb17-20020ad44f11000000b004bb743649demr7014739qvb.27.1668288093369; Sat, 12 Nov 2022 13:21:33 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21: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 Subject: [PATCH v3 02/14] serial: liteuart: use bit number macros Date: Sat, 12 Nov 2022 16:21:13 -0500 Message-Id: <20221112212125.448824-3-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749326944208580017?= X-GMAIL-MSGID: =?utf-8?q?1749326944208580017?= Replace magic bit constants (e.g., 1, 2, 4) with BIT(x) expressions. Signed-off-by: Gabriel Somlo --- 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 32b81bd03d0c..1497d4cdc221 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -38,8 +38,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 Sat Nov 12 21:21:14 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: 19244 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432254wru; Sat, 12 Nov 2022 13:22:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ZJFRUhS+yF2hcLB2bPyoEQ+WYB8lItjzWlvSiILqUiKSQ5c1LS5fTRW3D+JSPhAj83Vi8 X-Received: by 2002:a17:906:3e55:b0:7ad:dd43:5d18 with SMTP id t21-20020a1709063e5500b007addd435d18mr5826232eji.389.1668288164190; Sat, 12 Nov 2022 13:22:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288164; cv=none; d=google.com; s=arc-20160816; b=QWCTzIkPSPb7pv9NVgW86Ff/5xcOE/v1WIqctg5Y+Dmz/zRL07Lu799PBluM6nsVp+ yJ9rUB4K83dVBqdH7w0lIk+rQLJ+t/5U5IsceLeQJSaz2TzuP20DqVKf6L3LbZguytTF tG3Oy4lZr3UulCI4eb1WgTWSA4H2T6P4RI63u5jYpnzKhIJ9wL9BqONH9gGOFnkx6ORU HzB6hl1xCF8YF4c6Tu/AILuAkD62nux42hazXY4pj5AwEAu93xC/mPwlvzdypgv66IWW E1VjJqK/xyUQtpVDYUepkGVS3Z8qCDVb4RiGXNAHiPrPi3+CMEdNPIJb4xCvU/Cyem+c GsoA== 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=8/8DPEq9jxGYQguFphHAE7bQWgOJIibend0gpSldrS0=; b=v7rjBEMh6bhPB0KIwRkzq7WZSErF2WKRa4SOMWSh85igse2WioBUgi95gGyfEIePXt XGnF1hncxfwo0kim7gTiw0ZrgUI3KEbUTzPzReUjV5b7uo3OAM53DhcEG6rfIK4+rJTL p6b+2jXBZeNoXlQDDttCLbLHLQXsF7fnTckKwJbc7bcmOSb7IUDpmpeGbNhVm/bi3mcr NmzPE5uJ0kQommEkz9kRWB05R3TB0OFfGM4p4vrJFNnfD7b8B5EU0FOuOxMaoVd7+TZr LVqxxM7qB2aFdBYKqK4Rtm0vIqq73TYkophG6GOsF7A/Mtvdj2yQ6ZG543CssvKj390m tCBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pRD6w1gR; 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 go8-20020a1709070d8800b0079b40c09982si5150341ejc.340.2022.11.12.13.22.19; Sat, 12 Nov 2022 13:22:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pRD6w1gR; 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 S235107AbiKLVVq (ORCPT + 99 others); Sat, 12 Nov 2022 16:21:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235067AbiKLVVh (ORCPT ); Sat, 12 Nov 2022 16:21:37 -0500 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A89FD116E; Sat, 12 Nov 2022 13:21:35 -0800 (PST) Received: by mail-qv1-xf30.google.com with SMTP id x13so5679211qvn.6; Sat, 12 Nov 2022 13:21: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=8/8DPEq9jxGYQguFphHAE7bQWgOJIibend0gpSldrS0=; b=pRD6w1gRCDzRGm1uW8MIeuaDnD+7DSCddkxcWGyWGiaYUOOhRBAtNKCByPwmkfUFAX NgNUEsXck9OsSIWfmsiEu1NTRvglPNJwt0gOpuYU+XeO4GZBpaYgfY+rywUTciUeQ3DL zV2jMtncMGRtIf//3oiSiGervTkqCQAGFbt0nFDPjaP9G12y0bwf66U37d3C2RlkBQSL HJqZ35yZIKFoMSKCxlwq0k/zjnYuGXEzrBX09mU39/46ANYs38+nPc6pWGfIE2NFuz+P J+R4SHQrucUoY19+IylRagorvNoWm4ZSpMtqyXt4YQwp3EYu68EkNXCbI+azdCiXcB8W GWpA== 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=8/8DPEq9jxGYQguFphHAE7bQWgOJIibend0gpSldrS0=; b=SQowBztMEdKLfaNgVIZ/u91IxnyzGLSFpbuwct2UegZ38g/ym0JWqTHMDzo5+wxb/R s3rKfbdiI21usHyrCVHd7t759tDhjuRx4v7Ret9KhJMeRXTjN1j18JIChmkVMhTceIvc CaJMr8yvgb3J04Gaq8/L4+Gf3RM8Uuzc5MqwdX3YU83LU4WeggO+oYjQtaiBl5ROW30D qIJ+RBF0rgSy78ViI2E9KsiZDCsVZQvGAGHF0OqAwyclt7m5Dn+5ybeF2UlgGFe4vxln KPAB2ShKoBzCmWOfBadjnjfCIMKvwkrzti2UeszGYQcE4QKqBet5HjUbTHsLjHvZB6ij e4mA== X-Gm-Message-State: ANoB5pndsNBWYxmmzh+43p9kQAN+pi65VTuUfxvo6EEjZ/srYLCEENxG nWzhrIUpfdRLbOqOuazXPH0+kqNFdTyBRg== X-Received: by 2002:a05:6214:5911:b0:4b9:e098:e334 with SMTP id lp17-20020a056214591100b004b9e098e334mr7136818qvb.38.1668288094516; Sat, 12 Nov 2022 13:21:34 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21: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 Subject: [PATCH v3 03/14] serial: liteuart: remove unused uart_ops stubs Date: Sat, 12 Nov 2022 16:21:14 -0500 Message-Id: <20221112212125.448824-4-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749326929928497887?= X-GMAIL-MSGID: =?utf-8?q?1749326929928497887?= Remove stub uart_ops methods that are not called unconditionally from serial_core. Document stubs that are expected to be present. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 1497d4cdc221..90f6280c5452 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -122,6 +122,7 @@ static unsigned int liteuart_get_mctrl(struct uart_port *port) static void liteuart_stop_tx(struct uart_port *port) { + /* not used in LiteUART, but called unconditionally from serial_core */ } static void liteuart_start_tx(struct uart_port *port) @@ -154,11 +155,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 +193,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 +219,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 Sat Nov 12 21:21:15 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: 19245 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432255wru; Sat, 12 Nov 2022 13:22:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf5VfJl8XH9T2n7Tog+bJDhJxQfXhk1hu+AN7J8iBZ0vvGUseqUCEkN1ACwErGZmbErVLk54 X-Received: by 2002:a17:906:7fd8:b0:7ad:902c:d1d6 with SMTP id r24-20020a1709067fd800b007ad902cd1d6mr5872225ejs.143.1668288164190; Sat, 12 Nov 2022 13:22:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288164; cv=none; d=google.com; s=arc-20160816; b=WYDwOx19oQj3TjnFhog/EthGsYJ++aOsC6AjJzDB9xYwEMAoiR/F6/aULuucsXuj/M kXcMl6u2sYRL5xZstBVIfmj59Y8HW8Ieatuy16A/xozrKY7posrnqBnhyCLVjB2+AL1J Pbfdm1znsr9TIX60RMga7Bkff7lTN3YGsRl+Buc3IWHGhLmfb54ea2KYyBohbCu6nBBC IhN8h8iAQsQDeBmAXlYmmEGERIvAoi8WVUU7/SCNwn22BWKrKGwqdT8XdhZwY06b0ODS BkTNnAzPbl+Xt7gaX1bcrK/n60y2i97ELfNcIOZr+xwbMRNmFM2YZQZGxEV/l8j/XLuu Vt5g== 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=8WawqzZk7R2Fk2wsVcJJHQ6DiWGY8oW1x9eP6skVjzc=; b=Jo1abLY/Uzh2BQkikmx5O6efGNu7jFIg9UcMSDHFCgViwEyqNAxNsX2dgUtG1sBjHY a/Tm5yzcym0EyVHziRc34gcxPGbdku8HFXBGvKLQxsbqq5rjQ8o75A766uYHoCQtBiGv 0Nk+6XN5bmpB98Nj6kwNbze3Vs47V8TOZBHkeD6awP0/LwzTSfTGeIli4GfiiB2ysPGa Mk5xC30cqQT//GHSYzsD4v6Kx3O7QyEyJVu6mcgD3/hj8YnqHPbnsSbl4zgtOiNvbgJz LXihQrWAUcqxNS0HMSUK0sKOir0olfAEUDZGDn3IXumX22B2UKoeElZF6QapC+NmbXdb kqUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=erGeth7X; 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 eb6-20020a0564020d0600b0045d0660a039si6540777edb.316.2022.11.12.13.22.19; Sat, 12 Nov 2022 13:22:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=erGeth7X; 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 S235127AbiKLVVs (ORCPT + 99 others); Sat, 12 Nov 2022 16:21:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235076AbiKLVVh (ORCPT ); Sat, 12 Nov 2022 16:21:37 -0500 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1896E15805; Sat, 12 Nov 2022 13:21:36 -0800 (PST) Received: by mail-qv1-xf29.google.com with SMTP id h10so5668091qvq.7; Sat, 12 Nov 2022 13:21:36 -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=8WawqzZk7R2Fk2wsVcJJHQ6DiWGY8oW1x9eP6skVjzc=; b=erGeth7XdHfXrFpCTX/lYo73hGW1D0dqNev6FMVSG8CXXdRMZY3tyotII4xjilTBnY DUwUs6FCzhgnK/+2inHdJR4d5Fqr0tzu+z0KP4/OfNsMpduXbPI+5LsCmgi/R884m74x ktisuAj80uxFVLsCExMjSCtXIYOR3B9gwTWRBGQL8Wu3KNsutn9jKvV5OBHA2khtu1zd ZhLbcrELCGQSBxlQcAaDqcHtUrgFoRgKj7KH0j6n/3HseYf2xcqsVBjCUS2KlgruBQto eeXACw+hW92+l04OVRSlsE1cd0D+9YuAIUj1eKSQAKNzCGX0nXRtkC+JJJhzriIZgfvI QkvA== 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=8WawqzZk7R2Fk2wsVcJJHQ6DiWGY8oW1x9eP6skVjzc=; b=Mk+aDpZX2sB483Z7XacpiVTBvKsay5cuv9RmzuBitr5HPeOwUDggKlNZON20n0pMs7 JrR/3ku7oXMZAHkhAPSTS2yKaA5isqnGmF7f7lYKSJOm1MuduXcgPIldU6C/W7B6Ppek cjnuC0J54r0npiljrljRrCHE1DkPmqSM8Kgf3yJsY1j0eA5S6bnt95zC9MJBfSJVK9Wn ajaj8bSucmNWz5gpTjgJCC/x/E1DtzcAfNM3c5VqhVk4OVAbW4vVzNktUFywLYsDLGg/ klhT6DKWgoomw9qRVkAadxbPVIy7nDYRw+Bf08UHtNHoAR1ZZpSY2Zjcx9B8y4LNhO83 KBuw== X-Gm-Message-State: ANoB5pkzapBo7WYQ+hWNHd9ec9JibjkJhBhHWyQbSVOTof/WiHlE+W0G tyAuDsF8Ie+s7GkQzrlIeKDMD0hSZaUD6w== X-Received: by 2002:a0c:f951:0:b0:4bb:b2b1:c10f with SMTP id i17-20020a0cf951000000b004bbb2b1c10fmr7204628qvo.64.1668288095476; Sat, 12 Nov 2022 13:21:35 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:35 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 04/14] serial: liteuart: don't set unused port fields Date: Sat, 12 Nov 2022 16:21:15 -0500 Message-Id: <20221112212125.448824-5-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749326929926410218?= X-GMAIL-MSGID: =?utf-8?q?1749326929926410218?= Remove regshift and iobase port fields, since they are unused by the driver. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 90f6280c5452..5b684fd198b7 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -264,9 +264,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 Sat Nov 12 21:21:16 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: 19246 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432279wru; Sat, 12 Nov 2022 13:22:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf69sFRWcLjGMoS9iENOyl1/5dDsFuyxTpwa6EhNcFBTnfNcx1oGM3h258r2wJcPahKDZ9Im X-Received: by 2002:a05:6402:12c2:b0:467:74b2:e17c with SMTP id k2-20020a05640212c200b0046774b2e17cmr4751789edx.344.1668288172915; Sat, 12 Nov 2022 13:22:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288172; cv=none; d=google.com; s=arc-20160816; b=VYgU3xSLDFoVzwMfi47kJx8tEvjhNFBrSW0zLQBWoNnctsGktsdXkhUzOnIHMz6J6v vj2SWdncqMzFlZ6bF1JheYpfgEOXiHQCImbdxNIQjwYP+eIjYe0o7VhKkEqZfMfzabWZ aMybCtOkeEbHqmLvSS+hamBqRU8CS8ZSAX88oArJOHOatcF5hKyUF89dnrKmI9J2J5ek 3zsSznv/8NKw0y2InOndS5HlkhsTYvMIvu4rhzOgwzB7Bv3GetJ5swwpNa4YkirhC1e8 /063JGTf6jzkwJWHT1quZPq/aBJhA4W1q3zl7XJ3ll2ZaCNYI5XSmKfQCtR1yUeIj5Hg q+MA== 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=MThhfi/+6K/LOJrqVDZeVBTVPExj3Q+f1CKmXTQaNyE=; b=nOrEN+D9MipiAd8F+JNw8zHIPZJAbm9tG5KAlgvQYSGoYhb6vei52QQH3VhRXgJkQ3 Qa7oQCRrGhPjB+QbldMtJKrp/D8bz6QsSC8cl/P9kJStbLwOvWS25kAuRY+g6jlTc2mo 2skf8rooJXHNDYiJx7NGeX9cQS84GtWVlsXnB4C1ATyqFpknRfFVmid2UFIh4ertiCvR dJ3JMz6rYmd9nySSX56OxpJcv0Yw/cJt6PySTzbkmYHPxjVUSFuP46VgDDj4YARrkJ+C o6NNS+t6W8I3Eil/K2wPHXfN59KwRAia4PTAW/J24vVvLRn1jNJoiDT+TP5N3yJH1k6q 9mFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AXOzRqyT; 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 hb41-20020a170907162900b007ade20fc415si6291418ejc.811.2022.11.12.13.22.26; Sat, 12 Nov 2022 13:22:52 -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=AXOzRqyT; 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 S235132AbiKLVVx (ORCPT + 99 others); Sat, 12 Nov 2022 16:21:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235090AbiKLVVl (ORCPT ); Sat, 12 Nov 2022 16:21:41 -0500 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6BDD15837; Sat, 12 Nov 2022 13:21:37 -0800 (PST) Received: by mail-qt1-x832.google.com with SMTP id e15so4887281qts.1; Sat, 12 Nov 2022 13:21: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=MThhfi/+6K/LOJrqVDZeVBTVPExj3Q+f1CKmXTQaNyE=; b=AXOzRqyTDqtG7FZH8oEjR5QhNTkyr2FlKau53ZFDhVib8/PNf3gjqWtsOM7WzW1POP Mcsr+vDOSi7xwYwij+2JrEfpTNWySGA1Fn0c68CsMxt+/w6pFzB1W6AUfpItAee/Bhou E9LrxymO110qQgsYT6c6heWr85C/3PQojXd5fWJeMGKdptulmEsNidex8RUQl93A1cRi t3oiG8QQ1xlDhrOSNb87f8L1vugHuQewTvX2FWwZu9zfNk0+wTwYdfxMbIX7W7zIZ04h g1w+I8471NbkxRzuu1D0xkr5EiVGjo+gOXdmlRUuWZ2BJ9NO5AsUiYXx9G5CXdApOOOv Ir8g== 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=MThhfi/+6K/LOJrqVDZeVBTVPExj3Q+f1CKmXTQaNyE=; b=vsxKS7KSnYwmo6p5Sc4xBmwgEod4AODa42MjNLKrlBhhSpM4OXhKULEPYND+kqfVUA f17h/LeS6eAzomrZUYvaeg0QkMGehy1eQVtI1trCglNrnFkPlEKIDoEEbB2wvfxh9bmk kgLDoofaxE7d/mQPQahEr2bOhdONy6uqKogGakLy/MQsYR92a7ilB15I8ObwGVC+P2EC ts/S/JGLGlmGGw59UWb9SiNUIEI/QYuBkO/XwVESFM+8WP3GzcZ1DnujvQkuG4Xqjj4U MgPVgJzrssZJ71exELy6+4JtwwVtJxKYkfouM+Wj2GbGCfYBmSc1JrnHT7isu3gcfHCA 5vSg== X-Gm-Message-State: ANoB5pnBSOVu+eU1b0cpg2b7ydEhM0rV/nQbDN8VOnOv1EKi2nuwFyv0 2Fr8k9TColOW3gjh45EGd4WtPJXJwYvuXA== X-Received: by 2002:a05:622a:59c7:b0:3a5:4c53:8923 with SMTP id gc7-20020a05622a59c700b003a54c538923mr6815383qtb.267.1668288096553; Sat, 12 Nov 2022 13:21:36 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21: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 Subject: [PATCH v3 05/14] serial: liteuart: minor style fix in liteuart_init() Date: Sat, 12 Nov 2022 16:21:16 -0500 Message-Id: <20221112212125.448824-6-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749326938859847551?= X-GMAIL-MSGID: =?utf-8?q?1749326938859847551?= Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 5b684fd198b7..047d5ad32e13 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -398,12 +398,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 Sat Nov 12 21:21:17 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: 19248 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432373wru; Sat, 12 Nov 2022 13:23:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf7eDzk60DhsvZAviK6u/LcSWwoKPWpWdSOV0zZNPmy8Ajj+oVLIiw9+c2dl9TyvNaVjj1j/ X-Received: by 2002:a17:906:e8f:b0:78d:3cdb:e7ee with SMTP id p15-20020a1709060e8f00b0078d3cdbe7eemr6168300ejf.134.1668288191686; Sat, 12 Nov 2022 13:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288191; cv=none; d=google.com; s=arc-20160816; b=EtiIhZ5EU+TNBtVAcH4z29M76X4VEL/SCbqqUtWlq83bmve6XhYXhdp0jV0bti0aar hpyjfQFIOcrEYhy6AulQB5PTse43Ft6m3jCEMY6No/fGyQaf2470dJBdgos9WwzMsn3W Y2Wr1QACfywCROJ932NePDrFO3l8m6Txq3wBASBN2GLZfknKTBxM0iZv9iNFSE9NZyJC g4if1vlSAQazwRxZ+1AH631IJPND6e1w69jPLOG+1IgPmw7nkDaYCpA86PrdIXns0r8v 4NXkTJRmVI+VT6eqMbOfGrVYFZUeGsFyIq9f1oNC7IGRlNdYRR6sgybVW0RArFeyeF/L T6tQ== 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=ffs7WthYcxxlp9KpB8gp7rdODwrO1odw2XTkcOVFYl0=; b=JCFRVqJ0M5M6kRFZKrD+bsvV99diZLjMTl9NlikKOzqbNsRDuES64R5A+Kw8sTwWxq HX2XIqn47l7S9jRADQWCIP9k90FOF8Ez3SRsC/qMXy2ysjE8nxtzRT4zSJ97woxeg+wN kd8CIt4Efl2atedo1DpxvhQTr0BoBZbJy7kE7JDAIrOLxXgzBmJUbTvDn3Ed4Fo3bcl/ 90SH3TMGmcaoVSuqa8mfidUMdynpyV/tL1GS8PwcyIkVrwbANXE1nTtUmB5IFsCe5Xx8 gt8AYY38CqPcsr1nLJV7vuy8TNJAyLHDqOyIrdzQhZ54wp4lAfC8N59gtIv1VH6L4/R/ cXZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fu7M1MXO; 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 jw12-20020a17090776ac00b007ad79c4f58fsi4355665ejc.120.2022.11.12.13.22.46; Sat, 12 Nov 2022 13:23:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fu7M1MXO; 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 S235149AbiKLVV5 (ORCPT + 99 others); Sat, 12 Nov 2022 16:21:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235091AbiKLVVl (ORCPT ); Sat, 12 Nov 2022 16:21:41 -0500 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C128315801; Sat, 12 Nov 2022 13:21:38 -0800 (PST) Received: by mail-qk1-x72f.google.com with SMTP id k4so5327058qkj.8; Sat, 12 Nov 2022 13:21: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=ffs7WthYcxxlp9KpB8gp7rdODwrO1odw2XTkcOVFYl0=; b=fu7M1MXORgQuaanuE/aWKr8EMJsr5jPdK4A9VgySyuFCJO9sus1ArdI+0pstFJuIUx /F87VjCTbqCD4c8EGTxzDnFvPRKFqOBY+v04r6u+K2K++MbayeZ0ecNf21RqnaJODqui SGwH98YVuq9LG8Q0jmuEwatdnHC9n+JmTfWWxeOo01Z8g3aPmOnET1AOFYzbMWkH5OS1 2Rioc67FOg5aIpRARvQbWWPWyQA5ph3uD4a7cnKxZUbv/6QE+gVzkA6ZN7EqCt1v3oIy /4hK3F7ed/6eAC5L+Q0IadSDF4lCVEd4pOsFRtPW2OAobjrjwFPLem8te15I7vkebhUw nfmw== 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=ffs7WthYcxxlp9KpB8gp7rdODwrO1odw2XTkcOVFYl0=; b=5d3+hZtuVeLpXNv9Jn+MQeZekyvygDW5OWT4aSHfG9EacfJ19YUirrTfBtcrWd1VCg eOYMM0vMEkrA/0TBElHYSRfdPHRmyqKmpD/zsiTlVr1twCLSJJy4OUxTjklIz/OBb8Tx zo9d9+2VvM4h8IYifzTGbYg/tV80GdNHs33iwFVuUlkkEccuVcNxxz4gULWhwfrYeqSf cYkDKYxrtGAtOCCiS3QR4OuTVhRY/LWDv7+pBi+iaCsAK3Hy4eG4aIrwjNppmFRh/mVj CMVLHARRmIoxAw1cv8UBzN2PtIUHtO4xk4PVvTw1cgvZrNAlITNJm2UboyQ2qwvL00EH KlPg== X-Gm-Message-State: ANoB5pnk6JP8RTt8noZSQ7QS7uaDWM8pD9wCBinCGicbh9cC5o2hzEtu u92U8Nb/ci5P2CvxVxkD+r6I1i1J/RJFuA== X-Received: by 2002:a05:620a:892:b0:6f9:60e1:bd7c with SMTP id b18-20020a05620a089200b006f960e1bd7cmr6128970qka.412.1668288097461; Sat, 12 Nov 2022 13:21:37 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21: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 Subject: [PATCH v3 06/14] serial: liteuart: move tty_flip_buffer_push() out of rx loop Date: Sat, 12 Nov 2022 16:21:17 -0500 Message-Id: <20221112212125.448824-7-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749326959211180966?= X-GMAIL-MSGID: =?utf-8?q?1749326959211180966?= Calling tty_flip_buffer_push() for each individual received character is overkill. Move it out of the rx loop, and only call it once per set of characters received together. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 047d5ad32e13..ff3486860989 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -86,10 +86,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 Sat Nov 12 21:21:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 19249 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432523wru; Sat, 12 Nov 2022 13:23:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf730AxAX76gBabYMXAUAef6Kr06QYeDGYeJCKhPN3BGEd8bHq2ZM/93wwIH0hhA92fjMeCO X-Received: by 2002:a17:906:6c8d:b0:7ad:f2f9:2b49 with SMTP id s13-20020a1709066c8d00b007adf2f92b49mr5760116ejr.94.1668288225855; Sat, 12 Nov 2022 13:23:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288225; cv=none; d=google.com; s=arc-20160816; b=w0TLGfaufy/01AZD/t3vwJgZ7qYlko6DzIJ1FCi5Pfm1/fEMqijzIOt/NaW7NKyuRs 7fHo+FX4ASm2pcoIb5vIG4t3QM+Y9VwVkS+yiMFGD6lmACkwqveSMXBytJIgEedsdNWX 8MH481Jefmez1nAl8naEWOo9cz8exQFDuCP/c1rAjZ9G5bI6C/y4nRHoEejbKV2Ijkqd av9CMze1d9GW1PkzMsQwJ/2jGcfqwOF6vtm6jXM4SOtRTlsp+DXgOtjXNFFnCCubqON2 o9T6gXg1uLoNtJdMGonMYsczIkMy3LG6v2PmuGxk8XwwvvpQijvCOEJHS64zDDhaAM7z Vk6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lj3jgN94Up18U7wVvpj0Zgp4+ZbcXYE4CuLEGeta7KA=; b=a/I/iQvL8h/QD0BLL9OV5S134/FC6/QOhi9HqiBWE9gzPSlOqAFHsC0mocJsG9zHPs AW688TkrNNLZwDlDsPlZIIMC5BySZCT0gqya5VxNWHxP4ewi6dtc5vydOtApxBzBHHeL EVyhNlM3U1dZ3TYZ+QL8UcJC7Hh6g/2P0AT7BbrswvYrSFJePWmtVSCWtpv8582/k9hB C9KjlGkHzx3Jc5Qc0EeNz+YdBdkaEEju6lI40c0jwyHEBLGrUC8HJVDNTchSPSdgWIR2 hF2g5zCN/UBkf8ilQOMLSia2HM3Dd3UuC9p1YsFAR7R8Ty+f0iFLJTL7wBISF/nwZjum wSNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hT5YiZaC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a50c242000000b0046721c5b7e0si5170514edf.511.2022.11.12.13.23.21; Sat, 12 Nov 2022 13:23:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hT5YiZaC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235176AbiKLVWC (ORCPT + 99 others); Sat, 12 Nov 2022 16:22:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235092AbiKLVVl (ORCPT ); Sat, 12 Nov 2022 16:21:41 -0500 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F2B715A1D; Sat, 12 Nov 2022 13:21:39 -0800 (PST) Received: by mail-qt1-x82f.google.com with SMTP id l15so4874485qtv.4; Sat, 12 Nov 2022 13:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lj3jgN94Up18U7wVvpj0Zgp4+ZbcXYE4CuLEGeta7KA=; b=hT5YiZaCxVZ1nPy9zMoXb3qQqnPNsZ7o9pju+19OsVVMRh096IvhsGw3wrI3WyLprx qdPk33wgAo8ELhrFTjh2rJ6nwlND9hL1trHMue0kGpziwDe/aXDdF5A2OAztsgcbx0KP Devs53QoRNOxuZgtr9LpArCBscEp1EFIfWc+Wyv3CtrjVMAZaawDoetYCdxvKkAIXK+p 9bltTnJY5s/ewqlCSBZchvfwRncppJ3X2Q13ZUWTkSl1J1V1hikyiJ7EuSqzDPfs6J42 fk4qATFyjlt2NIP+fFBwR1ezjd70Ex5775RmWUNZKvqFjJYSuQJMGm3sO+iqGRD2Oco2 2lVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lj3jgN94Up18U7wVvpj0Zgp4+ZbcXYE4CuLEGeta7KA=; b=esRuAhsIkXxasbv3VU+/CPPofmVzwoyrT/cBYNwuG1l0SpbpwmrQwVsv5YZwFv8Kw6 Dx1rD15Y3z4JMOB/7pozgKyzADyOOM8ptoM3ziK93ncBMae2Gg57FgwzkabPVPo+DvMg S3v4SzG4nosa8KPjigJKEg10yGTaqGVs2sOVD9aN4hsUMDRDZNGn8z9x7NxFIRgM9o8r PsDyChdt2w32tlGISkXUf2Tx7BKSI0vYykpapOmaywcVi22C50jp4Lsn0J58pkomD4VE 8SeZ5l0VDM28AVPm+4FR4bxNVkkgxdPqN6EXi4uRi+4xUcwekd8Y+RodIwQzqWV5FIae 8oyQ== X-Gm-Message-State: ANoB5pnrD9wbFNQv0L+A565zHMdQeLMGTE0WMvhSeuPQYqcjgRnRvxZz VyNcmTzY6vLVGV4DgOvyeA9W1LnBTwAYHQ== X-Received: by 2002:ac8:474b:0:b0:3a5:177d:d9cb with SMTP id k11-20020ac8474b000000b003a5177dd9cbmr6770535qtp.64.1668288098440; Sat, 12 Nov 2022 13:21:38 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:38 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 07/14] serial: liteuart: rx loop should only ack rx events Date: Sat, 12 Nov 2022 16:21:18 -0500 Message-Id: <20221112212125.448824-8-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749326994866173518?= X-GMAIL-MSGID: =?utf-8?q?1749326994866173518?= While receiving characters, it is necessary to acknowledge each one by writing to the EV_PENDING register's EV_RX bit. Ensure we do not also gratuitously set the EV_TX bit in the process. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index ff3486860989..b5ab48aa35cf 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -81,7 +81,7 @@ static void liteuart_timer(struct timer_list *t) port->icount.rx++; /* necessary for RXEMPTY to refresh its value */ - litex_write8(membase + OFF_EV_PENDING, EV_TX | EV_RX); + litex_write8(membase + OFF_EV_PENDING, EV_RX); /* no overflow bits in status */ if (!(uart_handle_sysrq_char(port, ch))) From patchwork Sat Nov 12 21:21:19 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: 19251 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432571wru; Sat, 12 Nov 2022 13:23:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf7NkAutHCOaqK8fFkh2YqXzTWaYKlOHr1e9lgpkTut+qSVg2BcokAeevAqytpuXHBUw+biE X-Received: by 2002:a50:fa87:0:b0:467:4a80:719b with SMTP id w7-20020a50fa87000000b004674a80719bmr6659089edr.174.1668288237224; Sat, 12 Nov 2022 13:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288237; cv=none; d=google.com; s=arc-20160816; b=kYqHZIqYbadAUUb2m248nfLYsQi9cDY95IgtuC5lZ2u3YN7ffOMTwZfNl1X11v95nt aKGmMUvBUlZklbxG8s6IaaVAgFSuTSa8vKjj4cFOILmCc2p1ZemI8SQPDVepSC6w/G80 /8wEVEsy4NNfSaNda1euOn4oAm/VrKF3mTpTOnnfEbWy68cXCauxOd2sARJ5GOWEYFKO Y0mSh1Z1uHzVIRN1IsDs/ejBnvXZ19RkmkfTRUSDpm/5O1JWwQ4wCZzWQr8knJtpMAdl aFB6nyWWRzPWcDxUh3Hr3T4Lat13Lq6meKdg9ZVzE1a1OtHAnjThutmRAWX3c912y4DD 3r1w== 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=ysSI5FqkSkAdCqfOrlzY0olMSzKAxmyo3p2qEMQhEV8=; b=sbMuQJosU3/HM0lgULZfRFiTWj1YGS0uPuh5RX/e/ibAS0yKdqxl2bE4KgdmI3F+0Z t4ZzSD4NQOJCpkyuMasGms3gJyAnGk8eIdeb0lF1ms/rhC/SGOQ2cg1JAay7p5ib5v0T GggSoHZXlFmfYgBOPqqJ+PsOF+TkePo5dgiKiUw6bNaWJEROVzmYJr5MmHkSxyR9GUZ5 j8X1tNs37IN55OlmNypsBxnloFH0OsP6Nuw4j5MdVT9AOmJtzGHQH22DzHIl7J1daNKn bA28XNH+/G7+l0hh3iF74bMe6WcLoSmE3TmQM88NqO7aHAQmdha6W4ABWNnj0LLTqvvG aXzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZeyUCP31; 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 ds5-20020a170907724500b0078d4962a32asi6147294ejc.961.2022.11.12.13.23.32; Sat, 12 Nov 2022 13:23:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZeyUCP31; 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 S235092AbiKLVWE (ORCPT + 99 others); Sat, 12 Nov 2022 16:22:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235096AbiKLVVl (ORCPT ); Sat, 12 Nov 2022 16:21:41 -0500 Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71A4115A36; Sat, 12 Nov 2022 13:21:40 -0800 (PST) Received: by mail-qk1-x732.google.com with SMTP id d7so2946169qkk.3; Sat, 12 Nov 2022 13:21:40 -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=ysSI5FqkSkAdCqfOrlzY0olMSzKAxmyo3p2qEMQhEV8=; b=ZeyUCP31FCfmExvkf6Z0PI3w/Y3U89wZ6yeeShdpc9LKg74ByWcgDc6K2MlMp+L3vp aBgE7tlx/NrajJNENJ9ZTtfQ10AICFYsDmvDmhMx/P991C/a+GfbpSWFs3/GGTXPzaja GVTA5/NjS8EbKhFKOR9T6LQXFaMpgcY/5uY5a5xC/jVJTLHlublOHO77C0L47/GPoIlX OIe4k0j/iqWSv7jPkEoTUu8nfuhrhGaJJaN8GWQV9SzWP0bISpZjZmNw6ropLOkOQd27 oG8ZNmZ5eki4OWdErFlGDEXGg25/AW8fzcFHwZYehthrg2ZWjMwZB8AN305JrfodBWX5 uZDw== 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=ysSI5FqkSkAdCqfOrlzY0olMSzKAxmyo3p2qEMQhEV8=; b=NFx3Q8hRDD7WAItUEaY0zPwq8uc6LQVMz5XyilYCTkajX7aF8NvdFvFun0tRGamEHi PH3+C0NTQ2UsUSn2YXA4chMi0nh5KQ0Iktp0vc4A14NxIFw1eDTKsyBST0YFRcqo0bVD 9ZCqW7GEUapDR0QKa+UTUgtt0nl4E/MrmKCKJ15YDzq22za17xHGbZxx8uppqrzA5kyJ 6Tq3AzkT5/4HyisM5GcZb+zhj0ZIzB5GmoKjYVbVybPR6H1Q7wovQgYP5HHBpDYV9RE2 6w/dQ8OyZrKKo6iIJ4MIUETVxnaUQXKHah07Uwmwm3iMtlaw8P5x7N1NwlYNQGUQn5so y6+A== X-Gm-Message-State: ANoB5pmz9yW7qFb69i0MrnyYkAcxwVVXhcqVjsFtwzfJWENGOjY55Pot 5OYOqOrwCGmc1lDYkXZNCCDkIqseI1VLTQ== X-Received: by 2002:a05:620a:179f:b0:6fa:3f37:5af with SMTP id ay31-20020a05620a179f00b006fa3f3705afmr6091048qkb.572.1668288099339; Sat, 12 Nov 2022 13:21:39 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:39 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 08/14] serial: liteuart: simplify passing of uart_insert_char() flag Date: Sat, 12 Nov 2022 16:21:19 -0500 Message-Id: <20221112212125.448824-9-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749327006913103488?= X-GMAIL-MSGID: =?utf-8?q?1749327006913103488?= Simply provide the hard-coded TTY_NORMAL flag to uart_insert_char() directly -- no need to dedicate a variable for that exclusive purpose. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index b5ab48aa35cf..e9e99d6b5fef 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -72,7 +72,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; @@ -85,7 +84,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 Sat Nov 12 21:21:20 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: 19250 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432525wru; Sat, 12 Nov 2022 13:23:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf4eFYzRxvfS7Z3JgIKxF7hCtN2C81zLe5QXIY/7S0Cg5hiYRCFZQ/K0HoeyTbbxKu2PbgFw X-Received: by 2002:a05:6402:12c2:b0:467:74b2:e17c with SMTP id k2-20020a05640212c200b0046774b2e17cmr4753604edx.344.1668288226532; Sat, 12 Nov 2022 13:23:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288226; cv=none; d=google.com; s=arc-20160816; b=izSjbOZkFT93FIN9U35Ypl/7rjVRLrqqaiutLsjGwHXnxmWJZIjutkoYeOlRy1j948 IU8M7hkr5AXWg1yFT7FNZxZYuXUTXPSx0vSCi0PoUW+Z2AZQq8Eg7JM6kFJxZgRPlXvd pLh7W3r1fBj/Tv/9JV5GG3pyZOQD1KWlCKTXVfFYVty6CogFpZscJm1g6KEtblsbrFAt cJqCLRIm2rY7uxJxnEixJ26nGARRqgY9lHFqMLgz2TiqTw6UlYyvuTL7VkkmwZNFpc/F xZ7D2lEXt8uGphCu4k3BcKZm41+Xlvagnh3/X2uPKybIeaPJcGerLWn+o/6VDQWfdzmK Xcpg== 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=5/vT56mbrwM9r6/VHK5niKCx7aUlk+R45UC8FZrUKyA=; b=pivHrTnEI6hXQHLX0mOMvKto7fR9FidriEKzlX4NRHRop3oUmNQNbJEBiqGOAP37bW 37AOqtCAc18OY0SKNwbDbBU6OK3zTCGqTzni13lLR2CDIyhR1ILYET2mRqr6Ow6pOUDh 6WLrSgUxbIHCmh48NWtCTNoAidIrsK4Zrsvmb8ONmICXLqj5HljWCv9+fGhUUw6S+ts2 dsPDOCGoELR7x+1tlRRKfdNpGnLNkTPGKPrzElwDz2IFM1NBOILkUYmMOXxG5J6tA1OI h+xixufdFW732hWiMV88f2BgLE+bCmtxug+58x1chXjs19Y8qm6s57nzJRfN/KLOe08K V74A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LRpW5kHw; 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 bv9-20020a170906b1c900b0076f0940cb28si4331027ejb.175.2022.11.12.13.23.22; Sat, 12 Nov 2022 13:23: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=LRpW5kHw; 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 S235138AbiKLVWI (ORCPT + 99 others); Sat, 12 Nov 2022 16:22:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235116AbiKLVVr (ORCPT ); Sat, 12 Nov 2022 16:21:47 -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 8541E16591; Sat, 12 Nov 2022 13:21:41 -0800 (PST) Received: by mail-qk1-x735.google.com with SMTP id x18so5339982qki.4; Sat, 12 Nov 2022 13:21:41 -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=5/vT56mbrwM9r6/VHK5niKCx7aUlk+R45UC8FZrUKyA=; b=LRpW5kHwxusY1glBj850u+y7jQrP+SZ4AoSXheoTDc/JGlIHoxkT9bc9bSuF7S3jLG /Ki2s9AkagchVVQJKhqcLhqIJvS4JR2XP+ReMt6Bpb2zDphebqhcEJE28YAsy7+mzuzj xoE2gD6w9NnGjXVWDkiBH+SEhS1KKDzOi8btIjN/Wvu8HAewxJakolR80VC9wH9kINiu Y1i0J5D2pZ6aFQ40qaYrEidgql8uVwWmxBPfD9nETNI/gkeJLLw8ouXePznGbijjXwV4 XFOV+sWwQhWcARjjRQsGclr8rtPhwofxeyX+486E/S337wFeDIEUwuQwVrvNRb7LjobI 4rQA== 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=5/vT56mbrwM9r6/VHK5niKCx7aUlk+R45UC8FZrUKyA=; b=tno0HuZgkOUlrKmM18UVTRAzP1KtlZ/krUACK7wwJm3LsuMayshTT/A6VDN3cEpxJm JX03x14Ac5ETaPCY0Wkfi+eVbzOmNnB7bbuqIaM+2j4rfEdS3nv6ey2yJtJjQC/XGUvl HGvcvvDZir6KLtsckUXx+OXRFmvj9pqJIUsGhLfLSviZXEwA0N/gIU+D0EyRlmqpcjWc w6FxCFQ6djRHRo6PxZ2kyrG7DsHFMhQppcQ1t0VMvwxqg4aIxID2JjMoGsAAXle2JrCB 0s434Lc1Pidat8iGr3l/k46+uqD69ZvS3IPiL/ld1FiqQPVeqzj0Aog6vZBLZNCnRkXi ue1w== X-Gm-Message-State: ANoB5pnn0oj6GK98SKOx8GMavCiP4qXlzL+WezBwUmrjRLJ5QXzN4T22 Q0jRMQx+xNIlU9V4MdsFJvA0S3c9ZakG1Q== X-Received: by 2002:a05:620a:a15:b0:6fa:19c4:a6c7 with SMTP id i21-20020a05620a0a1500b006fa19c4a6c7mr6192955qka.51.1668288100251; Sat, 12 Nov 2022 13:21:40 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:39 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 09/14] serial: liteuart: fix rx loop variable types Date: Sat, 12 Nov 2022 16:21:20 -0500 Message-Id: <20221112212125.448824-10-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749326995367964258?= X-GMAIL-MSGID: =?utf-8?q?1749326995367964258?= 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 e9e99d6b5fef..974da0f73257 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -72,8 +72,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 Sat Nov 12 21:21:21 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: 19252 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432618wru; Sat, 12 Nov 2022 13:24:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf5xx7EMsBHCFMoBME40ij3y2E/7B+2t8L9JFoW22h6Eryu5PmA8LuxdXDZ6Zgw41gkU2Xi/ X-Received: by 2002:a17:906:1147:b0:78d:314e:b0fa with SMTP id i7-20020a170906114700b0078d314eb0famr5718114eja.370.1668288248233; Sat, 12 Nov 2022 13:24:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288248; cv=none; d=google.com; s=arc-20160816; b=srDCeFQOvjKFezpjJGzmS0PG21tswnmphIzDxubiPpYKRl/mz0EokDsDxdx8a/vaCt SUVXA2CrsvPVCw2uUVUace+Q8aSfY8FU0iZJi4I5eJffDemVL0VESu1DkWxaREjXBSIr NJt7o5xTGz9sOa7ujS/YYK0lrX32crYSVvIs8Qz9tKnUN+d4hFY1J8aSbBoeEbWyLGTS Gk4xshnCokNysNbGd3uThhWNC2uaP8M9g0ZoHFjByUcK50FTyJA7z/Nwh63QJ7za1er4 C9Lep0/RPw72/RFuGkzAqKCFW6KlkeRyJ9gTeZG9NISOEE2ahWi6w2bOjN7kC1xTnDtz fMuw== 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=v7F9S0T1jHPDEpUbaqxSzeQEs/x70iRlU8Bxi6Hwul4=; b=D4jH3/cYB5bhmYJUM8gRBn3tL9D1H9BMXxuXvoo0YbDBSFGZvx1eF2//bIoQet0cGP sc3u+1FKJEBhrXjRrgcXBcDmVReDjnBWkwVBcM5KJPzPYH77pncXZFl9WKnUnG9Thdmt jCVNpkwE5By8lpVrHYvU6sfW1kznyBvuPppdQ1GkQMUkIC8VvmE4wNVP2AydyUFLtB1x cScKfD/WEiqSDunVGeY1f2JDgKZvHre4hCbEQaco60faFjNGCIr7QrAY80EseNOghOt9 xE9LyLNOzOUfY4dJfY9R0FOibqtyKz0vs8RWSIxT7sPXRcnbEyi7aRT/m3+wS8u9hgfl h3lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M7PJUojq; 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 qf17-20020a1709077f1100b007a39ad3da43si5334192ejc.714.2022.11.12.13.23.44; Sat, 12 Nov 2022 13:24:08 -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=M7PJUojq; 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 S235016AbiKLVWO (ORCPT + 99 others); Sat, 12 Nov 2022 16:22:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235119AbiKLVVr (ORCPT ); Sat, 12 Nov 2022 16:21:47 -0500 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0A7515738; Sat, 12 Nov 2022 13:21:41 -0800 (PST) Received: by mail-qt1-x832.google.com with SMTP id e15so4887341qts.1; Sat, 12 Nov 2022 13:21:41 -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=v7F9S0T1jHPDEpUbaqxSzeQEs/x70iRlU8Bxi6Hwul4=; b=M7PJUojqhBgBIoTiJebAXTjImoD1KkEFisgCsYlzPUNHuCQRlkjwR9stkG9PF7z0x/ BZzqxU1PyElsSgNZpC+9oRV1gbQ/4Duo2N8VEEs8aD+rr3CjwB3d9OKRrfmoX7gZh6pe dZAG/kNmGWEYbtBjN9gHSwEviFgjbCHJHizx9XpyRWyT8yLDlDpCoVq6azmZcUY/nE+z hVSUA5ykZpvZ4FZZJ7+Qv5hLruFoE6NiqIEHxAct9r9hscqzri+4WDCrrcjgpt8KtHSW 0fy/c/UYYrlXcqi9RsSuK2YpRLGMM2jXGNf03ZIcCY3x89HQBXB4QyJ7sb5vJtjrq7Kl hcEA== 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=v7F9S0T1jHPDEpUbaqxSzeQEs/x70iRlU8Bxi6Hwul4=; b=xV+hnMKd4iMm8ZhJHE7iFWOY/SL4DEFA+Ic0IJIzAbwDoEt6ylNgouDwG4sszt89oJ 0IcFbJQBMph6gvMxp0NeOPtaDURyh2RhbDsJDWLFQycd8w4PRr6XM/bmv5kZNVximjrG BpZsw9pOJ+G7quV02eVNK4YC272JDyw93bN3qZHhR8p9GqWwIIYi6d7TvZgyFIigkkRE 3SZYoqdgUeptwIbvDI6/RJcPyaHV7cEcJXGds7d3aRKanAoMl8MtZzJsmWYhyrjBd54O ExesEy+6NZfmu4mI8eRCRsBeaLLUCPJEIQeZnpHveXbzl4Dbes614B3d4n0XObxWqHMr IaCw== X-Gm-Message-State: ANoB5pmFTX4YcweYKZKVQotjq53CLY6CrvannIMk6V52Qj9ob1MeYDzp xhXTnWirwgG9Oi+BWP8ccoS8tymzwulirQ== X-Received: by 2002:a05:622a:1714:b0:3a5:2029:df77 with SMTP id h20-20020a05622a171400b003a52029df77mr6659600qtk.225.1668288101159; Sat, 12 Nov 2022 13:21:41 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:40 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 10/14] serial: liteuart: separate rx loop from poll timer Date: Sat, 12 Nov 2022 16:21:21 -0500 Message-Id: <20221112212125.448824-11-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749327018156397508?= X-GMAIL-MSGID: =?utf-8?q?1749327018156397508?= Convert the rx loop into its own dedicated function, and (for now) call it from the poll timer. This is in preparation for adding irq support to the receive path. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 974da0f73257..172ac190ba2f 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -67,10 +67,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; @@ -87,6 +85,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 Sat Nov 12 21:21:22 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: 19253 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1432844wru; Sat, 12 Nov 2022 13:24:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf5BoxtN4sXger0JtRjs5tOVpVYrUHSUjgJF+tCKgy3/FpzDUEO5bbEFxHGU1KMdieWoKasi X-Received: by 2002:a17:907:7f27:b0:78c:b8b0:9d35 with SMTP id qf39-20020a1709077f2700b0078cb8b09d35mr6145160ejc.586.1668288292608; Sat, 12 Nov 2022 13:24:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288292; cv=none; d=google.com; s=arc-20160816; b=F7x+etri3DVnBP68aYHQH07qYvajPxyhoWwdTphiAsza1QN4eqLEDD9pWnj64yCh4/ GWG1HhnWqbpHn2RBRGwT12PdRrwtl4V315h/6ZMOFFdRFcVxTOkdVa1xwRFuBYxj6MWx vTjkITezEvAneO1nILGHmZNCYZjRT+SazTeQXqmoe/HgOu6xqXiVQq8LGnVA0B28vM6p j2zc64stTSVJK1udSTiH4bLGUmEL3hlnc7wP5PJCZofzEeUPsbXI1usPciwY5isyPnmH iZ9YKEu69WPy2/parbc0WwBjZBFI9vkLolbHc8Era0hhzxIGSOzcdY71F7IQoiJ7asuL 1Ysw== 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=fmWYDGpb8IgSQuNUIhuOc4E9EPEFJS+O6JKsCfcl04A=; b=0iNC1ADeaMVdP9jlUGWm4WRpHsRxAevhHs7nkrcD525H9sSGM780MsCNy0h8jthYdn h2wJ9IDb7tN13gFpDdZDNhkhAW8NocZaVDtossdG18PszCC3GgWpCGWNXMhybtiMv1Vb SFuar7pyACU6y4lRZ0hRkAcIvutE02NYPOXjyIu8D7q1zU6WmjQq2dE1U6ByfH1UxDv+ u4HYkh8rQp5gVN4Y9F7zSxX2V0CE1Nm644tZ8WYUMBCJ2UP2NewKpxnSDKgwlKH+rdcK +Gbb2SdPyl+9rqGk+mu0cAjKTT27Q4BJV0QckopcqXzD8W5xcUeBSWzEX3ZbvjZ/j8oH qvGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cvlZfzUO; 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 l8-20020a056402124800b004573107a5basi5210147edw.352.2022.11.12.13.24.28; Sat, 12 Nov 2022 13:24:52 -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=cvlZfzUO; 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 S231814AbiKLVWT (ORCPT + 99 others); Sat, 12 Nov 2022 16:22:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235133AbiKLVVx (ORCPT ); Sat, 12 Nov 2022 16:21:53 -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 46D4717E27; Sat, 12 Nov 2022 13:21:43 -0800 (PST) Received: by mail-qt1-x82e.google.com with SMTP id z6so4875247qtv.5; Sat, 12 Nov 2022 13:21:43 -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=fmWYDGpb8IgSQuNUIhuOc4E9EPEFJS+O6JKsCfcl04A=; b=cvlZfzUOE4fIt0ylPCWhzQf5qAHZnEqXbhj8O+qwvQOTp4EJud9fQeAEZPphl3kdWC KXVmf1d4Cp4xQGd6zioJfGaWmsThJ/ry6Hh0tsg7FkQJVMzAD5cB7nFDi9Lu97XAQWSt rIIQ8v33Hyrywe9aN32h69DZD/61u/oKTT/tApu1+E9njOKD9CxGhTgw1MpPh7iCk1Zw 1RoHqqLgjnCdanRFmdemtNvyuJYkW/LiE3pH3+FxKFSRyKJ7TZVoVfPLrI0gMltOZeSS 9hyggEiXSseJvROugFk6g/hbl6lZGA4RikQYGrmcZBSi7expFOcDLtWwH+84m3tsheyo 6g1A== 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=fmWYDGpb8IgSQuNUIhuOc4E9EPEFJS+O6JKsCfcl04A=; b=z2C/v2+ZUjC+vHj2Z6tgorPZqRTisFhfzZv2WVEyK6cY6N61p3JTM1StTmKI2orHO5 1Y0AHRQnld30vddi1u8Sc4R5ysVlTxi0kiy/za3PVUmiOmW8zY2652cq/9qvMq4jI0J3 ivAn6cYMcI9K212hFQ2CctKQQNeKsWVBTedkHRhulfOqcrFsTznI5l4vVEEfX/+krBCa Nj7lGMtO+xD2wuNV6TOlADEr54nBcxp7yhR8Tyvb9EwMxib9A4UvoI5GOGmcsFEWsulz aJ0tlAgepWIRdvXkXmT4kRsBfBFPQesWu66nHbUewcwgFb9NMpWPm0AWIfIDdkPE7ExM X7hg== X-Gm-Message-State: ANoB5pmZKipNdMltnZ9gyBsCRedk+hdgOmMpOgYuX6fgB36zoB4MtWkd S84Mm5kDB7Ri4ACD/YyN7y1AWbvKFNAzyw== X-Received: by 2002:ac8:118f:0:b0:3a5:9191:da4c with SMTP id d15-20020ac8118f000000b003a59191da4cmr6741736qtj.540.1668288102087; Sat, 12 Nov 2022 13:21:42 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:41 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 11/14] serial: liteuart: move function definitions Date: Sat, 12 Nov 2022 16:21:22 -0500 Message-Id: <20221112212125.448824-12-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749327064813850869?= X-GMAIL-MSGID: =?utf-8?q?1749327064813850869?= Move definitions for liteuart_[stop|start]_tx(), liteuart_stop_rx(), and liteuart_putchar() to a more convenient location in preparation for adding IRQ support. This patch contains no functional changes. Signed-off-by: Gabriel Somlo Reviewed-by: Ilpo Järvinen --- drivers/tty/serial/liteuart.c | 98 +++++++++++++++++------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 172ac190ba2f..cf1ce597b45e 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -67,36 +67,6 @@ static struct uart_driver liteuart_driver = { #endif }; -static void liteuart_rx_chars(struct uart_port *port) -{ - unsigned char __iomem *membase = port->membase; - unsigned int status, ch; - - while ((status = !litex_read8(membase + OFF_RXEMPTY)) == 1) { - ch = litex_read8(membase + OFF_RXTX); - port->icount.rx++; - - /* necessary for RXEMPTY to refresh its value */ - litex_write8(membase + OFF_EV_PENDING, EV_RX); - - /* no overflow bits in status */ - if (!(uart_handle_sysrq_char(port, ch))) - uart_insert_char(port, status, 0, ch, TTY_NORMAL); - } - - 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)); -} - static void liteuart_putchar(struct uart_port *port, unsigned char ch) { while (litex_read8(port->membase + OFF_TXFULL)) @@ -105,25 +75,6 @@ static void liteuart_putchar(struct uart_port *port, unsigned char ch) 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 */ - if (!litex_read8(port->membase + OFF_TXFULL)) - return TIOCSER_TEMT; - - return 0; -} - -static void liteuart_set_mctrl(struct uart_port *port, unsigned int mctrl) -{ - /* modem control register is not present in LiteUART */ -} - -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) { /* not used in LiteUART, but called unconditionally from serial_core */ @@ -159,6 +110,55 @@ static void liteuart_stop_rx(struct uart_port *port) del_timer(&uart->timer); } +static void liteuart_rx_chars(struct uart_port *port) +{ + unsigned char __iomem *membase = port->membase; + unsigned int status, ch; + + while ((status = !litex_read8(membase + OFF_RXEMPTY)) == 1) { + ch = litex_read8(membase + OFF_RXTX); + port->icount.rx++; + + /* necessary for RXEMPTY to refresh its value */ + litex_write8(membase + OFF_EV_PENDING, EV_RX); + + /* no overflow bits in status */ + if (!(uart_handle_sysrq_char(port, ch))) + uart_insert_char(port, status, 0, ch, TTY_NORMAL); + } + + 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)); +} + +static unsigned int liteuart_tx_empty(struct uart_port *port) +{ + /* not really tx empty, just checking if tx is not full */ + if (!litex_read8(port->membase + OFF_TXFULL)) + return TIOCSER_TEMT; + + return 0; +} + +static void liteuart_set_mctrl(struct uart_port *port, unsigned int mctrl) +{ + /* modem control register is not present in LiteUART */ +} + +static unsigned int liteuart_get_mctrl(struct uart_port *port) +{ + return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; +} + static int liteuart_startup(struct uart_port *port) { struct liteuart_port *uart = to_liteuart_port(port); From patchwork Sat Nov 12 21:21:23 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: 19254 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1433016wru; Sat, 12 Nov 2022 13:25:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf5w3BZ0FHLpy4lSf1Z5kPQfpLOD4z5EpFaqCAA4NsG+Etqj9u8lHvB9e2SERo94411PI6nA X-Received: by 2002:a17:906:dfe4:b0:7ad:8bc6:46e7 with SMTP id lc4-20020a170906dfe400b007ad8bc646e7mr6631503ejc.28.1668288333559; Sat, 12 Nov 2022 13:25:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288333; cv=none; d=google.com; s=arc-20160816; b=ZaBA51BRprj3BtXA8/8BVnJoo4Gu0x48BSM6DiEWWJaMbsWFVwOHerJRk6N5eVQhTx wnuqqID2ZWo6QCFrqCl6jrcdztXBd9x7FglgRpWGKftEj1gzEu75ernWTcMOcuChoVFk TjjrUbpVYcd844E8VRQaZijN18f+2rVehDB9+nRDQlcC8D4/t4Tas5hLZru3Zdq7JmmN IzY+qNTKhpqz/GablF3q0Uhf5wmNQRYyaccWO5BYedW/HiuSqDj9QMk/I6hATeI77soB t7Qk0oyRms4zzfDNHhAk1WpCbJumF4o5CK3Ic/WwFUoNAEDwDImsKz+9dPiOkqh0uIzs o56Q== 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=K4iHEj9GzsVhhsWXwgpXJUYpNlSEHLmzm/JsgBx/hzw=; b=wrB8b6Att5423MXgSokMU/66O7BJYts5DD9TF9CEH1x2GCvMK4nOa1sKdVJjjSO78B 2I/5Bt2wP3IfryIccEr1n/bjw6cXgw5xEGo2tXYUhfpt4WU/9VGQ1M/Z878h0HPV20iP txgcpkn/iYwhtdg4NiDGV3Lvu3dCymXV8uki0sqixgIHpR3y8nmfX49peRlytZFhVsTU CIady6tT2CNHWqw3dOYxz738xUa2tv6ysLd/KlBSc6GVweVgHYRLhLOKuHl0PHLTbZQe 46b95xq3wr3KJWGemHuxA8ZphHRSr25fTCUoX9iE4iHgDtSqZoXBs9iuIiRi/htKs3KV Qo6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EZSQB4sz; 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 cs21-20020a170906dc9500b007ae86742c39si5764673ejc.504.2022.11.12.13.25.10; Sat, 12 Nov 2022 13:25:33 -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=EZSQB4sz; 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 S235219AbiKLVWX (ORCPT + 99 others); Sat, 12 Nov 2022 16:22:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235145AbiKLVVy (ORCPT ); Sat, 12 Nov 2022 16:21:54 -0500 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31D7D18E32; Sat, 12 Nov 2022 13:21:44 -0800 (PST) Received: by mail-qk1-x730.google.com with SMTP id d8so2115611qki.13; Sat, 12 Nov 2022 13:21:44 -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=K4iHEj9GzsVhhsWXwgpXJUYpNlSEHLmzm/JsgBx/hzw=; b=EZSQB4szI1sqawbShitBG+hzdiK94qL8rotIka8T4R2AOXMEXnwnsPqjgi0OFSykcR Wj4xQgi5MSxXfhOOaNDiM2udoMgu+tPEn+eygOQeSbf2fE+0isZpODtq5sInTDiNFfye yJ4PG6QLktQy4Tz4QvFL+F2xMu6f05Xzl+PJcOX0PKSwhSE+QuTgeVO4oO1VeG4v/Vio E4KRfk9aL48mSGN+rA0AD4VYJLfISEQP4jrCdHnN/Q3v+QpJum/aX6sb8O3Dgy/210Ld mudcSj1Ci/sDA6Lnp91oChlRxHP9T+ZOtGiDz6lJjqo3Oj0kXH/cEvso/8OtCmyWtNk1 YLJg== 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=K4iHEj9GzsVhhsWXwgpXJUYpNlSEHLmzm/JsgBx/hzw=; b=42djFdXAMGNw/iua9V+o9Qcz/Tj24F63EFa1kSg/nh3nlaKNaDXANUQI2weQUahW+j HjxPPpzi5Phg35X/ZJW7TYfx6YI6YhqZOaUekeoCjcgGAP9AKjkHyEYFS1ff3dmuGPZs X4gv5Ga9m14rrAOoVROqgxm66ath6f0joAxCJrzjpdE6rhSZ/ttnDAQJpCSiJ3/B3MTp fgbkW1MHGzKI3aw7zyIpc5MeaiFFa+oCF+pxFas//bg/2/vBD8U62/++EwOmF7TUzjog gdomPSytF/UuS4stg9coAkjfIzT0Z5l9ZcLXLOoLWu2HR2WKJ7I/VzqEhkmeaiVxIQsH 4+UA== X-Gm-Message-State: ANoB5pkNPsmea2QhfUoyNXbCOg4GTBkjzFsacdPMDhlEPH54sChTOMVi GlhvL9hD7zKelVe2RUqiiFzAK1YSXYkFDA== X-Received: by 2002:a37:86c3:0:b0:6fa:d7e:7b4 with SMTP id i186-20020a3786c3000000b006fa0d7e07b4mr6006823qkd.373.1668288103069; Sat, 12 Nov 2022 13:21:43 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:42 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 12/14] serial: liteuart: add IRQ support for the RX path Date: Sat, 12 Nov 2022 16:21:23 -0500 Message-Id: <20221112212125.448824-13-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749327107847950396?= X-GMAIL-MSGID: =?utf-8?q?1749327107847950396?= Add support for IRQ-driven RX. Support for the TX path will be added in a separate commit. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 61 +++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index cf1ce597b45e..e30adb30277f 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -130,13 +131,29 @@ 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 = litex_read8(port->membase + OFF_EV_PENDING); + + /* for now, only rx path triggers interrupts */ + isr &= EV_RX; + + spin_lock(&port->lock); + 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)); } @@ -162,19 +179,42 @@ 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); + int ret; + u8 irq_mask = 0; - /* 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 == 0) { + /* only enable rx interrupts at this time */ + irq_mask = EV_RX; + } else { + pr_err(pr_fmt("line %d irq %d failed: using polling\n"), + port->line, port->irq); + port->irq = 0; + } + } - /* prepare timer for polling */ - timer_setup(&uart->timer, liteuart_timer, 0); - mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); + if (!port->irq) { + timer_setup(&uart->timer, liteuart_timer, 0); + mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); + } + + litex_write8(port->membase + OFF_EV_ENABLE, irq_mask); return 0; } static void liteuart_shutdown(struct uart_port *port) { + struct liteuart_port *uart = to_liteuart_port(port); + + litex_write8(port->membase + OFF_EV_ENABLE, 0); + + 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, @@ -263,6 +303,13 @@ static int liteuart_probe(struct platform_device *pdev) goto err_erase_id; } + /* get irq */ + ret = platform_get_irq_optional(pdev, 0); + if (ret < 0 && ret != -ENXIO) + return ret; + if (ret > 0) + port->irq = ret; + /* values not from device tree */ port->dev = &pdev->dev; port->iotype = UPIO_MEM; From patchwork Sat Nov 12 21:21:24 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: 19255 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1433028wru; Sat, 12 Nov 2022 13:25:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf54aeNRwvhj/gy4P0oFjrrAaU+clbbenSY4uYs7uqGekvB5x2JvrYvKVqlJMK5TD3VGwaNB X-Received: by 2002:a17:906:f8d6:b0:7ad:a0cb:f79e with SMTP id lh22-20020a170906f8d600b007ada0cbf79emr5818468ejb.458.1668288337357; Sat, 12 Nov 2022 13:25:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288337; cv=none; d=google.com; s=arc-20160816; b=nUdWKYhkJ5BBeHmp9ufIiWNd7g12RXTuTJGWjCHZoTocpDGGycuZBun0zZdetM3Qnk yVOWNfOhrMV2oE5lzXHeudl5JEqPLc1UmjD+l/vuJD5suujZtvX3OgHWP4coxTUwH3J5 RDZN2g15QMXlrRfSmTtTktQdDHX2uw5ImagISRgGIrZHwqE7aNWV+oXVRR5i1rNoZyk6 AShV4x10KSGp4ReTn6+jdmtW6Ik3SufTbjQO0KCpwAX3bW1tSZj+UqQtsqWpdqvTACTp b1IbqASDNTDmeSOZjyAYcrQerFI8S+cDxdN+3+E3KBZpp3JtU8ZcoxNTI0iqPL/W64YM QJgA== 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=RnlgHyHxWkwP8NBkj8ItqSrcSz+jgPdiCkwmRSzVrD8=; b=eHgSpuSllBOow9TmYxDsg8i6Hh/jH8okWfGPEEwVu+YdAhhSk2MfXO/rAuUHAlVXgw j9jD6np4HldNkTygIhZ2wGJIkjAF1p4mZf53HbaVvkVJiSpQsnZdAbavkn3wqE+XcsIa vF31+w2sTN11N7v9bQFxC0WvY3+5eo2HsO4LtScIZx/cilF+bjV8fjOY13wxv2+nm7U6 TGahfJMYQ/bqhOsDouq7hbbVxrKaJM27l9cK7hTVC9QmvWT5cFwvRQoZyD9Z3SX0uDpc LLNesrV2U9Hxy03145bWNPPiiUd8AM8kUkBc1Qn2C3w4eaukzFfjpAZDTxGoCrRyQ+Rk Udig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="N/5v4fSS"; 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 qb39-20020a1709077ea700b007aeaacd5592si2968128ejc.124.2022.11.12.13.25.13; Sat, 12 Nov 2022 13:25:37 -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="N/5v4fSS"; 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 S235158AbiKLVWa (ORCPT + 99 others); Sat, 12 Nov 2022 16:22:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235159AbiKLVV6 (ORCPT ); Sat, 12 Nov 2022 16:21:58 -0500 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3441418E3F; Sat, 12 Nov 2022 13:21:45 -0800 (PST) Received: by mail-qk1-x736.google.com with SMTP id z1so5323835qkl.9; Sat, 12 Nov 2022 13:21:45 -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=RnlgHyHxWkwP8NBkj8ItqSrcSz+jgPdiCkwmRSzVrD8=; b=N/5v4fSSSIAGk863cGwJ2LOZwHTkOlTFVZw5GBTZwG0fYggDGLhFLWEbS3SyaPoxGu bybG+F5QBHDGxXXIBEQAVFBTapHVzBwoE4+bix/ZqF+Zv6THz+qlPHG6LJAXOI2ieBi9 y5clfWPmRUsCgTSXm8Xg7XCFeWCHRRKfjZT+cayXiy7b1OKRMJRFOWcsHJT78V5laOI6 5qwdJVRt70KJt8CWEzCWWv+obmTrj2EFiRAv2FXVZVC6IIpvboeCwA5r5c+Vk+9cqf7B 1Z9snQ+4S8f6LCk7FilZj32bZUGhtTrESff7AGqGj5kEUoXJGOquWGl7iqr9XP8cz+jm +5NQ== 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=RnlgHyHxWkwP8NBkj8ItqSrcSz+jgPdiCkwmRSzVrD8=; b=PubWIGmneq80zX3VUf/ZugHI7xLOwb8sIXb0z7V5TBK96Vl24nMMMSqrwQWu/grMYi DfTyyXtHbphLfNKdGLsBUcgvgRoZjQ9RAtmlHNkWZBge3YnxIWZnoVs4RFie1gP1zL5o S/q6VRJapN68YWxXUgjpcP8PyOgicjzrpWQUqqMUaQXTCVTGuN7XKwYGTz5hQPBxARcS mOsTmXyTpb4gcspuHaQo7HKdP1AWhLdirgXJ0ppntgy9sWtscx3RksycQx9WOrWQpbjb 7TalEiBOOvzvVlvJeYD1l0TksD1jW2R1aAmvCnaW39+ZDw2EtonSbFcOP5IMK5P06F/m f9eg== X-Gm-Message-State: ANoB5pnJKyVZNxAVUJvGgQOvE+Ol8Yc63VEmmsTpXkKSwpzX9Hwo7xxR pkWOakNUrobqo4dw7LZff8P0SFXn3QfwsA== X-Received: by 2002:a05:620a:1202:b0:6fa:5f94:8b16 with SMTP id u2-20020a05620a120200b006fa5f948b16mr5871509qkj.215.1668288103983; Sat, 12 Nov 2022 13:21:43 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:43 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 13/14] serial: liteuart: add IRQ support for the TX path Date: Sat, 12 Nov 2022 16:21:24 -0500 Message-Id: <20221112212125.448824-14-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749327111434482470?= X-GMAIL-MSGID: =?utf-8?q?1749327111434482470?= Modify the TX path to operate in an IRQ-compatible way, while maintaining support for polling mode via the poll timer. Signed-off-by: Gabriel Somlo --- drivers/tty/serial/liteuart.c | 67 ++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index e30adb30277f..307c27398e30 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -46,6 +46,7 @@ struct liteuart_port { struct uart_port port; struct timer_list timer; u32 id; + bool poll_tx_started; }; #define to_liteuart_port(port) container_of(port, struct liteuart_port, port) @@ -78,29 +79,24 @@ static void liteuart_putchar(struct uart_port *port, unsigned char ch) static void liteuart_stop_tx(struct uart_port *port) { - /* not used in LiteUART, but called unconditionally from serial_core */ + if (port->irq) { + u8 irq_mask = litex_read8(port->membase + OFF_EV_ENABLE); + litex_write8(port->membase + OFF_EV_ENABLE, irq_mask & ~EV_TX); + } else { + struct liteuart_port *uart = to_liteuart_port(port); + uart->poll_tx_started = false; + } } 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]; - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - port->icount.tx++; - liteuart_putchar(port, ch); - } + if (port->irq) { + u8 irq_mask = litex_read8(port->membase + OFF_EV_ENABLE); + litex_write8(port->membase + OFF_EV_ENABLE, irq_mask | EV_TX); + } else { + struct liteuart_port *uart = to_liteuart_port(port); + uart->poll_tx_started = true; } - - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) - uart_write_wakeup(port); } static void liteuart_stop_rx(struct uart_port *port) @@ -131,18 +127,47 @@ 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) +{ + struct circ_buf *xmit = &port->state->xmit; + + if (unlikely(port->x_char)) { + litex_write8(port->membase + OFF_RXTX, port->x_char); + port->x_char = 0; + port->icount.tx++; + return; + } + + while (!litex_read8(port->membase + OFF_TXFULL)) { + if (xmit->head == xmit->tail) + break; + litex_write8(port->membase + OFF_RXTX, xmit->buf[xmit->tail]); + xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); + port->icount.tx++; + } + + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) + uart_write_wakeup(port); + + if (uart_circ_empty(xmit)) + liteuart_stop_tx(port); +} + static irqreturn_t liteuart_interrupt(int irq, void *data) { struct liteuart_port *uart = data; struct uart_port *port = &uart->port; u8 isr = litex_read8(port->membase + OFF_EV_PENDING); - /* for now, only rx path triggers interrupts */ - isr &= EV_RX; + if (!(port->irq || uart->poll_tx_started)) + isr &= ~EV_TX; /* polling mode with tx stopped */ spin_lock(&port->lock); if (isr & EV_RX) liteuart_rx_chars(port); + if (isr & EV_TX) { + liteuart_tx_chars(port); + } spin_unlock(&port->lock); return IRQ_RETVAL(isr); @@ -196,6 +221,7 @@ static int liteuart_startup(struct uart_port *port) } if (!port->irq) { + uart->poll_tx_started = false; timer_setup(&uart->timer, liteuart_timer, 0); mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); } @@ -210,6 +236,7 @@ static void liteuart_shutdown(struct uart_port *port) struct liteuart_port *uart = to_liteuart_port(port); litex_write8(port->membase + OFF_EV_ENABLE, 0); + uart->poll_tx_started = false; if (port->irq) free_irq(port->irq, port); From patchwork Sat Nov 12 21:21:25 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: 19256 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1433289wru; Sat, 12 Nov 2022 13:26:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf4tugSXTr56nuAYGxFe8FOohFm0SUVLOsC42LHZUlJjM9jj5CA/KAJlURxGN++EtA/peCWU X-Received: by 2002:a17:906:a1c8:b0:78d:585e:d183 with SMTP id bx8-20020a170906a1c800b0078d585ed183mr6042539ejb.768.1668288397918; Sat, 12 Nov 2022 13:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668288397; cv=none; d=google.com; s=arc-20160816; b=EhZTLzmxJA0G0tVL0R5VeiJrsMCupVbvQ0T9V7UJevz9w9rERy1uJz++2JAFSHFfrj Nvx+UKEVrhpFAANbXt017e2jpn9s/7r2QATLd7/SpDaVP5SsUghvEyrjRYIPRQITArvv 1lumB7YNEB4no8kf2KBGpgxLYt2J+01Bi6wCXsfJe295qZJ0ATzM1zbWXxSSnAeLYG60 cWiHMZ/PpL+oPjFXXoE0f71SJv2CjjfWNy7WlcXwuRwAUzJDhThVmuz20W+ZcZo58QND TJoFd77aXgy0lokQazrmDHCgGqMHL9jAQBq/V1g4V4+1tmut1KB3fJbAP7WGaQY8I3EX rTYg== 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=4NCT7lY3J4rHEmB/eCMozFwPMR+2ENWLul3W/EW/Ce8=; b=X5sejHA1dsDXOQW/oKlBo6NLWUnaA8dTFpSvSQidx5qH+c8uFI5m44UC9lt0gyESyy XKwKwxFGV8skmPmWahYpcTUj2Ut3fY8uSrlCBIVc+VFMAAcvWKFdeUvXM9+UWd3e0yg7 FlzsVSXO65uSH0v5iDZq4qH72xDPHuKOhHotvWEAHPBuPQqVq75hr2sHCsII+/Y0X79J ZWyKfw7dZJOPWDwkANPA5f+xZ02RmIhmEOjrHrtq20zrqrnReb1j9vYM6BPdhPoagXVB vXX/E5KFJF5vj935NR2+jUJkMNhXWIlTdfhZ3lliWtXVflv9yJdSnm7n4C8W3BMhs4on ZCKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ibBpN+mS; 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 n22-20020a509356000000b00461b2c460c8si5534461eda.531.2022.11.12.13.26.13; Sat, 12 Nov 2022 13:26:37 -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=ibBpN+mS; 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 S234976AbiKLVWd (ORCPT + 99 others); Sat, 12 Nov 2022 16:22:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235167AbiKLVWB (ORCPT ); Sat, 12 Nov 2022 16:22:01 -0500 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 911C119013; Sat, 12 Nov 2022 13:21:45 -0800 (PST) Received: by mail-qt1-x832.google.com with SMTP id e15so4887413qts.1; Sat, 12 Nov 2022 13:21:45 -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=4NCT7lY3J4rHEmB/eCMozFwPMR+2ENWLul3W/EW/Ce8=; b=ibBpN+mSBrLOruOHKikiQOy1KhKqal2y5bUcjXK4ClO1BHI2gzyH4zxhWvr14HLmtj aVcfH3Qd6G27BpBpmWlIyzjJGeUZ5QabY+U/uyl/QrZpraxCO7yYR/1tRDYlK7YTnOx9 AaEpn5kCukLOB3mJlw778PfWrLuvvIEHRjWvwbHHJuP/3KOf7rvS4e6gR58PlCX5tApD Mj2yTab+sc8N4mbgrCx8Q8pP9jteZ9U3DDcXgUBkJOUf7tqs6AWXx3Ljg7XQ6nHexUCB 3kYXez+RbpGpEXrrPilWX6q0GGXwRxaeetxJZSmHh/BWV08BOTi26YYOSXKyT1fgCLOD d7zw== 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=4NCT7lY3J4rHEmB/eCMozFwPMR+2ENWLul3W/EW/Ce8=; b=ejdLDZgqZDSBch7ozxThNUlzg8G7Zm0m9DLBz04k/6UIhk0CDSTu88KQy1qACON5Oh P7AMFoSi4aljHPgMDBH5Qpc1uyEoHNAcjNbhNAVe0FVv9+Tqbvrzh9MD4GnvU6f9B9CD eDGxQZL15SPGGot3A9L1S6jgF1nO8Gosp66ULVmmGkNydw3eXpy7YQ+Kt15KPojrMJyn 1KJxRdWGWPzhD/RyIjDacbeLn6AkPDIBYaYg3FFolE3cG4d8kqwShn5ikF1rZgfgR6WO W/V+0ja5YSY450tdNgjOer4abzjTgbxbUQnaQ5rFkyO14EPHps/bmDjHFyLWtyjK6klM 1NVw== X-Gm-Message-State: ANoB5pktSJIY2SfYAaYTHr/Bhi+UurH9/E1rfZ49fzRC9snfxO6A/oGN pSuTfD63HYmMp1u8UzXRxmLA++cbocos/w== X-Received: by 2002:a05:622a:1c0d:b0:3a5:21f0:39f0 with SMTP id bq13-20020a05622a1c0d00b003a521f039f0mr6848653qtb.10.1668288104961; Sat, 12 Nov 2022 13:21:44 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id t8-20020a37ea08000000b006fa313bf185sm3811839qkj.8.2022.11.12.13.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 13:21:44 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org Subject: [PATCH v3 14/14] serial: liteuart: move polling putchar() function Date: Sat, 12 Nov 2022 16:21:25 -0500 Message-Id: <20221112212125.448824-15-gsomlo@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221112212125.448824-1-gsomlo@gmail.com> References: <20221112212125.448824-1-gsomlo@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749327175487662845?= X-GMAIL-MSGID: =?utf-8?q?1749327175487662845?= 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 307c27398e30..767c356e60c9 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -69,14 +69,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_stop_tx(struct uart_port *port) { if (port->irq) { @@ -389,6 +381,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) {