mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
To: barebox@lists.infradead.org
Cc: rennes-dev@savoirfairelinux.com, jerome.oufella@savoirfairelinux.com
Subject: [PATCH] common: avoid bootchooser double watchdog configuration
Date: Thu, 18 Jun 2020 00:48:51 +0200	[thread overview]
Message-ID: <20200617224851.1163860-1-gilles.doffe@savoirfairelinux.com> (raw)

In case bootchooser is used, boot_entry() will be called twice:
1) boot bootchooser
2) boot <chosen_entry>
Thus it will lead to twice watchdog configuration if watchdog_timeout
is set.
Except that it should be activated only once in any way, it leads
to unwanted reset when issuing too much "near" calls of the watchdog
configuration for da9062.
Can be reproduced with this command:
 barebox/ wd 30;wd 30
Even if this commands are intentional, 'boot bootchooser' is not.
Resetting watchdog_timeout to 0 after first watchdog
configuration solves this problem ensuring watchdog will not be
configured a second time.

Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com>
---
 common/boot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/boot.c b/common/boot.c
index f546fce62..8d09f96b6 100644
--- a/common/boot.c
+++ b/common/boot.c
@@ -150,6 +150,8 @@ int boot_entry(struct bootentry *be, int verbose, int dryrun)
 					   boot_watchdog_timeout);
 		if (ret)
 			pr_warn("Failed to enable watchdog: %s\n", strerror(-ret));
+
+		boot_watchdog_timeout = 0;
 	}
 
 	ret = be->boot(be, verbose, dryrun);
-- 
2.25.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2020-06-17 22:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 22:48 Gilles DOFFE [this message]
2020-06-18 10:25 ` Ahmad Fatoum
2020-06-18 10:35   ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200617224851.1163860-1-gilles.doffe@savoirfairelinux.com \
    --to=gilles.doffe@savoirfairelinux.com \
    --cc=barebox@lists.infradead.org \
    --cc=jerome.oufella@savoirfairelinux.com \
    --cc=rennes-dev@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox