Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp934364pxj; Wed, 16 Jun 2021 17:39:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyEfFwXCDgspf2WRFIyFsMLiFowBSOZSGf8NBUPhxto2prIDWfHwd9IdZc8aAWO0roELCW X-Received: by 2002:a17:906:26db:: with SMTP id u27mr2183466ejc.532.1623890396715; Wed, 16 Jun 2021 17:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623890396; cv=none; d=google.com; s=arc-20160816; b=wOVHV8fCibcVJSI6Dj2Xxg1i9xH0LOtyYPSqJrlmZeLrM/4/2oiOeVPIfJa6Lc6U6p IsDcojmtu99UiekzOR82pyGbrP4N/NSBQZ1DyEiBkVlypkvZJxff72VxsvwLSObhmjmQ biJwMc8pqb4HL3ralV7RGuwOh7lbcnBZsy+BI/oFFRFGkemPl5RC8U3FjbXfaVrSh1by bpYbgKkdBWvBzCrwn5o37PBBP1L9wdjtnlo2YWHkJQ3+SYNeStE+fOwbzbmhVytTvPOw jrJY7lQumV3US4BqR/28cVCP5FLrBg9wOD8OqqWyYuitK5OUYSRsAI4f6jIkgfrAejFX Z7ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=JqX+3DOA7ox/K5I0DpI1KknuOiKmOjzSyVKeXkp2TrA=; b=PlU2ILvjz1IdGrWgAYrWwzyVHFJM2U+Ee1EJbOC4rUaxNzFvDa4QDGQS6H29gFF6/5 FfqvbMRCJCdyueSvrn2PPafkgskurBeFKd4cfv39OKQdnGIOPpaPI+NzfCN8AfRXmyuI FSiLyEr1u8Pys6DtHwcUxWMYbKwSd9u0Dy/wYQ4fUO3MriDtdL+lUGHjI5LkooHrJJe4 bP+44hbk8xH6TVLa2dKOlhwgz00FHQ8oxieWm3iYw9h8PaNh9mUlvKh8SngZk5aoqNq4 sBkbw2YZGd5IpuzIqPkOf7vpaq4MIqp8V1NHTKYqS8dC0AgdJxsS+meqmHDC7V3xX9S+ A4hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dW02d5zG; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si3685349edy.552.2021.06.16.17.39.33; Wed, 16 Jun 2021 17:39:56 -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=@gmail.com header.s=20161025 header.b=dW02d5zG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231478AbhFPR7r (ORCPT + 99 others); Wed, 16 Jun 2021 13:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230291AbhFPR7q (ORCPT ); Wed, 16 Jun 2021 13:59:46 -0400 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB595C061574; Wed, 16 Jun 2021 10:57:38 -0700 (PDT) Received: by mail-ot1-x32a.google.com with SMTP id h24-20020a9d64180000b029036edcf8f9a6so3383003otl.3; Wed, 16 Jun 2021 10:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JqX+3DOA7ox/K5I0DpI1KknuOiKmOjzSyVKeXkp2TrA=; b=dW02d5zGn/AmpCC7+x7DtbTbgBQUU5rhRi5ucgHUmHzYDGQ7MV2MssEJUNg2Fs1f0O CI/8/QGQGgPsOsamCwp17LNyN5AEePLUNB3WD1tcFCLD5XZO+oMVysfmQ5a52L6O6soU 4A/zLfkl03ILTmQTIOHrNhbkMB27WqRXj14lsLDhxGkbq7NXoVRMRlCWVo3wpCd2kwKp U3bmCEZTuNX6KyjoIGn5dqKgizTYu790Mc/IM/jG6kc9LhfzDSg0TM6Y0i8Mg4B42S7D Ip/NdkleRjTB0jVcgaLKetpz3gqeqRu/VP32kg+HybxOPEAogsQRycFbKK3MuwN/tt+p kKQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=JqX+3DOA7ox/K5I0DpI1KknuOiKmOjzSyVKeXkp2TrA=; b=jcQv+EN03Q66DVRps6SPpdBgJO9zIM0BpRHDwEzBxu6ZBmd4iVuFcAV8gLmDdqF0ey 6PEcZtJJwr5mSyM1dZ3hmcndtCvNatqx7T95V+XLvpE+Q07+eZD6n3v2ByOTE9WTj4cC 0OzujPtnkg61jyXohBYGcgnlFGaM/MTPXDe9PwyKsajNErUryrW4RX22eTg+/lt6dC9J dqVcPt7BUbxbMydr9Vjt8u4b74KlIzzbWa6Dcea0O/bZvBNP6nnQ0kyz9endYEl6d764 khRU7J4HkjULs0xI169QFPODz2HrPJmlCqe+CcDj9E3o0gZeKMM2FVmsBZj+fMY9CcRP m74Q== X-Gm-Message-State: AOAM532+a/YLJg7tehvljQC4K6WhNJsn2cx1SBCjLcsqO+XfhbAL72jV iL2HC+rnAMXifRuGu0/Gw88= X-Received: by 2002:a9d:226c:: with SMTP id o99mr929729ota.134.1623866258213; Wed, 16 Jun 2021 10:57:38 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id z6sm575517oiz.39.2021.06.16.10.57.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 10:57:37 -0700 (PDT) Sender: Guenter Roeck Date: Wed, 16 Jun 2021 10:57:35 -0700 From: Guenter Roeck To: Grzegorz Jaszczyk Cc: wim@linux-watchdog.org, shawnguo@kernel.org, linux-watchdog@vger.kernel.org, linux-arm-kernel , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] watchdog: introduce watchdog_dev_suspend/resume Message-ID: <20210616175735.GA1111788@roeck-us.net> References: <20210615123904.2568052-1-grzegorz.jaszczyk@linaro.org> <20210615123904.2568052-2-grzegorz.jaszczyk@linaro.org> <20210615141803.GA957871@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 16, 2021 at 03:59:23PM +0200, Grzegorz Jaszczyk wrote: > On Tue, 15 Jun 2021 at 16:18, Guenter Roeck wrote: > > > > On Tue, Jun 15, 2021 at 02:39:03PM +0200, Grzegorz Jaszczyk wrote: > > > The watchdog drivers often disable wdog clock during suspend and then > > > enable it again during resume. Nevertheless the ping worker is still > > > running and can issue low-level ping while the wdog clock is disabled > > > causing the system hang. To prevent such condition introduce > > > watchdog_dev_suspend/resume which can be used by any wdog driver and > > > actually cancel ping worker during suspend and restore it back, if > > > needed, during resume. > > > > > > > I'll have to look into this further, but I don't think this is the correct > > solution. Most likely the watchdog core needs to have its own independent > > suspend/resule functions and suspend the high resolution timer on > > suspend and restore it on resume. This may require an additional flag > > to be set by drivers to indicate that the timer should be stopped on > > suspend. > > That makes sense - thank you for your suggestion. I think I could > register a pm notifier in the watchdog core when the new e.g. > WDOG_STOP_PING_ON_SUSPEND status flag will be set by the driver and > actually call watchdog_dev_suspend/resume from the notifier callback. > Please let me know if you see any other issue with this solution, if > not I will post v2. > Go for it. Thanks, Guenter