Message ID | 20210702124510.124401-6-rasmus.villemoes@prevas.dk |
---|---|
State | Superseded |
Delegated to: | Stefan Roese |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=Rh7lq9A1; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GGZZq2H2Mz9sjD for <incoming@patchwork.ozlabs.org>; Fri, 2 Jul 2021 22:46:26 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9211582B36; Fri, 2 Jul 2021 14:45:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk 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=prevas.dk header.i=@prevas.dk header.b="Rh7lq9A1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 06B6482824; Fri, 2 Jul 2021 14:45:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20718.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::718]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ABDE3828F8 for <u-boot@lists.denx.de>; Fri, 2 Jul 2021 14:45:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aqbOUlQDQdWeUKq8OWTeO2R7yGflwdoTBst4KDa+nQJjLGclkkUTkBZrJCMOQjnIpxNrgZwnLtTbiVOaRh3rhezXzEfg06FitvvKxLHRPFk6PapLlr1K2AYfFRVVJoY7QkiwJFtsw3mu3zZsDPPp2udIQOswSKVRKW58a5408N9Ip78ogUKw9x2mLkWbXYTVI0AqDvhSR0uoAidZStxt/rCnaIIDQVtnBf5So/ur7kviThDJb76qjS80M4KcvDsyFGipOk+fC5+5LXeS4hCs/s9u+yImx3fDtTZBgsQ8A3WO060L4IohEe3ITOyX+gBUvBeBHCDyGf2tDt01qnP3Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=74yYfcU+ixrHq3ILDmw+83YiaUj4BDIcuFZFtI7d2U0=; b=QY9phLXzhnkr6XSRHTH5ow+KxA9gVBRnyFODkS4U+p00TrQ7B2xP08ouFSEEJYRPR2qkXRoD28+uLEvdOoq8u+QuA0kzYiu7DLWnFj2WEM9baT4y2hMdSa7aNTUbKAEof/R/fqHA0u65bS3EFukh1KZyG2gbhbzFsqpmm8m31YfyJSp2ndXFElrI78IRLQRaMv199twnbb5BzpDZ85cKvd/SufIezu+h+RE9WHR4fu4Zaqj0f5iqV792NaYXXHVWbPWlx1bY7hxWtiqXfxEGYzwuncf3O9UTXXr2oc0KIeTpECMLLOQxjds8Quo4QAAcj+jKyb32eH2+WmSdq25zKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=74yYfcU+ixrHq3ILDmw+83YiaUj4BDIcuFZFtI7d2U0=; b=Rh7lq9A1ZZgxhbCLiNQ7UecNlF6aKkBiK27hdcamjMXAqOV12jDjyOhpdKB04YiIb/oJJNsuIN86mZ5KRlJCthHtkNxoFLwFc6KAduv+ABCGyYbSEUWKsI6Lns5C33sOx6xn0mfIyrrDpZd4AXeEj+b1U+M1wdP91MoqVskqRis= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM9PR10MB3990.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:1cf::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22; Fri, 2 Jul 2021 12:45:21 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::fc83:36a5:db02:3dbb]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::fc83:36a5:db02:3dbb%7]) with mapi id 15.20.4287.029; Fri, 2 Jul 2021 12:45:21 +0000 From: Rasmus Villemoes <rasmus.villemoes@prevas.dk> To: u-boot@lists.denx.de Cc: Simon Glass <sjg@chromium.org>, Stefan Roese <sr@denx.de>, Tom Rini <trini@konsulko.com>, Rasmus Villemoes <rasmus.villemoes@prevas.dk> Subject: [PATCH v3 05/10] watchdog: wdt-uclass.c: keep track of each device's running state Date: Fri, 2 Jul 2021 14:45:05 +0200 Message-Id: <20210702124510.124401-6-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210702124510.124401-1-rasmus.villemoes@prevas.dk> References: <20210702124510.124401-1-rasmus.villemoes@prevas.dk> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [80.208.64.110] X-ClientProxiedBy: AM4PR0501CA0065.eurprd05.prod.outlook.com (2603:10a6:200:68::33) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (80.208.64.110) by AM4PR0501CA0065.eurprd05.prod.outlook.com (2603:10a6:200:68::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Fri, 2 Jul 2021 12:45:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30162c20-0e48-43ec-da1c-08d93d5740f0 X-MS-TrafficTypeDiagnostic: AM9PR10MB3990: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <AM9PR10MB399017AB70717717A3B9FD8E931F9@AM9PR10MB3990.EURPRD10.PROD.OUTLOOK.COM> X-MS-Oob-TLC-OOBClassifiers: OLM:1201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T2UAX4pIkHfFcRhDI05E4rwFvYIRpk+tSHK/muSXrBEt+YTU1gOn1yIncary9U93NCRvRRY1IJUfctmuPkQUQAV50gF2lq7baSxvxdQCqtIN3BzXsG/j44iug3EzkjJuaR0CKmj3yp7J87iraX4A4eb1QGfdH97TWXIW/aW7Cbw5PsunSv2hLJluxLAGbXdBsHs8Ui5GylJDrcAj/siZX1csp5LV+xDXg5OnQBKyMyayoJC9N4WcOIheZtJV7LVFMpJkv8qqvusC7SvzSCHnb2O0qDbBYXhsmCYc4IFKumxTdNE2uTFaMTQ+X8SCRghD6X61t/JGG5mbTFlVPwEy5sqz6g3PeyRnIxnySD1CqjEiH0GXJ+tU9IhThFCyGR/qXnlWAZqVJ3T2LQhV4Q/YGjnEm4kYAAFt0D4JdHLxwjl9ZK0Mj2Tj47BnoTrG0PEb3DchPiU+YOlJGUDdNpbVTqx77PQ9upDmcTUbrZ7rxnm4tUm8h3Ugsxbpx724nagVq+TTcxvF088PiKoyFT0fjbrmS9ScXW2AAiYivzLIifvJ+TXEYzDd4JqC7kPDn1hGqWLj3Qt5+fz6koxypIbGRnGlCsDOaPW/27YhuMirEiqGQAtTJJgKiexkKGVXFHUhp/JGB8p5+u4GaRIfMWeV5qjvCTZYS9EJBksFaaQHS8HeV1b3kShaAeoTLwTzXIwTeQdkqZTW1kT4C7Mb1VHgWA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(366004)(396003)(376002)(39850400004)(346002)(136003)(5660300002)(83380400001)(86362001)(8936002)(66946007)(6666004)(6506007)(66556008)(52116002)(6486002)(8976002)(8676002)(66476007)(6916009)(6512007)(186003)(38350700002)(54906003)(107886003)(16526019)(38100700002)(44832011)(36756003)(4326008)(316002)(26005)(2906002)(956004)(478600001)(1076003)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IflwmfKB0E3VMqmaUsB+5ZiF5+YB/C/tl65EwrXkKdbQwYOzOK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SyHa5xWjRKGpIxlCFTIrOkiUVqAZvr1ZMAnITZCAcZC/YWP6A7MThO6gsvzdE+HuVemxrzPNj4/TT6sIgZx+dxvGLeUYeljLYJZ3ZYIcfSh9nvI9tn8n2v4Ywlj5wldKIVZGJhj3t/oOSVrMmlsOssSrRt6JM4UnfSsC8yD2mOcieHPKvUOFhDxhwB1BaIKBwxAY1I97zrDc2/JdY/jxcJP X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 30162c20-0e48-43ec-da1c-08d93d5740f0 X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2021 12:45:21.1750 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: T9wTpaaVyKMOKUrhirrOpzXjDe+THKrarHW5VPcwngpy4OkCnYZgS32w9Sr7Y5nEs0D1isC4fa1QDJm5J52NWAR+WVOMSgyCgdwGoFCZzF0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR10MB3990 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
handling all DM watchdogs in watchdog_reset()
|
expand
|
diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 32f5b1d0f2..ca20c124d4 100644 --- a/drivers/watchdog/wdt-uclass.c +++ b/drivers/watchdog/wdt-uclass.c @@ -31,6 +31,8 @@ struct wdt_priv { * ->reset(). */ ulong next_reset; + /* Whether watchdog_start() has been called on the device. */ + bool running; }; static void init_watchdog_dev(struct udevice *dev) @@ -72,6 +74,7 @@ int initr_watchdog(void) } init_watchdog_dev(gd->watchdog_dev); + gd->flags |= GD_FLG_WDT_READY; return 0; } @@ -84,8 +87,11 @@ int wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags) return -ENOSYS; ret = ops->start(dev, timeout_ms, flags); - if (ret == 0) - gd->flags |= GD_FLG_WDT_READY; + if (ret == 0) { + struct wdt_priv *priv = dev_get_uclass_priv(dev); + + priv->running = true; + } return ret; } @@ -99,8 +105,11 @@ int wdt_stop(struct udevice *dev) return -ENOSYS; ret = ops->stop(dev); - if (ret == 0) - gd->flags &= ~GD_FLG_WDT_READY; + if (ret == 0) { + struct wdt_priv *priv = dev_get_uclass_priv(dev); + + priv->running = false; + } return ret; } @@ -154,6 +163,9 @@ void watchdog_reset(void) dev = gd->watchdog_dev; priv = dev_get_uclass_priv(dev); + if (!priv->running) + return; + /* Do not reset the watchdog too often */ now = get_timer(0); if (time_after_eq(now, priv->next_reset)) {