From nobody Thu Apr 2 00:09:38 2026 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 AA649304BDF for ; Tue, 24 Feb 2026 06:42:38 +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=1771915359; cv=none; b=WmibbfvrpWP1xXIZl+vZuXNsCWDE8RkXnfhk5Kk38W6G5w+XTqR6w1eaMA+Xm9xLkFNTOYBKPgLRfRjikOwXVVcdsiSCfLbC/da47/ojfHN39R7f3bChBHoF/pEXiSNdTJAtDeORWtrzAjyP8cLuCGJDm1Dyp7zeyOhnE1Gw/wM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771915359; c=relaxed/simple; bh=PdSzz0bj4RkAm9gUU9i1xAXXLdjyg5Gspl8Tfkihp6c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h/y3/CiFi7P2qwB5MBUwMC9SwO7f3+ovdXq/IJqWsTtsWQ7DQEHOifFWMAFtLy5joMlQpAANnUWjB5YClkdW5l8Z4Ww9nYRMLgEpS6xC842I4DSsGlq2KHMlNbTGHjpj3SQ4H10Eus1o5jBlNM6jjDEs4jjti3Atm3f4LzHA1XQ= 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=C/7sh+F6; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cN6BjzD4; 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="C/7sh+F6"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cN6BjzD4" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61O4Lifa2808544 for ; Tue, 24 Feb 2026 06:42:38 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= oHUkWHA7HOd0fTIofvIxhQ4B2OX1P9ypBZz5EM2pVT4=; b=C/7sh+F6t6c7mNZH LOENAoK2g9gdWxr35Ubb9rvP1Uyz7uCLyk73zjCdkBTCTeREdm5SU7B0wEtt2Cbl ATMYUGG8XMMg6ZK2r27bi2MNOZvOoXsrBqretJ4AX7wsgFSZM2Ra7RIoSaieVTrU +erRVB/iY6Yq+hhT/fw/3sAbID5pQJr6BZQ+rV0OtC9m3nZ/hroZXyi5IMQBejUT r/gjjiNMOR5Jl6RGJhu8P8/+zv5wLfx9btl74Ag6nrCdCoyc45ckkLgqhmHPIVxr KHj+08cNw0AQteiWsuqMTu8GOVKFoKmgNHjlMuQDmoEBkuWJp8He7Bo7aH3TUq5k bzZiEw== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgn8rb6fj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 24 Feb 2026 06:42:37 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-824f75913c4so2366926b3a.1 for ; Mon, 23 Feb 2026 22:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771915357; x=1772520157; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=oHUkWHA7HOd0fTIofvIxhQ4B2OX1P9ypBZz5EM2pVT4=; b=cN6BjzD4VHiYhfriXHme/W0T+4jIL46tNlC5SVsIdgjTMtqvysyIb7dnoh/ZVip1Sx IG0pcebDYwMl3iermqGyALcnLkKNzCT72+hRQLE4170SGqAIHu27h0hwS9ayINCb92pl VIOS39609bA13ybNOQs7gCBqOQR97HrpmLrBn4NEk3058mWxGQ0ROoyyelU3VAyBQtcr vijP9TK9+nhglqRr8DqEqASVl+K8qO0/RW9MIl0aIkmcuiyecfuqGzlRNbQkgAMYtMCm loKA+I1lqvtBMunlPn9fVbL/cJcYGUp1PBHea7XMs5//DtilM3G3ZwUdQ/BbUjgl7OTX yYFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771915357; x=1772520157; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=oHUkWHA7HOd0fTIofvIxhQ4B2OX1P9ypBZz5EM2pVT4=; b=HwH15lTxZcKeQAKqcegOU8fs2qYKL+yBIh6eCWDs1jogDs6D+n0gPOKS8KYK7HPWCS 1tNJ64uh3udPwvfObb8e5kOgJfK/M+Q8V4vDZZKuX7kUwXs+x9LZfyAjZKcYL67Muupq ovnZwtwDzvVdO+/OiQj4Hko/cpEpGbztXBRQHLuI2kPCDDGjMkaHD5Msxu16b9il4LrG PQBoJrtYzoFyOMv3Lzx2Wffyhv6IH7lAUuERSUI7U7xJOW+gohNCUICr9ycxxR97Lbna 5bCqhKsvOAo/GENWZfv4ZEqtHUVc7FhX3MyBMg82if+1j9GhZmknb/oTaKtws2qWNxgO C6rg== X-Gm-Message-State: AOJu0YxgvqkWxg93cS1HQVA0jEqDxumBwHu8KdCoXoh6PiwMxJGqa9iW 69RNhzHfPYjvKACDeHKHB8zAROMVAPYEpDf6x/LawxneSRPJKdcwz0jteOxSCuaul+bspMRIeGm NMAsd+l5m9Eq9mFfBsHMVJIWMhUnqv0O5mMdx8f1RMwDHw7ZZPi8+ejLJATs2X98jIcc= X-Gm-Gg: ATEYQzwFj6OgOcTOyAfzf9dIrr8Qwa15JphIScYzu18mcxkpyEI2FiydZ3jwFO+CDWZ 16kYM7sfVgxClobd+2JvU3uWbsGcAnLE/iiD1BL2f/a2AeUIKQEhAaiuo7i4YW122aPLbAPx71P l0BpIcm15HWZ2GFDWIq2/QkY2ZIeHtZliOyi+BB4ADyOpwgkIX9nA6FihVWjiPS38JktoJXSZ7x H2ft9vDr6ddC279/OijoMF7La4vvQDyvuMirlGSsZmtXwHB6G2+mCWpTr5fAxggpKOMC3Kbe7vZ XJxqkuuMud+YTUcLpg6mZZoMP8Ayp8gFXQS+2snybhsNJDGYg2Q2CQRnwHUvQMbxXnO15EWcK1W pwQs1nCxK9n/eQmbtLh0wgA/rcH60dyakHccUPpENMfg3jc2XJaVLsk9YOg== X-Received: by 2002:a05:6a00:23d2:b0:81f:4a0c:c584 with SMTP id d2e1a72fcca58-826da8bf420mr8945007b3a.1.1771915357196; Mon, 23 Feb 2026 22:42:37 -0800 (PST) X-Received: by 2002:a05:6a00:23d2:b0:81f:4a0c:c584 with SMTP id d2e1a72fcca58-826da8bf420mr8944979b3a.1.1771915356677; Mon, 23 Feb 2026 22:42:36 -0800 (PST) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-826dd8c7535sm11857732b3a.56.2026.02.23.22.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 22:42:36 -0800 (PST) From: Shivendra Pratap Date: Tue, 24 Feb 2026 12:12:26 +0530 Subject: [PATCH v24 1/2] Documentation: ABI: Add sysfs-class-reboot-mode-reboot_modes 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: <20260224-next-15nov_expose_sysfs-v24-1-4ee5b49d5a06@oss.qualcomm.com> References: <20260224-next-15nov_expose_sysfs-v24-0-4ee5b49d5a06@oss.qualcomm.com> In-Reply-To: <20260224-next-15nov_expose_sysfs-v24-0-4ee5b49d5a06@oss.qualcomm.com> To: Sebastian Reichel , Bartosz Golaszewski , Bjorn Andersson Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, Bartosz Golaszewski , Shivendra Pratap , Bartosz Golaszewski , Sebastian Reichel X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771915349; l=2327; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=PdSzz0bj4RkAm9gUU9i1xAXXLdjyg5Gspl8Tfkihp6c=; b=H6a3q9ynFdCwo5wpTqcHf5538fqn73/13OZdKErzfYNcjDDmjyLtPqStq0rg9px0DnKCAxID3 Hh7skNuRg/lCIFVGTJaBVf4cwbIJEfBLWke7TAsD6yxHI3FctC7bAk1 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-ORIG-GUID: GRXmNhIEPQVkzBb-CZfEOcwabk0rYuhN X-Authority-Analysis: v=2.4 cv=V7twEOni c=1 sm=1 tr=0 ts=699d485d cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=QX4gbG5DAAAA:8 a=EUspDBNiAAAA:8 a=LKyF0dicRlewKW4vAhwA:9 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq:22 a=AbAUZ8qAyYyZVLSsDulk:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI0MDA1NiBTYWx0ZWRfX14p5g3Dcd1sY TbgES2gf8KDa2aQ0hx96EwWkHm/jSIECWuOOpGP59aPBweAOvM/F1eg/lIaJICVwXljAfto0h7j 91fAZ+AM1/TDhhy5Je+8A2EO6+RzNyRh/Uqt79pyehiEayNeyUQiRPi7ErKHvaWC/SXa2Js7YCi 2slPMIosgoqgFMjlBpWBxFTAE6oZq+GOoqUwRalZT05zvzJO1NZTTFhyN6QhDMe+WTFaTqMTOD8 el15ATQj3RJthGxj/w4srLhDOExIb1h2AeZYhZr9PmVAXT3CGXLS+apjeD9GUIy/r2M9wTMoltM KXohbS8SsKgUH1OeLIVBsN4zOpeGlpqfD4214oYZ7UW2HSbZUiEq2K+se74TP/db0/Xjd97mS18 KjarqH7UMcYpLJwVjFLk80ZBCfGYzy0sO3s7bSWNyKr8/ndc7Tw8zgKz+jGho4oDswqqqnK9b2u hlJfWc+Qm7xx5P5Jdpg== X-Proofpoint-GUID: GRXmNhIEPQVkzBb-CZfEOcwabk0rYuhN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-23_06,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 impostorscore=0 bulkscore=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-2602130000 definitions=main-2602240056 Add ABI documentation for /sys/class/reboot-mode/*/reboot_modes, a read-only sysfs attribute exposing the list of supported reboot-mode arguments. This file is created by reboot-mode framework and provides a user-readable interface to query available reboot-mode arguments. Reviewed-by: Bartosz Golaszewski Reviewed-by: Sebastian Reichel Signed-off-by: Shivendra Pratap --- .../testing/sysfs-class-reboot-mode-reboot_modes | 36 ++++++++++++++++++= ++++ 1 file changed, 36 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes= b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes new file mode 100644 index 0000000000000000000000000000000000000000..a16c54ab841bb4687d3844ac5dd= 4abf6b37326e1 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes @@ -0,0 +1,36 @@ +What: /sys/class/reboot-mode//reboot_modes +Date: March 2026(TBD) +KernelVersion: TBD +Contact: linux-pm@vger.kernel.org + Description: + This interface exposes the reboot-mode arguments + registered with the reboot-mode framework. It is + a read-only interface and provides a space + separated list of reboot-mode arguments supported + on the current platform. + Example: + recovery fastboot bootloader + + The exact sysfs path may vary depending on the + name of the driver that registers the arguments. + Example: + /sys/class/reboot-mode/nvmem-reboot-mode/reboot_modes + /sys/class/reboot-mode/syscon-reboot-mode/reboot_modes + /sys/class/reboot-mode/qcom-pon/reboot_modes + + The supported arguments can be used by userspace to + invoke device reset using the standard reboot() system + call interface, with the "argument" as string to "*arg" + parameter along with LINUX_REBOOT_CMD_RESTART2. + + A driver can expose the supported arguments by + registering them with the reboot-mode framework + using the property names that follow the + mode- format. + Example: + mode-bootloader, mode-recovery. + + This attribute is useful for scripts or initramfs + logic that need to programmatically determine + which reboot-mode arguments are valid before + triggering a reboot. --=20 2.34.1 From nobody Thu Apr 2 00:09:38 2026 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 D6155304BA3 for ; Tue, 24 Feb 2026 06:42:41 +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=1771915363; cv=none; b=OQVdvuKZYQCOlOHgSH7lFVBjKlJ3YBrSkqI2VUTKuvcw4Zjmx+1VkMssTdKPX4zUoDiDxWh6WkL2hDSm+S947vPoxxvhED3PylR0igiZhQOQtkyZv4UbIG+twR6pWJkMYHRnx3VrpRuihEvsDHQyZw9AdvSokzStTfnGaPGB1cQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771915363; c=relaxed/simple; bh=LZfrAICD4KiAUYwQIZDxFx5vfdV0wiYTUoP+tPCPTyA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NW9ztK1JTdsp0mhjr/PVYIeSN0rWZOv+qClc2SamWeugcBCk0GUhkvl9Bw5TnwJKL1ZzfJ8AniljqHuOXDrxwo1A5VpToSc20psbpjXd0jvTTHgOOrTXpbsKjjD8TGs3ZdQkH3U9JXu66G1EZqUeiSn2nZzfXJtjdwRceAX3tu0= 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=d1hyLe7H; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=eoJ8gt1K; 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="d1hyLe7H"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="eoJ8gt1K" 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 61O4Lr3X2013843 for ; Tue, 24 Feb 2026 06:42: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= yMw9Pw25Ui92t5cfDP6O5v4cNs3hM/ikaiYaCJZzbbc=; b=d1hyLe7HINJNwp3A R5bBsnQCCfJoU0EQNhdwDsUX1+heoivKhqIEq8CJU2wc9sUTHh17ZiMjoRrIPXN4 Z9EXlA4Te/bqoAbFsBkAQB7u0PkDgTMWPhpok5mRwtkYZIfR0W+6P13yZi39c5I+ y5bXiO0ldU/Zc/AgwGEXv2WCKxOWlQd6EuIrQQ2HD7hjmapxrC+Y01FLS0RHQEvq WHEIl8EHnTdqCtS4DTpjaf2IP3NcF30QpBH9iP/HP3mYutkPsHeYE+XvQ/cR4g40 /f5cTjUCnduLAt9nJplwjuzS6TKF0TaQqvsxzrgZ/978Gxmi+ycgoqKkUTgbdS4T +hAU9g== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgr69jmcs-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 24 Feb 2026 06:42:41 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-82436a49592so2227393b3a.2 for ; Mon, 23 Feb 2026 22:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771915360; x=1772520160; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yMw9Pw25Ui92t5cfDP6O5v4cNs3hM/ikaiYaCJZzbbc=; b=eoJ8gt1KDloT1OdYKAh6pQZxXGHRJpRZv+NjR6XwibvGj3uTknHb1Di/qWb6A1Qkyc yHl3EGsQ17LOvKd4EHlPQ3DMWZkS6mZCq6A6MKrehIxN3Iv21Liai705exDmqJmnGnAq 9vrvHOZ8jQotkiuQjgvF11WRXGKzdBaU7Pi45LnM7yDUCYNF5HGe6LNUZgxVhyBG0zwU TpBRL8OjkTWDVl64Nd3Qta9spHxBsJ7xR7BLHoTKilLEjtz3oG4Cu13DF0t17oAW3MVd z9HnQnpKiXLEAdY0AVnKarF2VuyZyWF5/ObTRdziaGPr327Y53Oo28vwyt8JBv0tH/vJ DjcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771915360; x=1772520160; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=yMw9Pw25Ui92t5cfDP6O5v4cNs3hM/ikaiYaCJZzbbc=; b=jpOHtmAbTg2zzsEpGc/3X4pKylgCpb5K37zZNgJK09zApBGgeUlnXf02w90UCoHHfn +NjOvj0fPYdKV6/DmGFO/gAjyFoWh9Gc0uG8157e+5+uWQ4ldvR6wW/OHtDOWjntFZPk y1lUaDT31ApQkFXwNSh0X/e/wI15JHAag9mWGcZNYdBz7s/NFAIjlbkAL6g0sJJPvRCk YUDRee0vf0dzo+Je1hK3MibgTwX8B5wLI2MZBfIJaAGfDHMA53FnJss8bnfXyeipglGL dUC+Y69OedKmC0oR9wKt+7ggzI/tSGiLhrK5kf8yOoSjJhVu3u8VNtSP/ePg8wizTplN Ed2g== X-Gm-Message-State: AOJu0Yz+kaYmveQTNRqS7Kj9usxZHkLCc1Aqu1Mbm5bIcO8Ux4H8IGNW IDLOhopIH8XgjpNLtHEVnw7nfYBQk5JldL5esJEDaDehsAChx6HF/7yH7JoygJBo0NBXO6bUUKY WdbprI8RHMAewlMYuPf8sdtix98Ps4KiCP1tIfaVsAXttyfv4iLARJJGpL+xB8+Gh8g4= X-Gm-Gg: ATEYQzxY2ea4h+NYn3VSV6PVKHoWHdUqVxz/DuJHIUfB3BV65SSrhhh8o9DqQm80+Rr 58/fcdY3icsmQtne+2QFGE1MsceVhaUf8aMkq/vOrJbxTtdDVYLDebGB+Ph15iWjOgw87HevX91 nVuXzWNawrcwmU5jGs19RccCWs+3wPrr7RYFvb5in0t0PcKYWk+3eqlHERnKwRHgRBRRvKRtY3T Q0/ExKSUHSwgROvVhyE5sFT91fDBqBa0gGnXsiyYODpQ9eFTHPw/iPkMrUBzN9R7WYGJlg91+V/ u5GNPfVzv1RQ0qolsuzRAFK9UUNhHkNBP+RGOYFxVqFlMhvIPxOOdqtrFjyH/eB8qGhAtlpt7KZ YlYi4ImVymu6XK7FJfS5AD0fPZs7v4+JoVPkwINdMIgog27It/kAGx7h+Ww== X-Received: by 2002:a05:6a00:330a:b0:7f6:4922:89c4 with SMTP id d2e1a72fcca58-826daa26025mr9771271b3a.55.1771915360533; Mon, 23 Feb 2026 22:42:40 -0800 (PST) X-Received: by 2002:a05:6a00:330a:b0:7f6:4922:89c4 with SMTP id d2e1a72fcca58-826daa26025mr9771249b3a.55.1771915360059; Mon, 23 Feb 2026 22:42:40 -0800 (PST) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-826dd8c7535sm11857732b3a.56.2026.02.23.22.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 22:42:39 -0800 (PST) From: Shivendra Pratap Date: Tue, 24 Feb 2026 12:12:27 +0530 Subject: [PATCH v24 2/2] power: reset: reboot-mode: Expose sysfs for registered reboot_modes 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: <20260224-next-15nov_expose_sysfs-v24-2-4ee5b49d5a06@oss.qualcomm.com> References: <20260224-next-15nov_expose_sysfs-v24-0-4ee5b49d5a06@oss.qualcomm.com> In-Reply-To: <20260224-next-15nov_expose_sysfs-v24-0-4ee5b49d5a06@oss.qualcomm.com> To: Sebastian Reichel , Bartosz Golaszewski , Bjorn Andersson Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, Bartosz Golaszewski , Shivendra Pratap , Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771915349; l=6356; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=LZfrAICD4KiAUYwQIZDxFx5vfdV0wiYTUoP+tPCPTyA=; b=Dit3QqHWSvGfA+7x4H7Cb9kGjH808YTDaprXRrMsegtJCE+P3tSvGZmWbbYPxjNGW4gd1iLiJ DDQHTUv7kSNAwhGd1ccgwd5erBHUQ9r0D987++fx84bxN1okeFUCojZ X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=O6A0fR9W c=1 sm=1 tr=0 ts=699d4861 cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=s8YR1HE3AAAA:8 a=BT1iJhKI-cehe1MtwS8A:9 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 a=jGH_LyMDp9YhSvY-UuyI:22 X-Proofpoint-ORIG-GUID: zmZzVmlvesRN-Qwp-xo6k--O2_TGkf8q X-Proofpoint-GUID: zmZzVmlvesRN-Qwp-xo6k--O2_TGkf8q X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI0MDA1NiBTYWx0ZWRfX3k9aV+SdPQ6Q aGHCI1c4d4nfUWZVcqjACoWf+iovacE56I430TbckKAHjoLqj1AJo61a6knuIZTGehj+vtzxcIK mJ9V3wbPpAADyAwB5ATX3+jGrZkPHMdoEZIE35EKZUCzicA9spnThysWR9NsD3i3895CBUWzamP 5/Ly9roMcHaMUVACBFcHRPLs9Y9hWwiOEtB3vGqSu0MCWSl4B3EI03y05iB+jAfVeedhR9nT1w1 guUZWKvGBDkgLlM646lMyKih1lBs1t5g2vr5zyN1EbFvuRLayqmBT2bWfoFtU+eiw1rXaxFyMcN peYOh4Kr6JmNFz0+Svrzgrh82kIzhaJifSl8VXwVLkVQI4VMl8tDL5IGP5nNFPYv8kJRTHSKvMf 1IXclP1lCZhsyn2f+qbiyi1sqRzv+CFTi0Tuy0e9k8frD9nSsVIjjtnN8zva/xMZ58dMmh6MCjV 0kQhVDsdc7eFjmksh6g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-23_06,2026-02-23_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 priorityscore=1501 impostorscore=0 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602240056 Currently, there is no standardized mechanism for userspace to discover supported reboot modes on a platform. This limits userspace scripts, to rely on hardcoded assumptions about the available reboot-modes. Create a class 'reboot-mode' and a device under it. Use the name of the registering driver as device name. Expose a sysfs interface under this device to show available reboot mode arguments. This results in the creation of: /sys/class/reboot-mode//reboot_modes This read-only sysfs file will exposes the supported reboot mode arguments provided by the registering driver, enabling userspace to query the list of arguments. Reviewed-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- drivers/power/reset/reboot-mode.c | 150 ++++++++++++++++++++++++++++++++++= +++- 1 file changed, 147 insertions(+), 3 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index fba53f638da04655e756b5f8b7d2d666d1379535..ad239e96774b6f033f2bdea9e47= 79403bc609c57 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -4,12 +4,16 @@ */ =20 #include +#include #include #include +#include #include #include #include #include +#include +#include =20 #define PREFIX "mode-" =20 @@ -19,6 +23,54 @@ struct mode_info { struct list_head list; }; =20 +struct reboot_mode_sysfs_data { + struct device *reboot_mode_device; + struct list_head head; +}; + +static inline void reboot_mode_release_list(struct reboot_mode_sysfs_data = *priv) +{ + struct mode_info *info; + struct mode_info *next; + + list_for_each_entry_safe(info, next, &priv->head, list) { + list_del(&info->list); + kfree_const(info->mode); + kfree(info); + } +} + +static ssize_t reboot_modes_show(struct device *dev, struct device_attribu= te *attr, char *buf) +{ + struct reboot_mode_sysfs_data *priv; + struct mode_info *sysfs_info; + ssize_t size =3D 0; + + priv =3D dev_get_drvdata(dev); + if (!priv) + return -ENODATA; + + list_for_each_entry(sysfs_info, &priv->head, list) + size +=3D sysfs_emit_at(buf, size, "%s ", sysfs_info->mode); + + if (!size) + return -ENODATA; + + return size + sysfs_emit_at(buf, size - 1, "\n"); +} +static DEVICE_ATTR_RO(reboot_modes); + +static struct attribute *reboot_mode_attrs[] =3D { + &dev_attr_reboot_modes.attr, + NULL, +}; +ATTRIBUTE_GROUPS(reboot_mode); + +static const struct class reboot_mode_class =3D { + .name =3D "reboot-mode", + .dev_groups =3D reboot_mode_groups, +}; + static unsigned int get_reboot_mode_magic(struct reboot_mode_driver *reboo= t, const char *cmd) { @@ -62,6 +114,51 @@ static int reboot_mode_notify(struct notifier_block *th= is, return NOTIFY_DONE; } =20 +static int reboot_mode_create_device(struct reboot_mode_driver *reboot) +{ + struct reboot_mode_sysfs_data *priv; + struct mode_info *sysfs_info; + struct mode_info *info; + int ret; + + priv =3D kzalloc_obj(*priv, GFP_KERNEL); + if (!priv) + return -ENOMEM; + + INIT_LIST_HEAD(&priv->head); + + list_for_each_entry(info, &reboot->head, list) { + sysfs_info =3D kzalloc_obj(*sysfs_info, GFP_KERNEL); + if (!sysfs_info) { + ret =3D -ENOMEM; + goto error; + } + + sysfs_info->mode =3D kstrdup_const(info->mode, GFP_KERNEL); + if (!sysfs_info->mode) { + kfree(sysfs_info); + ret =3D -ENOMEM; + goto error; + } + + list_add_tail(&sysfs_info->list, &priv->head); + } + + priv->reboot_mode_device =3D device_create(&reboot_mode_class, NULL, 0, + (void *)priv, reboot->dev->driver->name); + if (IS_ERR(priv->reboot_mode_device)) { + ret =3D PTR_ERR(priv->reboot_mode_device); + goto error; + } + + return 0; + +error: + reboot_mode_release_list(priv); + kfree(priv); + return ret; +} + /** * reboot_mode_register - register a reboot mode driver * @reboot: reboot mode driver @@ -113,16 +210,49 @@ int reboot_mode_register(struct reboot_mode_driver *r= eboot) reboot->reboot_notifier.notifier_call =3D reboot_mode_notify; register_reboot_notifier(&reboot->reboot_notifier); =20 + ret =3D reboot_mode_create_device(reboot); + if (ret) + goto error; + return 0; =20 error: - list_for_each_entry(info, &reboot->head, list) - kfree_const(info->mode); - + reboot_mode_unregister(reboot); return ret; } EXPORT_SYMBOL_GPL(reboot_mode_register); =20 +static int reboot_mode_match_by_name(struct device *dev, const void *data) +{ + const char *name =3D data; + + if (!dev || !data) + return 0; + + return dev_name(dev) && strcmp(dev_name(dev), name) =3D=3D 0; +} + +static inline void reboot_mode_unregister_device(struct reboot_mode_driver= *reboot) +{ + struct reboot_mode_sysfs_data *priv; + struct device *reboot_mode_device; + + reboot_mode_device =3D class_find_device(&reboot_mode_class, NULL, reboot= ->dev->driver->name, + reboot_mode_match_by_name); + + if (!reboot_mode_device) + return; + + priv =3D dev_get_drvdata(reboot_mode_device); + device_unregister(reboot_mode_device); + + if (!priv) + return; + + reboot_mode_release_list(priv); + kfree(priv); +} + /** * reboot_mode_unregister - unregister a reboot mode driver * @reboot: reboot mode driver @@ -132,6 +262,7 @@ int reboot_mode_unregister(struct reboot_mode_driver *r= eboot) struct mode_info *info; =20 unregister_reboot_notifier(&reboot->reboot_notifier); + reboot_mode_unregister_device(reboot); =20 list_for_each_entry(info, &reboot->head, list) kfree_const(info->mode); @@ -199,6 +330,19 @@ void devm_reboot_mode_unregister(struct device *dev, } EXPORT_SYMBOL_GPL(devm_reboot_mode_unregister); =20 +static int __init reboot_mode_init(void) +{ + return class_register(&reboot_mode_class); +} + +static void __exit reboot_mode_exit(void) +{ + class_unregister(&reboot_mode_class); +} + +subsys_initcall(reboot_mode_init); +module_exit(reboot_mode_exit); + MODULE_AUTHOR("Andy Yan "); MODULE_DESCRIPTION("System reboot mode core library"); MODULE_LICENSE("GPL v2"); --=20 2.34.1