From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCEB334F247 for ; Thu, 30 Jul 2026 04:49:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785386990; cv=none; b=EF6oMGLX230M7mosT5L/XyzVtDrMRWE2AcTDtNu2dgnb9HWiqrDxyR4HNbpIINm3sC4+VBZcGhExCNkyqGfIiv1GQzi/5v2BGei6xMOML6cZkS51yM0PxSAhJ0sQRomKTCJ29/Gf5npa6C8WCiWap/+NS4NckxKRVApweonu/lk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785386990; c=relaxed/simple; bh=fhP1wbG3d+ulOnMxYIqs1V3WpHngKveC8jngYyjspSI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ekw8Fx227O6eQgTYYtAkPRjATSeLMDlFan+uMMgbcdplEff6SWavK3hB5g8jEEAaHp5mj5BmC+ODYHqN6HSzJpmo+y8To/jsREaZT5ArwD7nIvTdNpq0+LPqaidnSuE5ibNT91iZ3ICG8aJEp04gNcMbhYiE7hnVMyA0OA8xkDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dXFNJ6h7; arc=none smtp.client-ip=209.85.167.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dXFNJ6h7" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5b2b92065ffso1233700e87.1 for ; Wed, 29 Jul 2026 21:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785386987; x=1785991787; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=noDLu52YW31HFzyavdKF9a76RS9zMi0V29PPmiJzuHo=; b=dXFNJ6h79KOaDvge74toyTzo7CSY4ZLfseYS5AmU0d5n3P19d4gBhN3H2+tOx61hjZ mPMzxd6OA1VnlYUlhg4LcJdjGE5y/MFqSIZ/wa/2zYVOvmUBvFT+iZiKXldklrcRkn96 pmqBpZhnnrS2htx/vr9lB39MFoubN27qCXRtAF+8uNm+7KJOmJHpCKDBCeJlav5hGFez 8e4DBNITuEuBt+kpRdDUYVk0nnqZgn7ZjMGaLtURYMMevAkZOQRgVgp3iQx/on3v6OUX ASBNhoaYH/5I590eQPs/C76Lsn9XGQKSQ4xSB4ubZY1Vw7O6dwGfbTRhudzXe3WnBkIb 2CXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785386987; x=1785991787; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject: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=noDLu52YW31HFzyavdKF9a76RS9zMi0V29PPmiJzuHo=; b=EEDfnsAdm2+B7f7fuoZxns75tY3zfaq4HRZ+tX8c/hPX/ZAv3D5JSJTajI4huT2NCQ IQCkALUYgMCLrGmcFmOw/p9O6wx+T8MDq/eWQwm4ecdG9wtEkz8zswX2uU55L5Cw7PoM Qr4G8gEvXxblhl1udRdNztmmXuukmpz1M5qHTSx0gfJq3qHY+JCpm8MeCdrZQZcAo7sj NmOIPUJDZ7iBrL9/yC35ukGUbKfLH72b19EtBKt8IuvT61C4koEiXtN/Ke/mVgG9uQzP QfqdE3Q6iLa9LfVf0DTkRA/McB8HNBIpPeglU3dqo2hRGhT4FbT7E6O1w5rCnkx9MW5/ JS2Q== X-Forwarded-Encrypted: i=1; AHgh+RqfTkjLzbW6bcrE7Appj76Elzqiex68rdqz+MM5vSgQbt/oNpbE++5otWLVCWANv3yI13a3rFkttxELJec=@vger.kernel.org X-Gm-Message-State: AOJu0YwOzFqpEKSu6PWYfJXjTD7m/hWs8qEGbihFsBkR5yVjeE7wrZyh zuK7/QbdcvAhSbczw4cmHlMmh4E0wbQIvDqQidYbD8kR1JdZ17ckC9Pn X-Gm-Gg: AR+sD12Rtc4xsjHYF3mkJuLBZwQns2W03aFYmiFao3eTITLkPerO35HoZy/RtL5BpgZ 19SnjsMu8D2LadDoliGwMxBKT3+ZQtMUrobs3WrnW1VqjEbNK7jm8i/9Ly0Y7aCMHP7w6gzQ/Y6 EryHrrXZbU4tf3N5nQ7/hnDZG5L7WKOSPET3fm7MCxLzMiiKYt+daRdl/C10zPqM0rbghVf/hbf 0EGbW61YJmMJgag/tmUWCRrNAuIEHuDoSq33XKAWn/TVsDWDSVXrWW6E2dlNCItceMLf5zrqyoo uGF5RLQ6kfVy05DKbbiLK0inMMVWaC89uzL8M+hxLeOXFu2mHccgcWmXWzD8pv1GjxzR50GovBP 1TXD4CEYudHmXrcJgoJmD63gYYLPv6TrRAoC3IRyFsK4Ht7xsgSLWGwfXLs++jjCF/Ye+1hDP0C envOI6dV4QC2eCYyt584tuhdeG/jbUH20At12+Dfakaa0bxOU5sTmvAPH+8SHm9b2G0U3MRf+dn 4aWJJJnM5RFWgKkmcq92dlLFySYempkUHsXzfsguABeIA== X-Received: by 2002:ac2:4e0f:0:b0:5b2:a885:f3b9 with SMTP id 2adb3069b0e04-5b2db36d8c7mr167808e87.35.1785386986590; Wed, 29 Jul 2026 21:49:46 -0700 (PDT) Received: from ?IPV6:2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703? ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-39f6acb1167sm1267961fa.36.2026.07.29.21.49.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jul 2026 21:49:44 -0700 (PDT) Message-ID: <98e65507-3084-4948-8096-4e2d8d20dc81@gmail.com> Date: Thu, 30 Jul 2026 07:49:41 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] power: reset: pscrr: add watchdog pretimeout reason tracking To: Faruque Ansari , Sebastian Reichel , Wim Van Sebroeck , Guenter Roeck , Benson Leung , Tzung-Bi Shih , Oleksij Rempel , Srinivas Kandagatla , Daniel Lezcano Cc: 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> Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: <20260722-pscrr-reboot-reason-v2-2-495ba3005953@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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? For some reason I think the PSCRR was designed to be able to store multiple reasons(?) Could you just add one more instead of overwriting existing - or should the check be more generic (to ensure the reason is only set if there is nothing to overwrite). If I am just completely lost (which happens), could you then improve the comment a bit to explain why WDG timeout is special and shouldn't be overwritten. The checking code itself is quite self-explatonary ;) Anyways, I am happy to see the PSCRR being worked on! Thanks! Yours, -- Matti -- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~