From patchwork Wed Dec 13 21:53:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Hoemann X-Patchwork-Id: 753897 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b="OouDOYdH" Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C337E3; Wed, 13 Dec 2023 13:54:08 -0800 (PST) Received: from pps.filterd (m0150245.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDL31A1016672; Wed, 13 Dec 2023 21:53:53 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=/mc35BB7pN+bTQ14JgWZrfQ8eiHQQLtvFVxq/fsszlc=; b=OouDOYdHgXHG5XVl+pyVtruSEruAJaAe9d1QiBESMEYxdBkAnqKNV1mfCV7HOm9e1URD E9lI8KbQprBhvhfz/9nn+oZ/X1igO2s46E5CGAf8Gm/OUZPQ7jS92uiO4XMgYTCIGhQR +QBPdv8x4GBPrisYqTKqbFYZOtqtcHbhgQUFO12Yrl9b5yDeh9nEOczJzE6SFwheeT4w vYFWibI8lfF8d/NMFBrS00R23ZUe7+ZdURC58YddzgwAOKpZBkz7VGNbggLL5gjZr8C/ Tw7zdzJSURrFy1cyZZf8Dihq6K7z1kOnkcQ9x5dgk9vke1dIzgkTUaZe7jy4z5KWUbze Gw== Received: from p1lg14878.it.hpe.com ([16.230.97.204]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3uydkrc49m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 21:53:52 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (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 02BD213152; Wed, 13 Dec 2023 21:53:52 +0000 (UTC) Received: from anatevka.americas.hpqcorp.net (unknown [16.231.227.39]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 91C64800472; Wed, 13 Dec 2023 21:53:51 +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/3] watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO Date: Wed, 13 Dec 2023 14:53:38 -0700 Message-ID: <20231213215340.495734-2-jerry.hoemann@hpe.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231213215340.495734-1-jerry.hoemann@hpe.com> References: <20231213215340.495734-1-jerry.hoemann@hpe.com> Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: lQKZrEfkl6YnOP9D1O6kyoL07T5tlA7I X-Proofpoint-GUID: lQKZrEfkl6YnOP9D1O6kyoL07T5tlA7I X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-13_14,2023-12-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 mlxlogscore=999 priorityscore=1501 malwarescore=0 suspectscore=0 impostorscore=0 spamscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312130154 Avoid unnecessary crashes by claiming only NMIs that are due to ERROR signalling or generated by the hpwdt hardware device. The code does this, but only for iLO5. The intent was to preserve legacy, Gen9 and earlier, semantics of using hpwdt for error containtment as hardware/firmware would signal fatal IO errors as an NMI with the expectation of hpwdt crashing the system. Howerver, these IO errors should be received by hpwdt as an NMI_IO_CHECK. So the test is overly permissive and should not be limited to only ilo5. We need to enable this protection for future iLOs not matching the current PCI IDs. Fixes: 62290a5c194b ("watchdog: hpwdt: Claim NMIs generated by iLO5") Signed-off-by: Jerry Hoemann Reviewed-by: Guenter Roeck --- drivers/watchdog/hpwdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index f79f932bca14..79ed1626d8ea 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -178,7 +178,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs) "3. OA Forward Progress Log\n" "4. iLO Event Log"; - if (ilo5 && ulReason == NMI_UNKNOWN && !mynmi) + if (ulReason == NMI_UNKNOWN && !mynmi) return NMI_DONE; if (ilo5 && !pretimeout && !mynmi) From patchwork Wed Dec 13 21:53:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Hoemann X-Patchwork-Id: 753898 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b="NEH+lHY7" Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BCDBDB; Wed, 13 Dec 2023 13:54:08 -0800 (PST) Received: from pps.filterd (m0150245.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDKph5E023132; Wed, 13 Dec 2023 21:53:53 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=93anGPWaV+nF7AivhePM52WtbZOAbrqQj80AlF5LYy4=; b=NEH+lHY7Ebr1W8yzUR3nmjXPe1HKjyU2appqJX8OCjKJBvln/ciLv+qd+jWIZzqsA/Iz /UtFGNLVWz/1jz5k1fNDUpm4fKuVkZuSM+he4rB1rXC1gvMr7YAaC11Yb+vWRdPxvCSq EtaSGE1sFESFShnKR/ir9tpLh1190vNRbyk+pt6LupsnM6A9huQNtAg7qZOm8Pk70PXa gp8rbMk4EUWMEo54TnovsnLLH9aNMQ2H4yb0ptkEWszvAoLRa7olzxxlF0lq/9rjkY4V FhGdMnkw2xC9sOC0rLiJD5NPk629qhdcIUOCSg1tCA0mhe+w7hP/yDJABayZIFJJeQjn Bw== Received: from p1lg14879.it.hpe.com ([16.230.97.200]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3uydkrc49p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 21:53:53 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (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 p1lg14879.it.hpe.com (Postfix) with ESMTPS id 77C2F132D2; Wed, 13 Dec 2023 21:53:52 +0000 (UTC) Received: from anatevka.americas.hpqcorp.net (unknown [16.231.227.39]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 0C51C8000B4; Wed, 13 Dec 2023 21:53:52 +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 2/3] watchdog/hpwdt: Remove redundant test. Date: Wed, 13 Dec 2023 14:53:39 -0700 Message-ID: <20231213215340.495734-3-jerry.hoemann@hpe.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231213215340.495734-1-jerry.hoemann@hpe.com> References: <20231213215340.495734-1-jerry.hoemann@hpe.com> Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: GGyzWKnUGx6usK_7Br-VJ6XSeOKVPAte X-Proofpoint-GUID: GGyzWKnUGx6usK_7Br-VJ6XSeOKVPAte X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-13_14,2023-12-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 mlxlogscore=796 priorityscore=1501 malwarescore=0 suspectscore=0 impostorscore=0 spamscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312130154 ProLiants of vintage to have an iLO 5, no longer send watchdog NMI as an IO CHECK. They are presented to hpwdt_pretimeout as NMI_UNKNOWN. The preceding if statement rejects if !mynmi irrespective of value of pretimeout making this if statement redundant. Signed-off-by: Jerry Hoemann Reviewed-by: Guenter Roeck --- drivers/watchdog/hpwdt.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 79ed1626d8ea..d5c0aa3ef069 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -181,9 +181,6 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs) if (ulReason == NMI_UNKNOWN && !mynmi) return NMI_DONE; - if (ilo5 && !pretimeout && !mynmi) - return NMI_DONE; - if (kdumptimeout < 0) hpwdt_stop(); else if (kdumptimeout == 0) From patchwork Wed Dec 13 21:53:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Hoemann X-Patchwork-Id: 754828 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b="epAiYqZf" Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AAD4E0; Wed, 13 Dec 2023 13:54:08 -0800 (PST) Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BDL2GXH020125; Wed, 13 Dec 2023 21:53:53 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=F3XM/iTwy0EIQD79Zi6C9dxzthptKdfMe5DQ9M3l66U=; b=epAiYqZfvq/mAyPq7GdEl4rp6c7sBAVQ1kLbcWeajoVz7nK+YduvQAdr4277bB+lfbv4 9o6Kn8TKf1lyjl/uuiWvAcUoLcG9YjySYbAF/hiavECbEjwZrL7rOA6mPLSJbezj5bby TyNiv1L2Va+S46ABJ6qTGb+ivZ9gGxhuUoKNWfV8N8miJvzzB/jXwiX5a8WOm3ufCNhw aoDFTROPsYnG8pn6RZvMVf7nvqNeGun1P1djcYFtAbpO9aN/jQdSiA2YSXlaqCyNsbxQ nuuOllDPRbrduRufOpgEWEq5GMSi2gQG0B7OrX4+veUvyJWj2Lt8cZvGnjuFg3SUQeRH 0Q== Received: from p1lg14878.it.hpe.com ([16.230.97.204]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3uy89nffwd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 21:53:53 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (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 E7542131A9; Wed, 13 Dec 2023 21:53:52 +0000 (UTC) Received: from anatevka.americas.hpqcorp.net (unknown [16.231.227.39]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 81A40800472; Wed, 13 Dec 2023 21:53:52 +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 3/3] watchdog/hpwdt: Remove unused variable Date: Wed, 13 Dec 2023 14:53:40 -0700 Message-ID: <20231213215340.495734-4-jerry.hoemann@hpe.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231213215340.495734-1-jerry.hoemann@hpe.com> References: <20231213215340.495734-1-jerry.hoemann@hpe.com> Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: LIEevNw-2-8NirO5KXYar8IAuEU3V1In X-Proofpoint-ORIG-GUID: LIEevNw-2-8NirO5KXYar8IAuEU3V1In X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-13_14,2023-12-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 mlxlogscore=977 clxscore=1015 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312130154 Remove the unused variable ilo5. Signed-off-by: Jerry Hoemann --- drivers/watchdog/hpwdt.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index d5c0aa3ef069..138dc8d8ca3d 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -33,7 +33,6 @@ #define DEFAULT_MARGIN 30 #define PRETIMEOUT_SEC 9 -static bool ilo5; static unsigned int soft_margin = DEFAULT_MARGIN; /* in seconds */ static bool nowayout = WATCHDOG_NOWAYOUT; static bool pretimeout = IS_ENABLED(CONFIG_HPWDT_NMI_DECODING); @@ -360,9 +359,6 @@ static int hpwdt_init_one(struct pci_dev *dev, pretimeout ? "on" : "off"); dev_info(&dev->dev, "kdumptimeout: %d.\n", kdumptimeout); - if (dev->subsystem_vendor == PCI_VENDOR_ID_HP_3PAR) - ilo5 = true; - return 0; error_wd_register: