Message ID | 20221116144908.234154-11-gsomlo@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp183672wru; Wed, 16 Nov 2022 06:56:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf6b1jUaeublxXdQ5H8NnuYmseAhr4GJU38NyhCXrTZ0pLOvNGznCiwEdjd9ITAFyYpb2KYM X-Received: by 2002:a50:ec8c:0:b0:462:719:3372 with SMTP id e12-20020a50ec8c000000b0046207193372mr19538734edr.361.1668610560308; Wed, 16 Nov 2022 06:56:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668610560; cv=none; d=google.com; s=arc-20160816; b=rSub+s8uuZ/X8r8M8IVXxH5WtJetBlwZIwYPqCBcd7BAsR9ljdSUfKSjuzus12pxTd tmdCLqYo3hCFweYJFC7b1Kc5iJKjcmCCGEjuhuHWY+oFXGbgGL4NqUG61xy00BcqcbwF Qq2jLwTdDjQWZeaQmIuyCxQn3ZGVD4mue6v2s1nQXbXs+2MGvDW9sZAsFI57E7jE7t2b 3hzwwKX8HVRVERTs4PD84fVMpQjHgNK16++s+1PlvRt5/5reBgVbfNu9VB/4j0FhHVPb O+9RU9QlnM+2N/CKfd0iLX9vmCWh9nEmlhhkTz0hibc/aI77coIwMdxHbYgpJeMYdq+i hrJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I7E1AL+Zmws98336Eqgx5BGd+1bmMfsNL2UgCg2pcHE=; b=zPzHzS56pQ+1xVGQpicA8wj7ElfQUQM/Eei1/0VhXbgSW0ZstEfAv7T5hyGuJ0MJZn melapj4tAmO0886vttTOIBnZSKE4yHtpuJn+EgVFZDZMcauQt6nvYNrXK+Pv3/ALBUAb 67EqKCTtnWbmeGMBRNdgY5r3GEMLoWor6eafb/P1lpS/v+R34dKI7ryjXCUQopIMNvz/ qkF1D2r/9OOz65fhjFl0R8bs0/UncMs+8Ao3O2w8Q4gta8eDAVH8TnGCIvgPfS/12XzU qhcxMpjZ6GsNfb3MglldE2nFSOVTQohkEThp27Uuxx+HVN4OM6rgfR4wa+5ZlFkxutPK IvuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZKwMXYAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hu9-20020a170907a08900b007ae0db0c454si14368468ejc.635.2022.11.16.06.55.35; Wed, 16 Nov 2022 06:56:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZKwMXYAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233697AbiKPOuP (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Wed, 16 Nov 2022 09:50:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233646AbiKPOtc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 16 Nov 2022 09:49:32 -0500 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2675F391C2; Wed, 16 Nov 2022 06:49:27 -0800 (PST) Received: by mail-qk1-x734.google.com with SMTP id x21so11769008qkj.0; Wed, 16 Nov 2022 06:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I7E1AL+Zmws98336Eqgx5BGd+1bmMfsNL2UgCg2pcHE=; b=ZKwMXYAsBcmAgWdCUpSDxHcOrSAXlYOV7PAff/y6tTwJgXKL2kko/HH+3zquX9d+Sw FaHlyQZJgCf41nMo5DShHj+ZzRrxgnmlwpaCfxRqos7D8hyJRt7P9zmZb85iwTa6+6ja 6+4ofDmcoy8y6nBB+AFYXGTmnF8tqgbYlGPGKQhT2iqEHqvvT++4xBdSPe0xvGfWUra5 +y0mwVPtBQ5efqDQHPeTf+IU8/m+5bNruvn0r/1xmn0ZvRDvShe2mZT0H5by3tHOcjzw jMIKUH3jj9CrJ7IH+aqQUuCdKABzCp97neG+Hq/FQk7KEZkHUVek3a1yfDsMwcGvnJli a6Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I7E1AL+Zmws98336Eqgx5BGd+1bmMfsNL2UgCg2pcHE=; b=kHTK6MLSurpldSe2I4UKe7DzZMLB5qTb37Yzw1Z+RO825tgcYCnbNl93U8dOBrCIkx 4AckTxQ9aFQYNaLo5EnlZPK8mtAcQad9mM8bvfX3YBlYd/ptfs3C81HEn3nG3BBe6O0+ JHNoAE4BiZrL/bOZOphi57ZdZlwOCbNrxIKN1yipFcq0cUAf/2U0uYkIjAWgWqkgE3xo 0OZy4xevvoLthIqVMD9msBQ6nD6wlRaRLDs6/NZLpOApDLWGzHgHWzkhXe90hDWkBxis Tl3N9Ocj29Do2lnTRi739FV1j4NJ0Owf6EbMw3Vk0kK9ZqSyPYdjYrk5cHHwcqvQKZ5u ZVzQ== X-Gm-Message-State: ANoB5pl5M6oBth7bkySlJP8GjEhcCzGqZcd6GF2ziaIOAmDz97MNK19P 8n3xUU+tlKGVNde84N4CqqECd4yES8Ds0Q== X-Received: by 2002:a37:63d0:0:b0:6cf:5fa1:15f8 with SMTP id x199-20020a3763d0000000b006cf5fa115f8mr19666482qkb.748.1668610166484; Wed, 16 Nov 2022 06:49:26 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id g5-20020ac84805000000b0039a55f78792sm8729624qtq.89.2022.11.16.06.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 06:49:26 -0800 (PST) From: Gabriel Somlo <gsomlo@gmail.com> To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org, ilpo.jarvinen@linux.intel.com Subject: [PATCH v4 10/14] serial: liteuart: separate rx loop from poll timer Date: Wed, 16 Nov 2022 09:49:04 -0500 Message-Id: <20221116144908.234154-11-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116144908.234154-1-gsomlo@gmail.com> References: <20221116144908.234154-1-gsomlo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749664986821569292?= X-GMAIL-MSGID: =?utf-8?q?1749664986821569292?= |
Series |
serial: liteuart: add IRQ support
|
|
Commit Message
Gabriel L. Somlo
Nov. 16, 2022, 2:49 p.m. UTC
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 <gsomlo@gmail.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> --- drivers/tty/serial/liteuart.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 42ac9aee050a..76f8a09b82cd 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -68,10 +68,8 @@ static struct uart_driver liteuart_driver = { #endif }; -static void liteuart_timer(struct timer_list *t) +static void liteuart_rx_chars(struct uart_port *port) { - struct liteuart_port *uart = from_timer(uart, t, timer); - struct uart_port *port = &uart->port; unsigned char __iomem *membase = port->membase; unsigned int status, ch; @@ -88,6 +86,14 @@ static void liteuart_timer(struct timer_list *t) } tty_flip_buffer_push(&port->state->port); +} + +static void liteuart_timer(struct timer_list *t) +{ + struct liteuart_port *uart = from_timer(uart, t, timer); + struct uart_port *port = &uart->port; + + liteuart_rx_chars(port); mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); }