From patchwork Fri Jun 18 19:50:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Jaszczyk X-Patchwork-Id: 12332113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36401C48BE8 for ; Fri, 18 Jun 2021 19:53:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 054B9613C1 for ; Fri, 18 Jun 2021 19:53:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 054B9613C1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=b/EmTCh/pwBgC9OfUlFClukv8ukFemkytwceGit5hRI=; b=ezUbaaJfaWlizp xIEB9+5fBKVWr5G7JR8MzI3u2qWJUYyRW67ojUaHjQESAL9J2qVYb0gLGzuFY0Z/FHtXHk5oBnEO5 /PICxv6lqOxV+nxam02kmpZilqmBhSxJlkHX5vVFDwFbsB7w3OBxY6D104p75wRU6+yAbqV0Ltn8+ hLfLt1Vmp5/9tBgexKIJMJWWYfZ29s/xToleGznfXG2XDtHPCEn/n1Oq7VRHr1QkyPqpekh44Ujwr 3IA5JaheZASVGX+oDjgwoXJjMeaoj1CQaD+KA1fs/8/E6lAiuI4ouP4JP6SMxjMasqzZzMSXtAo0I cdnbyjHIqgiaFzwoEdUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luKWY-00FN6a-KS; Fri, 18 Jun 2021 19:51:30 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luKWC-00FN1R-Rv for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 19:51:10 +0000 Received: by mail-lf1-x12b.google.com with SMTP id f30so18509146lfj.1 for ; Fri, 18 Jun 2021 12:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xMVSNrHGcdt1vbOgCt0p2SZ9LSnvDYsg9SnZkED+C08=; b=OI+p8vNSYtg5dOKoFneDPR48HNRCn5+KtmQCC1iEiqeAkn90I7DNnoQ+1FM+nplYfP 3G8Bcf6gj2Veo22h9O+8GD5/NmlqM8wVuLUEXuYSQW2TiFmCI9geu61KyyJITWbw4dD5 RwtGyFY+nmPaVQBF6pZuo1fQ5EWDOIUpdiyQjvXGWoHvzaqaB4tHqISE3lOa0p8JVH16 aKRi/LfxMyvI08TLkYOS1nt2K6i8a6wCsffNAMk+B9/AG43n4M7EhkqVyFlW4QlHAsA+ CEvkfsnwzQ7BtnmuP9WaFc5g9E2fRp9jQnDGC/Ik0UMdQ36Z4YnZa6uPHeMXDgmvtEFc DvGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xMVSNrHGcdt1vbOgCt0p2SZ9LSnvDYsg9SnZkED+C08=; b=YjhMPARuxLA3AhQsA2Kd5EplO3CX1C8kCEbE3lyDpmU+iEO0cKY3yw32vD8ID2Ou3O v3jXKEB7qqKnrdIoC0KzgSXfXyuBNouhq9GWcVbb4rFv+UHcVVe+1V49wrsFPaOd5hsq hgu9hworUFavEMSXxgOI7rSlH2xCtX9kQSsGbqpobg5SUVJQL4gMLzDXcXFK6U8Lc0MV qxdtTA6n+qXsreHFaAdN2BS0T/TEZWCPRrIox5n3yfqh2kKRtYjH38wKgcyaZiYuDnV4 Ffetdr99FK/fYGXOBLYcGCTEHXAnEqerMITqm0yx6w5wPodw9mPBVw9oNIqmPeWSzSMc LUDw== X-Gm-Message-State: AOAM531sI7oGcVtgv51TM0JM/zkrnPJvwSAzM2+2GkfAiNnnfSYNhhho f/5Lsj3tOXA/mg0cRp8H9qSyCQ== X-Google-Smtp-Source: ABdhPJxTn9yUM//lgUINg3OMvXib0w3U1/wNLfUqdwLiM++zP7wiXYpSlpAY/I1XHz3rygGFqrs0KA== X-Received: by 2002:a19:24c3:: with SMTP id k186mr4452699lfk.472.1624045867006; Fri, 18 Jun 2021 12:51:07 -0700 (PDT) Received: from gilgamesh.lab.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id o7sm993221lfu.215.2021.06.18.12.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 12:51:06 -0700 (PDT) From: Grzegorz Jaszczyk To: wim@linux-watchdog.org, linux@roeck-us.net, shawnguo@kernel.org Cc: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, grzegorz.jaszczyk@linaro.org, Michal Koziel Subject: [PATCH v2 2/2] watchdog: imx2_wdg: notify wdog core to stop ping worker on suspend Date: Fri, 18 Jun 2021 21:50:33 +0200 Message-Id: <20210618195033.3209598-3-grzegorz.jaszczyk@linaro.org> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20210618195033.3209598-1-grzegorz.jaszczyk@linaro.org> References: <20210618195033.3209598-1-grzegorz.jaszczyk@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_125108_958544_DE23C0A7 X-CRM114-Status: GOOD ( 12.76 ) 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 Suspend routine disables wdog clk. Nevertheless, the watchdog subsystem is not aware of that and can still try to ping wdog through watchdog_ping_work. In order to prevent such condition and therefore prevent from system hang (caused by the wdog register access issued while the wdog clock is disabled) notify watchdog core that the ping worker should be canceled during watchdog core suspend and restored during resume. Signed-off-by: Michal Koziel Signed-off-by: Grzegorz Jaszczyk Reviewed-by: Guenter Roeck --- v1->v2: - Do not use watchdog_dev_suspend/resume directly, instead notify the watchdog core that the ping worker should be canceled during watchdog core suspend and restored during resume. - Commit log was updated accordingly. --- drivers/watchdog/imx2_wdt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index b84f80f7d342..3e8d9c3b6386 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c @@ -311,6 +311,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev) watchdog_set_nowayout(wdog, nowayout); watchdog_set_restart_priority(wdog, 128); watchdog_init_timeout(wdog, timeout, dev); + watchdog_stop_ping_on_suspend(wdog); if (imx2_wdt_is_running(wdev)) { imx2_wdt_set_timeout(wdog, wdog->timeout);