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 6309A4DEC2E; Mon, 21 Sep 2026 17:40:59 +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=1790012461; cv=none; b=W3W2yYAd7a3fEFfYdk60ojI7NoPeAHZRKLRo0nSqsKsKt0DAV1hXB3h6lqKvXXG892Z0A4t5nQ4TBzdVAiXy7cH4s1ATIXepq1UO2ddko0sUvEdhm90xPSmJ6dZz3gtKXSq9WFGIluNwVu55d+o9KwaxlP4vDBJLKMrSbs+DldA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790012461; c=relaxed/simple; bh=FHzNN028Wl7cxVh7NYXgrkxS7ahQnf7fNUunvOT8ZkM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pOnde9aeUNYVLMPc0+YdTx+oqRUWX9TaB643mHjn5fx02Up2W3DQcXp1NwoqMs5MiOn2CwmL0OUl+e3+xyfh+5Upt+eFMVWEJhU12/k7cw4dArjPYFMbP5ICWyR8+37D+lM6yoRAF70j/veL+9WcW1QXB0IUBGf8/RLaRAD7Kl8= 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=DNjcYsNS; 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="DNjcYsNS" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68LGUiZb2707775; Mon, 21 Sep 2026 17:40:42 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= z/mAy5pF38WxS6+ONcT4R6fBRT5kBAMVlmEJjMoX/2U=; b=DNjcYsNSqi9bneOq UcllAm2AUlOS12JR2/QKR9QeZoQixC7+AKR4lvDmLf1BxgQbk6c+bncvT0SvuKYz msAD/dUmYwOaohy5N25JhBEbZo37ob31WAcmwhvgO23QQ0l5Pasn9Ftz025WRsAV RbNNzajKj/8ThXyn/BKnzgLYpT584zKcRavEL134fMjABCRI3UrGo5wQ2KjzS1B3 1iJQ1WahPc//L6Pgv4r9ZIJ7QiQKfMzKESUgH+wD8QqXT5lXovx828x8lAk6R7c/ v/FrhwzJaV6a2BKdoqqtEt1nqY8y13EoZPruO8eZcNqPfNyQGZtHaRTV4B0U7pJf fc8JQQ== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gu85vg9te-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 21 Sep 2026 17:40:42 +0000 (GMT) Received: from pps.filterd (apblrppmta01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.18.1.11/8.18.1.11) with ESMTP id 68LHedC21524374; Mon, 21 Sep 2026 17:40:39 GMT Received: from hu-ffaruque-hyd.qualcomm.com (hu-ffaruque-hyd.qualcomm.com [10.147.245.31]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 68LHebct1524318; Mon, 21 Sep 2026 17:40:39 +0000 (GMT) From: Faruque Ansari Date: Mon, 21 Sep 2026 23:10:29 +0530 Subject: [PATCH 4/6] reboot: extend psc_reason with power-on and reset causes 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: 7bit Message-Id: <20260921-pscrr-framework-v1-4-a5ebe994a98a@oss.qualcomm.com> References: <20260921-pscrr-framework-v1-0-a5ebe994a98a@oss.qualcomm.com> In-Reply-To: <20260921-pscrr-framework-v1-0-a5ebe994a98a@oss.qualcomm.com> To: Sebastian Reichel , Benson Leung , Tzung-Bi Shih , Guenter Roeck , Liam Girdwood , Mark Brown , Matti Vaittinen , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Oleksij Rempel , Pengutronix Kernel Team Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, avaneesh.dwivedi@oss.qualcomm.com, Umang Chheda , Faruque Ansari X-Mailer: b4 0.14.3 X-Proofpoint-Reinject: loops=2 maxloops=12 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIxMDI1OCBTYWx0ZWRfX0ARhF81L1CeY +QO13bQUETtWyiICM4JOzUT66muac+c1WOJ5x+1AegJ/zS9yWlNgbwmM5IS32uUasWfPWcguCJv +26vdFHE5wA3qOFtdvQlbTqbTaaHZOI= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIxMDI1OCBTYWx0ZWRfX+/Jjy+KxipDf TqS0oAuiokwRg1qetWl9x6ZX75dBR9E/ubcn6KeJcwbDFgtN8riWpprN6/Qu8X2lvQb/nuslA8W G5t0fdHhK5HOAI0ET6bcavglVPkkcCo9WsG8B0nzycDhuUzLc8drCLqLLeE8Pv1aAlrBZMX+QZW 5/1lxiI1pa6x6SC4hGs/Z9AHcVs402f56z2MwJv1HpxvywB72DF9wCjQQNyljzDvT0JTxC0OyxJ zgTYmoLYLyGTwP4xf70ayn90QPqsYGbTMWz+U92Yuep0LypUbTNHf81wx1yI0nXgWgUqnA+0zp7 6mEucuAX2K1o4LIecCDPhdTGaMrTTiompx4BfI1VKdChbYMWWUJ5bwdaM1yBMvpCdW+5HAorAgl lFq4zv6cWGNFUeF9/3lTaPx/oMRAhptIOH8flm6uqjf5CcetVfiakkStDdpiXCeshzBPzFHRTgy Km7eK/AGiwBeU2xflBw== X-Authority-Analysis: v=2.4 cv=E8FYNqdl c=1 sm=1 tr=0 ts=6ab16c1a cx=c_pps a=Ou0eQOY4+eZoSc0qltEV5Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=uHPRDBdGixKVNKiypX4A:9 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: 4aTFDfq70GWAJWcc_se_JWevQixNfRC0 X-Proofpoint-GUID: 4aTFDfq70GWAJWcc_se_JWevQixNfRC0 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-09-21_05,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609210258 psc_reason covered only the protection reasons. Extend it to mirror the full POWER_ON_REASON_* vocabulary - power-on, watchdog, software, external, RTC, reset button, CPU clock and crystal failures - so a provider can report why the system last powered on, not only why it was shut down. New values are appended to keep the existing numeric ABI. Co-developed-by: Oleksij Rempel Signed-off-by: Oleksij Rempel Signed-off-by: Faruque Ansari changes v12: - new patch --- include/linux/reboot.h | 28 ++++++++++++++++++++++++++++ kernel/reboot.c | 8 ++++++++ 2 files changed, 36 insertions(+) diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 4c5327dd7645..13f004ad1066 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h @@ -225,9 +225,28 @@ extern void orderly_reboot(void); * management errors, or an unrecoverable hardware fault requiring * immediate response. * + * @PSCR_POWER_ON: Regular cold power-on (e.g. via a PMIC power-on request). + * + * @PSCR_WATCHDOG: Reset caused by a watchdog timeout. + * + * @PSCR_SOFTWARE: Software-initiated reset or reboot. + * + * @PSCR_EXTERNAL: Reset asserted through an external pin or reset input. + * + * @PSCR_RTC: Wake-up or power-on triggered by the RTC. + * + * @PSCR_RESET_BUTTON: Reset triggered by a user reset button. + * + * @PSCR_CPU_CLK_FAIL: Reset caused by a CPU clock failure. + * + * @PSCR_XTAL_FAIL: Reset caused by a crystal oscillator failure. + * * @PSCR_REASON_COUNT: Number of defined power state change reasons. This * value is useful for range checking and potential future extensions * while maintaining compatibility. + * + * The reasons mirror the POWER_ON_REASON_* strings in + * ; keep the two in sync when extending. */ enum psc_reason { PSCR_UNKNOWN, @@ -236,6 +255,15 @@ enum psc_reason { PSCR_REGULATOR_FAILURE, PSCR_OVER_TEMPERATURE, PSCR_EC_PANIC, + /* Append new reasons here; the numeric order is ABI. */ + PSCR_POWER_ON, + PSCR_WATCHDOG, + PSCR_SOFTWARE, + PSCR_EXTERNAL, + PSCR_RTC, + PSCR_RESET_BUTTON, + PSCR_CPU_CLK_FAIL, + PSCR_XTAL_FAIL, /* Number of reasons */ PSCR_REASON_COUNT, diff --git a/kernel/reboot.c b/kernel/reboot.c index e53fb31bad06..5d4ecc82b35e 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -1102,6 +1102,14 @@ static const struct psc_reason_desc psc_reason_descs[] = { [PSCR_REGULATOR_FAILURE] = { "regulator-failure", POWER_ON_REASON_REGULATOR_FAILURE }, [PSCR_OVER_TEMPERATURE] = { "over-temperature", POWER_ON_REASON_OVER_TEMPERATURE }, [PSCR_EC_PANIC] = { "ec-panic", POWER_ON_REASON_EC_PANIC }, + [PSCR_POWER_ON] = { "power-on", POWER_ON_REASON_REGULAR }, + [PSCR_WATCHDOG] = { "watchdog", POWER_ON_REASON_WATCHDOG }, + [PSCR_SOFTWARE] = { "software", POWER_ON_REASON_SOFTWARE }, + [PSCR_EXTERNAL] = { "external", POWER_ON_REASON_EXTERNAL }, + [PSCR_RTC] = { "rtc", POWER_ON_REASON_RTC }, + [PSCR_RESET_BUTTON] = { "reset-button", POWER_ON_REASON_RST_BTN }, + [PSCR_CPU_CLK_FAIL] = { "cpu-clock-failure", POWER_ON_REASON_CPU_CLK_FAIL }, + [PSCR_XTAL_FAIL] = { "crystal-failure", POWER_ON_REASON_XTAL_FAIL }, }; /** -- 2.34.1