Message ID | 20221019091151.6692-5-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 y7csp225720wrs; Wed, 19 Oct 2022 02:43:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ijWJiwmpwKor7Hy38YX5wNddi+kk1z5ze0Cg76OFSIOr/+EonU2wr0+3Y8874Sik9pUqX X-Received: by 2002:a05:6402:274c:b0:45d:4015:cd8c with SMTP id z12-20020a056402274c00b0045d4015cd8cmr6754696edd.268.1666172632067; Wed, 19 Oct 2022 02:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172632; cv=none; d=google.com; s=arc-20160816; b=qnc3Zs4XAqP0ThsDwKVf8+LdtC/2MRr5blKe9qjRMfzGZdAOVerL2/Y4j34S+LTvvJ ShUtYWxp7G+/ToLapZVaNftZFlnyKDOxYKVNsbdSEj6LMZLurwSA83/yflFyBdy+Y+Xg Lf3sqscPAhSvMnDRFyc5KfV+T3ZdJNIgpmcFPtYeytMKyYuuqPQmIiHxSPfQEBLwRCwr fEwaoS7bL9pZQs7DUfELFUlO5pKjkidE1cLSaNQh2zUBd9oSkCJAllHPqZgamMqgakIO oVI9p0V7B6G9sawBo7JfSAA71QOlMKauCgiuvQiVoiNVwhT9TW2KHnwPgCc3FI6NWesl g35w== 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=ZKeejLXpKyh4wOgADm6zZg6h936pNnAecDlMEDpdllo=; b=QmMNF3c/qelGQXqGSxal9O2BlzYjtCRIEd2rxZCjVG2/bdpLNmvaTn/KMPaeynn+hW ipqGns5Bbau91UMIipPB/L56P5nZ7JbX5c/1F+P86WGutRRnCYK3LnL13okJm4d2qAea ZrTGVaOam+bk+Sj/SDaVUfbj9uv4spCFFlCxzNJSyOq/UOku1cT2Zk6s+0mPELmks0wd PkOn1SPrVKZ94Kz8HpwVv2MMu/bFIwD3Fal8l34lT67DIUQsH0F2PNcjVunMhwmgiGTx Imwal2lzwvFq8SkSAmQvx1SIeUGmNUGWMsRl1B0aHizIwj6sC4FP+7jIgDXfC+pttGOE ytxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gTzkuGO5; 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 d22-20020a50fe96000000b0045beaf03ddesi11878863edt.411.2022.10.19.02.43.22; Wed, 19 Oct 2022 02:43:52 -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=gTzkuGO5; 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 S233801AbiJSJfU (ORCPT <rfc822;samuel.l.nystrom@gmail.com> + 99 others); Wed, 19 Oct 2022 05:35:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233850AbiJSJ3j (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Oct 2022 05:29:39 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4E47EC500; Wed, 19 Oct 2022 02:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666170794; x=1697706794; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hTprBOiynTEpT508TKZJXu6vmpZ3D1X3CSumF2lsD10=; b=gTzkuGO5vAj2/5Mu8v0Ga4nofIDILpjOheqb95/idfHUkPKuCz3M/PQw X8cBPIxiIKj50FV1w1W8wlXwkEtNqPhynEASi2XeljqAsnuExzrH0NtZ0 qdNwpV45xLYeKHiSwPU4hwuPfeV1HCD7SRJ+3uC5Fm0Qm4/E+7N88NdcN uLGkSQ+EReKv91GLEBxMQCfTYfUwA5WTn2XHYgTLxVVRZqRUS0GMI3Fa3 Iw+OHeaNtIIDDAJ1La7KRsYXe7EKBS6DGo6RIS7466zC/rQM2hER+bLe5 1wyBB4iMYU9KA13fc523P9uhCa0jQABLl4ofL1lBIvZvKlQ4afHxVeTj9 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="332910821" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="332910821" 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:12:34 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="734118499" X-IronPort-AV: E=Sophos;i="5.95,195,1661842800"; d="scan'208";a="734118499" 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:12:31 -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>, 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 04/44] serial: pch_uart: Use uart_xmit_advance() Date: Wed, 19 Oct 2022 12:11:11 +0300 Message-Id: <20221019091151.6692-5-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?1747108633332095428?= X-GMAIL-MSGID: =?utf-8?q?1747108633332095428?= |
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/pch_uart.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
Comments
On Wed, Oct 19, 2022 at 12:11:11PM +0300, Ilpo Järvinen wrote: > Take advantage of the new uart_xmit_advance() helper. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > --- > drivers/tty/serial/pch_uart.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c > index c59ce7886579..c76719c0f453 100644 > --- a/drivers/tty/serial/pch_uart.c > +++ b/drivers/tty/serial/pch_uart.c > @@ -738,15 +738,12 @@ static void pch_dma_tx_complete(void *arg) > { > struct eg20t_port *priv = arg; > struct uart_port *port = &priv->port; > - struct circ_buf *xmit = &port->state->xmit; > struct scatterlist *sg = priv->sg_tx_p; > int i; > > - for (i = 0; i < priv->nent; i++, sg++) { > - xmit->tail += sg_dma_len(sg); > - port->icount.tx += sg_dma_len(sg); > - } > - xmit->tail &= UART_XMIT_SIZE - 1; > + for (i = 0; i < priv->nent; i++, sg++) > + uart_xmit_advance(port, sg_dma_len(sg)); > + > async_tx_ack(priv->desc_tx); > dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE); > priv->tx_dma_use = 0; > @@ -843,8 +840,7 @@ static unsigned int handle_tx(struct eg20t_port *priv) > > while (!uart_tx_stopped(port) && !uart_circ_empty(xmit) && fifo_size) { > iowrite8(xmit->buf[xmit->tail], priv->membase + PCH_UART_THR); > - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); > - port->icount.tx++; > + uart_xmit_advance(port, 1); > fifo_size--; > tx_empty = 0; > } > -- > 2.30.2 >
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index c59ce7886579..c76719c0f453 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c @@ -738,15 +738,12 @@ static void pch_dma_tx_complete(void *arg) { struct eg20t_port *priv = arg; struct uart_port *port = &priv->port; - struct circ_buf *xmit = &port->state->xmit; struct scatterlist *sg = priv->sg_tx_p; int i; - for (i = 0; i < priv->nent; i++, sg++) { - xmit->tail += sg_dma_len(sg); - port->icount.tx += sg_dma_len(sg); - } - xmit->tail &= UART_XMIT_SIZE - 1; + for (i = 0; i < priv->nent; i++, sg++) + uart_xmit_advance(port, sg_dma_len(sg)); + async_tx_ack(priv->desc_tx); dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE); priv->tx_dma_use = 0; @@ -843,8 +840,7 @@ static unsigned int handle_tx(struct eg20t_port *priv) while (!uart_tx_stopped(port) && !uart_circ_empty(xmit) && fifo_size) { iowrite8(xmit->buf[xmit->tail], priv->membase + PCH_UART_THR); - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - port->icount.tx++; + uart_xmit_advance(port, 1); fifo_size--; tx_empty = 0; }