From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4580C4332F for ; Wed, 19 Oct 2022 11:37:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbiJSLhT (ORCPT ); Wed, 19 Oct 2022 07:37:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbiJSLhD (ORCPT ); Wed, 19 Oct 2022 07:37:03 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A690F036D; Wed, 19 Oct 2022 04:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666178117; x=1697714117; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=6P7kIa36+7jAAfqrpo1HhIeiIYqEsGmum7j1waY+mVw=; b=TBOlxz7JkqsBYXqTpSfb+6M7JjARaCyHYNN532TTckiJhvxBrOdxzqtr J2NV0CCJvt4IwsU7cMr+Uc5/elrM6i/A20jZ9yr+EPrpRSs8z4+DfIy8D AUmk5NSfrp0+UOHa1w3ueUkIhY5qR+1yea5BUmoaYM3XJqNm2i/zjV1A8 e54+h0/5bREIS8BImymxTIUeBK1o/Xrq3HkGtr/f68KSw4sL4a5OGnNuT XcJMO8uV41+/Th1fVKx2TtgEAPyLKJTRTBoAqbQqbCyNhdys3eyubb/BJ OZSYFjYCY5G9nNAlEs3xTA4DQVk9rkmcsS8lM2zvwGE+s++oG4jusxiR8 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="303996165" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="303996165" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 04:11:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="624086281" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="624086281" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga007.jf.intel.com with ESMTP; 19 Oct 2022 04:11:12 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1ol6yc-009pA6-31; Wed, 19 Oct 2022 14:11:10 +0300 Date: Wed, 19 Oct 2022 14:11:10 +0300 From: Andy Shevchenko To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/44] serial: pch_uart: Use uart_xmit_advance() Message-ID: References: <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com> <20221019091151.6692-5-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221019091151.6692-5-ilpo.jarvinen@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 > Signed-off-by: Ilpo Järvinen > --- > 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 > -- With Best Regards, Andy Shevchenko