From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 8F74533B96B for ; Fri, 31 Jul 2026 05:36:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785476175; cv=none; b=pfXyTqgALwxxVLv6qrg1M9V+6cPXdKU0r1nvtR+OiT4r7vMhUeSdFFuiVOawcH1V/ESWaZq6a627DeFaV41sqBTYNfDiJ9MCclT+UecUNkOfyKxj15rUq+YmQ3dYc0IJAia6z+ERysI0fnZah88JI2rk2qy5Q7E3FgpF4JZpTd0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785476175; c=relaxed/simple; bh=HlCj3OUYyqKtQ/5rTQybZUxn2k8hK828D1vbxPLMmSU=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=UqeGvuNrdYJAsZOt6yysze5aDotgFVcYyH14HOjYMFFpc3fEfMrl0brNJ63gXtDvOfcVA0HlwycGlLBBjM3JMRnnD+cZJmYxmSujGhQObztPsBxN0M+zCThEixz8BvLa2PherpaZSudIuOmn9JsT4r7NjNK9R37DYsb4YloxXZs= 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=RIGQzT9A; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LTqW3grq; arc=none smtp.client-ip=205.220.168.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="RIGQzT9A"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LTqW3grq" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66V56db52927812 for ; Fri, 31 Jul 2026 05:36:13 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= Jysv5gPSXcvU8IySyVYB1omnrR7juLYqFiyOpg6lF6w=; b=RIGQzT9AraOLTzZ9 bdoKEJFVrrZFwumzgB4E0h6ZfE2CSQALZ1Hn81cHOj0KMRiHeobwba0AP2zvt7HE EgFbXylJN8I9knulVquIq0KKMbGR9F6e6H+R0WFv9nPEogT7l15x6oeoJ5UIp5O5 aoiW6uJnI1aFgs7CkhX2j2wHoPgLbylxj0gwqs/wFeUYOCOTraIaH99JH5g4BAxb 1VlezU7G1ot84K3ZVEUhAfVh3Jh5pdg1+HZ7fC0LjUiFpwpfi7OP4NRsXkwvth45 mVB4n9M/fIGfnVxUHVBYjuYn30/0de1FGe+qEO/+coRDDP4//TSpEIeQ9/uiFVSf QYHoEg== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4frn92r31y-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 31 Jul 2026 05:36:13 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-38e7ff7b375so684067a91.1 for ; Thu, 30 Jul 2026 22:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785476173; x=1786080973; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=Jysv5gPSXcvU8IySyVYB1omnrR7juLYqFiyOpg6lF6w=; b=LTqW3grq02LWt8Cw2WPsPK1WuPDkz37EZNqFudC+ZI88O3PU1QBYMxq+awr87s+Iqx pAD6ydTju+0ET4uyWKfiaocNY2hevCqFPEnsrprAFNkdJpxNsJLNStB3IopwlmQJSZIj O5xSXPu/Wef/pGE5Ngg2cPuAU/eODvXLK384eVsho32AGESPhLjRcfJ5szggXJ529umg cy8CvwPAfriqELWmw70YDIhDJgMwk8kMuyUSzhN07d1EKxYYBIyTMLSWsXQbI4m7V3P9 QlyBeY72/Lzp8NcrHxsYuYBz5JYErIiDcTIuxe1gzPzGho3pwL/a3v2+Q4CVQKqF5jt8 +4eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785476173; x=1786080973; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Jysv5gPSXcvU8IySyVYB1omnrR7juLYqFiyOpg6lF6w=; b=QYcyffIJCMGkRr5KlL9OW1E76ceLgMxkY2/HVRBc44OI+iJAHCWZCuztf0FVmtVTx7 bJ4sDW+x0Wswu8LMfwF8/mgRFIvugZdz0/vHDSIv7NzLlTEXlHqP9CBzS/W86qbmq+ml gCwdGjVigqlDd+puqvHSbY8qrmj+//pwJLW5RpR3IrnKhuZEZzgrws2yxzUaaMX+jlNM 7UUc68/QgPEu5h7/rB3sesoG30P5P/mlckJ8FRH/1068pNZutdpxTaI8krHs6uUMVrA7 MGPt0O8iXOzygnXfvX7E/Th0CSAGRo2X2kKT1thN8xP6PyANotnUxSBpiXbqwo5Hhr+B Lgew== X-Forwarded-Encrypted: i=1; AHgh+RqfVzQ96VxYoA8QAf7zxIIqQEztiQ07JnySkOkZQmGeR2jq3ERgx0HhRM4DgvWRoiz9t4mrypOj8bmpGms=@vger.kernel.org X-Gm-Message-State: AOJu0YyzT5VvZe2gp5IwpVKBDDrWmFF0Ikj+hE0R1ZN3Ow8X9/0rf2go kQ17rlctXucpbwj0nIJ3N7DMB5SJOB6gLOH4jx5vLVHfc7iulggUGFDHyfUsUAkR1AYoFjv8thu pG6UeDQrly6Fib/lR5d6SUePxMb8j6I/lGuF7ddWn2KLq7o0vp53xCrWKnEVcZNIqHQ== X-Gm-Gg: AR+sD11pMrctIxQD1WVEfaTbDvsHTdKLY2jILa8DsKxL0lbGZ/Vl9pYlkiYaq7D9p5h GjnI7AbeU9VN0lIqnFJ2Qq6ES2TCtNRDxjPPRJENs3bPSFPKNPG5z8PLQC9D8997u++sToqVFX+ E7yw7YwtaPpTGty+v5cp3SBI81W3U23VXLLEtUkre3JHqXy3q9Y0YHQbjgEpqGsFpM1pyiRhhBr jsL8a2dDJNtycbcoc5eFBGIhHI62QaonLsfy9GTxx4xqeSikGzLkzZSTKXVTkmLf5sMUsKIJ62U y7odsYx4J6I9583yeSCwyrwB5a3LB9WloGAp5z4QURpvSmX0JRiwDWfEZWOaj+ZggeHa56ajmH0 EcZHmoFaLCQXfLehklyBuWG5YJDT2M9I= X-Received: by 2002:a17:90b:33ce:b0:38f:1f8:1fa with SMTP id 98e67ed59e1d1-38fb11f3accmr613799a91.15.1785476172858; Thu, 30 Jul 2026 22:36:12 -0700 (PDT) X-Received: by 2002:a17:90b:33ce:b0:38f:1f8:1fa with SMTP id 98e67ed59e1d1-38fb11f3accmr613786a91.15.1785476172302; Thu, 30 Jul 2026 22:36:12 -0700 (PDT) Received: from [10.218.33.235] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb30dff2esm169062a91.13.2026.07.30.22.36.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jul 2026 22:36:11 -0700 (PDT) Message-ID: Date: Fri, 31 Jul 2026 11:06:03 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Faruque Ansari Subject: Re: [PATCH v2 2/3] power: reset: pscrr: add watchdog pretimeout reason tracking To: Oleksij Rempel , Matti Vaittinen Cc: Sebastian Reichel , Wim Van Sebroeck , Guenter Roeck , Benson Leung , Tzung-Bi Shih , Srinivas Kandagatla , Daniel Lezcano , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-msm@vger.org, kernel@pengutronix.de, Liam Girdwood , Mark Brown , "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , =?UTF-8?Q?S=C3=B8ren_Andersen?= , Guenter Roeck , Ahmad Fatoum , Andrew Morton , avaneesh.dwivedi@oss.qualcomm.com, Umang Chheda , linux-arm-msm@vger.kernel.org References: <20260722-pscrr-reboot-reason-v2-0-495ba3005953@oss.qualcomm.com> <20260722-pscrr-reboot-reason-v2-2-495ba3005953@oss.qualcomm.com> <98e65507-3084-4948-8096-4e2d8d20dc81@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMxMDAzNSBTYWx0ZWRfXz2Vub9umGkCp lhvysHBvwaA+7cr6dtaFL333i7cPmqNtRKpNHaPUuCyithZUBPF8EWqETonxO0QHiG60G3DNA7I /FVMs92yZXEccdzOoFpJTkdQzXImVGwx4FxoAeKxjO+DxFsJH+uvK8lPku+4tcZLYrVbfeg4WVG iNtIbleMggpA+q7hg7gWnMrrxpyuPEdFClFeNjONzu0v+r1X9paM7lr5yltiP+teOHezH7IfKim EVs7pB1hsFqZKeCb/ziqqT8ikKlJ/+lm6JZAWV5H2uOS3UoPfRPDvw8B9BQm4mjHE+MK/f4gwDf qmh4tq8xHP4q0x2iG5CL5f0yfyRtrhCOkdMAHWZwC1j+WORJkreJHMJoreeQ4qF7xTQCMoVbyvn V/RFNe2tenlRZj8o/eZl+NeMDUFmSrDXoDBuTda4WxoDr8FtsFWFualvwGLb4OnBwASw3hxwDqH hn42IUQ+Q2CaIhob5vQ== X-Authority-Analysis: v=2.4 cv=FNcrAeos c=1 sm=1 tr=0 ts=6a6c344d cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=w9q8cTZDPmzYZkvZMkcA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-GUID: 8pwZLX-COGPiJ_iru1x7NlWIFnc26-yd X-Proofpoint-ORIG-GUID: 8pwZLX-COGPiJ_iru1x7NlWIFnc26-yd X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMxMDAzNSBTYWx0ZWRfX8ib7av9N3UIH /SAM1hy6p25v/nz7Uhd5zIOAE+EiDixbPWn2HpOelikQ2it8WEOUccos2YZFXH3kscLVLcgpuCa qcUMuUHRMYzSglPiux0VIOz0WU5Od5g= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-31_02,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 suspectscore=0 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607310035 Hi Matti, On 30-Jul-26 10:54 AM, Oleksij Rempel wrote: > Hi Matti, > > On Thu, Jul 30, 2026 at 07:49:41AM +0300, Matti Vaittinen wrote: >> On 22/07/2026 18:13, Faruque Ansari wrote: >>> Watchdog pretimeout resets are not recorded with a dedicated reset >>> 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 reset 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.c | 7 ++++++- >>> include/linux/power/power_on_reason.h | 1 + >>> include/linux/reboot.h | 1 + >>> kernel/reboot.c | 1 + >>> 4 files changed, 9 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/power/reset/pscrr.c b/drivers/power/reset/pscrr.c >>> index b5906f127e88..5b107c62fe82 100644 >>> --- a/drivers/power/reset/pscrr.c >>> +++ b/drivers/power/reset/pscrr.c >>> @@ -149,7 +149,12 @@ static int pscrr_panic_notifier(struct notifier_block *nb, >>> if (!backend || !backend->ops || !backend->ops->write_reason) >>> return NOTIFY_OK; >>> - set_psc_reason(PSCR_KERNEL_PANIC); >>> + /* >>> + * Do not overwrite a previously recorded watchdog pretimeout reason >>> + * during panic handling. >>> + */ >>> + if (get_psc_reason() != PSCR_WATCHDOG_PRETIMEOUT) >>> + set_psc_reason(PSCR_KERNEL_PANIC); >> >> Hi Faruque, >> >> I like the idea of adding WDG pretimeout resets in pscrr. I am just >> wondering what makes WDG reason so special, that it shouldn't be overwritten >> while other reasons can be? Can this notifier be called (now or in the >> future) so, that there are other reasons getting overwritten? I agree. WDG is not a special case - it is just one scenario that I have tested. There are many similar cases in the kernel. In the case of WDG, the WDG is the primary reason for the system reboot. The kernel panic is only a side effect of the WDG event. Therefore, I am recording the reboot reason based on the actual root cause, which is the reboot initiated by WDG. Yes, the notifier will still be called and may overwrite the reboot reason with another reason. Thanks, Faruque Ansari