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 4F765C6FA82 for ; Fri, 23 Sep 2022 15:57:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5864F838E0; Fri, 23 Sep 2022 17:57:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="FhZbEsjA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4586E83945; Fri, 23 Sep 2022 17:57:37 +0200 (CEST) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (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 843E2838DB for ; Fri, 23 Sep 2022 17:57:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x732.google.com with SMTP id g2so376153qkk.1 for ; Fri, 23 Sep 2022 08:57:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=iffY0JNmErTyfKC5H3Y9HlA/zasg/NsoL97IRaKR5HY=; b=FhZbEsjAWuDEq59Smme1ALKk2sSM7BGjXJCqUpB9OaVqqHbTUCNWVn4q43ZAOFS/8g aEJgijxgm7JS3OYjx06XytRFpVOQlIOuWMSXh3I52HZvVSaRl7jnj7kuSpc8GC0dRRmo BI0CvK4CeVEKwflkoZcp/JwFP5GQ9/iGUXul8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=iffY0JNmErTyfKC5H3Y9HlA/zasg/NsoL97IRaKR5HY=; b=uq8RiXFVSs3l5cmhuZdQDtr1rRDzmgC/22dneZteHueRHgHRLSFyURKbcIsQlBKIEj N71H4URiyWj+smNDJ/ARQZ1G1q1SdZzmSLTslTdg7HSAqkI7CbMLi945yJf7j1r9EXt2 MhzE5Gici8HHEEqITu2WN/3ACyKxAwx7VFH5L76VMJERb0LeKAG1zBlw81KrFO47MHdi E7bqz+HBAFiCrfre39id/4doXOwssGZHtjEU2qpwM1zQB/3sR2xiwsgTod5lfIrBtf2S EjN1bFcVL0FEj5Khgz9Y+IPca891CQXjrWqgFKEnFkPtzyCb4ZwZUMEh5c2o8sP+q7tg 4zUQ== X-Gm-Message-State: ACrzQf1i3DM81V438lQ12hZ93IZvQXN0+wYDqU7G0HHqSDDt4vRuW4w1 UaMN3GCQCHtdG6ZwgqB6puvefA== X-Google-Smtp-Source: AMsMyM4gFy7xG6vz/Lofz2XmBqwj5zuKYe2Te7opw3Nh+JdQFZ/2OdOA5ckLPUU6z/sx9idWyWwtnw== X-Received: by 2002:a05:620a:1a17:b0:6ce:7c1b:c27f with SMTP id bk23-20020a05620a1a1700b006ce7c1bc27fmr6132230qkb.42.1663948653134; Fri, 23 Sep 2022 08:57:33 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-100c-81f5-095d-9e48.res6.spectrum.com. [2603:6081:7b00:6400:100c:81f5:95d:9e48]) by smtp.gmail.com with ESMTPSA id c26-20020a05620a165a00b006b8e63dfffbsm5186030qko.58.2022.09.23.08.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 08:57:32 -0700 (PDT) Date: Fri, 23 Sep 2022 11:57:30 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Heinrich Schuchardt , U-Boot Mailing List , Simon Glass Subject: Re: [PATCH v3 0/6] console: Implement flush() function Message-ID: <20220923155730.GF3044094@bill-the-cat> References: <20220905093121.11630-1-pali@kernel.org> <20220921134924.GQ3044094@bill-the-cat> <20220921135413.lz6wzjrgabns5p7d@pali> <20220921135601.GS3044094@bill-the-cat> <20220922131411.nswhopn6hvwajx62@pali> <20220923154507.qlv5ghrf2kbyuubc@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QOa9dl9wYIBIim/b" Content-Disposition: inline In-Reply-To: <20220923154507.qlv5ghrf2kbyuubc@pali> X-Clacks-Overhead: GNU Terry Pratchett 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 --QOa9dl9wYIBIim/b Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 23, 2022 at 05:45:07PM +0200, Pali Roh=E1r wrote: > On Thursday 22 September 2022 17:06:31 Heinrich Schuchardt wrote: > > On 9/22/22 15:14, Pali Roh=E1r wrote: > > > On Thursday 22 September 2022 13:27:51 Simon Glass wrote: > > > > Hi, > > > >=20 > > > > On Wed, 21 Sept 2022 at 15:56, Tom Rini wrote: > > > > >=20 > > > > > On Wed, Sep 21, 2022 at 03:54:13PM +0200, Pali Roh=E1r wrote: > > > > > > On Wednesday 21 September 2022 09:49:24 Tom Rini wrote: > > > > > > > On Mon, Sep 05, 2022 at 11:31:15AM +0200, Pali Roh=E1r wrote: > > > > > > >=20 > > > > > > > > On certain places it is required to flush output print buff= ers to ensure > > > > > > > > that text strings were sent to console or serial devices. F= or example when > > > > > > > > printing message that U-Boot is going to boot kernel or whe= n U-Boot is > > > > > > > > going to change baudrate of terminal device. > > > > > > > >=20 > > > > > > > > Some console devices, like UART, have putc/puts functions w= hich just put > > > > > > > > characters into HW transmit queue and do not wait until all= data are > > > > > > > > transmitted. Doing some sensitive operations (like changing= baudrate or > > > > > > > > starting kernel which resets UART HW) cause that U-Boot mes= sages are lost. > > > > > > > >=20 > > > > > > > > Therefore introduce a new flush() function, implement it fo= r all serial > > > > > > > > devices via pending(false) callback and use this new flush(= ) function on > > > > > > > > sensitive places after which output device may go into rese= t state. > > > > > > > >=20 > > > > > > > > This change fixes printing of U-Boot messages: > > > > > > > > "## Starting application at ..." > > > > > > > > "## Switch baudrate to ..." > > > > > > > >=20 > > > > > > > > Changes in v3: > > > > > > > > * add macro STDIO_DEV_ASSIGN_FLUSH() > > > > > > > > * fix commit messages > > > > > > > > * remove changes from serial.c > > > > > > > >=20 > > > > > > > > Changes in v2: > > > > > > > > * split one big patch into smaller 6 patches > > > > > > > > * add config option to allow disabling this new function > > > > > > > >=20 > > > > > > > > Pali Roh=E1r (6): > > > > > > > > sandbox: Add function os_flush() > > > > > > > > console: Implement flush() function > > > > > > > > serial: Implement flush callback > > > > > > > > serial: Implement serial_flush() function for console fl= ush() fallback > > > > > > > > serial: Call flush() before changing baudrate > > > > > > > > boot: Call flush() before booting > > > > > > >=20 > > > > > > > Including the change you suggested to 4/6 to fix that build i= ssue, > > > > > > > there's at least one more large issue that prevents CI from g= etting too > > > > > > > far: > > > > > > > https://source.denx.de/u-boot/u-boot/-/pipelines/13534 > > > > > > > and they all have a failure similar to: > > > > > > > https://source.denx.de/u-boot/u-boot/-/jobs/500794#L51 > > > > > >=20 > > > > > > It looks like that some efi stuff overloads u-boot functions, i= n this > > > > > > case newly added flush() function. > > > > > >=20 > > > > > > Any idea how to handle this issue? > > > >=20 > > > > I think you should rename the EFI flush() function to something like > > > > efi_flush(). > > >=20 > > > Ok! I renamed EFI flush() function to efi_flush(). > > >=20 > > > I put all patches into github pull request which started CI test: > > > https://github.com/u-boot/u-boot/pull/241 > >=20 > > When merging, please, use > > [PATCH 1/1] efi_selftest: prefix test functions with efi_st_ > > https://lists.denx.de/pipermail/u-boot/2022-September/495334.html >=20 > Hello! I updated https://github.com/u-boot/u-boot/pull/241 pull request > for CI test. I added there above efi_selftest patch and after that CI > test passed. >=20 > So Tom, is this enough for you? Or do you need something more? Were you also going to rename flush as suggested? --=20 Tom --QOa9dl9wYIBIim/b Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmMt12cACgkQFHw5/5Y0 tyzROAv9Glr17Zcj1CMAphBsZTNV8nTE6pzeA1bz9sd9huwAs9hmPsd5SSk/ygqf PGigzQBFXK2b2IuDRzXrAsOEIttAt5Qh/REg3RRI4l4oXMB+CcklnYzTNfycKBHB mYS2ZlxZ7BOwDyjzNsMUTedQfXirLnht5IE8gjjJB3dlrkbTKdK9/a0IBZtoOqZu jOHXJmx169qmNT01kOSYeSE5gmtKS0IS4r67KV0MnzqnZ4C6ihQqq0UcH/Nq09zs zbF2YFMeeeAzSg+QVc1XaOB3eDjUduBAKa+dBaLKNUxWMRDsLPhKghPhYxSERTHR CFpCiFrzpP8idH+8s6moSDQ6lpd/MuBnjnWPjBJX80C13VhPSY3blpobXnocL4CX vMcX2KhVQ6/e+anbCsGDhlDIBy4gIzZy8lHTy6orjwhZT8L/iN3yZ2G5idfbVet8 V/sAKyHR0DHqnq570gu123WaOIMY380pEAR+lxL8921XT4j4DCYz/tzQ1yuuELvb bjJi33iJ =arMM -----END PGP SIGNATURE----- --QOa9dl9wYIBIim/b--