Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2883237rdb; Mon, 12 Feb 2024 23:07:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW1VIIIUWBHm7ejbNNsa4+R6FvO46e8DdVOvQHTPMg1dI+prPpO2sWzrjmzLv6UKm9du+s4EHPjUp+fMLaLhBDsoWSYo4KMhbdfvZQWXw== X-Google-Smtp-Source: AGHT+IElTvl73mpWETBQb2EUeWH/UjPcRTxifnBd0Gf339knnvgB8806EeGPVg0ru2fwjHCWorSz X-Received: by 2002:a05:6a20:93a5:b0:1a0:566a:597e with SMTP id x37-20020a056a2093a500b001a0566a597emr4894214pzh.14.1707808037205; Mon, 12 Feb 2024 23:07:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707808037; cv=pass; d=google.com; s=arc-20160816; b=JA7+LCajw6LBXJUL7oXRe1zH54RqzRuoVhzRpNHwM0dDKU4CKHQYGpVX3CGX4lDBrb VXAWl2vVCgDpebmRsSSICHPPISAR/15XJYRxiYkHjTsCnJYkVXKthpGYdvEAsdBOcC0Q fr2Ml5GdUNs1kr+pW+mftr4vCKCnnkGxJODeEEO6lYmGNIcwfISmJWB3IjDhAgAtBZ+1 IuS5eR0WamcWJ4ZH3hubpJtZdkkJhF9BxQNjRZmzPo3N8/OFzEJnojGUgaQpyqzEgb4j W84t81EoC28RuWFPPx7oVrYm5GmcKAsl1bUqnBU+5SxNxWS6XCKiG8d1bM8dUkZAZTY8 JSAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ZGCUbwQrOfaJeluWHwCgQ75rPKumNutfMnfqnj/tllA=; fh=2Ax80mm7NY+rntH6W2ro+Lxwn0ErOvFvB5L4mW+NRtA=; b=p+jvloWtIiotKD3N5/V/fMEXu2i67LfvlCNnnB/iLJ0zWY3vxWPotIys1L5xbhx7kV AiaHbizyNGNuFfZ8PXuj5LlZa5sKfbYEsodMDEzolPxqk0f7ycpvXrqs8V/MZOKG4Fx2 eoYi64flfkAy/SSIKSxUJH33zBcO1x7KIQQNM54NY7wH12ykOaRkhhfYhRebHzko/n9k DMlbe8IX2Tte0ynvsnaR3gCQGgBeZQAkeS36vqPWmtidFpvm7uOLPgdKYcvY0/TKsps8 ZRIpnepPAaRpv3/blvsZiEW773MXbS9nHSj8bG5Vs7Yql8cj05H26DGNr1FdBveMATBK WZQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=aouEfcPz; arc=pass (i=1 spf=pass spfdomain=hpe.com dkim=pass dkdomain=hpe.com dmarc=pass fromdomain=hpe.com); spf=pass (google.com: domain of linux-kernel+bounces-63033-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63033-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com X-Forwarded-Encrypted: i=2; AJvYcCVkB1mBQkT3BOh3Xyz9Rp6c3FP96675T7qyl8E6vwhYRRWyUOLI1GxCwWxIfWcm4rKseDqQ4cedVYs9VaTV+BUWJui89ieXVv4VnhC5JQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id r19-20020aa78b93000000b006e04ea7ceccsi6220243pfd.253.2024.02.12.23.07.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 23:07:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63033-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=aouEfcPz; arc=pass (i=1 spf=pass spfdomain=hpe.com dkim=pass dkdomain=hpe.com dmarc=pass fromdomain=hpe.com); spf=pass (google.com: domain of linux-kernel+bounces-63033-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63033-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com 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 B0E7EB21CD6 for ; Tue, 13 Feb 2024 07:04:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33D09171A1; Tue, 13 Feb 2024 07:04:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b="aouEfcPz" Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E058914296; Tue, 13 Feb 2024 07:04:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.147.86 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707807871; cv=none; b=V2jqXxfS7iqedeTWahsZqceOnA6avBdoLHdUgLtYfFCQk76aVLwqv3Uy2XyFPC9plBa1+o6tC7Lbcm8xPcvosMLqb6jeYBpg3759XA+lOEHz77lmcYjC7L4dDAhDdQI4fBC/jLGi1m+o158EmXrlRZ861XPRO7t8GQ1oed1DQVs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707807871; c=relaxed/simple; bh=E+QR563gX4hLxvs7YXfuwIMnx6zZm7FGrlrZu5sSaCk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tNLpQ6gCPGCBrfpxUqaqUuN4ccPVLiOS4xEMfMyopMwfS9ycwAaeYt+Lv6hsddK62dksu0BskkDpvEtTLu2wQAphFWKNkL527nxNzdZu89Ok1IhNh3Pqbp2Et0+dVxkwapMbxbFzhdZmePi3PcLZkR/RKNdoFLrOv9L8T7CUw6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hpe.com; spf=pass smtp.mailfrom=hpe.com; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b=aouEfcPz; arc=none smtp.client-ip=148.163.147.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hpe.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hpe.com Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41D5J2pv006063; Tue, 13 Feb 2024 07:04:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pps0720; bh=ZGCUbwQrOfaJeluWHwCgQ75rPKumNutfMnfqnj/tllA=; b=aouEfcPzk3/G9SabiCcwa7lmww9jKr2+aBjuFx9VoNIwoWw6ym2aBWOA9NaGP1tkRsUD yIRxNU1+JOxPZF9to2XSxcsRmrDeoc3V06GSKSRS2HwGrUq/9IRznwRzNuwmOWNBWiTq COS7Ah8cNcJLpj2xijwZ0+2yNp3/Y0lBhTyx/+UwpB1oB79J79iA1YQZmC92jrW1Jz41 yt5teGS8JcAdVRHs4QfHwCOWynSMwK5uV5sOwIODjT4hMkuBHQp49ztYo4c7ujmdtE+O 0FkZ8cbavE8GgPYb+Tavxnjrmx/6ef6MvYJ9ApXRdMwGdQ7z1kYv+0r086y3buXMQnAz mQ== Received: from p1lg14878.it.hpe.com ([16.230.97.204]) by mx0a-002e3701.pphosted.com (PPS) with ESMTPS id 3w7vf0538d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Feb 2024 07:04:09 +0000 Received: from p1lg14886.dc01.its.hpecorp.net (unknown [10.119.18.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id CE28C1378D; Tue, 13 Feb 2024 07:03:58 +0000 (UTC) Received: from anatevka.americas.hpqcorp.net (unknown [16.231.227.36]) by p1lg14886.dc01.its.hpecorp.net (Postfix) with ESMTP id 9425F80AD9F; Tue, 13 Feb 2024 07:03:57 +0000 (UTC) From: Jerry Hoemann To: linux@roeck-us.net Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Jerry Hoemann Subject: [PATCH] watchdog/hpwdt: Support Suspend and Resume Date: Tue, 13 Feb 2024 00:02:03 -0700 Message-ID: <20240213070203.489846-1-jerry.hoemann@hpe.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: RuPWc8ZjGihonCsa0ZSqFaSOSvqLDwP1 X-Proofpoint-GUID: RuPWc8ZjGihonCsa0ZSqFaSOSvqLDwP1 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-13_03,2024-02-12_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501 mlxscore=0 clxscore=1011 mlxlogscore=765 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402130053 Add call backs to support suspend and resume. 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"); + + 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); + static struct pci_driver hpwdt_driver = { .name = "hpwdt", .id_table = hpwdt_devices, .probe = hpwdt_init_one, .remove = hpwdt_exit, + + .driver = { + .name = "hpwdt", + .pm = &hpwdt_pm_ops, + } }; MODULE_AUTHOR("Tom Mingarelli"); -- 2.43.0