From mboxrd@z Thu Jan 1 00:00:00 1970 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 C27BAC4332F for ; Mon, 10 Oct 2022 17:56:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0A80084EE8; Mon, 10 Oct 2022 19:56: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=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="gB2OpO+f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DB9B884EEB; Mon, 10 Oct 2022 19:56:18 +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 02A5984E35 for ; Mon, 10 Oct 2022 19:56:13 +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 a5so2078504qkl.6 for ; Mon, 10 Oct 2022 10:56:13 -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:message-id:reply-to; bh=UJMVwdH65V6AS72QvWMGqK/odrqncJOnpQDFsNcqVLA=; b=gB2OpO+fnOt2lVoENopUP0ownPiP7MQPI0DWNh///f+t76iE/zvQSWVAjth3mxkyce XXBBC3HPOMZfxUsRAYdelGffFeNFoacG7+LTF53FJJgr9QXRAIIXlNwfsJjqTmTayyrV JE00ww8Yb2YPADURcsk+dg6c87x0QUIDecpUQ= 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=UJMVwdH65V6AS72QvWMGqK/odrqncJOnpQDFsNcqVLA=; b=XuCMKDqbXzwd32Qho0HC36+LYrLhlP0K+OeDaZEH6lqyjviEBDYE7/DjCgCLSGYLct o+akYW5F7t46ki1YmIKBYnvcmF6a3KeruVyMV5kiEwK+bNU90z1+8Zkv27BFOPbpVVCb MZ7fYdSQ82TJzOVt2fmG1CbNdLi5M8Qj19cS3aDnwarX65J5eiZO3vFly0tqJxSbgnBR LZxlalwxZhfRcARus8qRPWMHAlgKPGh5W6Wu5gP4Cv3XvOUNMeZZo9CFubhPwvvbZmk9 oYZXKaN3NNi1ZbDUZbn1SoCR9s6QM4VHZL/4svcRKB/Gak/SN1IqzTtsp08G68k5uzAG 9zbw== X-Gm-Message-State: ACrzQf1tYf70NLJ9famfFb2UURtCZU0O8oloeVm536dlYkbmufWWOoDc KNL1tnGjg2VPZCZ7w6+pLxZhSwc/QcCBww== X-Google-Smtp-Source: AMsMyM52YEmXcJ7mwOkHagGVChMTLSZyUm9a41cSUOB1IpXf2hv5f1a0LcuKV4or+8x8X4y7b86u/g== X-Received: by 2002:ae9:e895:0:b0:6ee:74f7:d0e6 with SMTP id a143-20020ae9e895000000b006ee74f7d0e6mr865795qkg.398.1665424572693; Mon, 10 Oct 2022 10:56:12 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-9534-07b5-32fb-791d.res6.spectrum.com. [2603:6081:7b00:6400:9534:7b5:32fb:791d]) by smtp.gmail.com with ESMTPSA id v8-20020a05620a440800b006ecc5f5635dsm1457073qkp.113.2022.10.10.10.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 10:56:12 -0700 (PDT) Date: Mon, 10 Oct 2022 13:56:10 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Stefan Roese , u-boot@lists.denx.de Subject: Re: Broken watchdog in u-boot master branch Message-ID: <20221010175610.GQ2020586@bill-the-cat> References: <20221009191225.65jwebefhqng3qbi@pali> <20221010162818.GM2020586@bill-the-cat> <20221010172256.jb4qwvgsbcucwejf@pali> <20221010174038.GP2020586@bill-the-cat> <20221010174405.5rvz7aclukn567gj@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7vLGWvOrvbSM0Ba8" Content-Disposition: inline In-Reply-To: <20221010174405.5rvz7aclukn567gj@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 --7vLGWvOrvbSM0Ba8 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 10, 2022 at 07:44:05PM +0200, Pali Roh=E1r wrote: > On Monday 10 October 2022 13:40:38 Tom Rini wrote: > > On Mon, Oct 10, 2022 at 07:22:56PM +0200, Pali Roh=E1r wrote: > > > On Monday 10 October 2022 12:28:18 Tom Rini wrote: > > > > On Sun, Oct 09, 2022 at 09:12:25PM +0200, Pali Roh=E1r wrote: > > > > > Hello! Watchdog code seems to be broken in u-boot master branch. > > > > > On Nokia N900 I'm getting following message in qemu: > > > > >=20 > > > > > cyclic function rx51_watchdog took too long: 10000us vs 1000us ma= x, disabling > > > > >=20 > > > > > Seems that watchdog core code is not prepared for "slower" watchd= ogs > > > > > which communicate over slower i2c bus, like it is the case for N9= 00. > > > > >=20 > > > > > Disabling slower watchdog is a bad idea as it would result in reb= oot > > > > > loop instead of slower - but working code. > > > >=20 > > > > So, looking at this in more detail, we have > > > > CONFIG_CYCLIC_MAX_CPU_TIME_US as a configuration option (which is w= here > > > > the too long comes from). And picking a random CI run: > > > > https://source.denx.de/u-boot/u-boot/-/jobs/511177 > > > > I do see we hit this in CI once, but not every time, QEMU runs here= =2E Is > > > > that the max time is configurable enough to satisfy your concerns h= ere? > > >=20 > > > It is needed to investigate, how to _properly_ fix this issue, not ju= st > > > workarounded it. Probably other boards may be affected. > >=20 > > So it's the cyclic watchdog code, which we merged as early as possible > > that's the reason here. And it was merged as early as we could to see if > > there's problems. Are there problems? We're seeing "system too slow, > > disabling" on QEMU, sometimes, and the value of too slow is > > configurable. I know you reported other problems with n900 HW, so we > > can't see if it's failing there >=20 > I was tested it with older asm code (as described in that other email, > via git checkout commit -- file) on n900 HW and watchdog problem is > there too. Phone reboots in about 20 seconds. But as I do not have > serial console, I do not know if that "disabling" message is printed > there too (but I guess it is). I think I'm a bit baffled at this point, honestly. The watchdog timeout is 60 seconds. If you're confident in it being about 20 seconds, consistently, changing WATCHDOG_TIMEOUT_MSECS to say 10000 (so, 10 seconds) should let you see if U-Boot has configured the watchdog and it's being tripped, or if it's still at the prior stage value. I would have expected that QEMU would see problems that real HW doesn't (the value in your log is much higher than the one in CI), but I could be wrong here. --=20 Tom --7vLGWvOrvbSM0Ba8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmNEXLAACgkQFHw5/5Y0 tyzEJwwAtRvMzpsyl6ZTd1F6v4yh1cLbWX9LNeYpmRKtGcWonchvxb7PqjiuLec4 nKKPWTcjMKRa2a2Rh0Or2FOT2X8Z9UoNzCSuSoFWI8rjNKpxhIcP0gyL2j4rNi7B V8j8JDv74/Y20CvQjWyMx8ErpfqdC6Utxol+z2G1lNZWeYE/obas81kAz8zepqJF Dv3ZiQM4V4pTP1/9d0l7Y06mbHWbRKRga9ODjx2tmCv6yDg4N3OhVOV0RuKRS4IX e7xgZj/TX9g6WspeuXUVU/FsJM2RD4x06Bjyq971HrZ+DpTRoQSf8OYWB+pZLh8g koPE8vLCajeWW6fyT0YmN7KDskSWW2580F6Gmp/jOYOQxJ1oOrGdnFlfoszVYAFy bIxUoGSpoj/VrPLRNis58zTgTA4bgrdKkMq5hiuM+fURkQaKipvO1k1UTW1ZL5wL OG6oI0M16yxiaEgZ6OnZvFHgIOk0cMM+N6AHzTOi7SL9hrHCF47AWNuNTp4EYc0q AAcXXsfH =IWUn -----END PGP SIGNATURE----- --7vLGWvOrvbSM0Ba8--