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 BD40DC433FE for ; Thu, 3 Nov 2022 11:14:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5134B85120; Thu, 3 Nov 2022 12:14:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="o7FizS+L"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F3093850F6; Thu, 3 Nov 2022 12:14:40 +0100 (CET) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1084A85120 for ; Thu, 3 Nov 2022 12:14:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=festevam@gmail.com Received: by mail-pg1-x530.google.com with SMTP id r18so1347657pgr.12 for ; Thu, 03 Nov 2022 04:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=boc8JJupKJvFVEoSAQjE0jfj6XvnluEPYA2nFGtXICM=; b=o7FizS+LOMtsEtdqJNjz93CQL5r8AFvUC4T4q8AORH0/dSY/pp+yWzdENBdlgZUaCL LDyCqcr+uaO3b3iq+oD1PS/zEHvpYP3FSfTk33aXBBaNsMH3JQvg5oqE7ZTi6E902Vke lQBnHKdtmRj6lcd90tlK+UoASnadI2OX0kYRrTTm+09oS4+zjBsbNt20/EvXt6gOGOCQ Dowg68nyaIsVbBtnck2QqlLaywywfNJ7/jxHsIYlyeuIm8EGfAiI0eIawVvf2LoGylja gV/zL/RegsLpyKfaiUzFWFc8Glv/NeuTSBcExC2x5hFqOs0vnKpQaArQlfQPSUVj6Ys4 T8Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=boc8JJupKJvFVEoSAQjE0jfj6XvnluEPYA2nFGtXICM=; b=H1Pawq+wWEEteZ4Jy6eOmaWznIX5twYmZ0ptkqKob40QoeRr3WKd1f1AjD16YYwrw6 get2cGL4bMcUYNI9gC//ay00Fq8/N4gJKuIpKqSnyl8c37qU/Jh2UEnr9ZAZY2ez9IoU bVuTTg6bfLzoT+MqdWKnMBQnWLbkvnsCOQO0ylXVSxEc6N1Ng2cT17tfjYmGD2vZIDqk NYK9HaeHdi0At9eq9WmNa0MahTdpSRF7gmiBNMZzWtY+Nj3guW4Lzc5HRwWnSw0Gh6I9 cNfzl0lGhNLiqJUoXzLg5d3JJW2B8hi4xS0B/ZCGnq1zPKgguWyumzjJCoPSXovNsOUx r5vQ== X-Gm-Message-State: ACrzQf0QIAjyWyYEHtjOvG2gIR3kA0IsquW2sQa6ix1B9KSS0YgzFXSF vKrUU9LF4wIhFuwMUJWueWUHXCssaq34OKK+/MQ= X-Google-Smtp-Source: AMsMyM5vFUCNeIeTSNxfmEatWz02jfmHoL7+me/IpseG/NvdD2RE8H+OZ7vGq4LNOe+QShNgjzNWTrZjHo4sDdV3tMA= X-Received: by 2002:a63:83c6:0:b0:46e:f5ee:e27c with SMTP id h189-20020a6383c6000000b0046ef5eee27cmr25036042pge.603.1667474076187; Thu, 03 Nov 2022 04:14:36 -0700 (PDT) MIME-Version: 1.0 References: <4e715158a0c58e2ae42b7748676851ff@denx.de> <4d9e14631817a586e735e7c9f5a86596@denx.de> <20221026174520.2asymp5xdwg2yitw@pali> <399871b65393a70ab31bee97fb118475@denx.de> <20221102172434.4wubfscqeh2xexgg@pali> In-Reply-To: From: Fabio Estevam Date: Thu, 3 Nov 2022 08:14:24 -0300 Message-ID: Subject: Re: [PATCH v5 2/2] serial: mxc: have putc use the TXFIFO To: SCHNEIDER Johannes Cc: =?UTF-8?Q?Pali_Roh=C3=A1r?= , Fabio Estevam , Tim Harvey , "u-boot@lists.denx.de" , "peng.fan@oss.nxp.com" , "sbabic@denx.de" , trini , GEO-CHHER-bsp-development , Peng Fan Content-Type: text/plain; charset="UTF-8" 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 On Thu, Nov 3, 2022 at 3:17 AM SCHNEIDER Johannes wrote: > > Hi all, > > flushing and waiting... maybe you're onto something: what if one printf races another since it thinks considers its buffer handed to the FIFO as "done" a bit too soon? > > might the below variation on "waiting for the fifo" solve the symptoms on imx6? > > regards > Johannes > > > diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c > index 4207650503..dfd7670f7e 100644 > --- a/drivers/serial/serial_mxc.c > +++ b/drivers/serial/serial_mxc.c > @@ -329,8 +329,23 @@ static int mxc_serial_pending(struct udevice *dev, bool input) > return sr2 & USR2_TXDC ? 0 : 1; > } > > +static ssize_t mxc_serial_puts(struct udevice *dev, const char *s, size_t len) > +{ > + struct mxc_serial_plat *plat = dev_get_plat(dev); > + struct mxc_uart *const uart = plat->reg; > + > + while (*s) > + mcx_serial_putc(dev, *s++); There is a typo here: it should be mxc_serial_putc() instead. No, it does not fix the issue. Not sure why you mentioned imx6. The issue can be reproduced on imx8mm as well.