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 C62623DBD63 for ; Wed, 4 Mar 2026 18:03:29 +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=1772647412; cv=none; b=rAWrcPLjXB/n/U8azbf0LGXFBi9G4JW1MtOgCbhFE4kEOv9JSvoHZC9Xh7SheLHdFcJ3HOstgcy9QCeRNiU4vXYpZzkzLm1ZbfEiGY7YuAyKv1y64WBanarM0AZzTq4Be/GgvLKJGPggECa+GXLi3pBgqXWrqSshTdd91nUazcg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772647412; c=relaxed/simple; bh=0vMXk/Md/p/dtT48Fb3BTHnIRamX9KagLmDjOqIwfng=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=ZqNvNe3YaeQinREUmG2opJIjG6Pamvff2f+a/86EjZnec5Hz+U3rzjS6VQwNM3am6CpdHaMS0DY3Sp/DKLDR9XPvHpFov33/BQJNC97FoM+70BeeUF+snPQ6bVmdDwhDmBY5EPshy9ZGfFQjj05YU6uf+t+G3W/3g/3YppjYxl0= 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=U4A26Lgl; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=IXlCZZgq; 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="U4A26Lgl"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="IXlCZZgq" 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 624E0XXU029301 for ; Wed, 4 Mar 2026 18:03:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=Vyv5gS68vJqgJnWX19CxJC j8iCvFpA1Yqk5ZPT0saPw=; b=U4A26Lgl4XgXYHuSfx18Itupf8W25tR+JDpAUW EBJaaaZ2kzHpjq1E+2GsIUeYUtkZ96lGf4c+9R8rmKiOjFncd5liu18Mn2UFJ4Sb v78tN9F/SpOjr+gcxXjA1vasVEX8/Dy++NFA+TmMdLhfHmzkNWBrh9SLu3VgGq5Q eAuQ16oYEFtZtqFoYPWD0MBLLq9whRkbN8RDq3FH3Am3qwv/DTa2kC3A7fuDizOw Zo863ITBj174+ekbq2asnr/MLenNfXeIs3up6tDC+esVu9/R4JDrcyktgX/EJ/w0 6jgfmeg0bT3bvyJtOMEJqZesePa9He9NCrX551F9QJm7n48w== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cpp4fguyv-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 04 Mar 2026 18:03:28 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-354c0234c1fso5952543a91.2 for ; Wed, 04 Mar 2026 10:03:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1772647408; x=1773252208; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=Vyv5gS68vJqgJnWX19CxJCj8iCvFpA1Yqk5ZPT0saPw=; b=IXlCZZgqKJs/KkwN9zjt6wPEANXTMLSYM/o6iDY3XTa9Ii3ghmROvWkeVbeJbCczyZ QHS9IMCtA+0F3wtP7s19g1DxaYy65w+NgHRPnzzscSxCzkgedEUda+0pCtD2fI/GZ++k L2AdY3t5dvhbDS9GyTyigFp5lXpreAAWL2Ivwoln5+r7KVoH0DBThzH3l5qbFZN+z5XE PaCNosOj7N7ixedzpl+VRnOi29y7aiMb/Lx5X8aMdiOKxcgp4DskA32RjWovxBKnOzTN Al8V7YaxB7vmIwjFGfjlohreWaZj/AU9sGMzycqTuo/lyaxbabvBgf8JehVl+IGLn1eK GOWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772647408; x=1773252208; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Vyv5gS68vJqgJnWX19CxJCj8iCvFpA1Yqk5ZPT0saPw=; b=akfmtiUnkIFoVitKzIDG0weWaxXNIuZrT2nRP+wSHw52bafPv60Q83IOh5vOy/JeV2 zV6q6VydEtNDr4IUZ6Qw+8nF2eY70UYxzVmQCCh4yUjKIA4qeX7R/Pb7vNAsEcLn/VJr rd1sjeneq/ivDUHj9on3j8XiLvBWpwEVp0JinAnQ8aZjrgrb/JEYbxW0Gn6TFipwxAd/ 2mYauieyp+gUkbrO4fNYiFd+u8bnhSqmXSwLfJgH2zV9JXAa4Mn/FDAVOBPpNVir4Fvt lA6rP9tzt30+AUQxqkhavh3lNRIok4yy6TSeMowovySOFrQd9uzEtBIvGblDJBIUA4nD Yr7A== X-Forwarded-Encrypted: i=1; AJvYcCWH0kakOLyspgxZKs9rAgPN3Z4qGwQaHghDg+nsW4qL60o5wYPRsgiFnk8FpZD6omobrxqWgtNPxHBbLcA=@vger.kernel.org X-Gm-Message-State: AOJu0YyS0Ho4dt8YmhyTSFDBsMQbpuNoGvcN/nEusLAMCKu6BbuRNzXL 6lbehvOYEZeesXo+lXyaIv/ijZ+S2/3kVyQ3VDNhhM0fDH14pCoOxMjq3/LyZVoBK9WepI6ed92 9g5WV71psgk43qoY3zhTVPYABTPzyh/ucNUstxGiCKjQnZiXio8GWbC1enLxdF0OWvBo= X-Gm-Gg: ATEYQzyYoMWfZJlsn6n9FYJxXl4rReEWrMxFYMRpwPJwei1mDpcBt2vPleyq/Uc1dcg y7sDOMtRx4bg+CqA/zGfHlLbQJkIgemtTIhvjfh61ZS6CuQHoup1qR/Su+BM1oPHuL5rGDyVZKb U5v2CvoRX+bPV5Xd3pkmJyIlud7YPf0RlfaH7WqbkA9ufdemWUtNAAGvdRzx4nsRDpyUb6GSl6M tKlwnYzk23sJO+efavswUcmO9MN3+zrvVAj/MK9YoTHLh8kWRJqQVLpYfhzmqSwKPPmDgBwZOCR W+qOIKKRzPUVDJGKwuw9UPQ4ZXQt98SWM826mMV4KDJIh1duxQFQnwMdgtiRuRg7s4bxvDJomyw ip4NRO7YuqcJWgBPpcLLQPTTvJiBPc71lC88U4mb6hzAkLTJhdTZ9AHhCLA== X-Received: by 2002:a17:90b:48cd:b0:34a:8c77:d37b with SMTP id 98e67ed59e1d1-359a6a21536mr2537929a91.16.1772647407946; Wed, 04 Mar 2026 10:03:27 -0800 (PST) X-Received: by 2002:a17:90b:48cd:b0:34a:8c77:d37b with SMTP id 98e67ed59e1d1-359a6a21536mr2537869a91.16.1772647407275; Wed, 04 Mar 2026 10:03:27 -0800 (PST) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-359a8f22062sm1080606a91.1.2026.03.04.10.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2026 10:03:26 -0800 (PST) From: Shivendra Pratap Subject: [PATCH v20 00/10] Implement PSCI reboot mode driver for PSCI resets Date: Wed, 04 Mar 2026 23:33:00 +0530 Message-Id: <20260304-arm-psci-system_reset2-vendor-reboots-v20-0-cf7d346b8372@oss.qualcomm.com> 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: 8bit X-B4-Tracking: v=1; b=H4sIANRzqGkC/53TUWvDIBAH8K9S8jyL3mk897TvMcZQc1kDa9PFL KyUfveZMpbCFnB7ERTu9z/lPFeJh45Tdb85VwNPXer6Q96AvNtUcecPLyy6Jh9UIMFIK53ww14 cU+xEOqWR988DJx5BTHxo+kEMHPp+TELXkaTU2rexrbJ1HLjtPq5Bj095v+vS2A+na+6k5Hz8F aFkYUQuE1KwtRotITY6PvQpbd/e/Wvs9/ttXubkf6kBGgxEEJjMT3W+wKTUbdO2mFeZb1pkCKA II67xcMODKuYh82SDj8hRA/Aaj7d8efeY+TpQA4jKkKM1Xi88KVPM68yjbcC1xvno/BpvFt4BF PMm8zYyeklkqVVrfP3NK/mH7ut5chx5brwH5NW3twuvin9ULsu8rlmSCdHrGNd4WngALOZpfnt ovWNbc7s+mO6Wp2LezZ81BGdqaVD+OjmXy+UT3ev1kZEEAAA= X-Change-ID: 20250709-arm-psci-system_reset2-vendor-reboots-46c80044afcf To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , Bartosz Golaszewski , Sudeep Holla Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Shivendra Pratap , Srinivas Kandagatla , Song Xue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772647398; l=17668; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=0vMXk/Md/p/dtT48Fb3BTHnIRamX9KagLmDjOqIwfng=; b=XukBl3UvZ4LslzaVJ+sV5QOVP6FpRSjXcAtzDwpPgUe6vohZCgwM0dqQfAaAeVzKNX61pLd/U nIhc5bZfu4JBrt/Gx09NGcbZlnTFUHaycyLldVRyT1INboZyi7ru+pQ X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-ORIG-GUID: hT0MFCbgll_SprBGu3mq_49xG0rjygdw X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzA0MDE0NyBTYWx0ZWRfX9bqZBqu5rRti /k+mny0v3TZm184KIXVHREV+tj0kxufyNokOUW+TGo58Y9l5lPAZNtk7wIjvY3T7yKEZfgOHfz/ qEAQP3KLCANaBuYDyGdd2q5maRfoO4Eb7MRCGxKjNPabPOh+LIJ2bemgpSQJKlRtyLRkjbT++v5 UwPeUqC6+bfIl+vhbGirV3dLtCBNeOJ4Eb+zZu91xSkR7VcE/O3YUixUh24SAxZsC2T2sKc/fb0 jXBXpF4Ytgf8YKp489iPuL4LhGSfUm/PeNN10XSL6+iO/LbbPL8+4KgRxo4Eh4ocIrBkazVxfaL qNdstNKdS8uftRwi3zz3XCIB2W/5gRGhwLZ+esX7CQ0J+xlYJIYdoGG3Qe6AK3CKTClRn8aDwmj xTGpvN3dJkFTuOtIw000OTcUviQWEY2ttuNYPUrfGhgFyKPBTlS3kHv8/IkHdCi7m42iUiMTnKO sDfdVLp57Wg44QFZkNQ== X-Authority-Analysis: v=2.4 cv=CdMFJbrl c=1 sm=1 tr=0 ts=69a873f1 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=VwQbUJbxAAAA:8 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=zhUIari6AHtRpBlHacAA:9 a=P4XKan-RzZr4SToD:21 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: hT0MFCbgll_SprBGu3mq_49xG0rjygdw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-04_07,2026-03-04_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 adultscore=0 impostorscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603040147 Userspace should be able to initiate device reboots using the various PSCI SYSTEM_RESET and SYSTEM_RESET2 types defined by PSCI spec. This patch series introduces psci-reboot-mode driver that registers with reboot-mode framework to provide this functionality. The PSCI system reset calls takes two arguments: reset_type and cookie. It defines predefined reset types, such as warm and cold reset, and vendor-specific reset types which are SoC vendor specific. To support these requirements, the reboot-mode framework is enhanced in two key ways: 1. 64-bit magic support: Extend reboot-mode to handle two 32-bit arguments (reset_type and cookie) by encoding them into a single 64-bit magic value. 2. Predefined modes: Add support for predefined reboot modes in the framework. With these enhancements, the patch series enables: - Warm reset and cold reset as predefined reboot modes. - Vendor-specific resets exposed as tunables, configurable via the SoC-specific device tree. Together, these changes allow userspace to trigger all above PSCI resets from userspace. Currently three drivers register with reboot-mode framework - syscon-reboot-mode, nvmem-reboot-mode and qcom-pon. Consolidated list of commands currently added across various vendor DTs: mode-loader mode-normal mode-bootloader mode-charge mode-fastboot mode-reboot-ab-update mode-recovery mode-rescue mode-shutdown-thermal mode-shutdown-thermal-battery On gs101 we also pass kernel-generated modes from kernel_restart() or panic(), specifically DM verity's 'dm-verity device corrupted': mode-dm-verity-device-corrupted = <0x50>; - thanks Andre' for providing this. Detailed list of commands being used by syscon-reboot-mode: arm64/boot/dts/exynos/exynosautov9.dtsi: mode-bootloader = ; mode-fastboot = ; mode-recovery = ; arm64/boot/dts/exynos/google/gs101.dtsi: mode-bootloader = <0xfc>; mode-charge = <0x0a>; mode-fastboot = <0xfa>; mode-reboot-ab-update = <0x52>; mode-recovery = <0xff>; mode-rescue = <0xf9>; mode-shutdown-thermal = <0x51>; mode-shutdown-thermal-battery = <0x51>; arm64/boot/dts/hisilicon/hi3660-hikey960.dts: mode-normal = <0x77665501>; mode-bootloader = <0x77665500>; mode-recovery = <0x77665502>; arm64/boot/dts/hisilicon/hi6220-hikey.dts: mode-normal = <0x77665501>; mode-bootloader = <0x77665500>; mode-recovery = <0x77665502>; arm64/boot/dts/rockchip/px30.dtsi: mode-bootloader = ; mode-fastboot = ; mode-loader = ; mode-normal = ; mode-recovery = ; arm64/boot/dts/rockchip/rk3308.dtsi: mode-bootloader = ; mode-loader = ; mode-normal = ; mode-recovery = ; mode-fastboot = ; arm64/boot/dts/rockchip/rk3566-lckfb-tspi.dts: mode-normal = ; mode-loader = ; mode-recovery = ; mode-bootloader = ; Detailed list of commands being used by nvmem-reboot-mode: arm64/boot/dts/qcom/pmXXXX.dtsi:(multiple qcom DTs) mode-recovery = <0x01>; mode-bootloader = <0x02>; The patch is tested on rb3Gen2, lemans-ride, lemans-evk, monaco-ride, qcs615-ride. @Florian/@Kathiravan, Please note that reset_type in DT needs to be full in itself with 31st bit set. (eg: 0x80000000). PS: As advised from Lorenzo, "PSCI maintainers should be added as maintainers for psci-reboot-mode". Previous discussions around SYSTEM_RESET2: - https://lore.kernel.org/lkml/20230724223057.1208122-2-quic_eberman@quicinc.com/T/ - https://lore.kernel.org/all/4a679542-b48d-7e11-f33a-63535a5c68cb@quicinc.com/ Signed-off-by: Shivendra Pratap Changes in v20: By Bart: power: reset: Add psci-reboot-mode driver - Check for psci compatible in init arm,psci-1.0 - Node pointer should not be assigned in device probe. To Align on above: - Remove probe call for faux device. - Set node using device_set_node after faux_device_create. - Register the reboot mode using explicit call to psci_reboot_mode_register_device. - Updated in-code documentation. For Alignment to use of device_property_xx: power: reset: reboot-mode: Add support for 64 bit magic - Use device_property_count_u32 instead of device_property_read_u32. - Check count of properties before reading. - u64 magic changed to u32 magic[2]. - nvmem-reboot rebased on recent changes. - Update documentation and commit text. power: reset: reboot-mode: Remove devres based allocations By Dmitry/Bart: - pr_err to pr_debug in case of invalid reboot-mode prop. By Bart: - Use device_property_read_u32 instead of of_property_read_u32. - Avoid repeated code for free list. Now calling unregister from error path of regiister_reboot_mode. - Fix magic assignment. - Link to v19: https://lore.kernel.org/r/20251228-arm-psci-system_reset2-vendor-reboots-v19-0-ebb956053098@oss.qualcomm.com Changes in v19: - Add missing To/Cc entries (include devicetree list) – Thanks to Krzysztof for pointing this out. - Fix compilation error in reboot-mode.c for ARCH=powerpc by explicitly including . - Link to v18: https://lore.kernel.org/r/20251223-arm-psci-system_reset2-vendor-reboots-v18-0-32fa9e76efc3@oss.qualcomm.com Changes in v18: power: reset: reboot-mode: Remove devres based allocations - Update commit text for alignment. – Bart - Read magic before assigning kzalloc(info) in reboot_mode_register. - Mukesh - Update error handling path. - Mukesh By Bjorn - Expose sysfs for reboot-mode bisected to different series- Link: https://lore.kernel.org/all/20251222-next-15nov_expose_sysfs-v21-0-244614135fd8@oss.qualcomm.com/ By Bjorn/Lorenzo/Mukesh power: reset: reboot-mode: Add support for 64 bit magic - Use FIELD_GET/FIELD_PREP for u64 magic wherever required. - Update commit text and add documentation for structure of 64 bit magic. By Lorenzo - Remove direct reboot-mode registration by psci driver. - Add support for predefined reboot modes in reboot-mode framework. - Add psci-reboot-mode driver and implement a psci-resets to accommodate all psci-resets including warm, cold and customizable vendor-resets. By Bjorn - Update DT patches for qcm6490, lemans, monaco and tolos. - Update commit text to include more details – By Bjorn For Alignment - dt-bindings: arm: Document reboot mode magic - Update reboot mode documentation to clarify that argument1 should provide full value of reset_type along with the 31st bit wherever required. - DT patches for qcm6490, lemans, monaco and tolos. - Provide full value of reset_type including 31st bit.(eg:0x80000001). - Link to v17: https://lore.kernel.org/r/20251109-arm-psci-system_reset2-vendor-reboots-v17-0-46e085bca4cc@oss.qualcomm.com Changes in v17: Remove the patch to synchronize list traversal - Bjorn power: reset: reboot-mode: Remove devres based allocations - Remove devres based allocations as a fix - Bartosz power: reset: reboot-mode: Expose sysfs for registered reboot_modes - remove devres based allocations in create_reboot_mode_device and manually free resources on failure. - Bartosz - Add driver data while creating reboot device and retrive the same in reboot_mode_show. - Bartosz - Remove the mutex lock. firmware: psci: Implement vendor-specific resets as reboot-mode - Call put_device(np) once processing is complete - Pavan Kondeti Move reboot-mode to SOC DT wherever applicable - Mukesh Ojha - Link to v16: https://lore.kernel.org/r/20251015-arm-psci-system_reset2-vendor-reboots-v16-0-b98aedaa23ee@oss.qualcomm.com Changes in v16: firmware: psci: Implement vendor-specific resets as reboot-mode - Use GENMASK(31, 0) instead of 0xffffffff - by Kathiravan - Link to v15: https://lore.kernel.org/r/20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com Changes in v15: By Sebastian: power: reset: reboot-mode: Synchronize list traversal - Change mutex locking to scoped_guard() and a Fixes: tag power: reset: reboot-mode: Add device tree node-based registration - Change reboot_mode_register external call to use fwnode power: reset: reboot-mode: Expose sysfs for registered reboot_modes - Use sysfs_emit_at for printing sysfs entries - Add driver_name to struct reboot_mode_driver instead of passing as argument - Update reboot_mode_register, devm_reboot_mode_register and create_reboot_mode_device for same. firmware: psci: Implement vendor-specific resets as reboot-mode - Update psci to use updated reboot_mode_register and store driver_name to struct reboot_mode_driver - Add DT nodes for PSCI SYSTEM_RESET2 types for lemans-evk, qcs8300-ride, monaco-evk and qcs615-ride boards. - Link to v14: https://lore.kernel.org/r/20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com Changes in v14: - mode-dm-verity-device-corrupted documented in cover letter -by André ABI Documentation: - Updated KernelVersion in ABI documentation to reflect base commit version. – by André - Revised ABI documentation to clarify space-separated format for supported reboot-mode commands. – by André power: reset: reboot-mode: Expose sysfs patch - Modified `show_modes` to output a space-separated list of supported reboot modes – by André - Added error handling in `create_reboot_mode_device()` to ensure proper cleanup on failure. firmware: psci: - Locate psci/reboot-mode node using psci compatible. - by Krzysztof, Dmitry, Sudeep. - Added error handling for additional code for compatible. - Converted hex values to lowercase for consistency. – by André - Introduced panic notifier to disable valid vendor-reset flag in panic path. – by André - Added check for `psci_system_reset2` before registering vendor reset commands. - Updated Commit text. dts: sa8775p: - DT file name changed from sa8775p to lemans and commit text updated accordingly. – for dt renaming in base commit (sa8775p to lemans). - Link to v13: https://lore.kernel.org/r/20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com Changes in v13: - Split patch1 into two (Synchronize list traversal and DT node-based registration) - by Dmitry. - Move mutex lock inside get_reboot_mode_magic - by Dmitry. - Reorder the patches – pull patch8 for exposing reboot-mode sysfs before psci patch - to align the change in reboot-mode sysfs patch. - Update patch- reboot-mode: Expose sysfs for registered reboot_modes - Introduce a driver_name in reboot_mode_register. This will be used in sysfs creation - by Arnd. - Update documentation and commit text for above. - Fix release function to properly call delete attr file. - Fix sparse warning for devres_find. - Add error handling for devres_find. - Split ABI documentation as a separate patch and update ABI documentation for usage of driver-name in sysfs - by Arnd - Update patch - psci: Implement vendor-specific resets as reboot-mode - Fix Kconfig for CONFIG related warning. - Add driver_name as "psci" in register call to reboot-mode - by Arnd - Link to v12: https://lore.kernel.org/r/20250721-arm-psci-system_reset2-vendor-reboots-v12-0-87bac3ec422e@oss.qualcomm.com Changes in v12: - Added lock for list traversals in reboot-mode - by Dmitry. - Added proper handling for BE and LE cases in reboot-mode - by Dmitry. - Removed type casting for u64 to u32 conversions. Added limit checks and used bitwise operations for same - by Andrew. - Link to v11: https://lore.kernel.org/r/20250717-arm-psci-system_reset2-vendor-reboots-v11-0-df3e2b2183c3@oss.qualcomm.com Changes in v11: - Remove reference of cookie in reboot-mode – Arnd/Rob - Introduce 64-bit magic in reboot-mode to accommodate two 32-bit arguments – Arnd - Change reset-type to reboot-mode in psci device tree binding – Arnd - binding no more mandates two arguments as in v10. - dt changes done to support this binding. - Remove obvious comments in psci reset path – Konrad - Merge sysfs and ABI doc into single patch. - Fix compilation issue on X86 configs. - Fix warnings for pr_fmt. - Link to v10: https://lore.kernel.org/all/569f154d-c714-1714-b898-83a42a38771c@oss.qualcomm.com/ Changes in V10: - Change in reset-type binding to make cookie as a mandatory argument. - Change reboot-mode binding to support additional argument "cookie". From Lorenzo: - Use reboot-mode framework for implementing vendor-resets. - Modify reboot-mode framework to support two arguments (magic and cookie). - Expose sysfs for supported reboot-modes commands. - List out all existing reboot-mode commands and their users. - Added this to cover letter. From Dmitry: - Modify reboot-mode to support non-device based registration. - Modify reboot-mode to create a class and device to expose sysfs interface. - Link to v9: https://lore.kernel.org/all/20250303-arm-psci-system_reset2-vendor-reboots-v9-0-b2cf4a20feda@oss.qualcomm.com/ Changes in v9: - Don't fallback to architecturally defined resets from Lorenzo. - Link to v8: https://lore.kernel.org/r/20241107-arm-psci-system_reset2-vendor-reboots-v8-0-e8715fa65cb5@quicinc.com Changes in v8: - Code style nits from Stephen - Add rb3gen2 - Link to v7: https://lore.kernel.org/r/20241028-arm-psci-system_reset2-vendor-reboots-v7-0-a4c40b0ebc54@quicinc.com Changes in v7: - Code style nits from Stephen - Dropped unnecessary hunk from the sa8775p-ride patch - Link to v6: https://lore.kernel.org/r/20241018-arm-psci-system_reset2-vendor-reboots-v6-0-50cbe88b0a24@quicinc.com Changes in v6: - Rebase to v6.11 and fix trivial conflicts in qcm6490-idp - Add sa8775p-ride support (same as qcm6490-idp) - Link to v5: https://lore.kernel.org/r/20240617-arm-psci-system_reset2-vendor-reboots-v5-0-086950f650c8@quicinc.com Changes in v5: - Drop the nested "items" in prep for future dtschema tools - Link to v4: https://lore.kernel.org/r/20240611-arm-psci-system_reset2-vendor-reboots-v4-0-98f55aa74ae8@quicinc.com Changes in v4: - Change mode- properties from uint32-matrix to uint32-array - Restructure the reset-types node so only the restriction is in the if/then schemas and not the entire definition - Link to v3: https://lore.kernel.org/r/20240515-arm-psci-system_reset2-vendor-reboots-v3-0-16dd4f9c0ab4@quicinc.com Changes in v3: - Limit outer number of items to 1 for mode-* properties - Move the reboot-mode for psci under a subnode "reset-types" - Fix the DT node in qcm6490-idp so it doesn't overwrite the one from sc7820.dtsi - Link to v2: https://lore.kernel.org/r/20240414-arm-psci-system_reset2-vendor-reboots-v2-0-da9a055a648f@quicinc.com Changes in v2: - Fixes to schema as suggested by Rob and Krzysztof - Add qcm6490 idp as first Qualcomm device to support - Link to v1: https://lore.kernel.org/r/20231117-arm-psci-system_reset2-vendor-reboots-v1-0-03c4612153e2@quicinc.com Changes in v1: - Reference reboot-mode bindings as suggeted by Rob. - Link to RFC: https://lore.kernel.org/r/20231030-arm-psci-system_reset2-vendor-reboots-v1-0-dcdd63352ad1@quicinc.com --- Shivendra Pratap (10): power: reset: reboot-mode: Remove devres based allocations power: reset: reboot-mode: Add support for 64 bit magic power: reset: reboot-mode: Add support for predefined reboot modes firmware: psci: Introduce command-based reset in psci_sys_reset dt-bindings: arm: Document reboot mode magic power: reset: Add psci-reboot-mode driver arm64: dts: qcom: qcm6490: Add psci reboot-modes arm64: dts: qcom: lemans: Add psci reboot-modes arm64: dts: qcom: monaco: Add psci reboot-modes arm64: dts: qcom: talos: Add psci reboot-modes Documentation/devicetree/bindings/arm/psci.yaml | 42 +++++++++ arch/arm64/boot/dts/qcom/kodiak.dtsi | 2 +- arch/arm64/boot/dts/qcom/lemans.dtsi | 5 + arch/arm64/boot/dts/qcom/monaco.dtsi | 5 + arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 7 ++ arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 7 ++ arch/arm64/boot/dts/qcom/talos.dtsi | 5 + drivers/firmware/psci/psci.c | 45 ++++++++- drivers/power/reset/Kconfig | 10 ++ drivers/power/reset/Makefile | 1 + drivers/power/reset/nvmem-reboot-mode.c | 9 +- drivers/power/reset/psci-reboot-mode.c | 119 ++++++++++++++++++++++++ drivers/power/reset/qcom-pon.c | 7 +- drivers/power/reset/reboot-mode.c | 69 +++++++++----- drivers/power/reset/syscon-reboot-mode.c | 7 +- include/linux/psci.h | 2 + include/linux/reboot-mode.h | 24 ++++- 17 files changed, 330 insertions(+), 36 deletions(-) --- base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31 change-id: 20250709-arm-psci-system_reset2-vendor-reboots-46c80044afcf Best regards, -- Shivendra Pratap