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 5E5BDC54EBE for ; Fri, 13 Jan 2023 00:18:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A43E68555D; Fri, 13 Jan 2023 01:17:42 +0100 (CET) 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="K1JdhH2c"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 56389854FB; Fri, 13 Jan 2023 01:17:15 +0100 (CET) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (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 34C598549F for ; Fri, 13 Jan 2023 01:17:03 +0100 (CET) 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-x829.google.com with SMTP id k11so737662qth.3 for ; Thu, 12 Jan 2023 16:17:03 -0800 (PST) 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:message-id:reply-to; bh=202Fnb7ZKWhCDq6qhxXIt6eGMeTutjeOznkbH+VnGQU=; b=K1JdhH2cm8r4uL/PAYurhzCIeBYi9ylSUVgsW+no45mHLzskhaYpD5vZ91tZoxqQ4f FU+een20LdR1C5ciu/wCAsIdtalvqJmOzL5bKExQSmifu+fzAoWf/lG3NxFB5o7UpvHd BUzymt5S4lkHGEJ8I/1bYbLkbQYWXxhGhe3yM= 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 :message-id:reply-to; bh=202Fnb7ZKWhCDq6qhxXIt6eGMeTutjeOznkbH+VnGQU=; b=DZ2v5RBGfjNGLlrxiROcZ7PHVE97CtndT2Dtpa5X4wVRTVNmH4F8A2f64/5qTnajys fp8bywm34MFKbH7Mk+80FNVv988dKI+cjcLvhnhme6biFJRxInB43UEVbCMwUvd6tYbO aw6kTu6SownKhatqBiJHLcdElnxCRr4z3smGLZJ6qCYeaIzfMfBC2azFppbNEk0pKZXu qSMLsr+OUO9BEnG0mR4Ksq2cp9JvBl90mVDfTEVOTsq52/Fn7vS7r1O+T9HWjGdGUob6 joILrqVWS1sRq+dTaLXBkAegJCpWbtsOcOY+wDUuSj+SVmDiYrku2ZjzWDoxYapSI4AA pcFg== X-Gm-Message-State: AFqh2kp3BagHjMfeFunAL8pgwR+2DFXmDydsai0JUxrPvzZ1jx+1FnT2 bloFRh4XnZ0HiEuNZkbm4BCB+Q== X-Google-Smtp-Source: AMrXdXvcIz5gPc/kt4GsJC2IZ5JpEYlLg/+RaptzyQrDMwcWAyYF4rQyz3+6nnhkxhnD2tFt3SRr2A== X-Received: by 2002:ac8:43d2:0:b0:3a8:137e:2963 with SMTP id w18-20020ac843d2000000b003a8137e2963mr17545246qtn.20.1673569021845; Thu, 12 Jan 2023 16:17:01 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-38c4-8177-7e9d-a94f.res6.spectrum.com. [2603:6081:7b00:6400:38c4:8177:7e9d:a94f]) by smtp.gmail.com with ESMTPSA id g20-20020ac84814000000b003a97a71c906sm9767945qtq.78.2023.01.12.16.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 16:17:01 -0800 (PST) Date: Thu, 12 Jan 2023 19:16:59 -0500 From: Tom Rini To: Harald Seiler Cc: u-boot@lists.denx.de, Rob Herring , Simon Glass , Serge Bazanski Subject: Re: [PATCH] Revert "time: add weak annotation to timer_read_counter declaration" Message-ID: <20230113001659.GE3787616@bill-the-cat> References: <20230105000847.151464-1-hws@denx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oWHx+3Q+JtI1XbGl" Content-Disposition: inline In-Reply-To: <20230105000847.151464-1-hws@denx.de> 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 --oWHx+3Q+JtI1XbGl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 05, 2023 at 01:08:47AM +0100, Harald Seiler wrote: > This reverts commit 65ba7add0d609bbd035b8d42fafdaf428ac24751. >=20 > A weak extern is a nasty sight to behold: If the symbol is never > defined, on ARM, the linker will replace the function call with a NOP. > This behavior isn't well documented but there are at least some hints > to it [1]. >=20 > When timer_read_counter() is not defined, this obviously does the wrong > thing here and it does so silently. The consequence is that a board > without timer_read_counter() will sleep for random amounts and generally > have erratic get_ticks() values. >=20 > Drop the __weak annotation of the extern so a linker error is raised > when timer_read_counter() is not defined. This is okay, the original > reason for the reverted change - breaking the sandbox build - no longer > applies. >=20 > Final sidenote: This was the only weak extern in the entire tree at > this time as far as I can tell. I guess we should avoid introduction of > them again as they are obviously a very big footgun. >=20 > [1]: https://stackoverflow.com/questions/31203402/gcc-behavior-for-unreso= lved-weak-functions >=20 > Fixes: 65ba7add0d60 ("time: add weak annotation to timer_read_counter dec= laration") > Reported-by: Serge Bazanski > Signed-off-by: Harald Seiler Applied to u-boot/master, thanks! --=20 Tom --oWHx+3Q+JtI1XbGl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmPAovsACgkQFHw5/5Y0 tyyTxQv8DCw8sbfz4L1mwkFgc2ICn9CqdmUflKtt02Xx8dFAhQbIZ7n86gx8DIpr yZAk8bfDkg8NGw70DRFigQGOp+BL0pDmI/OdlLQaMir/i+7PfFhUefvZsN0gjYDv KUpDZQMYjTxWgz/hOtseOiUHvJkn5bAX4IpBzLJMXre+Y8xjP6txr++0GEBG5HQ5 /LtB6sa+jQh2IzLMXxyHYrz9B4OCyCal1wOzvbvFhSep6hX9pTkyrIkKMoR5xMAc R4RUvp3VPr+yqs6J+45FMXeh2Vsm7rl/GTZ2Qne70+RXhKrPfuGlCFOGGM4GPoGU mK7ScUxg+qM4P9G1qT2TL0YZwn2b/uLexkUDP1hwcXvhZYzNny11bG9JQcI9FjXh AelLKZii4Vc1mGNxQluuxz7U3r/FHopOR5QPBtW0sAua1NpjaPRxaQEbfSOAvfaD 0D8cJZhtI8814R1wpcNDlmIr/eB4w+mZCSsMMDHBAQDY+VgoVvmw3xsbgztx99uW gRnmZvZO =4lGu -----END PGP SIGNATURE----- --oWHx+3Q+JtI1XbGl--