From patchwork Sun Jan 24 11:49:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Winkler, Tomas" X-Patchwork-Id: 12042273 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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 5C2B2C433E0 for ; Sun, 24 Jan 2021 11:51:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23F1223102 for ; Sun, 24 Jan 2021 11:51:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726551AbhAXLvQ (ORCPT ); Sun, 24 Jan 2021 06:51:16 -0500 Received: from mga06.intel.com ([134.134.136.31]:22732 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726904AbhAXLuc (ORCPT ); Sun, 24 Jan 2021 06:50:32 -0500 IronPort-SDR: 04r2c8Z/NMlAnrPFlXlPWtRgL1v1VRJVJbI7mL07xRNkMMImX+XhOXtGbR23dts8etrZWjBFIx gyL2okH8mOjg== X-IronPort-AV: E=McAfee;i="6000,8403,9873"; a="241148559" X-IronPort-AV: E=Sophos;i="5.79,371,1602572400"; d="scan'208";a="241148559" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2021 03:49:51 -0800 IronPort-SDR: DKtA1IrDy53e5SYhvH9xaepu8Nbr2v6aDb5vdMfpyNVLwV3rGPDmpXtxfBsDIfAxpNEF9eptMa vrpsl6pZsUBg== X-IronPort-AV: E=Sophos;i="5.79,371,1602572400"; d="scan'208";a="368194809" Received: from twinkler-lnx.jer.intel.com ([10.12.91.138]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2021 03:49:48 -0800 From: Tomas Winkler To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Usyskin , stable@vger.kernel.org, Tomas Winkler Subject: [watchdog v2] watchdog: mei_wdt: request stop on unregister Date: Sun, 24 Jan 2021 13:49:38 +0200 Message-Id: <20210124114938.373885-1-tomas.winkler@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org From: Alexander Usyskin The MEI bus has a special behavior on suspend it destroys all the attached devices, this is due to the fact that also firmware context is not persistent across power flows. If watchdog on MEI bus is ticking before suspending the firmware times out and reports that the OS is missing watchdog tick. Send the stop command to the firmware on watchdog unregistered to eliminate the false event on suspend. This does not make the things worse from the user-space perspective as a user-space should re-open watchdog device after suspending before this patch. Cc: Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Guenter Roeck --- V2: Update the commit message with better explanation drivers/watchdog/mei_wdt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c index 5391bf3e6b11..c5967d8b4256 100644 --- a/drivers/watchdog/mei_wdt.c +++ b/drivers/watchdog/mei_wdt.c @@ -382,6 +382,7 @@ static int mei_wdt_register(struct mei_wdt *wdt) watchdog_set_drvdata(&wdt->wdd, wdt); watchdog_stop_on_reboot(&wdt->wdd); + watchdog_stop_on_unregister(&wdt->wdd); ret = watchdog_register_device(&wdt->wdd); if (ret)