Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp33794rdh; Tue, 13 Feb 2024 08:34:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV9tjhixylTsfNIESGus/1nFUPbydYxRzDyf39j28eXt9Rhm6txpBS2sRp77aqEyZ4K9SIctwH3PgrvBOAANNLKpBGHjaWkmZgkcfXIgQ== X-Google-Smtp-Source: AGHT+IHlTv73Ho23KmQEsb5+KNghkffKabSPLfNYSejqrkpqecT984QqdFlYoezU7e74G/Zs5U6m X-Received: by 2002:a05:6a20:c70b:b0:19e:cb16:f03e with SMTP id hi11-20020a056a20c70b00b0019ecb16f03emr3484735pzb.30.1707842089807; Tue, 13 Feb 2024 08:34:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707842089; cv=pass; d=google.com; s=arc-20160816; b=AW5/HcA2CzkcZ1A+jjoUMStBODT05jQHf/4W1o+VmvJTjYeFF55+B5CE67UrJOlx5+ HcY4vw49kz6uddvormWe/irpGI42Pwz/fKLuR7tHhcfuEXcAjmKZ7Z9+KJfmcl3p+eYA oWIf4iypT/z64H+KBDbV5H/TeBhQtWpBLKuMNk43OR28PggvZOY4EDqf0pOnrdbVqTys nXaRZrbFnMuDaSVhGmmiphvhHuGGFbWYnMQM9KkGQreR+flEU2n/PizQQVXhcMoD+RAz Zx6c+a7wHO2vRt9o279nmuWqkVC6+crGyQAokDmP1ybPdHaCzuSXV8hTmI5uwu4ghih5 WqmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=D8rkZbyPYFgVx8KHNAMihfBeoKM5d9jXNM0RcMpsSfI=; fh=xrq0gbDBSdyL9FiH8KqoGakgZbJWzaA6PNsC/A0Z2k4=; b=cX7bPjNvEsG0KWLswncUe2z2BIl84n3DawyXipXBpehkD/mPzXDLnAW0kZYIBDaUsS 79glsSerA+fNl+cvGhU1BGnRYhEJYaqwKjfQ/MHDjiF+S3i8Us/vYpRS9CZw0t9PtaeX oaQ3xX0fDHzIxmkNLkbhlXLdYEYzNeUaGKIF6rxLxyxhbH6B5Ure7YNFbEYJgoE24top fNGBLs0EjS59b3Sc0a1IJp/ZU9lvoScLV1w0OreH9OTx+Tub783j0Q798J0t66op3dqS vKQeUz/gZg6inE7thrp2IPyz9L4aWiAueKQaXcMOMlgW6K4BToVHO/O3Hwei1iyyJYgX 68mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=C7n8wCn3; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-63871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63871-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCX/Mc2df2ssOrHhNIYcXclmioJG9MIKYrL72HLJTa0Qip1T/YntCRFuE4w1GvuTppsn0Qsw3IdAKsyF7eaLH/uCcO+CaR2FwZsDsnKFuQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e26-20020a65679a000000b005cdfaea88adsi2185262pgr.774.2024.02.13.08.34.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 08:34:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=C7n8wCn3; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-63871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63871-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9636FB286BF for ; Tue, 13 Feb 2024 16:13:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D858B5F84A; Tue, 13 Feb 2024 16:13:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C7n8wCn3" Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95B485F564; Tue, 13 Feb 2024 16:13:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707840782; cv=none; b=glnDb1YNQTk6lITG7o1t7uSfMJTO1ADQ5FAcMCBsq+OHazCVoTwnL/Qm/8kd6w6+BdWLxxj2KCYEC+dtbXIhWOGrMVPmvntRdEcILy3V8Fx8P8SAI9d1C0oR+4IV9U/yg7FYY3osMBSRX5pOGnvnIexh2wIHMfobLyTjBce22B4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707840782; c=relaxed/simple; bh=N2yP66lwtVP62oiiX2anPJqTkl4LISR2GidqocTTxCA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bpMsDtFpdouVDhdDrGLZWxCBV0fyB73ovvjV6PzgCPGSjj6wHB3TeypFkD/ikq2UygT18/yGY0cJ4ns/JiEEDLs6HMuMGDC6ePA5piBZcyxj4hBRemyl8NCOi+V1KFZCp1QR3UqihPkUrllD5hbQZGu+48IxCQr6jqzNLsu4ltw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=C7n8wCn3; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6e0dcf0a936so1171746b3a.0; Tue, 13 Feb 2024 08:13:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707840780; x=1708445580; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=D8rkZbyPYFgVx8KHNAMihfBeoKM5d9jXNM0RcMpsSfI=; b=C7n8wCn3W0bNDWKQA/qHgIG3iJ3gMxIfU2y99zfcwyi19a513M4evQYUjABjmOr1sb WxCiDicTSubxhCuWktH54FuqL+6UKZuviPsgSZJWfh+S2D3wfG9YyeeeA/lV5NgzfljM W/DD+Xqma+QstZwdk6GPitygDrvpkaDH7luxesE6aRtSDV940YVAMhMMVN7LFN4lZAux LpmV+RcpgL+V7vUt1QsijZyCEbprE0FmnxT1QIp5mbQnj7OCN2aLU1XCIXivuOS4vDDt euZ8VrD0lGYO6wyFkFZlsmOY0kH3oqAYYioTnl8Ir2zIPVa7HcVoH8wJqYjG0rnD2N9S hqDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707840780; x=1708445580; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D8rkZbyPYFgVx8KHNAMihfBeoKM5d9jXNM0RcMpsSfI=; b=jCch/O7lzITGAfLAox2H5CG0FU8jZOn+YzN5S7JumlqcU1DbHi4f7F8GAQa1uYl5xO BkdzxqLvgUrPmcd4oHhpoqEbIZ+rwHWTq8jr1b8FGt+BdMuniSXa+qrFckNnWQ85gwEO tDjUkJ0SJPtixS2f6LtCdCwXvwRC2Zl014O6mvbys3ww6e2eXsStJViFX08yD5vlOSbL fInaQQSTk+TPY3CMxWXv2/sDUgoQcfLVl0N2Mn8NMqbVmy+SnU3l7oda6MggxBmng6b7 xhFdjOHF7zl0vA7+em/v7W9tjtDRaXoaZ8jsRgpTcoL1qMHddUiEQFXB+fAIsPutbx43 uy7w== X-Forwarded-Encrypted: i=1; AJvYcCWgUZjRVgJEYFNSRBWjcgKmKBwqH/vWAgf5r0i6ykGyovhCH/tl5YwywpKzZIC8DV0dNpv5q+S0opvTnWvZ6aDDY4Brp6n1bGgBX7mBJ9OveRKqWcSGYqLtx9niCO9D4AOz8flnsvu2NH98R2Y= X-Gm-Message-State: AOJu0YxT7quRATtvDj+o2EPQnPKEyflSnaTWb9bdgMr7R1u8QvtcCSo9 GzP6evKKYvJDXLPgqg3H0eAwhNwl9/SPIBtyjBLNcqJXVbboMhUR X-Received: by 2002:a62:cd45:0:b0:6e0:384e:c6ce with SMTP id o66-20020a62cd45000000b006e0384ec6cemr3409319pfg.7.1707840779793; Tue, 13 Feb 2024 08:12:59 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWldg6+ZQSDlHfSIR7hksr6KNW0RUzroLd4GaRLwWY/zargZ7lbGeYtlvI2fMzGboyYTOoVJz1OD5AhC0+PinjmTmIwNZ1+zpbhD5RzLEZvsPyBCD9TmFyWcTjO1mV6vZOxZxWePUquWbCs5v0= Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id lm17-20020a056a003c9100b006e080d792acsm7486815pfb.184.2024.02.13.08.12.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 08:12:58 -0800 (PST) Sender: Guenter Roeck Date: Tue, 13 Feb 2024 08:12:57 -0800 From: Guenter Roeck To: Jerry Hoemann Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] watchdog/hpwdt: Support Suspend and Resume Message-ID: <7b70a8e7-10ce-4835-891c-b854919fa3cb@roeck-us.net> References: <20240213070203.489846-1-jerry.hoemann@hpe.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240213070203.489846-1-jerry.hoemann@hpe.com> On Tue, Feb 13, 2024 at 12:02:03AM -0700, Jerry Hoemann wrote: > Add call backs to support suspend and resume. > That makes me wonder if we should add something like watchdog_stop_on_suspend() to the watchdog core. Almost every watchdog driver supporting suspend/resume repeats the same sequence (except for the debug message). That is a separate question, though. > Signed-off-by: Jerry Hoemann > --- > drivers/watchdog/hpwdt.c | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c > index 138dc8d8ca3d..6565cfaa8e57 100644 > --- a/drivers/watchdog/hpwdt.c > +++ b/drivers/watchdog/hpwdt.c > @@ -378,11 +378,38 @@ static void hpwdt_exit(struct pci_dev *dev) > pci_disable_device(dev); > } > > +static int hpwdt_suspend(struct device *dev) > +{ > + dev_dbg(dev, "Suspend watchdog\n"); > + Doesn't the suspend / resume code already display such debug messages ? > + if (watchdog_active(&hpwdt_dev)) > + hpwdt_stop(); > + > + return 0; > +} > + > +static int hpwdt_resume(struct device *dev) > +{ > + dev_dbg(dev, "Resume watchdog\n"); > + > + if (watchdog_active(&hpwdt_dev)) > + hpwdt_start(&hpwdt_dev); > + > + return 0; > +} > + > +static DEFINE_SIMPLE_DEV_PM_OPS(hpwdt_pm_ops, hpwdt_suspend, hpwdt_resume); That disables / enables the watchdog as part of regular suspend/resume handling, meaning any hang during suspend/resume that happens later will hang the system. Sure you don't want to use SET_LATE_SYSTEM_SLEEP_PM_OPS() instead ? Never mind, though. Your call, obviously. Reviewed-by: Guenter Roeck Thanks, Guenter