From patchwork Tue Feb 13 07:02:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Hoemann X-Patchwork-Id: 200244 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp368036dyb; Mon, 12 Feb 2024 23:04:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX02CnzualnpLoq+5qPbwBCFeA4rAQ9ubionUttE3SlWzFVLSxH71a7bdxibBIkcamuK18nri8gxy5mLeqMEVAJGkEXXw== X-Google-Smtp-Source: AGHT+IH0lWDTVDWzO2vOlOI+v3GkOag+Mx3/gVj5iSX1s8ky+DxKoqcumgZRGZXWYt9lOIm0TW1+ X-Received: by 2002:a17:906:6bc8:b0:a38:51c2:68a5 with SMTP id t8-20020a1709066bc800b00a3851c268a5mr6208950ejs.7.1707807889223; Mon, 12 Feb 2024 23:04:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707807889; cv=pass; d=google.com; s=arc-20160816; b=vInYOCELQj57X3cKtnVlR5MGpRU3lLny+mC+VdT9muy0MsbkUzDsvhVz/Ec68Cko2w DAzSt+lT2loK8TZlV2oJBHxiQEf1Gg6ih3PwoMHj7vC9Tb3LsDuJKkAGBKglyeVMiY0Z TkAECNWvXI+xmgQ2ijCsoFgwWAJ6uKeoQg/eIAhzt92kKELrNhHteGNEpgZegewPysp9 t8NCj+2IB7J681Tq5vWuPYbWGi3szqsyY7GLp4WVorpfjW/15Yw3HX0NZGdw0u/HTGTJ dHrLzI2VIs+8IivmZE6d1vOLQ4vdMELS5vZJhcpZMVnZqr74HZjDvJDtROufIed+0Hle 6KdA== 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=69gzWLlhOINnMI3udt/JUyGboUi7TUhyMHHweezjs+U=; b=cFP5ezmGbvK6rs4fLkiXx4sXf3d5+v5DFeLOF9E6T2tqVg5O8G0CosOwI5loZfDsLa hQNrUtczzJEwJ4VSVgH5Nh+h1nWgEb9xYvQrD5BaFUVc1n7z5/xhLdAb7qfEnkWhEhpe nnzM6LvFWNhIW8DGtw6b79MFRgquXBCzwnB7b0RcrkGOQ6F1q9jSkCkAsz6ODs4ixJPQ kib+/Q6GhrKPYiLpuyeQtNpMRHmBOx+pfWmsY0KQDKcJjR9HzCczJQoRNr1r7RcSdI2T 2yTktzvwqGyqSl6sOWdVz3pCrnZxHn09CGi9XJO++6f9k5bUS/w4rH8u5dguSbJnE3NM jLxQ==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63033-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com X-Forwarded-Encrypted: i=2; AJvYcCXseWUhMtYLgU3I9cK1e3rOHI3gjb7a/om1DEZBV6nVeOQx9BaXE8jZCnfJBDE6U7ykzAS7t6ZInydZU48F2cqdfjjTSA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lr4-20020a170906fb8400b00a3cb30d6274si972491ejb.48.2024.02.12.23.04.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 23:04:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63033-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63033-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id D18521F22627 for ; Tue, 13 Feb 2024 07:04:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 15CFE17564; Tue, 13 Feb 2024 07:04:34 +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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790766365322649454 X-GMAIL-MSGID: 1790766365322649454 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");