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 7AFE5C6FA82 for ; Tue, 20 Sep 2022 22:46:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5B00B84A59; Wed, 21 Sep 2022 00:46:25 +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="F1IyQs4S"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9E0F484AB9; Wed, 21 Sep 2022 00:46:23 +0200 (CEST) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (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 1E11A8432F for ; Wed, 21 Sep 2022 00:46:21 +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-x736.google.com with SMTP id x18so2833197qkn.6 for ; Tue, 20 Sep 2022 15:46:21 -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=nGNws/ymUBD2/efl++FWRX151+FU8IQpE5kouKSuqKQ=; b=F1IyQs4SjoXnk76xWsChqbhwpnnyJ3zjHq+jLlqNi06bKlw5jbJdvT/YMV+2loIRU+ QdKTDEgWCxCWWV+nUShn3nXYKgGnbKQ7WckrXz2aMLGBS4XUG0eRwqtEGy/cTk3BU67M RjxtznpoNbbs2U9NaJHPP9nCrjGlUWC32pKQg= 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=nGNws/ymUBD2/efl++FWRX151+FU8IQpE5kouKSuqKQ=; b=vo/w1ChM+P33s9VqPrPqYOa7+XyOsQ1TJ+qXw+xUo6RAY4pW3oakb2J1+Qk//Q9Hnr 9cW2oSl5j9wdf/dzR9W+OMr70B93jybERVp+YSelqWQk4HPkU54y96WsLx1fz1FF9T8i oWUBaUZlfz3QaPtKHeLak02ZbpJ8m9Fie6mmtde3Fi6ye/SBMeINqEK0lZBAlj4IvYAK olbDmpNCrhpu1KWpbo7C34uK2JvRcZHnDhqJznEjye8l1e9GIpiabDRJEQ2qIXAh601R YqbpeAKLYGdNnjKZfyt+50izuwLQFgLgUGnTrnyFMrObBVYdY+XO0E8J6dyihYMDNINe FAWg== X-Gm-Message-State: ACrzQf0p+S4lnTsTMl5xFZx50UpcpT+cLR0cAeC+jW4PgxBGliwFa8bZ gQy/x87oRsnjyDnRlKIR9ONmPcjY1bfCxy7m X-Google-Smtp-Source: AMsMyM6Z0MYHgfqIJAcaHE1fKLuA93AegUQ6wvpo9PAWc+dVEXW6xObf4zpynH7iH3GFDcHPgJ3iqA== X-Received: by 2002:a05:620a:19a0:b0:6ce:d53b:809d with SMTP id bm32-20020a05620a19a000b006ced53b809dmr15441127qkb.482.1663713979803; Tue, 20 Sep 2022 15:46:19 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-0ca7-0a1a-8231-1683.res6.spectrum.com. [2603:6081:7b00:6400:ca7:a1a:8231:1683]) by smtp.gmail.com with ESMTPSA id t3-20020a37ea03000000b006ce5ba64e30sm608419qkj.136.2022.09.20.15.46.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 15:46:19 -0700 (PDT) Date: Tue, 20 Sep 2022 18:46:17 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Simon Glass , u-boot@lists.denx.de Subject: Re: [PATCH v3 4/6] serial: Implement serial_flush() function for console flush() fallback Message-ID: <20220920224617.GO3044094@bill-the-cat> References: <20220905093121.11630-1-pali@kernel.org> <20220905093121.11630-5-pali@kernel.org> <20220920214039.GA571952@bill-the-cat> <20220920221857.33c4x6rj6aj3xr44@pali> <20220920222902.GN3044094@bill-the-cat> <20220920223233.7u7ga2dtlwwhkphs@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dwWFXG4JqVa0wfCP" Content-Disposition: inline In-Reply-To: <20220920223233.7u7ga2dtlwwhkphs@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 --dwWFXG4JqVa0wfCP Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 21, 2022 at 12:32:33AM +0200, Pali Roh=E1r wrote: > On Tuesday 20 September 2022 18:29:02 Tom Rini wrote: > > On Wed, Sep 21, 2022 at 12:18:57AM +0200, Pali Roh=E1r wrote: > > > On Tuesday 20 September 2022 17:40:39 Tom Rini wrote: > > > > On Mon, Sep 05, 2022 at 11:31:19AM +0200, Pali Roh=E1r wrote: > > > >=20 > > > > > Like in all other console functions, implement also serial_flush(= ) function > > > > > as a fallback int console flush() function. > > > > >=20 > > > > > Flush support is available only when config option CONSOLE_FLUSH_= SUPPORT is > > > > > enabled. So when it is disabled then provides just empty static i= nline > > > > > function serial_flush(). > > > > >=20 > > > > > Signed-off-by: Pali Roh=E1r > > > > > Reviewed-by: Simon Glass > > > >=20 > > > > This breaks building on a number of platforms such as ds109 probabl= y due > > > > to DM_SERIAL not being enabled. > > >=20 > > > ds109 is failing on error: > > >=20 > > > LD u-boot > > > arm-linux-gnueabihf-ld.bfd: common/console.o: in function `flush': > > > /tmp/u-boot/common/console.c:802: undefined reference to `serial_flus= h' > > > arm-linux-gnueabihf-ld.bfd: common/stdio.o: in function `stdio_serial= _flush': > > > /tmp/u-boot/common/stdio.c:93: undefined reference to `serial_flush' > > > make: *** [Makefile:1782: u-boot] Error 1 > > >=20 > > > And serial_flush() is implemented only in serial-uclass.c (which is > > > DM_SERIAL code). > > >=20 > > > So could you try to add this additional guard (into this 4/6 patch)? > > >=20 > > > diff --git a/include/serial.h b/include/serial.h > > > index f9009d4046e3..fe01bcfadb9b 100644 > > > --- a/include/serial.h > > > +++ b/include/serial.h > > > @@ -362,7 +362,7 @@ void serial_setbrg(void); > > > void serial_putc(const char ch); > > > void serial_putc_raw(const char ch); > > > void serial_puts(const char *str); > > > -#ifdef CONFIG_CONSOLE_FLUSH_SUPPORT > > > +#if defined(CONFIG_CONSOLE_FLUSH_SUPPORT) && CONFIG_IS_ENABLED(DM_SE= RIAL) > > > void serial_flush(void); > > > #else > > > static inline void serial_flush(void) {} > > >=20 > > > ds109 with this change compiles fine on my computer. > >=20 > > It should, but that means that CONSOLE_FLUSH_SUPPORT itself should be > > depending on DM_SERIAL. >=20 > No. Because CONSOLE_FLUSH_SUPPORT has nothing with serial. You can have > e.g. LCD/VGA or USB tty output console device on platform without serial > console (where would be whole serial subsystem disabled) and still able > to use new flush support. Ah, hum. I'll apply the above and look at the before/after for everyone before I suggest anything further. --=20 Tom --dwWFXG4JqVa0wfCP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmMqQrUACgkQFHw5/5Y0 tyx4QAv/clPAnYQpvJtxcJASVrbQ6qTFhp6eQXRBfMhfAmq9KwUHSTJSltFGLCqn lvRPtIqnCMJIYmAobW/7Ae+YaHaw5EUvNrF+WwOvg3UZTUs3UuYGMqBe+D4vEcB9 1kUsq0CCEUw8FQUr2wBi6gCuIYRWdQK3Vlc2T2hEMVBUEiEdrJk6mnkyxrmcntVa CfNVuhTetAYpzSqqNOpAiGNCuNpbVlzvxAuSNVrvEctGJvi1VjRBc2iMppHWYFNt dChRJE6nrknfrVg5+CG4O39wTeM/LWz13GUkZF77PSM1QFxRrG+iyE8X8KEtDab4 ATrVaohsq+bROYErYRxegE9K/LyfV8KbJnKCOdEUGFJxZFXackmQjB3H8dbjldvE +x5Qnk0M0w1GKfB9ozknYCPbBDDCINObntjfuKjGJBI3QxlsYloavxGTWSEnelys pRGyWz0JMPtH2vmpfLB3Hk6X1mIYxyYCN19RmmqNCrCjz6sXPfqnvdk3YdJcTBkP B5RvlcAg =0NVc -----END PGP SIGNATURE----- --dwWFXG4JqVa0wfCP--