Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp700375rdh; Wed, 14 Feb 2024 08:51:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXrGu6tZVhXWCX6yre5TlgkAo/Vto8K8PZSvk85j7CAYQ4+SwX3yz7Q8FkJixHQVcmS4rubvtyB7+VZQE8s8FruzCOga7sBnnS4HoQ1gA== X-Google-Smtp-Source: AGHT+IE1VIB0yS+wDgUUYJ2pJqDNQXR055+s+5Mz0EUciGf9uZsAzhfT3XD4PrF1N3bFIB604+mN X-Received: by 2002:a17:907:20e9:b0:a3d:6cb1:1889 with SMTP id rh9-20020a17090720e900b00a3d6cb11889mr665665ejb.23.1707929492332; Wed, 14 Feb 2024 08:51:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707929492; cv=pass; d=google.com; s=arc-20160816; b=Ok9UzBnnF6D3yeQb8YASI/5OXPHUN4hw7EuhGSplo1YefYzrsG5fDZJF9io4s5ungD sr9Fc4BLpXd4nK7AiVpMAv5vBMGsmzNX1qS/Tgsg+2s8Hn75x4f850240fk0TArtvaIH btKYGoWABXvTDqwa9r2HRFiJ5K3dbwdtGiToGKAhZTJRtZRziWTV59jMoef+EbCEZxXp MiWv3ZPlCuaDcCDzRVEieLhIcfSfOTimp4+QejBQRSzP4x+2ea5hm2BastbgY9NkEn3P svfIsE6gjLQkZNTgg5vpRCctId3v/D/Y8dEeeygDS5U5XXZIylq3lpSgT/fsPi+3baHS 2VJw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=G0H3Ukg4sOEmcUSwLhLyPtT8HbW50emICiCcGmN4ZT0=; fh=RCfQp6fmY5kpKIxWjOWfmupfAe09J+A6fYqES3/Bdlo=; b=jTwH/p7pDXKgJnLIabkxEXFTgRoAV/IXitQGq5u8TkDHvJKOzaKzg2p20Bm/b07SYT 7WeS9Lwg4kCwGcMveZA2rqBCAWiV/+LbTIpCPpRe/CEvHLObRqFCm31vUNjSaKBroUkp yxYw/gmWf11ZsYZPhWD0q1vO0Pq5J5xXYOF7yU3Btg8TXQbRDjwGqVHbkNHfHtXypaJ9 G2wTziTCH97QATf3BuYX4nR9KXuCSBBU1IC8ZA8xSpq+Bp/WgJQPuJvUg0U3dWhcT7Dr mdFDCgbNt3oLmi3R5aG8+fOOr3ecKTNzoVYS7k2Hh/5dW09w89eFksFer94ENoQ6RIOl WjWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b="K6yR/XmM"; 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-65589-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65589-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; AJvYcCUqXCXfHTGHoPfxI6K4HY8uY7tk549RDEO5jmnOE67ru+WmRRo3X8i2OHAzdeiQV7f9B/nzC8H7054QvEmPF3ua9We3n4L8MT3FDBYmUw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gn38-20020a1709070d2600b00a3cfc0286b5si1917119ejc.420.2024.02.14.08.51.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 08:51:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65589-linux.lists.archive=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="K6yR/XmM"; 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-65589-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65589-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1221C1F218F3 for ; Wed, 14 Feb 2024 16:51:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 712F960BBC; Wed, 14 Feb 2024 16:51:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b="K6yR/XmM" Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) (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 B64CB60B82; Wed, 14 Feb 2024 16:51:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.143.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707929464; cv=none; b=Pl3wISyN+aJKDyIkWiyYKZxAxrck3XjjWt/NN02/D0ZrJPNwd2qyz2qxBhx42+O0LEheWe40qFphqfplaTyytO3K+TbxLlrgHiwJcrn/vs9etGDreMk6V/WsUFSAkBiPk84ZXdkjXf6Eqev8kTD1pkXoqzz+ODY+SgdZWgYQFc8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707929464; c=relaxed/simple; bh=7c/2k+DP/jX8b7hwRgJMRjMXKnwQ37+q3s+m74p7ssg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mxsVgU9ZPzcLBymWGoD/8M4sLa5RBRCE3iK8vztAoM1BvQjeQ4/7c0sJej6P34zrfT7MU6MX3bjLFrWygj2Q8XN5LiNqSarS7COEehl0vwiGkwoqJmYuFKLODuz/qsIob5YE7iJ+EMv6Ko6eXPRvLuUbEAHYv5jBNLCQ9YHLliY= 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=K6yR/XmM; arc=none smtp.client-ip=148.163.143.35 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 (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41EGhQ0F015745; Wed, 14 Feb 2024 16:50:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=G0H3Ukg4sOEmcUSwLhLyPtT8HbW50emICiCcGmN4ZT0=; b=K6yR/XmMrkX2+i/CQNojUZ/l4OjvN932lexEGi8G0Y/2vOJhHVLGpcyjzKk0pqmPM7Vl uF823K9sQveWxWmCPCfc1mFadZGhzmVYY3EOxpQbqBteN44i+bprx7nLrV4aTToskE+N qyeJDyGILB+q0HojmIEC8bVwyf/abhkwZW+zT9JmcuHRUQOcI9cQhbE3z4O9czXU0zfT u+xfdbI0217oClx3+r6Fi25WjigQBZ/dndAZ9Eo8dumKjDv08ol0J/WFrU6pqAGQrOWk sEnk/kx9KOjVdn6xGJWOegleY5+XoMt64h7rfyatwRl2Qm6pExtIEX3dCWYIECqTRoeK cw== Received: from p1lg14878.it.hpe.com ([16.230.97.204]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3w919u02kv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Feb 2024 16:50:46 +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 CC8BA2D870; Wed, 14 Feb 2024 16:49:55 +0000 (UTC) Received: from anatevka.americas.hpqcorp.net (unknown [16.231.227.36]) by p1lg14886.dc01.its.hpecorp.net (Postfix) with ESMTP id E3401805AE3; Wed, 14 Feb 2024 16:49:47 +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 v2 1/1] watchdog/hpwdt: Support Suspend and Resume Date: Wed, 14 Feb 2024 09:49:40 -0700 Message-ID: <20240214164941.630775-2-jerry.hoemann@hpe.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240214164941.630775-1-jerry.hoemann@hpe.com> References: <20240214164941.630775-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-Transfer-Encoding: 8bit X-Proofpoint-GUID: mBZqTb82VOkFUPfuDfW_9BFt8X35y5Az X-Proofpoint-ORIG-GUID: mBZqTb82VOkFUPfuDfW_9BFt8X35y5Az 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-14_09,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 spamscore=0 priorityscore=1501 adultscore=0 suspectscore=0 clxscore=1015 mlxlogscore=944 impostorscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402140131 Add call backs to support suspend and resume. Signed-off-by: Jerry Hoemann --- drivers/watchdog/hpwdt.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 138dc8d8ca3d..ae30e394d176 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -378,11 +378,36 @@ static void hpwdt_exit(struct pci_dev *dev) pci_disable_device(dev); } +static int hpwdt_suspend(struct device *dev) +{ + if (watchdog_active(&hpwdt_dev)) + hpwdt_stop(); + + return 0; +} + +static int hpwdt_resume(struct device *dev) +{ + if (watchdog_active(&hpwdt_dev)) + hpwdt_start(&hpwdt_dev); + + return 0; +} + +static const struct dev_pm_ops hpwdt_pm_ops = { + LATE_SYSTEM_SLEEP_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