From nobody Fri Oct 2 06:58:29 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 7124F43E094; Tue, 4 Aug 2026 09:22:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785835334; cv=none; b=GnMpWY2xoE36eOo0KsPNsBIM9QwoNdxr7gwGlI1IjkqAGY8wEqc1Q7fwq3CDdT3Pg/yUbqEtYZHKZb3RvEOO4/wL9LLcyG1S86sZrKpzHPLVJWksJ3lg+r2RUc/MQ3QHG350LxnvilfXJVkZGb+kNMev9Ac1fTa4+qiKMoRrDhY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785835334; c=relaxed/simple; bh=17xrdJIWU4ZH/JxF9fsfn3sGYVwjviG/2kKacoqnHRg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hIQyAkulbKOdS+xKgdVBACjen5zYpsEzOqddSzBPiqr9m8qAyo1azIR49RqGbn34ywJsb/wuaHP7fhBABTvCbPsINP6Ortez1CwPdKSmiejtiLNmy0iJnf4BZz3fFiNCnu/9CaznxGxR5qA1TB4raJh2lZVEjAKCuR2YzoIIqIA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=c0h37S+8; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="c0h37S+8" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6748CHlX3236530; Tue, 4 Aug 2026 09:21:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= nRfsZhCcwjHwU9yHOJWvrhAiTLSvqkBHCQCwWwnd708=; b=c0h37S+8cuwOJ9vu tgHz0Kr5QVcGThT60XkAPP4mhYDv+4/XEeOPnDqHkRtzFjY39b5lBYy4zmFP6E38 Pb4WdnA9fGn7S8M77UxYSgajo15gPdMGYxYL1JDVH4ccfVtYT5zW3vQEWtmKy80h 5G9gGtoTkT26sn2rA89YOYpASdoTboezpeLFSgEimHvNozg0/dVx/GMlOjza0yKL QFSh33G+DyBZYNEq5PSe+NIwGvaeJymbnq7xPHW68eFWxWSaA8q2wRdg9CN6eQaS MqtEjRhKl3WNgFPaGrHIbGsT7M6Q6rbtZZenmAOLlm5WDLBYp8IzrQjfPRhMxzlO mdnaAQ== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fu5hqsvrk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Aug 2026 09:21:38 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.18.1.7/8.18.1.7) with ESMTP id 6749LZL3027311; Tue, 4 Aug 2026 09:21:35 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 4fs9vjk7uu-1; Tue, 04 Aug 2026 09:21:35 +0000 (GMT) Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 6749LY8K027285; Tue, 4 Aug 2026 09:21:34 GMT Received: from hu-ffaruque-hyd.qualcomm.com (hu-ffaruque-hyd.qualcomm.com [10.147.245.31]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 6749LY9H027260; Tue, 04 Aug 2026 09:21:34 +0000 (GMT) From: Faruque Ansari Date: Tue, 04 Aug 2026 14:51:20 +0530 Subject: [PATCH v3 1/3] power: reset: pscrr: add kernel panic reason tracking 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260804-pscrr-reboot-reason-v3-1-e706dbfc7465@oss.qualcomm.com> References: <20260804-pscrr-reboot-reason-v3-0-e706dbfc7465@oss.qualcomm.com> In-Reply-To: <20260804-pscrr-reboot-reason-v3-0-e706dbfc7465@oss.qualcomm.com> To: Sebastian Reichel , Wim Van Sebroeck , Guenter Roeck , Benson Leung , Tzung-Bi Shih , Oleksij Rempel , Srinivas Kandagatla , Daniel Lezcano , Pengutronix Kernel Team Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de, Liam Girdwood , Mark Brown , "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , =?utf-8?q?S=C3=B8ren_Andersen?= , Guenter Roeck , Matti Vaittinen , Ahmad Fatoum , Andrew Morton , avaneesh.dwivedi@oss.qualcomm.com, Umang Chheda , Faruque Ansari X-Mailer: b4 0.14.3 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Spam-Info: AW1haW4tMjYwODA0MDA3MyBTYWx0ZWRfX2+YhBEsMeUv4 yOuQF1gRAXw4llWs4CHAJyRIEFtTk9svQGn751yGUplGITcKS0U8oGKZkPoI9aZ37vRN5m1iBhG aZCRXCsye1Hga7NIML6P9V/ZSche/dQ= X-Proofpoint-GUID: LtQwJli2caWtWwJ2o_Newzz9XfUuc6A6 X-Proofpoint-ORIG-GUID: LtQwJli2caWtWwJ2o_Newzz9XfUuc6A6 X-Authority-Analysis: v=2.4 cv=EoniaycA c=1 sm=1 tr=0 ts=6a71af23 cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=opvmgqTE--nunqmWsLMA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODA0MDA3MyBTYWx0ZWRfX1nX39WRrnRwv SYmp7r54mOPnzKYpC3SQssPHXN4QKabV6tk6HrSJVoKQNbiqYcijN1qR3V6qdwtAowUDngtrzqS vWcQAWdek7wOtpf6OPgVHZYf4PmK2RLrB2lA/gVmlvuwKrVuibKHn6UPqnZzxqg4h739ep+zZMU 0JJMaO9r8GbL/75xBfyDgiAPSPNDLA+9hNYRCNRP3KohRniwSVJ9IGHn0hZwN8WNein78vYeab4 l9mrx/m6yGjZNfjJpiy4qg1YzoMRFwjrsviK4OJvUSF5Ld3oKnDZc80Jiaw5hhKbgmkhsQbV/wF jMMvlqY+HPSYSl6xOI4xEMwgYTjTs8bEN1zbghV1nw4SnAq/rtAGKc3b2rqVeWX6GNt5jZMpWkX Fz0177bsmBm2Dwb+B8J2QkSkDu8FZ0P8nk0wpH+wQGBO/OLMPc8EG6wtWA7FakgzFFO1X96eB3+ E0fAXxpyCbmzmGoVkMA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-04_02,2026-08-03_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 impostorscore=0 suspectscore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608040073 Kernel panic resets are not recorded in NVMEM, causing subsequent boots to report PSCR_UNKNOWN and making post-mortem analysis more difficult. Register a panic notifier to preserve the shutdown reason across panic-triggered resets. Add PSCR_KERNEL_PANIC as a dedicated reset reason code and its corresponding reason string to identify kernel panic resets on subsequent boots. Signed-off-by: Faruque Ansari --- drivers/power/reset/pscrr/pscrr.c | 27 +++++++++++++++++++++++++++ include/linux/power/power_on_reason.h | 1 + include/linux/reboot.h | 3 +++ kernel/reboot.c | 1 + 4 files changed, 32 insertions(+) diff --git a/drivers/power/reset/pscrr/pscrr.c b/drivers/power/reset/pscrr/= pscrr.c index 6f23f4c4f590..8c45b84059a9 100644 --- a/drivers/power/reset/pscrr/pscrr.c +++ b/drivers/power/reset/pscrr/pscrr.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -519,6 +520,29 @@ static struct notifier_block pscrr_reboot_nb =3D { .notifier_call =3D pscrr_reboot_notifier, }; =20 +/* + * Panic notifier: record that the machine went down through a kernel pani= c, so + * the cause is visible on the next boot. Runs in atomic panic context, so= the + * provider list is walked without pscrr_lock - providers no longer come o= r go + * once the machine is going down. + */ +static int pscrr_panic_notifier(struct notifier_block *nb, + unsigned long action, void *unused) +{ + struct pscrr_provider_dir *dir; + + set_psc_reason(PSCR_KERNEL_PANIC); + + list_for_each_entry(dir, &pscrr_dirs, node) + pscrr_do_record(dir, get_psc_reason()); + + return NOTIFY_DONE; +} + +static struct notifier_block pscrr_panic_nb =3D { + .notifier_call =3D pscrr_panic_notifier, +}; + /*----------------------------------------------------------------------*/ /* Built-in provider: device-tree /chosen/reset-source */ /*----------------------------------------------------------------------*/ @@ -611,6 +635,8 @@ static int __init pscrr_core_init(void) return ret; } =20 + atomic_notifier_chain_register(&panic_notifier_list, &pscrr_panic_nb); + pscrr_register_reset_source(); =20 return 0; @@ -619,6 +645,7 @@ static int __init pscrr_core_init(void) static void __exit pscrr_core_exit(void) { pscrr_provider_unregister(&pscrr_reset_source_provider); + atomic_notifier_chain_unregister(&panic_notifier_list, &pscrr_panic_nb); unregister_reboot_notifier(&pscrr_reboot_nb); kobject_put(pscrr_root); pscrr_root =3D NULL; diff --git a/include/linux/power/power_on_reason.h b/include/linux/power/po= wer_on_reason.h index 13e61ace14f5..8c99bdd75021 100644 --- a/include/linux/power/power_on_reason.h +++ b/include/linux/power/power_on_reason.h @@ -20,5 +20,6 @@ #define POWER_ON_REASON_OVER_TEMPERATURE "over temperature" #define POWER_ON_REASON_EC_PANIC "EC panic" #define POWER_ON_REASON_EXTERNAL "external reset" +#define POWER_ON_REASON_KERNEL_PANIC "kernel panic" =20 #endif /* POWER_ON_REASON_H */ diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 13f004ad1066..a117dd5eaecd 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h @@ -241,6 +241,8 @@ extern void orderly_reboot(void); * * @PSCR_XTAL_FAIL: Reset caused by a crystal oscillator failure. * + * @PSCR_KERNEL_PANIC: Reset that followed a kernel panic. + * * @PSCR_REASON_COUNT: Number of defined power state change reasons. This * value is useful for range checking and potential future extensions * while maintaining compatibility. @@ -264,6 +266,7 @@ enum psc_reason { PSCR_RESET_BUTTON, PSCR_CPU_CLK_FAIL, PSCR_XTAL_FAIL, + PSCR_KERNEL_PANIC, =20 /* Number of reasons */ PSCR_REASON_COUNT, diff --git a/kernel/reboot.c b/kernel/reboot.c index 75af5d763465..979ecf3b093c 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -1109,6 +1109,7 @@ static const struct psc_reason_desc psc_reason_descs[= ] =3D { [PSCR_RESET_BUTTON] =3D { "reset-button", POWER_ON_REASON_RST_BTN }, [PSCR_CPU_CLK_FAIL] =3D { "cpu-clock-failure", POWER_ON_REASON_CPU_CLK_F= AIL }, [PSCR_XTAL_FAIL] =3D { "crystal-failure", POWER_ON_REASON_XTAL_FAIL }, + [PSCR_KERNEL_PANIC] =3D { "kernel-panic", POWER_ON_REASON_KERNEL_PANIC= }, }; =20 /** --=20 2.34.1 From nobody Fri Oct 2 06:58:29 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 371A443D4F4; Tue, 4 Aug 2026 09:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785835329; cv=none; b=odiAQcszJafP0vVqcDrzUH0wqNpL/22TJeKc/8u9IBhoez9C53BxCPKR/cCcg9Fh8voDfgdVIx2HVobA4PIBnOQX1xrI7fbYT2n18ybziAvh+BqBxISx0Qq2qkT12u9iBDpFyOvu8F23g0+rbuOR5lzjRGG8vNwc4FB/Xc623Bk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785835329; c=relaxed/simple; bh=Jww2Z7fvh+tZFB7Df28/xpCuhfGnEybrqIGfbSewvRM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=emANXQqLvkLd47TPJKPG87v4VUNZXVNkgEZVFHbh5yVJNA9OKb5lcnEDWdo8T0xzAPvICI9WYnNRaqSZxjpkEov7BOQ0X5i98DrKT2xhLB/9d4eHgKkBZOkge+hl/dW/FD5DGxhRCpSZRE72nZH7ftTaYH5+/cVw7/bjlOcNdcQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=DLX8wO5G; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="DLX8wO5G" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6748CWC43531682; Tue, 4 Aug 2026 09:21:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= kdo9Gdgjwm2h+DY+NxyO5CQGrdLGwKBHtzQMLXnlRTM=; b=DLX8wO5GTNqJ47Br nEBmdJqQgE3moAcwb41VOVcbhue3W2xdx2BfcGzoIYFadITVz4ka9jJVJsIdvXp9 A/I7FB7s12/C+KdM3Ifwo1XyZ6AAoEcGMH6m/ym/kpVgUV81Z0umi9Bb2qQGnmBX tvXc1dSihT6jpR4kKahSJnvbS/rRh9ahtlLrvrUiy1R2KgN3167IUgYNHjwSEikX /Xk0ABHHW/bNOMzI67uYNUPPcB47ICwA494HymRQsgNWVo1K7ZIZkp/d5vGRlGTJ KjqStsBJGvneQzsH8a4YBpIMCsi1f1IRzme/slyQtfYnUhN/0j8eW732sEIjfPq7 1y9vpQ== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fty3skjfb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Aug 2026 09:21:39 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.18.1.7/8.18.1.7) with ESMTP id 6749LZL4027311; Tue, 4 Aug 2026 09:21:35 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 4fs9vjk7v0-1; Tue, 04 Aug 2026 09:21:35 +0000 (GMT) Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 6749LY8M027285; Tue, 4 Aug 2026 09:21:35 GMT Received: from hu-ffaruque-hyd.qualcomm.com (hu-ffaruque-hyd.qualcomm.com [10.147.245.31]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 6749LY9I027260; Tue, 04 Aug 2026 09:21:35 +0000 (GMT) From: Faruque Ansari Date: Tue, 04 Aug 2026 14:51:21 +0530 Subject: [PATCH v3 2/3] power: reset: pscrr: add watchdog pretimeout reason tracking 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260804-pscrr-reboot-reason-v3-2-e706dbfc7465@oss.qualcomm.com> References: <20260804-pscrr-reboot-reason-v3-0-e706dbfc7465@oss.qualcomm.com> In-Reply-To: <20260804-pscrr-reboot-reason-v3-0-e706dbfc7465@oss.qualcomm.com> To: Sebastian Reichel , Wim Van Sebroeck , Guenter Roeck , Benson Leung , Tzung-Bi Shih , Oleksij Rempel , Srinivas Kandagatla , Daniel Lezcano , Pengutronix Kernel Team Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de, Liam Girdwood , Mark Brown , "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , =?utf-8?q?S=C3=B8ren_Andersen?= , Guenter Roeck , Matti Vaittinen , Ahmad Fatoum , Andrew Morton , avaneesh.dwivedi@oss.qualcomm.com, Umang Chheda , Faruque Ansari X-Mailer: b4 0.14.3 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Spam-Info: AW1haW4tMjYwODA0MDA3MyBTYWx0ZWRfXyk1loyYXu/GV IEnxWPq3Ki9Y+fDbeLFvlIRI/Tk4LE+gRuatzna+dHI+6ogcmLRUeB/HxbaqJfHicDtprk8vR5v zYDML8o9ed3XvWnNxyQl6ICKylmEis0= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODA0MDA3MyBTYWx0ZWRfX8RaEivsFOZzn VEFnudeoOdxc4hMLR0a6kC+MdzSjIkEz1kJmHklmTAieAQuEccrV0ffJvmH/zkFb0186Q0lE10I ePfDi3z9+CVxtZAEdFtysp4BIzRSFY91C9skRtCyD/hRaZD4r84R6SojCq6Ab6OuMEoQuA9msUZ ObTBgxEr8qxcUa0xTbMJMiljBskK24fZph1SgweWGHiQOxPNItvZ8cLyu4zmbicOvxbBnNDXqK2 qB3HbX6enn8pSJ/o5U96L/wG4rvSIJq/KP8wM+zAtubJRA87U83OqCy0qSpUV9XXKRokmC2LjM+ SslsHEv5tnpU7rZ3D2E6TkO9HOvnTmA5/F3jfCl4ll+LvN1gNo14FruxcE/WnssAI0YxSggEeEw cbIBkJl6/cIOVrfp3ClxQZDn/uCGXqaTKPWeKfElqKEtH5q/3oEXeg7pBi67xY6aslPtxmCE5A4 LsMj/Do6hYXqTySCAhA== X-Authority-Analysis: v=2.4 cv=Nu3htcdJ c=1 sm=1 tr=0 ts=6a71af23 cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=liq4Q_DvyCEuhuVGVXgA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: H2MyqJYeTYjzehjanYoN70UroNY7K_I5 X-Proofpoint-GUID: H2MyqJYeTYjzehjanYoN70UroNY7K_I5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-04_02,2026-08-03_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 priorityscore=1501 bulkscore=0 phishscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608040073 Watchdog pretimeout resets are not recorded with a dedicated reason, causing subsequent boots to report PSCR_UNKNOWN and making it difficult to distinguish them from other unexpected resets. Add PSCR_WATCHDOG_PRETIMEOUT as a dedicated reason code and prevent the panic notifier from overwriting a watchdog pretimeout reason with PSCR_KERNEL_PANIC when the pretimeout governor triggers a panic. Signed-off-by: Faruque Ansari --- drivers/power/reset/pscrr/pscrr.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/power/reset/pscrr/pscrr.c b/drivers/power/reset/pscrr/= pscrr.c index 8c45b84059a9..b7e6239e207e 100644 --- a/drivers/power/reset/pscrr/pscrr.c +++ b/drivers/power/reset/pscrr/pscrr.c @@ -529,12 +529,15 @@ static struct notifier_block pscrr_reboot_nb =3D { static int pscrr_panic_notifier(struct notifier_block *nb, unsigned long action, void *unused) { - struct pscrr_provider_dir *dir; =20 - set_psc_reason(PSCR_KERNEL_PANIC); + /* + * Do not overwrite a watchdog pretimeout reason already set by the + * pretimeout path before it triggered this panic. + */ + if (get_psc_reason() !=3D PSCR_WATCHDOG_PRETIMEOUT) + set_psc_reason(PSCR_KERNEL_PANIC); =20 - list_for_each_entry(dir, &pscrr_dirs, node) - pscrr_do_record(dir, get_psc_reason()); + pscrr_record_current(); =20 return NOTIFY_DONE; } --=20 2.34.1 From nobody Fri Oct 2 06:58:29 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 3708643CEF2; Tue, 4 Aug 2026 09:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785835329; cv=none; b=Y6VVAVCf22vG+HsYl40c6XQoL2w5eYWmfPRMfsPNQrAV5nX+GoyDuYkorBHz42JjM/Jl7P5qzGbZhfxsktJkzykQgS9UU3j8Btmn1P+aXe2ScJuf4kV37F3P7kK0T7YTG+ffi4h/9HPKJ1Pk8nZ/VJq48HMDsce/DNhfGEaNrt4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785835329; c=relaxed/simple; bh=ARgR8aPbH4uU6yMM6lztEeNLijJyXZf2YV/9a0Is8LU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dSCXuNjDycgKdMqiBIUxWjObxO/wG6dQwC9hB2pbq9geYiCQReCoBN01xukYM7UVKQMbLzveHZAp0k6XPqvaWcA//v3neX1AOHHA7ndgCIktw3p9I+0HpxJbC7faw4u3f56qrETn9XJ/nRqfXfpnHsDvTzR8Efd2iGTuI9VFlUc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=BRH//DsD; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="BRH//DsD" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6748CMQu3300468; Tue, 4 Aug 2026 09:21:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= SqqiIiH8h2AqcgR9DgbjNWCm4HTJ6T1Ws54sjHwyhZI=; b=BRH//DsDCbhIfuDP sDaPrrbDK3AMjbitqlE4okVUQJfVBeCFTvkE/W5zXknJleXk1CtdOs6cYvtSSTyz oYzr5MB76jKHExYhQHYkRN+l9nP6PX/DgjBuqfSiPA3LMreAitSgQw27MiafOM13 67NtrvA7g4AQCrfxrX3phxM70RW565HuTiRTgmPZopYvKnYMFUYcf+q7jNS1PmmN 9lrWOB7YO+ravzUeswtwDuSfPpbMkcJfNFoI1zc/sMltlfurM0495n1bvGGoFCFk tkBoCoP5P3eolzMutDVu9ZrE1IdH6N3jAKAnyPL/QVelr3br6EXPH08OdUM6lCjd cZaqCA== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fu1p8auh4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Aug 2026 09:21:38 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.18.1.7/8.18.1.7) with ESMTP id 6749LaWq027346; Tue, 4 Aug 2026 09:21:36 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 4fs9vjk7v3-1; Tue, 04 Aug 2026 09:21:36 +0000 (GMT) Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 6749LY8O027285; Tue, 4 Aug 2026 09:21:35 GMT Received: from hu-ffaruque-hyd.qualcomm.com (hu-ffaruque-hyd.qualcomm.com [10.147.245.31]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 6749LY9J027260; Tue, 04 Aug 2026 09:21:35 +0000 (GMT) From: Faruque Ansari Date: Tue, 04 Aug 2026 14:51:22 +0530 Subject: [PATCH v3 3/3] watchdog: pretimeout: update PSC reason in panic pretimeout governor 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260804-pscrr-reboot-reason-v3-3-e706dbfc7465@oss.qualcomm.com> References: <20260804-pscrr-reboot-reason-v3-0-e706dbfc7465@oss.qualcomm.com> In-Reply-To: <20260804-pscrr-reboot-reason-v3-0-e706dbfc7465@oss.qualcomm.com> To: Sebastian Reichel , Wim Van Sebroeck , Guenter Roeck , Benson Leung , Tzung-Bi Shih , Oleksij Rempel , Srinivas Kandagatla , Daniel Lezcano , Pengutronix Kernel Team Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de, Liam Girdwood , Mark Brown , "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , =?utf-8?q?S=C3=B8ren_Andersen?= , Guenter Roeck , Matti Vaittinen , Ahmad Fatoum , Andrew Morton , avaneesh.dwivedi@oss.qualcomm.com, Umang Chheda , Faruque Ansari X-Mailer: b4 0.14.3 X-QCInternal: smtphost X-QCInternal: smtphost X-Authority-Analysis: v=2.4 cv=A5xc+aWG c=1 sm=1 tr=0 ts=6a71af23 cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=FYyizyoliohAzulCZuQA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODA0MDA3MyBTYWx0ZWRfXxBgajlnhQcXI 7wQ9ebeYNA6cUpA3cn0mTRo27RHHV6tSaZKSyBUf5VNfviM35He/ab81F8xEg2W+4H6xXfjzavB q1aN3Lom8De280AwaAk11qwDyTrqnlmrnrdCKr22vsW4u92D9KciETj6DDB2ycgku8un3IxejzE xrkyWIb8A7G4Xjd2gY6dLIc1kOfaurfbh8T2zr8JIpkmmwHFCbEArPR/Glehp4oZ+pJLaNabv7w JlC3rYs5G9J0pkBku9Ns71vb5RVhxuxoFZL9gpHuQl3GA7pd8FwPb4367sYApWf79POQcKJ/7O8 YzMaoMWk4iJhunPEYnzV8pfnRKQtEetvIOR0qaoEXHjju005uoPXZey3G2LqebZR/7OQi621qlX ihNEi2yjyrqn9kYSxoC+oFyLOhtmaXaX7re0P0SesRSWDfJr0z7HmTTH5jPvsiIU3ehKA5+1DWd lLmUvyXYKxiJ+Pl6zEA== X-Proofpoint-Spam-Info: AW1haW4tMjYwODA0MDA3MyBTYWx0ZWRfXzGKZDv4041a6 Ijk2u55T7GCFpxD7i5NxiHFpTLZwQpK38ejl6eeqlqMxr15A2VqCxdfKzM7xnekkc8qAhegaH0U d+Z9AaZwuPotb4Q1WJqnRCb1jJ9ha7k= X-Proofpoint-ORIG-GUID: O-8R8Ss2-e6W8Go5svX2v1PRQW9s1qvW X-Proofpoint-GUID: O-8R8Ss2-e6W8Go5svX2v1PRQW9s1qvW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-04_02,2026-08-03_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 spamscore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608040073 Update the PSC reset reason by invoking set_psc_reason(PSCR_WATCHDOG_PRETIMEOUT) from the panic governor's pretimeout handler before calling panic(), so the reset cause is committed to persistent storage before the system goes down. Signed-off-by: Faruque Ansari Acked-by: Guenter Roeck --- drivers/watchdog/pretimeout_panic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/watchdog/pretimeout_panic.c b/drivers/watchdog/pretime= out_panic.c index 8c3ac674dc45..819487b5e6fe 100644 --- a/drivers/watchdog/pretimeout_panic.c +++ b/drivers/watchdog/pretimeout_panic.c @@ -5,6 +5,7 @@ =20 #include #include +#include #include =20 #include "watchdog_pretimeout.h" @@ -17,6 +18,7 @@ */ static void pretimeout_panic(struct watchdog_device *wdd) { + set_psc_reason(PSCR_WATCHDOG_PRETIMEOUT); panic("watchdog pretimeout event\n"); } =20 --=20 2.34.1