From patchwork Sun Apr 3 05:22:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Farber, Eliav" X-Patchwork-Id: 556161 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD032C433EF for ; Sun, 3 Apr 2022 05:23:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232244AbiDCFY4 (ORCPT ); Sun, 3 Apr 2022 01:24:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbiDCFY4 (ORCPT ); Sun, 3 Apr 2022 01:24:56 -0400 Received: from smtp-fw-6002.amazon.com (smtp-fw-6002.amazon.com [52.95.49.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36DF3B7DC; Sat, 2 Apr 2022 22:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1648963383; x=1680499383; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=rAtvMqa3UEA1I/gQzlxH67hrGaELitMbpfXhAAOLSoU=; b=L46yBIMVBoGlrFN9T4cWb6VLINHQi8MR+aEI07Im+WPAUz/OUS3JtOn2 8u4Ne0X8W4H+iWxPMRjCbu6UrZaGFp0MWDmMwUwlVXm5wX7z/25vbAT1N t8unrJcMMhiOyCYFmuJ6Y4lbja0L2tiNcx3jdqSgI8Or0ChTNkBvQsIae A=; X-IronPort-AV: E=Sophos;i="5.90,231,1643673600"; d="scan'208";a="189965259" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1e-90d70b14.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP; 03 Apr 2022 05:22:53 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1e-90d70b14.us-east-1.amazon.com (Postfix) with ESMTPS id 97AA4C0291; Sun, 3 Apr 2022 05:22:52 +0000 (UTC) Received: from EX13D13UWB003.ant.amazon.com (10.43.161.233) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Sun, 3 Apr 2022 05:22:50 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D13UWB003.ant.amazon.com (10.43.161.233) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Sun, 3 Apr 2022 05:22:50 +0000 Received: from dev-dsk-farbere-1a-46ecabed.eu-west-1.amazon.com (172.19.116.181) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1497.32 via Frontend Transport; Sun, 3 Apr 2022 05:22:50 +0000 Received: by dev-dsk-farbere-1a-46ecabed.eu-west-1.amazon.com (Postfix, from userid 14301484) id 168431687; Sun, 3 Apr 2022 05:22:49 +0000 (UTC) From: Eliav Farber To: , , , CC: , , , , , , Subject: [PATCH] watchdog: sp805: disable watchdog on remove Date: Sun, 3 Apr 2022 05:22:49 +0000 Message-ID: <20220403052249.48784-1-farbere@amazon.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Disable the watchdog if it is active while removing the module. It is necessary in order to prevent a reset in case watchdog hw was running before the removal. Signed-off-by: Eliav Farber --- drivers/watchdog/sp805_wdt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index d8876fba686d..d7dc0f3f16ec 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c @@ -311,6 +311,9 @@ static int sp805_wdt_remove(struct amba_device *adev) { struct sp805_wdt *wdt = amba_get_drvdata(adev); + if (watchdog_active(&wdt->wdd)) + wdt_disable(&wdt->wdd); + watchdog_unregister_device(&wdt->wdd); watchdog_set_drvdata(&wdt->wdd, NULL);