Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7419954rwb; Wed, 23 Nov 2022 06:22:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf773Bo5TTBGQiG/sLyns9juJGvJN4ZV9OzelpwoLk+mvUoyZMnRRoJ3LSRCH2HANLVaAwyb X-Received: by 2002:a17:902:f7cb:b0:189:3e8f:fa49 with SMTP id h11-20020a170902f7cb00b001893e8ffa49mr4247412plw.142.1669213339131; Wed, 23 Nov 2022 06:22:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669213339; cv=none; d=google.com; s=arc-20160816; b=bHGK0tGGRYfN/GKcYiv4mrBBYmHTdRn1zX+DUxWkg7LrEuWzFYzKrXp/1n2jyAQWcE XciAmkoM4KsjhbKa03BSam1kVpgmglFEL2JR8XKJuVSt5fvL0Ly3ELPMn3jWBO7flSh1 oI10cT9nMnvjqQq4dGWHv8ayBske+cC9goAcFYZLeCLlTZa1xDnk/o/mY9fYnKiEPf+k lGUUMJLYkxfJ2TWMGQ+FeByPYIkOECneDYw9pvCKaev+MhKckJTc9UHQnLPdrzyqStXg NJogz+76E7hLGOd98bw07dFGodF8edke1ELghr9GfnHa1ON5iFxwnNpeDFqRUc+wE1zn MfZg== 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=qoMIkJU7RvbZZuqzplaT4bBXFPZMXchGTRlt2jCO+kI=; b=V0TEhIGiRkjJTqsYx2byehUfcZh7qFLy0JZ5Vkv8o7lpu0TzAi2AG+5jxWZY230zmb mCBDWcJ2y2vb/e7NSbfyjvz/xoCeStsHu65R6+dLnb4vGT0hqMjWFfpXGWQaXqlgGeJw HXVxkPKAOVoPtPGGSNgXc6AWqhLcXuUUmFy7ZRCZXg8MwQXggB/Vhsygp4JNWz2ZYzZo eTwWjaDct3H12yrl8TFNaajVvKNhX4oWqLjNe8PRd8EtCnPUgKoDDgH/9W9fIKYaimWZ LNWwRbK2OhRUGonTLPUQ+gVx/s5pqCsVXlma5WYYEmd01mbO6Rdg03FJ+CDN2mVp6HOH xSqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I+QzPRYC; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay6-20020a056a00300600b0056bc1d790ebsi16559566pfb.57.2022.11.23.06.22.08; Wed, 23 Nov 2022 06:22:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I+QzPRYC; 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 S237045AbiKWN0B (ORCPT + 89 others); Wed, 23 Nov 2022 08:26:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237333AbiKWNYf (ORCPT ); Wed, 23 Nov 2022 08:24:35 -0500 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EAFCB7EB0; Wed, 23 Nov 2022 05:05:19 -0800 (PST) Received: by mail-qk1-x72d.google.com with SMTP id d8so12285861qki.13; Wed, 23 Nov 2022 05:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qoMIkJU7RvbZZuqzplaT4bBXFPZMXchGTRlt2jCO+kI=; b=I+QzPRYCpOeZh/2+ywxlPc/2XDtmrdlAzbocluylrcg7fu31+yAzdvskXCyfskDn6s 51QCg8Na8xgIQaw0irNIOto8HoK4LCL0vVx7fwODVDzNByYBS/mWWAy3nks+XLEyJ/62 2f28zTORjWh4XNJHyBTduP2Zgux2aYnsdjOUOa3wmQHSfaMa+17lFLnVPeAYkN5E0sH/ met4D8CUHTpttDuZNFaTnFfTL2Mx0o/Fl9mNr2QAUeSBiGWt80cBwLc/PSs22yWd2ycT /vAVAgyvuixmABgBob/4vifIWMoDQJ82WfboIfbpmIsLXWr0sOQBHTrMYPDPUbECQLH8 68Fw== 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=qoMIkJU7RvbZZuqzplaT4bBXFPZMXchGTRlt2jCO+kI=; b=oOKUASGeT5gUN0XO+CBH1GcGnyfl3p9F9P+zrG3/6e9irCBmTkRCWKhTb53+kbloOw TaftU14KabVtJIZ8oKZhxteQHIpu5K9qkt9JPm5gLttrqI/EhHwNhypkorpBezhiwgBm JqYm9GgeMlbWd+EEA470Z7sKeOqfRE3AIHawjKvNTIDNV3UjweLWZKScTCCSq0PHgHiP maKOcma2C0XvaWYK2fN6VvGGWh2/TB5sAqPcMULRB1StYtIJ+gLUJWKFVPS2TDK9uL9a /KACq6g8G6A03kJcb8Od+aHy2sQbDBc7LKkhDzeym22URQzUSemwaHpGzrDhYadH7rpF PvVQ== X-Gm-Message-State: ANoB5plur2lnPN5Chs/Ta9QMC4z3kz3SkZFS3qhLvWVmmxVUUGjkJAPT MIXhefTTkjeFvpEEnxfO7TyuWVeOs3WQvQ== X-Received: by 2002:a05:620a:15b7:b0:6fa:3f37:5af with SMTP id f23-20020a05620a15b700b006fa3f3705afmr25311630qkk.572.1669208718684; Wed, 23 Nov 2022 05:05:18 -0800 (PST) Received: from glsvmlin.ini.cmu.edu (GLSVMLIN.INI.CMU.EDU. [128.2.16.9]) by smtp.gmail.com with ESMTPSA id f13-20020a05620a408d00b006bb78d095c5sm12188520qko.79.2022.11.23.05.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Nov 2022 05:05:18 -0800 (PST) From: Gabriel Somlo To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, kgugala@antmicro.com, mholenko@antmicro.com, joel@jms.id.au, david.abdurachmanov@gmail.com, florent@enjoy-digital.fr, geert@linux-m68k.org, ilpo.jarvinen@linux.intel.com Subject: [PATCH v6 10/14] serial: liteuart: separate rx loop from poll timer Date: Wed, 23 Nov 2022 08:04:56 -0500 Message-Id: <20221123130500.1030189-11-gsomlo@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123130500.1030189-1-gsomlo@gmail.com> References: <20221123130500.1030189-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: X-Mailing-List: linux-kernel@vger.kernel.org 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 62bfd2ed9051..ab6837f3e40d 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; u8 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)); } -- 2.38.1