Message ID | 20221019091151.6692-34-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp227135wrs; Wed, 19 Oct 2022 02:47:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OeZoTYHt5UsrwL/2uGka6sT0anNBcxABWTmgEORckshhpf+AWKHbI6L55B75b78yCVs6l X-Received: by 2002:a05:6a00:c86:b0:563:b89c:3d0b with SMTP id a6-20020a056a000c8600b00563b89c3d0bmr7900141pfv.50.1666172875360; Wed, 19 Oct 2022 02:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172875; cv=none; d=google.com; s=arc-20160816; b=dV0xV0f4YrShO7ylQFpNTlELZ5Et8q5JwwSuUNsuynmy6CFIEqnk13aITJMjk3Q81X 09Bf6Od1Hpv8Fb4pd6jySzdXNYx4ZWTP2TuVxatHeJfcvc5jm3W9OeQQeYPA9GT0dswp DvzKx5ggoaqMzqs+ln22dccddflts9XFacUEu+GKc3mDtw0yuTJjd9iUqMLF4U46Wj7N 0A9JFqcehSd8Ui0+xZZoVscVKVtszbGPiWhCZ4lwgTQzlg2bmlNPg9NVYzTYhng2tjQf UAs4gnk6g/tkLSdZ54ju15XN2zkp/SDGkwYAW7p4AulBFULmmFK8NaxTqoedQFhdGuno RVUQ== 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=paZ/SS1F+d4FEhf1BdaEWN7r8nMYwZZTZSlvmr0Zih4=; b=NwqoWCdK999z3MCsKEY+Ddp7XocvOsCdXg/JZw27R5falpxp7/gH2Cb6rTO6LYqcH6 C60SwsLpSghbZjqlf9iUHwJJ7ggAJk4MpHxq5bvybjEXkpYPYLif1ILC/ZtxXi12gRJr ckZBGX0vfjfujAURlj148sV1Jc8LuXkelinpfJbjTEx06rIiBqkWLv8SPnghPTscmoTV kDGGwSUSKV0Rpj3xyHi4X/u8hE6aRtAuNHcM71MVxDOhvei7QFl6+Kto6WAUIXiYf9Hg +6akqTCGMUKgvWv/QMCcOowAsO5P05QLslFeUus6tBVUoG7D4IbISBtQNWQPiyvz6UxR EgyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c9OQZPNf; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a170903244900b0017d2c45e93fsi20221369pls.169.2022.10.19.02.47.40; Wed, 19 Oct 2022 02:47:55 -0700 (PDT) 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=@intel.com header.s=Intel header.b=c9OQZPNf; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234269AbiJSJjj (ORCPT <rfc822;samuel.l.nystrom@gmail.com> + 99 others); Wed, 19 Oct 2022 05:39:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234028AbiJSJe1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Oct 2022 05:34:27 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F252513CFC; Wed, 19 Oct 2022 02:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666170912; x=1697706912; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VdtdsxsRvs8JMRXdzAFU0lT7qdRtckYO+MxQniqr59g=; b=c9OQZPNf/ysw7PXeS0O7HkqQAD4kYus0CzRhyPxU8GfLvYmVWkZGOBdo C7QtjshH9QAjF81901SXbQS+NFkwPPC2klpCEzNqqX7QV1Q6r14nVtzOm ezDGe4FFoAmMkGut+AyZI5Wx+dK2dmVBYyGDsAN3wa3GUlf2cZyob4bt/ +Sqh3xqyK2QNnuL1EPXFZH5hlt+YkIC1Ss5ZBEY+fB7X+1g0ECP0k5Ejw IYCmfDiy/jCFNah0lDpEwzJqnpRxzYbEldeLtZ8L27WPvFChEd8MfMLdT +QA9l31qhi7NorTNZZse0z9vqYTJ7EGrK2A7SJ5ygHgxxqViT0cLhuwGm w==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="332911273" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="332911273" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 02:14:13 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="734119193" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="734119193" Received: from sponnura-mobl1.amr.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.214.35]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 02:14:10 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: linux-serial@vger.kernel.org, Greg KH <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, Orson Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, linux-kernel@vger.kernel.org Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH 33/44] serial: sprd: Use uart_xmit_advance() Date: Wed, 19 Oct 2022 12:11:40 +0300 Message-Id: <20221019091151.6692-34-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com> References: <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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?1747108889099420047?= X-GMAIL-MSGID: =?utf-8?q?1747108889099420047?= |
Series |
serial: Convert drivers to use uart_xmit_advance()
|
|
Commit Message
Ilpo Järvinen
Oct. 19, 2022, 9:11 a.m. UTC
Take advantage of the new uart_xmit_advance() helper.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/tty/serial/sprd_serial.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
Comments
Hi, On 10/19/2022 5:11 PM, Ilpo Järvinen wrote: > Take advantage of the new uart_xmit_advance() helper. > > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> LGTM. Thanks. Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> > --- > drivers/tty/serial/sprd_serial.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c > index 342a87967631..eae700809342 100644 > --- a/drivers/tty/serial/sprd_serial.c > +++ b/drivers/tty/serial/sprd_serial.c > @@ -206,7 +206,6 @@ static void sprd_stop_tx_dma(struct uart_port *port) > { > struct sprd_uart_port *sp = > container_of(port, struct sprd_uart_port, port); > - struct circ_buf *xmit = &port->state->xmit; > struct dma_tx_state state; > u32 trans_len; > > @@ -215,8 +214,7 @@ static void sprd_stop_tx_dma(struct uart_port *port) > dmaengine_tx_status(sp->tx_dma.chn, sp->tx_dma.cookie, &state); > if (state.residue) { > trans_len = state.residue - sp->tx_dma.phys_addr; > - xmit->tail = (xmit->tail + trans_len) & (UART_XMIT_SIZE - 1); > - port->icount.tx += trans_len; > + uart_xmit_advance(port, trans_len); > dma_unmap_single(port->dev, sp->tx_dma.phys_addr, > sp->tx_dma.trans_len, DMA_TO_DEVICE); > } > @@ -253,8 +251,7 @@ static void sprd_complete_tx_dma(void *data) > dma_unmap_single(port->dev, sp->tx_dma.phys_addr, > sp->tx_dma.trans_len, DMA_TO_DEVICE); > > - xmit->tail = (xmit->tail + sp->tx_dma.trans_len) & (UART_XMIT_SIZE - 1); > - port->icount.tx += sp->tx_dma.trans_len; > + uart_xmit_advance(port, sp->tx_dma.trans_len); > > if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) > uart_write_wakeup(port);
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 342a87967631..eae700809342 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -206,7 +206,6 @@ static void sprd_stop_tx_dma(struct uart_port *port) { struct sprd_uart_port *sp = container_of(port, struct sprd_uart_port, port); - struct circ_buf *xmit = &port->state->xmit; struct dma_tx_state state; u32 trans_len; @@ -215,8 +214,7 @@ static void sprd_stop_tx_dma(struct uart_port *port) dmaengine_tx_status(sp->tx_dma.chn, sp->tx_dma.cookie, &state); if (state.residue) { trans_len = state.residue - sp->tx_dma.phys_addr; - xmit->tail = (xmit->tail + trans_len) & (UART_XMIT_SIZE - 1); - port->icount.tx += trans_len; + uart_xmit_advance(port, trans_len); dma_unmap_single(port->dev, sp->tx_dma.phys_addr, sp->tx_dma.trans_len, DMA_TO_DEVICE); } @@ -253,8 +251,7 @@ static void sprd_complete_tx_dma(void *data) dma_unmap_single(port->dev, sp->tx_dma.phys_addr, sp->tx_dma.trans_len, DMA_TO_DEVICE); - xmit->tail = (xmit->tail + sp->tx_dma.trans_len) & (UART_XMIT_SIZE - 1); - port->icount.tx += sp->tx_dma.trans_len; + uart_xmit_advance(port, sp->tx_dma.trans_len); if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(port);