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 5740EC636CC for ; Tue, 7 Feb 2023 15:31:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1657985DAF; Tue, 7 Feb 2023 16:31:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="k9RziS1k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4317285E02; Tue, 7 Feb 2023 16:30:58 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6DE4A85B0F for ; Tue, 7 Feb 2023 16:30:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 858643FDA0 for ; Tue, 7 Feb 2023 15:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1675783854; bh=Ya78fH+vHUNT4EHt326UWozrglR7LSJRMQn0vLfyzFA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=k9RziS1kR43Enaurexf2ijl0twIByMJnI0sPrD0+Nwb729oTFBD70JzBhx9fuaqTz mnG97V3YeHop572/1hDdqVb5VxewGJCS4lvLRrbaffOBr8r5eaTsR6mOk/xSpj3qou 4ZbsGEbZq0AhRuPs5O1PYVESI65bR0qlhMkzzMlrHzw01PHW+gs+gbQ1pkNpvTmUOF Xvw7UP9q4cWtWMPsP2UwLUxxX+n2xbBBzKjxef7oZxQX8VdpGz32l1RQYcRIqw2Wxm rn72dcs8ycf7iJQamNQsXX+1Jvd2nJFNt9dLsW8T4JnrqIN30J/axqqG6Yr00ZdUOs 4wHurYWKPOTdQ== Received: by mail-wm1-f70.google.com with SMTP id o31-20020a05600c511f00b003dc53da325dso10733388wms.8 for ; Tue, 07 Feb 2023 07:30:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ya78fH+vHUNT4EHt326UWozrglR7LSJRMQn0vLfyzFA=; b=iTKksPldIyhsjaqVZ4h6M/utOr+Dh5R5T8TXlfdwD+WE4LWH1sRe3aOreBEwebmV6w s777r/tMom87DWKm2Fi/UgP4+CwHWFdeYJNkX0obTLqxudjpPb/xQsyELskrIGUn5y6g b2RtuIlZF5TA3te5lDe/E3rufw2/+rRCjJ8E+1mVFi9pHU9kpaVoU1yJt6a8ozxAKyAK 6hlTklJkmrdTQvTH2hJpWrTUkNK10zY44rpYeHiEJeYNcmkZ1bU6Va8Y1qEQpK8xQAP1 NkA7NALmPToli2bF7hsWpzurr45r31YMRKPoGH64jXZhft4rmT5qwLZLwV5Xdi/EKQsT yCcg== X-Gm-Message-State: AO0yUKUgy1d8qvopin5PZXU4aG0+O7QWlxoP8b72ElLhJop7++ZtS3Qt 1UR6Xpp72JhAB4NLXGKu1Fc5HtsG6vO2W1HRNARa+7xDdsQT9JHZbRTQ31af/xjrofyIM7AXLkA Dwpht7qqmxHfgD6yCiMFcaDNIW+UVUpE= X-Received: by 2002:a05:600c:755:b0:3dc:443e:4212 with SMTP id j21-20020a05600c075500b003dc443e4212mr3467673wmn.1.1675783854110; Tue, 07 Feb 2023 07:30:54 -0800 (PST) X-Google-Smtp-Source: AK7set+GaC562YLqjMZRrhswuroLQca7A75yhadjgOTBsN5hNl5UJ1Ekx+B5NC3D29rflDNCVVvE7A== X-Received: by 2002:a05:600c:755:b0:3dc:443e:4212 with SMTP id j21-20020a05600c075500b003dc443e4212mr3467645wmn.1.1675783853772; Tue, 07 Feb 2023 07:30:53 -0800 (PST) Received: from [192.168.123.67] (ip-088-152-145-137.um26.pools.vodafone-ip.de. [88.152.145.137]) by smtp.gmail.com with ESMTPSA id m13-20020a05600c3b0d00b003dc51c48f0bsm21156941wms.19.2023.02.07.07.30.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Feb 2023 07:30:53 -0800 (PST) Message-ID: Date: Tue, 7 Feb 2023 16:30:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH 1/1] efi_loader: stop watchdogs in ExitBootServices() Content-Language: en-US To: Michael Walle Cc: andre.przywara@arm.com, etienne.carriere@linaro.org, ilias.apalodimas@linaro.org, sjg@chromium.org, trini@konsulko.com, u-boot@lists.denx.de, rasmus.villemoes@prevas.dk References: <22478c7f-ffa0-0bf7-5473-0ba1ee7478c3@prevas.dk> <20230207145955.2468379-1-michael@walle.cc> <1cda1ca157aae7210f93bea7e9c3f3a1@walle.cc> From: Heinrich Schuchardt In-Reply-To: <1cda1ca157aae7210f93bea7e9c3f3a1@walle.cc> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 On 2/7/23 16:29, Michael Walle wrote: >>>>>> Honestly, not really? Some good number of SoCs will start the >>>>>> watchdog >>>>>> in ROM and these are also the ones that don't allow you to turn it >>>>>> off. >>>>> >>>>> I hope not, that sounds really risky. How would you debug such a >>>>> platform? >>>> >>>> _Every single_ custom piece of industrial (as opposed to >>>> consumer-grade) >>>> hardware I've worked on as a consultant has had an external, >>>> always-running, gpio-petted watchdog. It's simply just something that >>>> the hardware designers include, and in some cases that's even due to >>>> certification requirements. So an always-running, cannot-be-turned-off, >>>> watchdog is a real thing, in real hardware, and if specs don't account >>>> for that, well, the spec is just paper, and we can ignore it. >>> >>> I agree. But on the other hand, you cannot assume or force the OS to >>> have a watchdog driver in the general case - which is as I understand >>> it - one goal of EFI. >>> >>> Obviously, there are watchdogs that can be disabled and some which >>> cannot. I don't want to argue about the advantages and disadvantages. >>> >>> For watchdogs which cannot be turned off, we can't really do anything >>> anyway after the handoff to the OS - except increasing its timeout if >>> thats possible. >>> >>> For watchdogs that can be disabled (and are enabled in u-boot of >>> course), >>> there seems to be two use-cases: >>>   (1) embedded EFI boot, that is you know exactly what you are >>> booting, i.e. >>>       self compiled kernel with a watchdog driver >>>   (2) booting a general OS via EFI, think of a debian boot CD for >>> example. >>> >>> I agree, that for (1) the watchdog shouldn't be disabled. For (2) you >>> cannot assume the booting OS has a driver for the watchdog, let it be an >>> older version of a distribution which just haven't the SoC watchdog >>> driver >>> enabled or maybe because there is no driver for it at all (yet). >>> >>> Is there a way, to have the watchdog disabled for case (2) while also >>> having the possibity to use bootm/booti/bootz and keep the watchdog >>> enabled? Basically I want the following: >>> >>> (1) board boots with watchdog enabled >>> (2) u-boot services watchdog >>> (3a) booting embedded linux with booti (watchdog enabled) or >>> (3b) booting generic OS with bootefi (watchdog disabled) >>> >>> The missing case is booting an embedded linux with bootefi, which >>> would be nice to have. But I don't really see it as a use-case for >>> our board. >>> >>> -michael >> >> For SUNXI boards disabling CONFIG_WATCHDOG_AUTOSTART solved the >> problem with the very short maximum expiration time of the watchdog. > > I can't follow you here. What "very short maximum expiration time"? > With CONFIG_WATCHDOG_AUTOSTART disabled, the watchdog won't be kicked > by u-boot, right? wdt->running will never be set to true and > wdt_cyclic() will be a noop. > > -michael The sunxi boards failed to boot with CONFIG_WATCHDOG_AUTOSTART because 16s is too short for Linux to install a watchdog driver. With CONFIG_WATCHDOG_AUTOSTART=n the watchdog is not running and the boards boot. Best regards Heinrich