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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8176CFA373E for ; Tue, 25 Oct 2022 20:37:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B7F4B84DBF; Tue, 25 Oct 2022 22:37:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1666730225; bh=/dUGsfJwt+33GiEHE75Lq9w4+M8arfMAbioBw2HZ72c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dYODwdPG6ZVdkyT01pfeU8SXqdvHDGrTWlNcwiyoMSoLBe8l1ZBHehExlSg0vnEVE KfoXenW1QL27APpnFbs2ZvtxsBkPDysnnrKTVtJkogFBsOdRUAUsenrUSo0y1ID8Iz w9VCew1LsB9lUb//aN2XtudYRy6UYAZLcNm2g+/Fso27UTV8Vf0lu5iiFCeoRPLaEk iwFZ2HkeLM+rzr6GWV2ne+uX1TaMw1mIVY5PQcpfNRKgYwlAVX94+hG1469FL92pGb DLlfmZ7pX+lb9rIZi3x+Uv5/xp7tzWBTbUWRZTDvThmvvzmqUYtzmnsEvnDcD49tOE aqLPfrWWSsU8g== Received: from mail.denx.de (unknown [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: festevam@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id C991183F51; Tue, 25 Oct 2022 22:37:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1666730221; bh=/dUGsfJwt+33GiEHE75Lq9w4+M8arfMAbioBw2HZ72c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NDwU3IZFsGI6uy2VjTxvJ06QYaS3e0iQ4WuYbX02dC86LAWvKiYCMJCgA+omSMLux kjBwbWyDQn+iDEXRM9uM61NwweBddmK1mpiNDRjzSuthMzeonbXKQoYnH2dCSuf7TU CaYr1PrgjRThAKPQ1n7O+osmZezLGYYs4b26SNWh9mUWQPzpQT0wc6vedCrxTZ7B6e 9WZInSUq5qzf8S1tMlYHKcfiJe/M3EiI8gHQKZJUoFFL1e0dqCQrXldFocZg7F6xpa XwTkXSsjyNUp8o1ZysFug1qOebsySInjIuXyClWh8g50rBdhJWnezChGD4c4QSxrnv NTUVlL4Nj7TSw== MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 25 Oct 2022 17:37:01 -0300 From: Fabio Estevam To: =?UTF-8?Q?Pali_Roh=C3=A1r?= Cc: Tim Harvey , Johannes Schneider , u-boot@lists.denx.de, peng.fan@oss.nxp.com, sbabic@denx.de, trini@konsulko.com, bsp-development.geo@leica-geosystems.com, Peng Fan Subject: Re: [PATCH v5 2/2] serial: mxc: have putc use the TXFIFO In-Reply-To: <20221025202335.k5isd54j6ubhdglu@pali> References: <20220906121504.2200171-1-johannes.schneider@leica-geosystems.com> <20220906121504.2200171-3-johannes.schneider@leica-geosystems.com> <20221025202335.k5isd54j6ubhdglu@pali> Message-ID: <4e715158a0c58e2ae42b7748676851ff@denx.de> X-Sender: festevam@denx.de User-Agent: Roundcube Webmail/1.3.6 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi Pali, On 25/10/2022 17:23, Pali Rohár wrote: > Hello! I do not have any MXC hardware but I see there one issue. > mxc_serial_putc() function probably should not return -EAGAIN when > device is busy. But instead it should wait until it is ready. > > Could you try to change code to following? > > while (readl(&uart->ts) & UTS_TXFULL) > ; > > writel(ch, &uart->txd); Your analysis looks correct. The kernel does like this: static void imx_uart_console_putchar(struct uart_port *port, unsigned char ch) { struct imx_port *sport = (struct imx_port *)port; while (imx_uart_readl(sport, imx_uart_uts_reg(sport)) & UTS_TXFULL) barrier(); imx_uart_writel(sport, ch, URTX0); } Thanks