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 1953EC54EE9 for ; Tue, 20 Sep 2022 08:54:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231468AbiITIyf (ORCPT ); Tue, 20 Sep 2022 04:54:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231426AbiITIy0 (ORCPT ); Tue, 20 Sep 2022 04:54:26 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 691296B8FA; Tue, 20 Sep 2022 01:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663664059; x=1695200059; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=3JHiv1cbPe8ZCd8mmIXB55mW1dRePjWIOPwNMnry1hk=; b=LiMjq9up6eA+Dl6DrohfV6nmRHDJrD08V5Sp18PQIO04YDpYyDCqP8Wq AsB0rkCiycuVexciCTwXVnxFaX58q/iENr0MVf7yYjB33c55GikFKwbn/ shuhfOzJXWm7jplRYBHp8zYRkiIHTx2SUOCp8JG6V00YhyJZj7DwRu7Hl 1D/qSCP2Z6ZUO1TRRMbAf1Ox8tCwGw/krGW5+cQbsWXYP0l4KDz0iW2GE uuoxHoI74xAEVTt9XCpjblgg/xbJDkoPwvovEjnGvu4VoFREpntw2AqSZ hiU7qT4XdmKP8RbHMCW2MSoe/+Swm5I7ueOc8sCaMvv5vZ6Ztlwug9g4k w==; X-IronPort-AV: E=McAfee;i="6500,9779,10475"; a="297231680" X-IronPort-AV: E=Sophos;i="5.93,330,1654585200"; d="scan'208";a="297231680" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 01:54:19 -0700 X-IronPort-AV: E=Sophos;i="5.93,330,1654585200"; d="scan'208";a="687323021" Received: from bdallmer-mobl.ger.corp.intel.com ([10.252.59.238]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2022 01:54:14 -0700 Date: Tue, 20 Sep 2022 11:54:12 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Jiri Slaby cc: Greg Kroah-Hartman , linux-serial , LKML , Tobias Klauser , Richard Genoud , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Vladimir Zapolskiy , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , =?ISO-8859-15?Q?Andreas_F=E4rber?= , Manivannan Sadhasivam Subject: Re: [PATCH v4 09/10] tty: serial: use uart_port_tx() helper In-Reply-To: <20220920052049.20507-10-jslaby@suse.cz> Message-ID: <87251b8a-d955-e6dd-94df-c7621e72bac@linux.intel.com> References: <20220920052049.20507-1-jslaby@suse.cz> <20220920052049.20507-10-jslaby@suse.cz> MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-407419242-1663660068=:1766" Content-ID: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-407419242-1663660068=:1766 Content-Type: text/plain; CHARSET=ISO-8859-15 Content-Transfer-Encoding: 8BIT Content-ID: <6ec236dd-66a1-72aa-3adc-f63fdc3ee@linux.intel.com> On Tue, 20 Sep 2022, Jiri Slaby wrote: > uart_port_tx() is a new helper to send characters to the device. Use it > in these drivers. > > Cc: Tobias Klauser > Cc: Richard Genoud > Cc: Nicolas Ferre > Cc: Alexandre Belloni > Cc: Claudiu Beznea > Cc: Vladimir Zapolskiy > Cc: Liviu Dudau > Cc: Sudeep Holla > Cc: Lorenzo Pieralisi > Cc: Shawn Guo > Cc: Sascha Hauer > Cc: Pengutronix Kernel Team > Cc: Fabio Estevam > Cc: NXP Linux Team > Cc: "Andreas Färber" > Cc: Manivannan Sadhasivam > Signed-off-by: Jiri Slaby > --- > diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c > index b1cd9a76dd93..53b642ea46ba 100644 > --- a/drivers/tty/serial/mcf.c > +++ b/drivers/tty/serial/mcf.c > @@ -327,29 +327,13 @@ static void mcf_rx_chars(struct mcf_uart *pp) > static void mcf_tx_chars(struct mcf_uart *pp) > { > struct uart_port *port = &pp->port; > - struct circ_buf *xmit = &port->state->xmit; > - > - if (port->x_char) { > - /* Send special char - probably flow control */ > - writeb(port->x_char, port->membase + MCFUART_UTB); > - port->x_char = 0; > - port->icount.tx++; > - return; > - } > - > - while (readb(port->membase + MCFUART_USR) & MCFUART_USR_TXREADY) { > - if (uart_circ_empty(xmit)) > - break; > - writeb(xmit->buf[xmit->tail], port->membase + MCFUART_UTB); > - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE -1); > - port->icount.tx++; > - } > - > - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) > - uart_write_wakeup(port); > + unsigned int pending; > + u8 ch; > > - if (uart_circ_empty(xmit)) { > - mcf_stop_tx(port); > + pending = uart_port_tx(port, ch, > + readb(port->membase + MCFUART_USR) & MCFUART_USR_TXREADY, > + writeb(ch, port->membase + MCFUART_UTB)); > + if (!pending) { Why unsigned int pending here and bool pending in the other cases? Reviewed-by: Ilpo Järvinen -- i. --8323329-407419242-1663660068=:1766--