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 7FFF2C6FA82 for ; Tue, 20 Sep 2022 22:29:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 32ECC84B50; Wed, 21 Sep 2022 00:29: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=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="hXWMQL5F"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8619B84B58; Wed, 21 Sep 2022 00:29:09 +0200 (CEST) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (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 2B15E84B18 for ; Wed, 21 Sep 2022 00:29:07 +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-x82d.google.com with SMTP id r20so2871065qtn.12 for ; Tue, 20 Sep 2022 15:29:07 -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=Xh/zErJ/FL1Z8nPxacSE0KQa6N8nelu/1ulyVpQlNyk=; b=hXWMQL5FDMtKGO3Jus5+24hQCWtkl3vaTh0uVCIQis/bjK6SKabnpFKy7evie/SEv0 gfwxIDKnAdmxEr8vdBd8ncKgd1W9ASFp5sNfVK00GNjcS9HIAZOwnnzXoNIS1UAh4zgQ Jd3IFRFNuMF1OBK+pvxubdvjaLUQAvRL3xrVo= 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=Xh/zErJ/FL1Z8nPxacSE0KQa6N8nelu/1ulyVpQlNyk=; b=KnERMzCk0jReSqTN7oaO3M4uvlnlP//gASBvXhJ/ypqYncunQsLkNdfYeAqgU9Mwe6 QkgKKY3rktk7C6oMFlg3JU8PYDCiANwlX3hHZxjOpS4GJTXjlEEsKusAoWC6ylH8iTe2 tKsgDX498gIxd4BTAAiDABVFT94jXVlTVpN49TVWKax8+NT61r44e/nk5QvxfqZZOKzi YJYAOhsk9vsrJr/7AOXK+A7ZqEHN+6nb9g9fXWJ0mJnSmmc8PxtHwTPl99G9pH/ORWXl JDwFIJ8aAjcghPzKUb4XipcA5Zwwg2Dl6BrFWASWPbdZimBgj6cZz4ULaAuTDcH+BQGy 1u4Q== X-Gm-Message-State: ACrzQf3wef/lhIZw4xDnXwC4N5HJU18+XDw0nbaq/9ZT7SgUo2si2r5T +qjbSDo8/U6F8hmRGvmNk+ZTzg== X-Google-Smtp-Source: AMsMyM5yHBA9KMKu2QR3oZA4FE4CfrDo05X5zVO9oVNYNNo+2tGnftLXfShy9ty0B4pcDyhD76qfxA== X-Received: by 2002:a05:622a:48f:b0:35c:eb08:aed9 with SMTP id p15-20020a05622a048f00b0035ceb08aed9mr9890426qtx.143.1663712945938; Tue, 20 Sep 2022 15:29:05 -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 s5-20020a05620a254500b006b98315c6fbsm806467qko.1.2022.09.20.15.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 15:29:05 -0700 (PDT) Date: Tue, 20 Sep 2022 18:29:02 -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: <20220920222902.GN3044094@bill-the-cat> References: <20220905093121.11630-1-pali@kernel.org> <20220905093121.11630-5-pali@kernel.org> <20220920214039.GA571952@bill-the-cat> <20220920221857.33c4x6rj6aj3xr44@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="D6z0c4W1rkZNF4Vu" Content-Disposition: inline In-Reply-To: <20220920221857.33c4x6rj6aj3xr44@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 --D6z0c4W1rkZNF4Vu Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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() fu= nction > > > as a fallback int console flush() function. > > >=20 > > > Flush support is available only when config option CONSOLE_FLUSH_SUPP= ORT is > > > enabled. So when it is disabled then provides just empty static inline > > > 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 probably 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_flush' > arm-linux-gnueabihf-ld.bfd: common/stdio.o: in function `stdio_serial_flu= sh': > /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_SERIAL) > void serial_flush(void); > #else > static inline void serial_flush(void) {} >=20 > ds109 with this change compiles fine on my computer. It should, but that means that CONSOLE_FLUSH_SUPPORT itself should be depending on DM_SERIAL. --=20 Tom --D6z0c4W1rkZNF4Vu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmMqPqcACgkQFHw5/5Y0 tyy9+gwAk69eziAyMsnS9wmShiDcO1QVqAzkr0EK4wkS6gLTlsEDJSS+K1vs1oN+ rGy4fShqIGonjYDeMOepTrWXvFi/zCmVx86Qe+jBX8f/aQZBmly2yhZ97LSmcBTF wZJLQp0U1rz5MAUkLP/HPGwFr72QvUITm3BOTNI2Lt+tAnE40lTVe0FTGMhdbCGr riNhu51w6lddBXrLV5qBKfnkp2WWXmHzU0y57OIVtLLTxfGHi/nSJgv95BsYTUsO fR3B1trcjxRQpX6d7cSk/e/8dr3jjPGRuvEwdlR8JGfV4w/XuqLOS1n3lPuzyL25 m4HdOxlsSqhlitpP52u8LbW+rW+0Z2Vq9dYTFxuA8HH4HVSXXTHDJWsa+p8jFalw VnHEJvEZUpMwpy5/Wzr8kHbKcm/JubpLkWxLUoQxAkZgvsnDgLSBWwfPLzg2YJyE iPIFeQ0f/pqWrOiZDvB3BqVG4gpuSgXdY72PzgI51Fi9sz24cGUogbuyBVq6I7+Z W7kkfDyN =9wgl -----END PGP SIGNATURE----- --D6z0c4W1rkZNF4Vu--