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 B8EB1ECAAD8 for ; Fri, 23 Sep 2022 16:19:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 18B5A83914; Fri, 23 Sep 2022 18:19:16 +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="dLlczUHo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2374483945; Fri, 23 Sep 2022 18:19:14 +0200 (CEST) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 4E280838DB for ; Fri, 23 Sep 2022 18:19:11 +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-qt1-x82b.google.com with SMTP id r20so329340qtn.12 for ; Fri, 23 Sep 2022 09:19:11 -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=6bHa+qW/6DZK4QqkhNeWWIsSOBi9SQ97KPnDoKzDdhg=; b=dLlczUHoNdw2xql7EdIprbFEdPM1upPBcm3gkwwT+cnXvaEsqh9Ac5prLC1JuPFkTl znyrX6IP7uaVl4izOt8on7FCRLJLrfIzy53CdQEowHLG8jLYcSyDuEFBbCl9mNi3cllr SXt/s7n0ROLx8IV4NcgL9sTG5I+ds3uyGcWvk= 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=6bHa+qW/6DZK4QqkhNeWWIsSOBi9SQ97KPnDoKzDdhg=; b=3ss6vIka+co4Vp7eQUNKo3p5zHNDrSG/lZ5M8xm+bDxspORbtg22aZh1Zrd9r0NFiX 5qGxUBKOzZb6WCcXWuZpsHbXL08cr4y/XNg6x3g3/cY54qqubm9qEkq7+CBtFbByoh+v n4l2nL+f2XuzYyzm8PSM11ZyEN+UYP9uCzo9pY6uvQAb310NRzaayW3wKlvx5K8wJzYE XOV1oNqkqK7WgZEAhQlr4lD2CRH4oTHc1Ks8adcITkQQgCnnuS1kBrMDJZvhSgNfjKDC coMXDW/Ho8kSOZheH+peEjZwh2aFJPrIqBY5+WFerxTrFtemCqAlVNwQe4nRaBMpe+2e 2wFw== X-Gm-Message-State: ACrzQf0baTGMkXcSIjih+FeSnCUtP0na8D4vmR5kDTKIyhmD0o4ezpM0 /oGFtpIgwLuz6L/l2Dmbq1VC6g== X-Google-Smtp-Source: AMsMyM4f7sZ4Z8x50l9EBxiyOa/L+l0iufMv78HtK1+ub4oG2NeCBy5ufT2VBWoniTQovel3jlnuTg== X-Received: by 2002:ac8:7d4a:0:b0:35c:cbc8:6c0e with SMTP id h10-20020ac87d4a000000b0035ccbc86c0emr7835362qtb.356.1663949949555; Fri, 23 Sep 2022 09:19:09 -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 o17-20020a05622a045100b003447c4f5aa5sm6207883qtx.24.2022.09.23.09.19.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 09:19:09 -0700 (PDT) Date: Fri, 23 Sep 2022 12:19:06 -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: <20220923161906.GG3044094@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> <20220923155730.GF3044094@bill-the-cat> <20220923160703.4o4hnr63p5gbwppr@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dRgc669pgRVB2OqT" Content-Disposition: inline In-Reply-To: <20220923160703.4o4hnr63p5gbwppr@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 --dRgc669pgRVB2OqT Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 23, 2022 at 06:07:03PM +0200, Pali Roh=E1r wrote: > On Friday 23 September 2022 11:57:30 Tom Rini wrote: > > 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 wr= ote: > > > > > > >=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 wr= ote: > > > > > > > > >=20 > > > > > > > > > > On certain places it is required to flush output print = buffers to ensure > > > > > > > > > > that text strings were sent to console or serial device= s. For example when > > > > > > > > > > printing message that U-Boot is going to boot kernel or= when U-Boot is > > > > > > > > > > going to change baudrate of terminal device. > > > > > > > > > >=20 > > > > > > > > > > Some console devices, like UART, have putc/puts functio= ns which just put > > > > > > > > > > characters into HW transmit queue and do not wait until= all data are > > > > > > > > > > transmitted. Doing some sensitive operations (like chan= ging baudrate or > > > > > > > > > > starting kernel which resets UART HW) cause that U-Boot= messages are lost. > > > > > > > > > >=20 > > > > > > > > > > Therefore introduce a new flush() function, implement i= t for all serial > > > > > > > > > > devices via pending(false) callback and use this new fl= ush() function on > > > > > > > > > > sensitive places after which output device may go into = reset 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 consol= e flush() fallback > > > > > > > > > > serial: Call flush() before changing baudrate > > > > > > > > > > boot: Call flush() before booting > > > > > > > > >=20 > > > > > > > > > Including the change you suggested to 4/6 to fix that bui= ld issue, > > > > > > > > > there's at least one more large issue that prevents CI fr= om getting 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 function= s, in 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 reque= st > > > 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? > >=20 > > Were you also going to rename flush as suggested? >=20 > I have not done any renaming (yet). I pushed on CI test above efi_st fix > and this patch series (with 4/6 build fix issue). Nothing more. >=20 > About renaming, I'm not sure what if flush_console() is better name as > this is generic API and it can do e.g. flushing LCD output. Just like > generic puts() or getc(). I just do not know if generic name is better > or worse... I'm not sure either, lets wait a little bit longer to see if anyone else chimes in with a strong opinion? --=20 Tom --dRgc669pgRVB2OqT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmMt3HAACgkQFHw5/5Y0 tyxTzgwArurTfVSPLsVJLtbqNPZ06pTQ0PFoINQx7y9hFR6EyFdaJjfN60yOPePN X7xb0PpQtmvM9O6H9316Oa9Rf3WXFUel24JIBVNXJfbxeWadcF5HJcNetcMT3ZgZ DGJ9Qh5SRYEDotpspxb2rHgvJzVDRfnKCX0BBePkMnR5y1PTGqOChkcNw0lt75ZE GgHwLa+pPQ7mNeiG4Gx/gNidmYM9xSNSIX74iZRiI8r6VA9YwgWL3Vbd4sZqUAIK JtdTk3TxqFnWqg5Q/ajGwz15S1jcWGlmxMZQyahjpjcofHcdFhYfOwv4VeCR3ZHO DYSal8McZIV/YB4ET9R5YKdG+yLQ8EipO5AJ9zMpz8eD+Ff3zTUuq4XJmLz6SEfr KcphauZs9hvvZK0GAY3tu64uwJBLq+VuGqpt0vWpbQBTlXJd0JghpJLPqEh/nFKu H/oKqgQkZt9tq2AKSQpJEsb2aCw1NtlR3vPwUFUvYfxAbFlr55k0i8p/1n7TFFiN kG+Kg0FX =cPZL -----END PGP SIGNATURE----- --dRgc669pgRVB2OqT--