Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1985823pxa; Mon, 24 Aug 2020 01:28:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8F4HProrStqxor/Trrrb5IM89JWeIo6aUufPHmRz4yGY+LVkn6JhCIWcyF4E8OnIbyMv6 X-Received: by 2002:a17:906:aad7:: with SMTP id kt23mr4412141ejb.124.1598257725928; Mon, 24 Aug 2020 01:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598257725; cv=none; d=google.com; s=arc-20160816; b=aeEi9zP2Shfw6JJGLBhxhbr5T6KWZURc7+Pur/9iIulBe3DpE1WcclvUKURctFd+7G pJzc36Uxra5kgHPGScks3EXqG5CmzETSQS0nHbpTO6HztaFDOZEp+HNGxJHnYLjGrDGZ T3s8x8jkjxhDcPpM2pf0RZOPbFxBTvbfcEPIrAMI0UdOXrw2mxHhkLN0HcIzHeCBWTWJ 93jw8RjedMaOcfQ/frRtbGg/9nUMppprZHYKwWavXFjwUkaO5i5ZxnxeqO5ZeqU2XZyq z/D14fuPbvd1y2wTPQvVme0Q6N50YbFunlW2nbwtu4gaA0DXENZpbJNTALBmIPd/3efk qVQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=uj/Wfdz3GfPLWRurAi/BvlQNsMxio0039ZaWElnd9js=; b=J+0cU/i0tk2tYPXSD3GwiD8YUp6mi4riavjqThWzVYUNXIa/hbHVW4SGqG8IaxQaG7 knX5OBuTlNgGJvrd5AUvxBCkiZxBwnr5VcIGv+i31uiRTWr/Dyvji9+ETflKSz1Mt9CV E1jFc/jVYRL+JBW1uA/hvZwDIa6b2Z3h+1ISEGkQdnHB3RX640fCs7BRm8biMzSqA6UQ Og/NthBlWNFMJfbjK3MQoYOZk4rAcv4PYav9UNC52hh3gvRbBil5mFt53lMjNnqtuILY PF3wqXKgn267tC4B3+XljXyYNVWQGnR/DqIk43wbD6/pWdecV54qqXoSvy/uKimeoAy+ EB2A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 4si2705789ejr.244.2020.08.24.01.28.22; Mon, 24 Aug 2020 01:28:45 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726354AbgHXIZj (ORCPT + 99 others); Mon, 24 Aug 2020 04:25:39 -0400 Received: from inva020.nxp.com ([92.121.34.13]:40238 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbgHXIZe (ORCPT ); Mon, 24 Aug 2020 04:25:34 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 2350A1A1169; Mon, 24 Aug 2020 10:25:33 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C678D1A0331; Mon, 24 Aug 2020 10:25:30 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2D9EE4031B; Mon, 24 Aug 2020 10:25:27 +0200 (CEST) From: Qiang Zhao To: wim@linux-watchdog.org, linux@roeck-us.net Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Zhao Qiang Subject: [PATCH] watchdog: sbsa_gwdt: add shutdown hook to driver Date: Mon, 24 Aug 2020 16:18:04 +0800 Message-Id: <20200824081804.23206-1-qiang.zhao@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhao Qiang Kexec maybe need more time than timeout of wdt(sbsa) which will reset the system. So it is necessary to add shutdown hook to disable the wdt when run kexec. Signed-off-by: Zhao Qiang --- drivers/watchdog/sbsa_gwdt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c index f0f1e3b..bbcd04d 100644 --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -313,6 +313,14 @@ static int sbsa_gwdt_probe(struct platform_device *pdev) return 0; } +static void sbsa_gwdt_shutdown(struct platform_device *pdev) +{ + struct sbsa_gwdt *gwdt; + + gwdt = platform_get_drvdata(pdev); + sbsa_gwdt_stop(&gwdt->wdd); +} + /* Disable watchdog if it is active during suspend */ static int __maybe_unused sbsa_gwdt_suspend(struct device *dev) { @@ -357,6 +365,7 @@ static struct platform_driver sbsa_gwdt_driver = { .pm = &sbsa_gwdt_pm_ops, .of_match_table = sbsa_gwdt_of_match, }, + .shutdown = sbsa_gwdt_shutdown, .probe = sbsa_gwdt_probe, .id_table = sbsa_gwdt_pdev_match, }; -- 2.7.4