Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1887291pxj; Fri, 18 Jun 2021 19:21:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc1szISDahN0ea0vnowdy5c4tijk2jl3TGgvmXyf2BB4olF8cn9475ifmRhtNt+qiP8t1O X-Received: by 2002:a02:942e:: with SMTP id a43mr6179132jai.74.1624069285931; Fri, 18 Jun 2021 19:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624069285; cv=none; d=google.com; s=arc-20160816; b=ZoRKhlZAhF0zVX6yej0E5vYSc/nksZfCjhyquhWFPPcffMLmbR+iLu3Y0oJYMKlJC1 DOhftUMvq5ak9AOi+WS/kg/YEnWQwA04Ap8vRX9qJ0ac4pMLg85/dJy+99ZkIVKzw/jh rMXieL8Nx/wkX8lOqZBAYwwoOpM/3oMNQpU7ONu/gF0CqAb3JKZ5QNytotb8X+SHpd2X vunFgjl6ZzYbWAjBiE/6dUamfq8KDXA2RAP4hgmZgatnG2bVb235x4dhlyqFsMJJvyyy Q0ILeynK0jPGV5su6sabav7+lom58r9zAkoxenHxpe7ZfI+hsXX37RlSrsfVbLsiAteu u9lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xMVSNrHGcdt1vbOgCt0p2SZ9LSnvDYsg9SnZkED+C08=; b=JM5R/cWvBJlpKuTWR5vdqTdhZSObBvD4zq6RQXLn57a/SgHXwojOdQUTRPp7GTuUpY YFRyKykw7Hy0hdRYXH4iMmLn32PaiwaXFK3nMa9y/xTcRGb78wRmKiAqEK55DtRGJsQy hJx8Go6A1cYGQII/2sKuQYGf06DVFsH5rIfr1K25IamCO3dVmEAcehLn2D7uOCsU7+Bg 7rlqGT19M81y5RfjkyOSOX52MtofKxso0H0CWDdimOMqrzBjkrrG9rcuZbstU5ZO+CLD mGmD5QHP2sKyzHvO42NoxT0lXi3dPF5OmWgJi3zHY85c3Zs+DrihqviOd66WMr6p13pX Kd5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OI+p8vNS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si9689433iox.100.2021.06.18.19.21.14; Fri, 18 Jun 2021 19:21:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OI+p8vNS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233577AbhFRTxW (ORCPT + 99 others); Fri, 18 Jun 2021 15:53:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233572AbhFRTxT (ORCPT ); Fri, 18 Jun 2021 15:53:19 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A07EDC06175F for ; Fri, 18 Jun 2021 12:51:08 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id m21so18427192lfg.13 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=qQ5njZHK3Xni97L4QlFUw6OmQdkFx36MCElldyv7A4iP8jU37JQK5GUe3E4dPm8X3B SnGayuzAp6tzAy/MPeju+R3k0ieR0lXESa6HNPUBV5FGzh882BoHffVZZ1H7ZrhmVUho eJ6iC2E7H6tKJyvDwthpML8bEr/XCHpZ/CRc8NwflrBwBjfRbZOjQ+eNYD3MXvzB7XDB igXDYKa5u5HkgGa0gmBRpMVPjiLsD5L5ZQID/ZP+3wv3ldfHNRaH4zrpjOUqI7Xi+9go VpJm8CiyTkLKGTnbq8W3Kn0bfsaDiyM2Nlr5WKZdcCASgI+D7PyOlPM/EKKJggw013vn 8I/w== X-Gm-Message-State: AOAM533aoGyh7V4rqhkDjqZ/Xd4ZbUnsrO17PUPOkkpleeqjTTxr/QeF Ux5OztAxL/fcmBIKHXviuphKAQ== 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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); -- 2.29.0