From patchwork Thu Aug 1 12:18:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Blixt X-Patchwork-Id: 13750282 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 709BDC3DA64 for ; Thu, 1 Aug 2024 12:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=vKSgnAOtcbXyDcGOuai4yVuHdCl+1GDK2Bw/XtPFFsE=; b=pwZnHezrK6AxL8hbkcPSJkEjSu u1z2cqCbXA/tnj/QHLnTul0ExWmFq7v3uvRQEWW5TFHEvkc7V8UsSWh+kG1j+fZkHApmXucnHeLIX HMOTVaVuijEMsEgIhXgMb0v09tG3hKGE8TuesLnHyCVn09mzWb5i7UKfNzShSzTIjIiurIYL9FnZI rABVji9O3XjvxthLBZcVxQDQ67SGm80RL1CqD0S8bh/nvvZr9HwxbWWnW1LkmcvywWgXFGck7wVpF QUbDuh/8YkDHcHPVf0myo+CUuugR/X4AB7G5xYFPnGveLJh8ZcFmlF9w2KBAv7PwQh8e/c5XoEscC uzhy5AsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZUyr-00000005Co7-1Hph; Thu, 01 Aug 2024 12:32:29 +0000 Received: from mail.actia.se ([212.181.117.226]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZUlu-000000056au-2G1v for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2024 12:19:08 +0000 Received: from W388ANL.actianordic.se (10.12.12.26) by S035ANL.actianordic.se (10.12.31.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 14:18:56 +0200 From: Jonas Blixt To: , , , , , , , , , CC: , Jonas Blixt , Anson Huang Subject: [PATCH] watchdog: imx_sc_wdt: Don't disable WDT in suspend Date: Thu, 1 Aug 2024 14:18:45 +0200 Message-ID: <20240801121845.1465765-1-jonas.blixt@actia.se> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.12.12.26] X-EsetResult: clean, is OK X-EsetId: 37303A2956B14454667063 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240801_051906_612534_F3D57F06 X-CRM114-Status: GOOD ( 11.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Parts of the suspend and resume chain is left unprotected if we disable the WDT here. From experiments we can see that the SCU disables and re-enables the WDT when we enter and leave suspend to ram. By not touching the WDT here we are protected by the WDT all the way to the SCU. CC: Anson Huang Fixes: 986857acbc9a ("watchdog: imx_sc: Add i.MX system controller watchdog support") Signed-off-by: Jonas Blixt Reviewed-by: Guenter Roeck --- drivers/watchdog/imx_sc_wdt.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c index e51fe1b78518..d73076b686d8 100644 --- a/drivers/watchdog/imx_sc_wdt.c +++ b/drivers/watchdog/imx_sc_wdt.c @@ -216,29 +216,6 @@ static int imx_sc_wdt_probe(struct platform_device *pdev) return devm_watchdog_register_device(dev, wdog); } -static int __maybe_unused imx_sc_wdt_suspend(struct device *dev) -{ - struct imx_sc_wdt_device *imx_sc_wdd = dev_get_drvdata(dev); - - if (watchdog_active(&imx_sc_wdd->wdd)) - imx_sc_wdt_stop(&imx_sc_wdd->wdd); - - return 0; -} - -static int __maybe_unused imx_sc_wdt_resume(struct device *dev) -{ - struct imx_sc_wdt_device *imx_sc_wdd = dev_get_drvdata(dev); - - if (watchdog_active(&imx_sc_wdd->wdd)) - imx_sc_wdt_start(&imx_sc_wdd->wdd); - - return 0; -} - -static SIMPLE_DEV_PM_OPS(imx_sc_wdt_pm_ops, - imx_sc_wdt_suspend, imx_sc_wdt_resume); - static const struct of_device_id imx_sc_wdt_dt_ids[] = { { .compatible = "fsl,imx-sc-wdt", }, { /* sentinel */ } @@ -250,7 +227,6 @@ static struct platform_driver imx_sc_wdt_driver = { .driver = { .name = "imx-sc-wdt", .of_match_table = imx_sc_wdt_dt_ids, - .pm = &imx_sc_wdt_pm_ops, }, }; module_platform_driver(imx_sc_wdt_driver);