From nobody Thu Oct 2 05:08:10 2025 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 0986B30DD1D for ; Mon, 22 Sep 2025 13:40: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=1758548443; cv=none; b=CN4/+XQaxueNQ/STRDDGNZEB58WurBOqbu0HntZpugSaoAbef9t7RX+N+kOgjKIXaNAef/sdn6zbEzICSEn4y0/fqAscyoqKpnbFCBBVDwQR4/hV1z8ah4+2dWlQfTZfMPBj1suFTRBoSDWbhhsOaf7z1I2w0nPlHfMdxeENWm0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548443; c=relaxed/simple; bh=+LF5Rl/5f5znpMQv1GLZ4NG0dpObtQwZ7SckbxZ5OJg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DfaaDKZgGkJlXixFgLfK2To0jIn3uESFKuLjQvOR6L0wInusRhTGgslzqjG+G1DTGY2tp9c9Pjq/j74WUGzuTHcC9q1oGi8tt0Qp0mPA95V0dSyZ5ad9N7SlXz/CsNDrpmV+0YkKUiji9If4NbNZOhE7DAqSd9hUxNnPXYOCHlo= 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=NYGtS06H; 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="NYGtS06H" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M9G3Zt022695 for ; Mon, 22 Sep 2025 13:40: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= wck1RFL3Etc5iANJFBisnl6A9QEEqYSWtMuEcnVHG7E=; b=NYGtS06HtujpjOy7 EaoMP5NEqsjM5+zsN1ce45OXw/3Z9TlNtgIumlgKxHX//KFHHzHW+xmQr28/ArdH 0Whc8vUWcy0pgIrlBvaqAsDmfJfyv7WciT6wvZeROXDrRCyEr8BpIzr7tm4PRsGy +7S9JnKlXrX68Y5kTbKezzUPPCoDQJh9cHAUTIrX+fdDAfZ8RRD379r8TVhkknKD aGpDMz1l9xnB6/sKJa6gFskwBkXQaKVAKbjBBasf+CizCXLByRl+tUcFAvfLX2pA TlYTDfdaY8+NFfq2nNxMzjosgWykffDR3DrQIPYRA8iembPFe4H1EkHlK7Pv7xvO n/T50A== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49b3ny8pvq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:40:41 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-25bdf8126ceso88703465ad.3 for ; Mon, 22 Sep 2025 06:40:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548440; x=1759153240; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wck1RFL3Etc5iANJFBisnl6A9QEEqYSWtMuEcnVHG7E=; b=lXQ7xlg24JqNA2gMpiKE08AuPrLDbkpepuTWmZT/5oG+N6FDy44L5HEXhp0zoXX2MY 0fIf/dR+k8wLsa/QRb0fAvOSxFv5cwPzmhUgIILjbu859AymsNXAFUqqoUGK+miMBaxT AnegB/SXPbAhLxXx8UbGsHsrwS1NEfZQAatvEkfrFxAfwY+X6spyIrJWvwYqdea5MnEB i+ae+1gocLGf/vWuRILQGss4YbI3DWoniK8sTiupk4uIraVpoKIcFUsWsYg1Al6NKQYs 3OMU+T14WDQOk97knBtG4lFyE2YY1BaLXolcZUxTV2BpFYR9ojlsAl+dOFQqRJ1hERNH oyzA== X-Forwarded-Encrypted: i=1; AJvYcCWRkU7TYR9vqWpfkYU994ntoyzMOxq5YfJGOLw0ldBxuU2MVjPpjnlUQlMRTRoHyJnVohV5rhsHtvKnB4c=@vger.kernel.org X-Gm-Message-State: AOJu0YxzgZpCRfiwoD5scuaxxOZVvOWwxLnNM3Q6nzptbf7CDbgYx06T ChVICYbydM/q/GpQXwIpIRlaxghIteiFl5YSO4FNH7MtOHUxNJcEVqpgbS7+f1i3ofPKqogearf llneu27BzS6gsajhgbKfgdYC1WP7YmXcULPwQDCyB4+hUBLH8teDmSaUcovwr5xP1D9c= X-Gm-Gg: ASbGnctceK1olZeS01JU4FitwtikveO6D3iaB48fqfU8N7K2MY+9ypUWgZ6f2e6seZo cxPMlJRLZLPU+66iZdJbn63ThoqvpFdEW+EEigmP/KMIVcccWfpAp5cizK92H/3cW1rFfVTvYIl 4Na5EW/KtkJY1E5q9zJyd9rEbeT7FWz0iLk4Yw+e6rfhBLjrytC/NeY/OignOJU5yCwjQmxMFZg PoJ8Z5frd2xRzRHZO00xNpAs4Qh1HFLkpD0kj0sHIXJd3zfW2Am7YGqRPcagddg7IRT7M36tqK0 CGbl5i7k88M/ZeYuQ+odPU01UGvZIICjY6F1MNx4BxYniNgIu3vDOnlZ3oQM47ApdAul8QUjW3c J X-Received: by 2002:a17:903:2342:b0:265:982a:d450 with SMTP id d9443c01a7336-269ba533c6cmr153441385ad.40.1758548440166; Mon, 22 Sep 2025 06:40:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHo2/a4BVdjp6tjYR2Y07Siikp43uvotxG3p+AwbYTvOOPwZqz5VaSP3wBnmdNsJoZXYNxiFg== X-Received: by 2002:a17:903:2342:b0:265:982a:d450 with SMTP id d9443c01a7336-269ba533c6cmr153440945ad.40.1758548439664; Mon, 22 Sep 2025 06:40:39 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.40.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:40:39 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:11 +0530 Subject: [PATCH v15 01/14] power: reset: reboot-mode: Synchronize list traversal 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-1-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=5404; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=+LF5Rl/5f5znpMQv1GLZ4NG0dpObtQwZ7SckbxZ5OJg=; b=yzvvk3xOQzGRIfbypo337GvXrt2u9sEAEj3aA6MIS0LHEOylzx77NGaQMiaatRSoiCZG1XFdY RBTwjziAxJgBmHAO5r5GKKjyxKj4zbZtbDfuYZM8V2wAKDMIVJwAOq8 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=EuPSrTcA c=1 sm=1 tr=0 ts=68d151d9 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=gP18aZtcJwKeVuiPoooA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-GUID: 1rCCp9HKJ17EtAt-cD6HZrlDFgclrHpo X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIyMDA5MCBTYWx0ZWRfXxcOkaXTkCgN8 QYeBBDIhLqq4VIPGFE1Ze8Sw2mlP3/4RDKlKSum1lK5JSfrnCKeL0LLPKGyDKedGJ/+WPCXg7vQ wLX+UUR00X05VbeZEwlpOmirTBpe4Ac789xZA5KYsI3+EtO+OCFR8DP/D7avXGkSz+MComEaUxY fGoB+92joPjrNk7dK8sxnDkvvv4Hi1+ewnfYz7FnKQcUfhMC/3b+JBiJq74rqZ1PESi2sGH5cDy X45yWbF4aMzNn/zCJMtLt11Nx5GfHtXV2+NAozSuFmEoxdxdj5Is8jrTYRcLhzlaH4C+SqVwrEL NvRyM96B/0ArAL9hzw3pb4VFt2HNz1LnhK7ssaZNQWflJZJPda5nD7hgWR3TDsxgg+sjuxW0j19 U7uu/wEz X-Proofpoint-ORIG-GUID: 1rCCp9HKJ17EtAt-cD6HZrlDFgclrHpo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 malwarescore=0 spamscore=0 adultscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509220090 List traversals must be synchronized to prevent race conditions and data corruption. The reboot-mode list is not protected by a lock currently, which can lead to concurrent access and race. Introduce a mutex lock to guard all operations on the reboot-mode list and ensure thread-safe access. The change prevents unsafe concurrent access on reboot-mode list. Fixes: 4fcd504edbf7 ("power: reset: add reboot mode driver") Fixes: ca3d2ea52314 ("power: reset: reboot-mode: better compatibility with = DT (replace ' ,/')") Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- drivers/power/reset/reboot-mode.c | 96 +++++++++++++++++++++--------------= ---- include/linux/reboot-mode.h | 4 ++ 2 files changed, 57 insertions(+), 43 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index fba53f638da04655e756b5f8b7d2d666d1379535..8fc3e14638ea757c8dc3808c240= ff569cbd74786 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -29,9 +29,11 @@ static unsigned int get_reboot_mode_magic(struct reboot_= mode_driver *reboot, if (!cmd) cmd =3D normal; =20 - list_for_each_entry(info, &reboot->head, list) - if (!strcmp(info->mode, cmd)) - return info->magic; + scoped_guard(mutex, &reboot->rb_lock) { + list_for_each_entry(info, &reboot->head, list) + if (!strcmp(info->mode, cmd)) + return info->magic; + } =20 /* try to match again, replacing characters impossible in DT */ if (strscpy(cmd_, cmd, sizeof(cmd_)) =3D=3D -E2BIG) @@ -41,9 +43,11 @@ static unsigned int get_reboot_mode_magic(struct reboot_= mode_driver *reboot, strreplace(cmd_, ',', '-'); strreplace(cmd_, '/', '-'); =20 - list_for_each_entry(info, &reboot->head, list) - if (!strcmp(info->mode, cmd_)) - return info->magic; + scoped_guard(mutex, &reboot->rb_lock) { + list_for_each_entry(info, &reboot->head, list) + if (!strcmp(info->mode, cmd_)) + return info->magic; + } =20 return 0; } @@ -78,46 +82,50 @@ int reboot_mode_register(struct reboot_mode_driver *reb= oot) =20 INIT_LIST_HEAD(&reboot->head); =20 - for_each_property_of_node(np, prop) { - if (strncmp(prop->name, PREFIX, len)) - continue; - - info =3D devm_kzalloc(reboot->dev, sizeof(*info), GFP_KERNEL); - if (!info) { - ret =3D -ENOMEM; - goto error; - } - - if (of_property_read_u32(np, prop->name, &info->magic)) { - dev_err(reboot->dev, "reboot mode %s without magic number\n", - info->mode); - devm_kfree(reboot->dev, info); - continue; - } - - info->mode =3D kstrdup_const(prop->name + len, GFP_KERNEL); - if (!info->mode) { - ret =3D -ENOMEM; - goto error; - } else if (info->mode[0] =3D=3D '\0') { - kfree_const(info->mode); - ret =3D -EINVAL; - dev_err(reboot->dev, "invalid mode name(%s): too short!\n", - prop->name); - goto error; + mutex_init(&reboot->rb_lock); + + scoped_guard(mutex, &reboot->rb_lock) { + for_each_property_of_node(np, prop) { + if (strncmp(prop->name, PREFIX, len)) + continue; + + info =3D devm_kzalloc(reboot->dev, sizeof(*info), GFP_KERNEL); + if (!info) { + ret =3D -ENOMEM; + goto error; + } + + if (of_property_read_u32(np, prop->name, &info->magic)) { + dev_err(reboot->dev, "reboot mode %s without magic number\n", + info->mode); + devm_kfree(reboot->dev, info); + continue; + } + + info->mode =3D kstrdup_const(prop->name + len, GFP_KERNEL); + if (!info->mode) { + ret =3D -ENOMEM; + goto error; + } else if (info->mode[0] =3D=3D '\0') { + kfree_const(info->mode); + ret =3D -EINVAL; + dev_err(reboot->dev, "invalid mode name(%s): too short!\n", + prop->name); + goto error; + } + + list_add_tail(&info->list, &reboot->head); } =20 - list_add_tail(&info->list, &reboot->head); - } - - reboot->reboot_notifier.notifier_call =3D reboot_mode_notify; - register_reboot_notifier(&reboot->reboot_notifier); + reboot->reboot_notifier.notifier_call =3D reboot_mode_notify; + register_reboot_notifier(&reboot->reboot_notifier); =20 - return 0; + return 0; =20 error: - list_for_each_entry(info, &reboot->head, list) - kfree_const(info->mode); + list_for_each_entry(info, &reboot->head, list) + kfree_const(info->mode); + } =20 return ret; } @@ -133,8 +141,10 @@ int reboot_mode_unregister(struct reboot_mode_driver *= reboot) =20 unregister_reboot_notifier(&reboot->reboot_notifier); =20 - list_for_each_entry(info, &reboot->head, list) - kfree_const(info->mode); + scoped_guard(mutex, &reboot->rb_lock) { + list_for_each_entry(info, &reboot->head, list) + kfree_const(info->mode); + } =20 return 0; } diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h index 4a2abb38d1d612ec0fdf05eb18c98b210f631b7f..b73f80708197677db8dc2e43aff= c519782b7146e 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -2,11 +2,15 @@ #ifndef __REBOOT_MODE_H__ #define __REBOOT_MODE_H__ =20 +#include + struct reboot_mode_driver { struct device *dev; struct list_head head; int (*write)(struct reboot_mode_driver *reboot, unsigned int magic); struct notifier_block reboot_notifier; + /*Protects access to reboot mode list*/ + struct mutex rb_lock; }; =20 int reboot_mode_register(struct reboot_mode_driver *reboot); --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 CD56D283FE9 for ; Mon, 22 Sep 2025 13:40:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548454; cv=none; b=ipCxawmJgI/3Uag3zF1GtCqfZ2Y0xRvWHMtCQU9Vl+QPF+PVluC1xqC0a+Xx39w6joxw1QZsoEwVvwvTNRkVvp5u8h40oXcDzdIN/pr4CX7QOwbVknZ1tod1wRGiyVJbxceKT93p/IZLefDXsjgNyEwUCjoKutwa+Ds1S1sXAhg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548454; c=relaxed/simple; bh=OtVs7gPtVXV3AbZFz+D50jHX3+pXlZ1jHuc0GH75ZNs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TH19FqOpajQ2pLUD2RcbYqgfun8K93mnhau0gAv46Di91kZ39/qF7od+nAlCW41ACTDeHSzStGjh3uXBxRo84PEow1vfbWw4vp2W2Q/I6If9I5Ag7OQiZC044cAIvvW/4C0KCXA4fTCn5eaho0JeuyPJUI/9Pq34a/cqA3riROQ= 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=DuVykh36; arc=none smtp.client-ip=205.220.180.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="DuVykh36" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M8ni2S032343 for ; Mon, 22 Sep 2025 13:40:51 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= vmMn16oiZkqxnrWnAxeSCVdi+UZd2TgsHXVJWSGcec8=; b=DuVykh362S2jWEPu VTCMgw+s3yPEUcqJbNuWF8UgPsjfw+tzK/Tq+UfvfPjDq7Lo5rlMyBvbJv8qX+7Q oGfv0C/ZnfgvZ3/PnBjvtZugsWcbcwK9MlpzB02e4dxqofoASE3OwGrmYiLePxac zfmgSxDc0LgXIyJaaOZb/0SV7krdoIPX2kJiOA+4GTSIH8mvvLpbP1tPa3omNZgp IaGdyFcaicTxsJJptt3+7KCztquUJkHhqS+lJpA6A/GsgFprQA8utXIH13UBdsQk 3w6ZjB8jverOSmq/vUXa0YEcmQFwLmXxegs7zecip8sey8T9dWVs11OV0LwoMQP6 p+Fmaw== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 499mn7cwhu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:40:51 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-25bdf8126ceso88711365ad.3 for ; Mon, 22 Sep 2025 06:40:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548450; x=1759153250; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vmMn16oiZkqxnrWnAxeSCVdi+UZd2TgsHXVJWSGcec8=; b=vP3v4QGz0r47G2UcQG2YAv8aLfKHGK/mCWnJBYsHgLzfBEaUGnPXXbZhsRVnurL02k Z4x6Ar14yXEGAH5nTNEDzxCjQBlF2q4tCcTzYOA7X7vjHKfHLfiNe/2JIyc4M8Qiw7wb CexJpoXzvxK7CVnQh7L40ioTX2jmk8bS4zau0bGGsYzzOTdbQ7z5UFxfXRACvGMiyw4M P+Orrd9qqf/71nmEmjLGSZ4/GVEl7mI/PKxF2q7ujdDdENdsZ5HU31mthwDananc9iSZ qVG8h9oO4FH8XpvArAJlejRi5va+57xr6qs+ExIVeXFiA9/fYsM4XAH83roQM1T0rIWJ BAEw== X-Forwarded-Encrypted: i=1; AJvYcCWldbadaqJrsrm8Wnu0qqY1Qpya6543C6aBNLezf3xIsAD+phFzfr4UwEkyGHVtTZYHFUIAIUkjW0Oz0Bk=@vger.kernel.org X-Gm-Message-State: AOJu0YzOX/2f1wij9D3P/+RN5bJAOg4Sk/iZyfLECl1hVWmWyf77gtSM 8YF0Gfr5dQxSq1vMzs/F93Btj5Rta5+BXE5uwJKrGFvHqTfgmlxCPbTH6nj57Z0chATPCh3Ln4f jiXNlXY7iGKY83oEDat0DtYLcW2VcnG2y4vjHeCEl9aNAjTpDTsbbHeuyQ2Ir9EDUNMA= X-Gm-Gg: ASbGncvfLav6D2bmwlO8uBzR4w/e97tM64AG31MnJ70y20HIKK2YuhKx7he5505U5Wd Gls59reVqPafTc0bfjijWLOlBwDdbbsc+q/dgaHw35XgwYYQA0UBCS1nq5TOdqpWOWoRsYvbq7I 1c3ovXLzw5kHCKwvEOKAIctn1tVLtI6Kz+ueHApSUqgscnS+tPhqup04OyOII52P66Z0Ju/1Kjs LAMHhKjjh806jEWutqXEMqJfqumFHS1jY/P/rqyZmwn+YwSaH5LbMaU6XXZnM7LGurBWW3FGIjz e54CRh5xYCFspue5NPPW5U7AH9hZSIdAHS/yUP5F8FKcIoXc6CQFX36hGV/sPKju6xqehsGdnH8 b X-Received: by 2002:a17:902:f54e:b0:271:49f:eaf5 with SMTP id d9443c01a7336-271049ff060mr102463075ad.30.1758548450160; Mon, 22 Sep 2025 06:40:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJLarzGKvKl9HgTKxpDtBRtb2AXq2ZCgS3r1CAksTaBDdckn/+MrwC4zD485alAKlinWboPw== X-Received: by 2002:a17:902:f54e:b0:271:49f:eaf5 with SMTP id d9443c01a7336-271049ff060mr102462645ad.30.1758548449690; Mon, 22 Sep 2025 06:40:49 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:40:48 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:12 +0530 Subject: [PATCH v15 02/14] power: reset: reboot-mode: Add device tree node-based registration 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-2-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=5376; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=OtVs7gPtVXV3AbZFz+D50jHX3+pXlZ1jHuc0GH75ZNs=; b=gJ1mwrSZZc5KYCfmG7idToZL91Qco+UvkVqPCmh2hbufifqTgfLagRbsAws6bAWcUYAEU81PP hHIaDeYiIR2BvRQ+7HSFlwYrGlgA12jbO0CNQDNACk9eGuCbFy+Crmq X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAzMyBTYWx0ZWRfXynpPFynzDmGr hKqSAu4ONtBpEP/3tBftvkcsQN5556l9wq5OsoxPgsvqYnFMfMZJD+D4RYBxKkz6gBeNROmCpAr HZUrmO5jNtjjQrkZtNUl6knHvqyJ+wYgBLl47LDVRGf17LzP7bnliAKZm5lbwzn5ugweIaNJyJE 31WT53x04JUChNaBAbUEZXcgZkFikpV8j88GxgZirqNdP6SrdRXgGxsMAjLb3o0/qmyU/FLJmMK zy6rIRdfmDS2SIvRIccZ/YpBWK4Gq5QQqC6FuvGWgs5A7pRonQ31x0LjGFMuCEPY8uCNCB0E6by 47AiITUi4Gj29KtQfcwpkFeJUDeWHrfyVn7k1vfsz641AJ0sMc4G+tiaqcCOQRH5iyXeD+ojxII PtZ3f5us X-Proofpoint-GUID: 1RgE_8jEQw9fWG8Tf3khAHhZ7YiQW0Ni X-Proofpoint-ORIG-GUID: 1RgE_8jEQw9fWG8Tf3khAHhZ7YiQW0Ni X-Authority-Analysis: v=2.4 cv=EZrIQOmC c=1 sm=1 tr=0 ts=68d151e3 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=239sejjMsMoxT4pUUhgA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 phishscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200033 The reboot-mode driver does not have a strict requirement for device-based registration. It primarily uses the device's of_node to read mode- properties and the device pointer for logging. Remove the dependency on struct device and introduce support for firmware node (fwnode) based registration. This enables drivers that are not associated with a struct device to leverage the reboot-mode framework. Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- drivers/power/reset/reboot-mode.c | 45 +++++++++++++++++++++++++++++------= ---- include/linux/reboot-mode.h | 3 ++- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index 8fc3e14638ea757c8dc3808c240ff569cbd74786..c8f71e6f661ae14eb72bdcb1f41= 2cd05faee3dd9 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -3,13 +3,17 @@ * Copyright (c) 2016, Fuzhou Rockchip Electronics Co., Ltd */ =20 +#define pr_fmt(fmt) "reboot-mode: " fmt + #include #include #include +#include #include #include #include #include +#include =20 #define PREFIX "mode-" =20 @@ -69,17 +73,26 @@ static int reboot_mode_notify(struct notifier_block *th= is, /** * reboot_mode_register - register a reboot mode driver * @reboot: reboot mode driver + * @fwnode: Firmware node with reboot-mode configuration * * Returns: 0 on success or a negative error code on failure. */ -int reboot_mode_register(struct reboot_mode_driver *reboot) +int reboot_mode_register(struct reboot_mode_driver *reboot, struct fwnode_= handle *fwnode) { struct mode_info *info; + struct mode_info *next; + struct device_node *np; struct property *prop; - struct device_node *np =3D reboot->dev->of_node; size_t len =3D strlen(PREFIX); int ret; =20 + if (!fwnode) + return -EINVAL; + + np =3D to_of_node(fwnode); + if (!np) + return -EINVAL; + INIT_LIST_HEAD(&reboot->head); =20 mutex_init(&reboot->rb_lock); @@ -89,28 +102,28 @@ int reboot_mode_register(struct reboot_mode_driver *re= boot) if (strncmp(prop->name, PREFIX, len)) continue; =20 - info =3D devm_kzalloc(reboot->dev, sizeof(*info), GFP_KERNEL); + info =3D kzalloc(sizeof(*info), GFP_KERNEL); if (!info) { ret =3D -ENOMEM; goto error; } =20 if (of_property_read_u32(np, prop->name, &info->magic)) { - dev_err(reboot->dev, "reboot mode %s without magic number\n", - info->mode); - devm_kfree(reboot->dev, info); + pr_err("reboot mode %s without magic number\n", info->mode); + kfree(info); continue; } =20 info->mode =3D kstrdup_const(prop->name + len, GFP_KERNEL); if (!info->mode) { ret =3D -ENOMEM; + kfree(info); goto error; } else if (info->mode[0] =3D=3D '\0') { kfree_const(info->mode); + kfree(info); ret =3D -EINVAL; - dev_err(reboot->dev, "invalid mode name(%s): too short!\n", - prop->name); + pr_err("invalid mode name(%s): too short!\n", prop->name); goto error; } =20 @@ -123,8 +136,11 @@ int reboot_mode_register(struct reboot_mode_driver *re= boot) return 0; =20 error: - list_for_each_entry(info, &reboot->head, list) + list_for_each_entry_safe(info, next, &reboot->head, list) { + list_del(&info->list); kfree_const(info->mode); + kfree(info); + } } =20 return ret; @@ -138,12 +154,16 @@ EXPORT_SYMBOL_GPL(reboot_mode_register); int reboot_mode_unregister(struct reboot_mode_driver *reboot) { struct mode_info *info; + struct mode_info *next; =20 unregister_reboot_notifier(&reboot->reboot_notifier); =20 scoped_guard(mutex, &reboot->rb_lock) { - list_for_each_entry(info, &reboot->head, list) + list_for_each_entry_safe(info, next, &reboot->head, list) { + list_del(&info->list); kfree_const(info->mode); + kfree(info); + } } =20 return 0; @@ -168,11 +188,14 @@ int devm_reboot_mode_register(struct device *dev, struct reboot_mode_driver **dr; int rc; =20 + if (!reboot->dev || !reboot->dev->of_node) + return -EINVAL; + dr =3D devres_alloc(devm_reboot_mode_release, sizeof(*dr), GFP_KERNEL); if (!dr) return -ENOMEM; =20 - rc =3D reboot_mode_register(reboot); + rc =3D reboot_mode_register(reboot, of_fwnode_handle(reboot->dev->of_node= )); if (rc) { devres_free(dr); return rc; diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h index b73f80708197677db8dc2e43affc519782b7146e..7f05fd873e95ca8249bc167c21a= a6b76faba7849 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -2,6 +2,7 @@ #ifndef __REBOOT_MODE_H__ #define __REBOOT_MODE_H__ =20 +#include #include =20 struct reboot_mode_driver { @@ -13,7 +14,7 @@ struct reboot_mode_driver { struct mutex rb_lock; }; =20 -int reboot_mode_register(struct reboot_mode_driver *reboot); +int reboot_mode_register(struct reboot_mode_driver *reboot, struct fwnode_= handle *fwnode); int reboot_mode_unregister(struct reboot_mode_driver *reboot); int devm_reboot_mode_register(struct device *dev, struct reboot_mode_driver *reboot); --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 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 0C9D630F554 for ; Mon, 22 Sep 2025 13:41:00 +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=1758548462; cv=none; b=aJTBpBDc1rUhWzXcNF6RJ0xHwft9IQKyzrBCcLF3H/06SrREROvwZOu8nk1++Xsk5MOU6SlOaPBkq2kF/z/6rD+0M6eocWxHI1PQSt+DnihkotlbWKgn9rDlO/N2SFb40MVkf03jTzQk9dLgD9hUeOj3vD70333Zw+fu6Gjw7+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548462; c=relaxed/simple; bh=M034h2Di1cmMjLKB84r2uoAd+40fCZthgOLruF4HJrk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l+1wvGJrWU2PxfTjdNwl9sWZGga7hX3GqA3O5nJitmRm4ra4tnD5uJGB6KfyzWcAJHkNFWfBZADll8mWKlsbAdnXQyGAoAhXxNN4sPIQ1jQRLgJmXNGu51QxSeD0KfNuXYywAN3qL2/FM3B3/Bi2J9ef9CessiZiuISkDlviwm4= 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=VvSoXGTK; 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="VvSoXGTK" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M7pTkq006138 for ; Mon, 22 Sep 2025 13:41:00 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= nlDpgG4AgbfxwCOJZCQP/7oE/9P96tZjlUe4LmJwps4=; b=VvSoXGTK9QUP2Vm4 5mKN32K2Om60W+714AYvSkVBEgQqWTf4Za4K8dwDp7LgXboEIkbOBeUp3zlFtt3+ d0TKODelqe7xJYf2ZVfjKG8o31j6BsOxdsSq1AUicsQz6iGZ0pSbjzxsbqqaBXQJ 2H4R7aAOxexGqesOzepsTBSCTt09zeTTBqFlhQuajvOKG9kO9/AKQjCKyVI/csQa HU8Y5Q3qi5RpGt70of1RLKVm+TIoEmo6cUfOs3kTT5JUiSMQ5U0H95nM6b4EuS4m fyoF684uGgvFeHnbyKHU2QERzEFxQY4j1UYzHvpaDdXzAfgYqGYnxerRkaFStetJ 6zTDrA== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49b2e112pv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:41:00 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-268149e1c28so51273905ad.1 for ; Mon, 22 Sep 2025 06:41:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548459; x=1759153259; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nlDpgG4AgbfxwCOJZCQP/7oE/9P96tZjlUe4LmJwps4=; b=amci/w+auoeQ8FNTrgzHKpLfmsIPfigrBWeK7XtctZ8v/2O8K25ILsk0pL15Vwkk4J fDS7epd9yL2P4iNfam92bzufhtdgAqh0z0BMOFjn2Lm8dqepQiUYOzHaFImIy6LOrs2i +IpWAVf2qbm+psO5VDLdMW3VYVCAkM09k4cF8mCCOlEN9JTwpO/okYDaT2ryxAOfQKY3 KSrMQQ/ASliJl6f6O2Wg0gQ2prkxs1ES32FGdKtOwipO3gJ/nz9q09L/OCXA4gLKdQcU mBhWibOALm4gPX/brkV40CBE8R4Inya/B8ENOmPkIoejgZ/uKaEOyApZ+g1gBNv7POLL sB1Q== X-Forwarded-Encrypted: i=1; AJvYcCXv+jghv6zRrUeKzJs8fwaPI5cM87L3z/niI3N9x1eRDQlfFAXWXXL0DToagamkx4dtQz+nU8bHvbBF4IU=@vger.kernel.org X-Gm-Message-State: AOJu0YwfurZXZQO2SL/GL864agZgvYfYLS3QJKGK7/n3wWO8u5nv2MSW HfM25Qhd0vN34ct49uC81EkzU9exjGA010tJFSlBcFshkaAV6vSHBA1Km8m7KmIMlQzbmRoxdo8 a3lP6EC8LghaQxqq/REZXLjHhj1x+d+WdGKaOcguzZzbmXLYqpWQ6r6AttzbD3Qw6PTY= X-Gm-Gg: ASbGncs/91d/P4P/FS4bM85Fv39coKQ0PqplUHuK3GhK3mmTR5WMTVFS0QOfgtW1A8P cv3133Ym895QJF3ggXTHtaeInTP6323Wb/GuxRGOPkIlNybJVRUe7n6voLW/YIMi0UZZokY2kzs 73A8EJHSiaUrusMCf3LMfDhiC8YLpjjbCXO02OtaGF2By0n3VpQ6aLpGj4KNVGu8NXvjc2bdC8x 6vWCWINNjUXfpxp44PNV1POyeCa03/Ko2qRQ0GAYTWMYLnA4JMHjGw/B59cGQfOKqYtg2xcHUze Nurm4Wgb82MUhWC0489sWxJjCfLyXkMfVY5QDphd8Sisvb+i23Uq9pzTfu8SBqSNBuDCYpiwkPE i X-Received: by 2002:a17:902:ccc9:b0:267:b2fc:8a2 with SMTP id d9443c01a7336-269ba46f141mr149984525ad.23.1758548459090; Mon, 22 Sep 2025 06:40:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbE5iJ+HSIMUitg/W+4ksQTF2yMwalZu6F17/bSuNgJ3VEVoZeuKosRoBkkFgDRLiaQKQr/A== X-Received: by 2002:a17:902:ccc9:b0:267:b2fc:8a2 with SMTP id d9443c01a7336-269ba46f141mr149984055ad.23.1758548458456; Mon, 22 Sep 2025 06:40:58 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:40:58 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:13 +0530 Subject: [PATCH v15 03/14] power: reset: reboot-mode: Add support for 64 bit magic 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-3-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=6976; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=M034h2Di1cmMjLKB84r2uoAd+40fCZthgOLruF4HJrk=; b=QP+FiWdkBwbcJeXV9RT+1lBYacdBujwGLD+FnHhQecZZXVuCAYr3EsNZ6KnXeyNdxzGXv+wy6 kmYFDUSjjyBCiNXBn48tr3jXZDEQ3UC1N75FMiyGU+6NfqWBx7nrtdy X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIyMDA3NiBTYWx0ZWRfX3n5UZdedU5wE HyiwVA5iGmH+Vsd3GLeU/E50baU3bOuwmV1KnlQ9HeFjbqQIOErLAgs04oDr1u8Upj9V07moVtb hLgfZ6Uq9k8vs1SaDJlBmdWCo9kNkf+v/g8R/lBApA06ryhQ1tIm+LaJvy7LF7AzjaNv1n46NEx UEivJKvVhiKRWNI/fs+fZ8nnNky9N6lSiq8HedmeoBcIrflAQJFo/TLIbQ7oDUrQ/tFpAruK60w bu09fe565YcaSFY/TVMXUkkGVYbNgRira6E5Tyj5XI++iAIV0lbjLgzVyTb68Ppd93DA/xgcvzO kXB3J8JvX6rCRWTi8H/5czyCY2HTXS7FhgsiDmrilJ7e5A54tNY7iMKhWoAYGAUN3F8sWh38NTG dC5Der1C X-Proofpoint-ORIG-GUID: qxjONmfzQvHVN2atCoHrrtGV0GuqBSts X-Authority-Analysis: v=2.4 cv=HM7DFptv c=1 sm=1 tr=0 ts=68d151ec cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=bqVjg2-MoX4cBg1ZSeQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-GUID: qxjONmfzQvHVN2atCoHrrtGV0GuqBSts X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 impostorscore=0 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509220076 Current reboot-mode supports a single 32-bit argument for any supported mode. Some reboot-mode based drivers may require passing two independent 32-bit arguments during a reboot sequence, for uses-cases, where a mode requires an additional argument. Such drivers may not be able to use the reboot-mode driver. For example, ARM PSCI vendor-specific resets, need two arguments for its operation =E2=80=93 reset_type and cookie, to complete the reset operation. If a driver wants to implement this firmware-based reset, it cannot use reboot-mode framework. Introduce 64-bit magic values in reboot-mode driver to accommodate dual 32-bit arguments when specified via device tree. In cases, where no second argument is passed from device tree, keep the upper 32-bit of magic un-changed(0) to maintain backward compatibility. Update the current drivers using reboot-mode for a 64-bit magic value. Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- drivers/power/reset/nvmem-reboot-mode.c | 13 +++++++++---- drivers/power/reset/qcom-pon.c | 11 ++++++++--- drivers/power/reset/reboot-mode.c | 19 +++++++++++++------ drivers/power/reset/syscon-reboot-mode.c | 11 ++++++++--- include/linux/reboot-mode.h | 3 ++- 5 files changed, 40 insertions(+), 17 deletions(-) diff --git a/drivers/power/reset/nvmem-reboot-mode.c b/drivers/power/reset/= nvmem-reboot-mode.c index 41530b70cfc48c2a83fbbd96f523d5816960a0d1..5d73dde585b1fd438b1847f884f= eb37cd9e4dd5c 100644 --- a/drivers/power/reset/nvmem-reboot-mode.c +++ b/drivers/power/reset/nvmem-reboot-mode.c @@ -16,15 +16,20 @@ struct nvmem_reboot_mode { struct nvmem_cell *cell; }; =20 -static int nvmem_reboot_mode_write(struct reboot_mode_driver *reboot, - unsigned int magic) +static int nvmem_reboot_mode_write(struct reboot_mode_driver *reboot, u64 = magic) { - int ret; struct nvmem_reboot_mode *nvmem_rbm; + u32 magic_32; + int ret; + + if (magic > U32_MAX) + return -EINVAL; + + magic_32 =3D magic; =20 nvmem_rbm =3D container_of(reboot, struct nvmem_reboot_mode, reboot); =20 - ret =3D nvmem_cell_write(nvmem_rbm->cell, &magic, sizeof(magic)); + ret =3D nvmem_cell_write(nvmem_rbm->cell, &magic_32, sizeof(magic_32)); if (ret < 0) dev_err(reboot->dev, "update reboot mode bits failed\n"); =20 diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c index 7e108982a582e8243c5c806bd4a793646b87189f..d0ed9431a02313a7bbaa93743c1= 6fa1ae713ddfe 100644 --- a/drivers/power/reset/qcom-pon.c +++ b/drivers/power/reset/qcom-pon.c @@ -27,17 +27,22 @@ struct qcom_pon { long reason_shift; }; =20 -static int qcom_pon_reboot_mode_write(struct reboot_mode_driver *reboot, - unsigned int magic) +static int qcom_pon_reboot_mode_write(struct reboot_mode_driver *reboot, u= 64 magic) { struct qcom_pon *pon =3D container_of (reboot, struct qcom_pon, reboot_mode); + u32 magic_32; int ret; =20 + if (magic > U32_MAX || (magic << pon->reason_shift) > U32_MAX) + return -EINVAL; + + magic_32 =3D magic << pon->reason_shift; + ret =3D regmap_update_bits(pon->regmap, pon->baseaddr + PON_SOFT_RB_SPARE, GENMASK(7, pon->reason_shift), - magic << pon->reason_shift); + magic_32); if (ret < 0) dev_err(pon->dev, "update reboot mode bits failed\n"); =20 diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index c8f71e6f661ae14eb72bdcb1f412cd05faee3dd9..79763a839c9b0161b4acb6afb62= 5f50a880971cc 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -19,12 +19,11 @@ =20 struct mode_info { const char *mode; - u32 magic; + u64 magic; struct list_head list; }; =20 -static unsigned int get_reboot_mode_magic(struct reboot_mode_driver *reboo= t, - const char *cmd) +static u64 get_reboot_mode_magic(struct reboot_mode_driver *reboot, const = char *cmd) { const char *normal =3D "normal"; struct mode_info *info; @@ -60,7 +59,7 @@ static int reboot_mode_notify(struct notifier_block *this, unsigned long mode, void *cmd) { struct reboot_mode_driver *reboot; - unsigned int magic; + u64 magic; =20 reboot =3D container_of(this, struct reboot_mode_driver, reboot_notifier); magic =3D get_reboot_mode_magic(reboot, cmd); @@ -84,6 +83,8 @@ int reboot_mode_register(struct reboot_mode_driver *reboo= t, struct fwnode_handle struct device_node *np; struct property *prop; size_t len =3D strlen(PREFIX); + u32 magic_arg1; + u32 magic_arg2; int ret; =20 if (!fwnode) @@ -108,12 +109,18 @@ int reboot_mode_register(struct reboot_mode_driver *r= eboot, struct fwnode_handle goto error; } =20 - if (of_property_read_u32(np, prop->name, &info->magic)) { - pr_err("reboot mode %s without magic number\n", info->mode); + if (of_property_read_u32(np, prop->name, &magic_arg1)) { + pr_err("reboot mode without magic number\n"); kfree(info); continue; } =20 + if (of_property_read_u32_index(np, prop->name, 1, &magic_arg2)) + magic_arg2 =3D 0; + + info->magic =3D magic_arg2; + info->magic =3D (info->magic << 32) | magic_arg1; + info->mode =3D kstrdup_const(prop->name + len, GFP_KERNEL); if (!info->mode) { ret =3D -ENOMEM; diff --git a/drivers/power/reset/syscon-reboot-mode.c b/drivers/power/reset= /syscon-reboot-mode.c index e0772c9f70f7a19cd8ec8a0b7fdbbaa7ba44afd0..3cbd000c512239b12ec51987e90= 0d260540a9dea 100644 --- a/drivers/power/reset/syscon-reboot-mode.c +++ b/drivers/power/reset/syscon-reboot-mode.c @@ -20,16 +20,21 @@ struct syscon_reboot_mode { u32 mask; }; =20 -static int syscon_reboot_mode_write(struct reboot_mode_driver *reboot, - unsigned int magic) +static int syscon_reboot_mode_write(struct reboot_mode_driver *reboot, u64= magic) { struct syscon_reboot_mode *syscon_rbm; + u32 magic_32; int ret; =20 + if (magic > U32_MAX) + return -EINVAL; + + magic_32 =3D magic; + syscon_rbm =3D container_of(reboot, struct syscon_reboot_mode, reboot); =20 ret =3D regmap_update_bits(syscon_rbm->map, syscon_rbm->offset, - syscon_rbm->mask, magic); + syscon_rbm->mask, magic_32); if (ret < 0) dev_err(reboot->dev, "update reboot mode bits failed\n"); =20 diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h index 7f05fd873e95ca8249bc167c21aa6b76faba7849..3a14df2ddd1db4181ea76f99ef4= 47ed8368a3594 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -4,11 +4,12 @@ =20 #include #include +#include =20 struct reboot_mode_driver { struct device *dev; struct list_head head; - int (*write)(struct reboot_mode_driver *reboot, unsigned int magic); + int (*write)(struct reboot_mode_driver *reboot, u64 magic); struct notifier_block reboot_notifier; /*Protects access to reboot mode list*/ struct mutex rb_lock; --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 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 2C4D930FC06 for ; Mon, 22 Sep 2025 13:41:10 +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=1758548473; cv=none; b=RfakwBcd39IyftxWXY5Q1yyOWkBP5k55Nk8qxps7zcFkKD1OsyvcJbemPxv6SqDBmIPKXf6zOke4KH05j5VXd2ZD3q/tSeqbxSrYDuKyqqDAcDAuWQNJ1hxjhoZLOMJ7wGjZwV8Agw2LEGqmc/As65lUhuEvGgOMNQon685hYJw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548473; c=relaxed/simple; bh=KkC4QSxclwx5Tk4AVwolzQwcYruXvNFOfpqU998deKY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ujUrCJS0Y6KUFVCeCivB5m4ixHDH8kMgQBGGCdfQpJO5lCb2z1nPFccLdOmXxSCZPrFKM3/2pCWKk4BWQK7JDBlL4HU87abM7wYBRoTAhuppm1klvtfJ2IKDf1FAwSqbLuqqMhMDdwxhMc+zs48qPBt/tGrJw2k5BMGancOEmPw= 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=lbq14I6w; 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="lbq14I6w" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M8KFFJ001358 for ; Mon, 22 Sep 2025 13:41:09 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= 4zriVHHzMQQ8ELUT932V4l8RDRcEXWAm2X8YnUX13NY=; b=lbq14I6wezBqTHbX C3tBbifWxovD4vQWscjBArY3cpwx8tjFzHQCeVfSnfmi04z1gwgzQmE5UoCuSI3q zP8OzWx8dAJjcMnPpQrM5pDpFKD68xu1/EGI/N6IYUGiyObySRVM++qJHZv/au/2 7eTn2PKlh1DxOI5Sjrg9ciHaDM5JnZqepahHsH4a+BctuJOjhZpDAOB8eJlmI5+F VEtTrDvcHV0uFVivcQejILSDBkH4l93C5aonapUB8rItarW320SvBHdTHGwfVeOY IGoHyb+/p1wAnMu/EChVBnaFxlolZ2EntobmHbm00ur5KSp9bXg7yY+Ql6fiKWIs Fkt/WQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 499n1fctx0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:41:09 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-272b7bdf41fso20594955ad.0 for ; Mon, 22 Sep 2025 06:41:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548468; x=1759153268; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4zriVHHzMQQ8ELUT932V4l8RDRcEXWAm2X8YnUX13NY=; b=Vnx3MzU3CDThVsi1S819NCmL+dAfJupOWOdc33VR6BLc7Rkh0KDPb9oyZGcCQIVFLw Sw0Rd9eEdVu6/P0rHbWlzxh8Dsk3fFKEYhkMCuwxzqCPO3YIf60UvwQQVC3rHV2HR0XK gk5jmf3rIp8ieSihxt7RMGEF4B3NRA+SGzpHeKfSGP78uyNizGQukshnDwRr0bav86b8 MDjo+sDSoSyqGlHLsr7jQ3mgaWqbOHhGfXKbC0EU1JZfyKmb1qq20vM0aE8ZlWg/29s1 fli4EIddMDb/dZ/klUaWibrzKuPNcMpkugTU0jyl7Jfu/PVnSw1qr8XoRbidHAM+wvHH 4xhA== X-Forwarded-Encrypted: i=1; AJvYcCWXphWFWL9KqQ7MuRNxGqK09/DTICVXCHOX2OampXCzUI7adTCXZtFT20TQosPv26vTCuXbVEhZ23C6zPE=@vger.kernel.org X-Gm-Message-State: AOJu0YzLVJu5qxobT5iejQd19XUbud+RgYRmAGV9S2XPI76vHR5gsCBd iRmISD4SUrI+g2uqY9C+7oo4nBqjZV5asgRfxJRcE/NpJMXefKjOckvaTdQ7sBJt9SxdbGjDZJi 8FFyjMEIMvCcdJzs7etnUECHLDzCj0wllYtVya3EmFpUsngANOxeLwetPulwsH12idbY= X-Gm-Gg: ASbGncudm+FnlTZc6VcvP6JD3o23GG2a+3Vnv2S/8Jq4G6tQXya2v8IT1iaDj7sJzUK InqSwd0JM0X373sqNuGPFzVMnpgVCTcafb3B0jaIi6ew3Xt/LCISdarnabsqzeLYGQJ/IRULASe 7O1ZqIvFTp6W8zRbjxR2kBtT4XcU2gOdD2J6bOaatueVf0y9+5Jbi4+Hy1KVDg3biNLt483cduj FGXWMnzd07Rj8XdZBwJ5quM4zPBPGPslhPHSJ3orHII/MblyxyzfIPst0H6Xr8Wf8zlU/kTrn9y 73Lfin19LGf1AQwpjBcT9fo5TEeuvVH9gxYCctK+uj3Z6sFlHOfdSkvy1bXeGqGrSGx6Auhy+On Q X-Received: by 2002:a17:902:f645:b0:258:c13d:9b1a with SMTP id d9443c01a7336-269ba534dc8mr157813865ad.41.1758548468270; Mon, 22 Sep 2025 06:41:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHduNm914Aec/xKw82GcSDYLVCzvWXbdPEGvEZBtKD9TBFGvd/XuvNECs8ldINaTjU69ejDGg== X-Received: by 2002:a17:902:f645:b0:258:c13d:9b1a with SMTP id d9443c01a7336-269ba534dc8mr157813555ad.41.1758548467797; Mon, 22 Sep 2025 06:41:07 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:41:07 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:14 +0530 Subject: [PATCH v15 04/14] 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-4-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla , Sebastian Reichel X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=2381; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=KkC4QSxclwx5Tk4AVwolzQwcYruXvNFOfpqU998deKY=; b=uN/mNSJciqwPL2c846Ag2zmHUDTAwr0+DmX3GeKjBJun6SviBcqN2hIimRUdXBy5VUvYhksA1 lXOvd8ZvtgZApCFxM4p+PgWnnQaGrV1OVcuhR4WyI0oc7VoQWD4VOt4 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-ORIG-GUID: Ko_koeYE6MBW4KMAbbJR0AeY9zx0swNT X-Proofpoint-GUID: Ko_koeYE6MBW4KMAbbJR0AeY9zx0swNT X-Authority-Analysis: v=2.4 cv=No/Rc9dJ c=1 sm=1 tr=0 ts=68d151f5 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=QX4gbG5DAAAA:8 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=5CgfHzhl2afHKY-Ush4A:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 a=AbAUZ8qAyYyZVLSsDulk:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAzNyBTYWx0ZWRfX5SFHi2Zk/BRd yplKbbKqH5aCWOXb7zWF1/ym3BjfldM2jXGm+ypPFPldmzfp1DqXUOu5pMSpZkyGN7q5swmSicr ykxn2M3HEeKaMGXrUosui9OXywBDa2FJpdXbN774TfmzTRbK/CtoTkzdujLzx0YV0xn9L/6c4KC 3+XE+vL7NYd5axYUNJFtc4ikAwK1CLi2CI0EEL9cS1xomYhNUF+dIukp1NG+3/IHNYfx0ZblpUV vPl73o0g2G5IHEsgMT1RWehHoz5W/f2prFMs2OUTFsGhJMqMpzZIhaz+93mbVZhIZEg0UyTvp8H YjE2YGwcgvl+KGVDtsUqTadtrZYpOQN6gIAaa37fRwviesUbxq3spFKYOoQ20MFLXto+w0jz1uS NaLQUDaz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200037 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: Sebastian Reichel Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- .../testing/sysfs-class-reboot-mode-reboot_modes | 39 ++++++++++++++++++= ++++ 1 file changed, 39 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..6a3fc379afae3a6caf56ad0b73b= 1c06c43a9fee7 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes @@ -0,0 +1,39 @@ +What: /sys/class/reboot-mode//reboot_modes +Date: August 2025 +KernelVersion: 6.17.0-rc1 +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 reboot() system + call, with the "argument" as string to "*arg" + parameter along with LINUX_REBOOT_CMD_RESTART2. + Example: + reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, + LINUX_REBOOT_CMD_RESTART2, "bootloader"); + + 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 Oct 2 05:08:10 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 4728630F538 for ; Mon, 22 Sep 2025 13:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548482; cv=none; b=HME1zrYePDugiJayPOAghW7XQ4tkMNGWnhRBARPDoygacr4TkBKhdGlh28WI/vAOCAVr85HJMx8gzkEMLmPRy6kVF7qM0kC4wePrGme4sBQS6UdPC9Mwv9MaXtAyyUql8XXQjJe8jipsg/ZuOVIZrDV7w4lW8IFrtG1JL9BjEH0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548482; c=relaxed/simple; bh=8AcG56zSaj2lb+5LiiVME4iAOJl8Jy9RSPWY/3KevJU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tib49tiIo1F+XptpzPaSmB5aS/IZRZceGhYFeEuAojZY8umDBRmRFwTFSZaj04fWcBPA738FaoM2ew9pioZxJY/jRB0q5wfpSok82GxcFH0gzlL5SUPxt88k+ItkJXkHgHBDSvo5CIbEGm6EIwRiIMkw0qXuysgSPipcSkw0MvU= 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=NSmUKIBv; arc=none smtp.client-ip=205.220.180.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="NSmUKIBv" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M9FiiF005264 for ; Mon, 22 Sep 2025 13:41:19 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= 2Bdm4klfKmI9KtujwTAZDFlBBRS0qX6qK7HSOvDmFEM=; b=NSmUKIBv3VkNF2po nSDIl+NNmIDP3IY3Y1wyO7FJBTTnJWBB67REyU96gThJroNbaxnuiyz+b+g+9MgC E8Ez6Dk6OLd15UOZU9ElYEd2WsInFc2UbWqyt1DaR6injkZ3SzMVR3XwT+FNXe9i 4VMFD/o5Ga4nzDE/Uf1GMzH+nF2ja/T4EmDtkcPMkNCTA7SVn4rWJaDpHcu2TNhT pdCianny+0NhWIjoHEIUMbrzqegsOfNkR6LISYrH6fVsBjPL1UOyv8rrGb60xR49 L+4Jx1WN7mcyWapvVcb4QvvSDXy7pCBdipkZG1rGIbUjNQ9/CnE8/RozJP0qwZZ1 MlIGFQ== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 499hmnn6am-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:41:19 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-b5527f0d39bso3506338a12.2 for ; Mon, 22 Sep 2025 06:41:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548478; x=1759153278; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Bdm4klfKmI9KtujwTAZDFlBBRS0qX6qK7HSOvDmFEM=; b=NwZpbGp26qWDsUoWkWS/b7wxxrCVzDdYXSRxos61aUhmGxR1TfWhcLxEm4ppc0N34l pSVtPT/Pzf9RXvsw3ySFeb3VDmhjJjHdgWY18TbNDj3B5nmXGEtU+z0CdY7A2I1RMTb+ nO4R5kI+gF7/68YVxU8YuNQ24mzMsmn9uTvHssdKCJcigYT40/t3C/mBDBBuku0De6nM logEKbQOSwRWwKspc4wwdN5tG64tOCEc8YGjXCKTsrUxw36U/3QVaoeFFIKBJBj4ySIG aoKDX8fU5FwpC/8q/yG/JgRt8Hn7BxKWfuqGLuoStF2BHYMEKTJiicbdc+rDv9RFsDWC 9HWg== X-Forwarded-Encrypted: i=1; AJvYcCVVTacg6ZW/rvUIky9YMkqliGSQH6N8jzx+z2kVk+v/WZZIBtUmE7ufysQQTvNL8zHsaVCXi4F3LHK/IFA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx25cRHPNmkprwQ9bIDs4z9oPAV8youDBK26RQ9ny77NhWZavfV q+xvDwQVI+dSJKGmuwtMGNIzvBKmqlC5BB66AJb7iKv3nTUetBohUIBNK733MSit5WFWu1tLzhk qtIKt4UTCIWMV/2QKGLUcdxXv91HtWj0h8QBNVsbpRVRoXkdEy0mVqyIbRrvXBsNxYZs= X-Gm-Gg: ASbGncsM/GVtth0IG66Kst+sMgF+1ZMBBl1X2xk348KhXLrVU4VXq09bQrarg6/Cww3 A6wRhb2ISZylob7Xab0osZy+J4XTB5578trKbZv5ZjU3cubWmpcjM6w8FrR6FvrgDKUHcOxBHiu h3RbDNwidGsP0tRvDN0C13AFqM4rFv1JaCdrDQdWRXoQxEcQyZ8kMMxSTJ8zglrA65AeX2slasY 1nbkhBzR1fS/JkhrAnljNfTupQOlCpufipdqPguKVE2SWNXhqduk+XfwkWMSfqSq4+Rb97+jwPN XIyapwLnA8kKz9a9Kha7diz8JKtM3cE/mOP+zwxMybL8Eo4ulpZDTICQIuFAquVI01eBhJec3VN K X-Received: by 2002:a17:903:40c5:b0:24c:cb60:f6f0 with SMTP id d9443c01a7336-269ba5892b3mr158849355ad.58.1758548477549; Mon, 22 Sep 2025 06:41:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9fsATo6UhpdeSkkyqA9MLiHd6fS2xnAaK2hUbkSIjcoFXHNp2TOmj8KWrOBsc5K0Ff729lw== X-Received: by 2002:a17:903:40c5:b0:24c:cb60:f6f0 with SMTP id d9443c01a7336-269ba5892b3mr158848895ad.58.1758548477099; Mon, 22 Sep 2025 06:41:17 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:41:16 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:15 +0530 Subject: [PATCH v15 05/14] 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-5-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=7370; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=8AcG56zSaj2lb+5LiiVME4iAOJl8Jy9RSPWY/3KevJU=; b=68MJWOyTk9YoPpAE8jwkXqGx+6Wvip/5TTeO/JMhSodJIzvLvIxFnvN8P9WuuYb4HfkZsPV5y FZE5YqWk8eyDbbVfzUDig5EorKo4ODoq1K09WVekij+DlO5VpoSZwch X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=YPqfyQGx c=1 sm=1 tr=0 ts=68d151ff cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=I4qJSSq-i-5ETPqSmjYA:9 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 X-Proofpoint-ORIG-GUID: 12FzI4hIh3oIL79Lpy1DA4YqhtM3r16H X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAwMCBTYWx0ZWRfX9QHADqR/VTkg xV/HQhLg1HGpN3rAKb+OJqcdPV7jCED/rRrazMQ2HtLwFNQ0fZzf0FIvtpdV0ln/vVMz9fW7zNb bARAjYz2uojZJRrWC3spvHbT5RKle+BWNBAfmSHZ6f3zC+xBd2GXxoc3EPp9KuQuKlaYqLysS8n gsWb4cBTjv8RuPHuxYVAfvfaxMJO6TCABILFP+0Vej8e4JC+sDnIDH2yJaxzYG7FJRGUC9Rk3aF u+Pscc81agPu7aYD3oUwp7V9NAzP1DpNS0aWfq3ksdc1UbQ6SvKPIrthLFO4J9BGhEEHYXP9Qe4 NU3RQKYx5kMvvWBzywKEdGd/rAMaNzr/3acX8iHLK+D6UsdPDId5SYIgGyV/kWjIstX7CH5i57w OzP/GSJH X-Proofpoint-GUID: 12FzI4hIh3oIL79Lpy1DA4YqhtM3r16H X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 phishscore=0 adultscore=0 clxscore=1015 impostorscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200000 Currently, there is no standardized mechanism for userspace to discover which reboot-modes are supported on a given platform. This limitation forces tools and scripts to rely on hardcoded assumptions about the supported reboot-modes. Create a class 'reboot-mode' and a device under it to expose a sysfs interface to show the available reboot mode arguments to userspace. Use the driver_name field of the struct reboot_mode_driver to create the device. For device-based drivers, configure the device driver name as driver_name. This results in the creation of: /sys/class/reboot-mode//reboot_modes This read-only sysfs file will exposes the list of supported reboot modes arguments provided by the driver, enabling userspace to query the list of arguments. Align the clean up path to maintain backward compatibility for existing reboot-mode based drivers. Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- drivers/power/reset/reboot-mode.c | 127 ++++++++++++++++++++++++++++++----= ---- include/linux/reboot-mode.h | 2 + 2 files changed, 103 insertions(+), 26 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index 79763a839c9b0161b4acb6afb625f50a880971cc..1e78eb3d0fe513c934b37bf7f08= 29e1f9f4634f0 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -6,6 +6,7 @@ #define pr_fmt(fmt) "reboot-mode: " fmt =20 #include +#include #include #include #include @@ -23,6 +24,8 @@ struct mode_info { struct list_head list; }; =20 +static struct class *rb_class; + static u64 get_reboot_mode_magic(struct reboot_mode_driver *reboot, const = char *cmd) { const char *normal =3D "normal"; @@ -69,6 +72,89 @@ static int reboot_mode_notify(struct notifier_block *thi= s, return NOTIFY_DONE; } =20 +static void release_reboot_mode_device(struct device *dev, void *res); + +static ssize_t reboot_modes_show(struct device *dev, struct device_attribu= te *attr, char *buf) +{ + struct reboot_mode_driver **devres_reboot; + struct reboot_mode_driver *reboot; + struct mode_info *info; + ssize_t size =3D 0; + + devres_reboot =3D devres_find(dev, release_reboot_mode_device, NULL, NULL= ); + if (!devres_reboot || !(*devres_reboot)) + return -ENODATA; + + reboot =3D *devres_reboot; + scoped_guard(mutex, &reboot->rb_lock) { + list_for_each_entry(info, &reboot->head, list) + size +=3D sysfs_emit_at(buf, size, "%s ", info->mode); + } + + if (size) { + size +=3D sysfs_emit_at(buf, size - 1, "\n"); + return size; + } + + return -ENODATA; +} +static DEVICE_ATTR_RO(reboot_modes); + +static void release_reboot_mode_device(struct device *dev, void *res) +{ + struct reboot_mode_driver *reboot =3D *(struct reboot_mode_driver **)res; + struct mode_info *info; + struct mode_info *next; + + unregister_reboot_notifier(&reboot->reboot_notifier); + + scoped_guard(mutex, &reboot->rb_lock) { + list_for_each_entry_safe(info, next, &reboot->head, list) { + list_del(&info->list); + kfree_const(info->mode); + kfree(info); + } + } + + device_remove_file(reboot->reboot_dev, &dev_attr_reboot_modes); +} + +static int create_reboot_mode_device(struct reboot_mode_driver *reboot) +{ + struct reboot_mode_driver **dr; + int ret =3D 0; + + if (!rb_class) { + rb_class =3D class_create("reboot-mode"); + if (IS_ERR(rb_class)) + return PTR_ERR(rb_class); + } + + reboot->reboot_dev =3D device_create(rb_class, NULL, 0, NULL, reboot->dri= ver_name); + if (IS_ERR(reboot->reboot_dev)) + return PTR_ERR(reboot->reboot_dev); + + ret =3D device_create_file(reboot->reboot_dev, &dev_attr_reboot_modes); + if (ret) + goto create_file_err; + + dr =3D devres_alloc(release_reboot_mode_device, sizeof(*dr), GFP_KERNEL); + if (!dr) { + ret =3D -ENOMEM; + goto devres_alloc_error; + } + + *dr =3D reboot; + devres_add(reboot->reboot_dev, dr); + return ret; + +devres_alloc_error: + device_remove_file(reboot->reboot_dev, &dev_attr_reboot_modes); +create_file_err: + device_unregister(reboot->reboot_dev); + return ret; +} + /** * reboot_mode_register - register a reboot mode driver * @reboot: reboot mode driver @@ -79,7 +165,6 @@ static int reboot_mode_notify(struct notifier_block *thi= s, int reboot_mode_register(struct reboot_mode_driver *reboot, struct fwnode_= handle *fwnode) { struct mode_info *info; - struct mode_info *next; struct device_node *np; struct property *prop; size_t len =3D strlen(PREFIX); @@ -87,13 +172,17 @@ int reboot_mode_register(struct reboot_mode_driver *re= boot, struct fwnode_handle u32 magic_arg2; int ret; =20 - if (!fwnode) + if (!fwnode || !reboot->driver_name) return -EINVAL; =20 np =3D to_of_node(fwnode); if (!np) return -EINVAL; =20 + ret =3D create_reboot_mode_device(reboot); + if (ret) + return ret; + INIT_LIST_HEAD(&reboot->head); =20 mutex_init(&reboot->rb_lock); @@ -136,20 +225,15 @@ int reboot_mode_register(struct reboot_mode_driver *r= eboot, struct fwnode_handle =20 list_add_tail(&info->list, &reboot->head); } + } =20 - reboot->reboot_notifier.notifier_call =3D reboot_mode_notify; - register_reboot_notifier(&reboot->reboot_notifier); + reboot->reboot_notifier.notifier_call =3D reboot_mode_notify; + register_reboot_notifier(&reboot->reboot_notifier); =20 - return 0; + return 0; =20 error: - list_for_each_entry_safe(info, next, &reboot->head, list) { - list_del(&info->list); - kfree_const(info->mode); - kfree(info); - } - } - + device_unregister(reboot->reboot_dev); return ret; } EXPORT_SYMBOL_GPL(reboot_mode_register); @@ -160,26 +244,16 @@ EXPORT_SYMBOL_GPL(reboot_mode_register); */ int reboot_mode_unregister(struct reboot_mode_driver *reboot) { - struct mode_info *info; - struct mode_info *next; - - unregister_reboot_notifier(&reboot->reboot_notifier); - - scoped_guard(mutex, &reboot->rb_lock) { - list_for_each_entry_safe(info, next, &reboot->head, list) { - list_del(&info->list); - kfree_const(info->mode); - kfree(info); - } - } - + device_unregister(reboot->reboot_dev); return 0; } EXPORT_SYMBOL_GPL(reboot_mode_unregister); =20 static void devm_reboot_mode_release(struct device *dev, void *res) { - reboot_mode_unregister(*(struct reboot_mode_driver **)res); + struct reboot_mode_driver *reboot =3D *(struct reboot_mode_driver **)res; + + device_unregister(reboot->reboot_dev); } =20 /** @@ -202,6 +276,7 @@ int devm_reboot_mode_register(struct device *dev, if (!dr) return -ENOMEM; =20 + reboot->driver_name =3D reboot->dev->driver->name; rc =3D reboot_mode_register(reboot, of_fwnode_handle(reboot->dev->of_node= )); if (rc) { devres_free(dr); diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h index 3a14df2ddd1db4181ea76f99ef447ed8368a3594..c68a671f6947f2346e1e6a0ce3c= 6ebc18722b98e 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -8,6 +8,8 @@ =20 struct reboot_mode_driver { struct device *dev; + struct device *reboot_dev; + const char *driver_name; struct list_head head; int (*write)(struct reboot_mode_driver *reboot, u64 magic); struct notifier_block reboot_notifier; --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 E2BAB30FF3B for ; Mon, 22 Sep 2025 13:41:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548490; cv=none; b=Ke7eZtOfPDw3qnW1wVl2To3TIwqgj2EGmB74hxX/MV3M/yL0HGjpqXpSPE6JoIGNH/vJI1iuQKyq+hKDnHF3rJZ8fSvSWJyq581+8uiZJrRmdATpM1wZxS5MZLPACq88/QXDljHdIGj8pqPJDPImRK0MSVHvtk7hM5p+VrjCNO0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548490; c=relaxed/simple; bh=R3BNXlzor3OWM1UHW0bocrQrgSVBuB1WLn0clYEcPVU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IsrJvTIbuAFMW3Zdx/2bdSanTUQTgQHAvZETPZJVtVBII8ax66c6gsLDMiWb/Q5NORTzJYVPWYJkVgleyZIrMAlpv7HGwb4Z92XF+r8c7W5IIAmo/NFg3Ak74tAVRJaJcgABgMMsFEMSLjiRHTG1G69vKVhrA82VCpjRw2JoLwU= 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=dDd//0gJ; arc=none smtp.client-ip=205.220.180.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="dDd//0gJ" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M8x9o2008593 for ; Mon, 22 Sep 2025 13:41:28 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= PIWnFWN9JswVjgeJAZVSk7CUtGSis2EJBGP3G7aJZqM=; b=dDd//0gJ0/kkvliw mQcChpU452MYo9eFEYDB4MkQikrDUyije6EDRTXHpDzBryE6UemVVLWWHC6Zk/Ik aoFcDATml5Tnkf8OaRMkOLnvowbPSNqnxSmvIpPRJxX1yrew29jXlRmTK2hUy3r8 A6wslEqZmER6TqBxsw/5U3eccEWNotIyqkEE0SFUAUcqqVuPkaBqiL346YnTF1z8 zUwPIbQkFkK+KkemjwD9NX935aYLW77H5j7PDyZfw3WFDTLIVtsNkxmt9aUc0Ydb EHtM1m6xiraiXtM5uHUqQVj+hi3sQniKfPfIJdcNCIkEM4smVUikYu/jJZoltGwr OofuhQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 499kkhmxww-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:41:27 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-24456ebed7bso54335655ad.0 for ; Mon, 22 Sep 2025 06:41:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548486; x=1759153286; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PIWnFWN9JswVjgeJAZVSk7CUtGSis2EJBGP3G7aJZqM=; b=ngIivYedzWKz2uF/zN394s95TLp+6LQKPuf3bCoosodNYnqkggi2GunMqcMg2XUb5g ngcSm3WomRxLXAynifI5HAEhoVvc3Ji04+O/aL+yDfDJ28qlMdfXQxbPj6BOW5o2TUqp /hnJ+XIICZbVB78OLNN2nJ5kmvT9JhBsg47N+w0qft5vrGaYrhwcXoQsLfVEqbTvR3K3 ts04IIYhPAUV6vkDIVvCthkWXaz7p4dCTrf6XIPLWyn6dE5CRCKgffhRQ4ra8RY7GA1S UQeS4D2dviQRoWS9HQvyHJFf9UdZZ2o+s1SENbGtV72fb0vYr1XqhwkMFcHqXAUO3AGh zU7A== X-Forwarded-Encrypted: i=1; AJvYcCXx7lZaq0BxUjuKV+Tk/nH41BIQScqLgot+j3UyVVPNuUkuyZV/BsDGyncAIeDcn0DmSaax9Yade5j1N50=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+75DDnw6eLqy5k5EcJNO5kaiTNXnvO07yulY3p8FqcRPN5eqG HsuBlQO2ifvZTt40rHtx/kAryON+/dYkWVd8IzHIHpSxMdzRfvks/eGnErrv+ncB8PUcm+P6qe9 5Qhr10dIWZ9PXF6KFr/Qw658qy1Yxrw8Gxv/sQPutcz7UUTBLp/jswyP3wcjx/iH7TFA= X-Gm-Gg: ASbGnctYHp3U3rH2VkusI9E6LQzh0Cm1T1yuVl5okzH2CsRWdUAP1qrvPDbA8pHBn/0 +QyBq3SsBW02thn3hgJyr1+SFj5FqSSgo1/Hc8ipvPJBsykAxR+SCyn5rzHHGRvQ8qxE500m4vZ fKJ9hSAIOnGqWHftlJ0ZvF3gDOeDGOFF9UFYtIEDkntIsUrSy7lLfCoTPDQsGDdfN+Jfud7z3Lv J0GlXnoKcZBmXxVSa07ROSPqb4XkygtUuKncGDDEki6ioOtv4zVQpAf0Wo9SlTC6G3vb0AsNvvA /9UGY0URtziyDWay6xBeFTSMTAZRVFlG7JkSb69KNfvhu6myxJKDts5+ZhpqpiEGZWrDbFaC7kC u X-Received: by 2002:a17:903:18e:b0:26e:7ac9:9d3 with SMTP id d9443c01a7336-26e7ac90c41mr134693545ad.18.1758548486349; Mon, 22 Sep 2025 06:41:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECJWJDojyXBjsBbEa7hEjwrxc9WYv0/zCgrWii3r2CuVqCDvWfZmFkwNzUJptObbkGXcARkQ== X-Received: by 2002:a17:903:18e:b0:26e:7ac9:9d3 with SMTP id d9443c01a7336-26e7ac90c41mr134693005ad.18.1758548485876; Mon, 22 Sep 2025 06:41:25 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:41:25 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:16 +0530 Subject: [PATCH v15 06/14] dt-bindings: arm: Document reboot mode magic 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-6-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla , Elliot Berman X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=2577; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=SmkKRQQh3S8Gtdgd1oOIc80Ljvpw2jelYZ428aYXpJY=; b=vLj0922EjIbkbMbR+tqY47qh1UHzIiJOZnJu5uAsC3pDrEZ1BMq1hZ/Sen1hgB2OFsr79Qcsn 2BVNWRyGH7vC6AoW944ox7b2Qjq1qN+eQL7hQ/x1SwnmHchfyFmBDQD X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-ORIG-GUID: QmyvS4ow9EhmsXIZnrM_KExS1jkypBoi X-Proofpoint-GUID: QmyvS4ow9EhmsXIZnrM_KExS1jkypBoi X-Authority-Analysis: v=2.4 cv=JMo7s9Kb c=1 sm=1 tr=0 ts=68d15207 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=UInjrUrXc7y1C1sAkbYA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAyMiBTYWx0ZWRfX+/1s1somhrUs RPhn7ArEt+Ifnpy1SItISuyYJLjDoN83RPoQxVrHKGHmDlEhvObaWbLVVCfutZMcMqIT8fTde74 vsYnV1476bkbKLnukccmJ9BDM3BSHYH6op9UCUZxtP+fBzfUCzq5wCd9bgLU+0/o0SgUDd9HJzP /U+dG7zoNvL1VWHKVO3IsLQkp+zhmPUNoi7Domqy08M9pEI+RClj4w6xg1GFpbU6lHJEStcf796 NnPbUwqRvwuWDX81U5Gv0yU8PCzo2s8B84tB9i2IjuTDTB09HxSIJzrzTIiXNEhg5sj9oNnLe2q e6QkdTowv1dFUwu6esJ42ANRUYW1d2kJwoKEy8Mf9qi/t/dYTIWrTFQ6BijpWlCOzrlGjxyE3De mmDIG1W+ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 phishscore=0 clxscore=1015 adultscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200022 From: Elliot Berman Add bindings to describe vendor-specific reboot modes. Values here correspond to valid parameters to vendor-specific reset types in PSCI SYSTEM_RESET2 call. Reviewed-by: Rob Herring (Arm) Signed-off-by: Elliot Berman Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- Documentation/devicetree/bindings/arm/psci.yaml | 43 +++++++++++++++++++++= ++++ 1 file changed, 43 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentatio= n/devicetree/bindings/arm/psci.yaml index 7360a2849b5bd1e4cbadac533c1a7228573288d4..eca38f8747d320e8371c1dc37ce= e2287d71821c4 100644 --- a/Documentation/devicetree/bindings/arm/psci.yaml +++ b/Documentation/devicetree/bindings/arm/psci.yaml @@ -98,6 +98,27 @@ properties: [1] Kernel documentation - ARM idle states bindings Documentation/devicetree/bindings/cpu/idle-states.yaml =20 + reboot-mode: + type: object + $ref: /schemas/power/reset/reboot-mode.yaml# + unevaluatedProperties: false + properties: + # "mode-normal" is just SYSTEM_RESET + mode-normal: false + patternProperties: + "^mode-.*$": + minItems: 1 + maxItems: 2 + description: | + Describes a vendor-specific reset type. The string after "mode-" + maps a reboot mode to the parameters in the PSCI SYSTEM_RESET2 c= all. + + Parameters are named mode-xxx =3D , where xxx + is the name of the magic reboot mode, type is the lower 31 bits + of the reset_type, and, optionally, the cookie value. If the coo= kie + is not provided, it is defaulted to zero. + The 31st bit (vendor-resets) will be implicitly set by the drive= r. + patternProperties: "^power-domain-": $ref: /schemas/power/power-domain.yaml# @@ -137,6 +158,15 @@ allOf: required: - cpu_off - cpu_on + - if: + not: + properties: + compatible: + contains: + const: arm,psci-1.0 + then: + properties: + reboot-mode: false =20 additionalProperties: false =20 @@ -261,4 +291,17 @@ examples: domain-idle-states =3D <&cluster_ret>, <&cluster_pwrdn>; }; }; + + - |+ + + // Case 5: SYSTEM_RESET2 vendor resets + psci { + compatible =3D "arm,psci-1.0"; + method =3D "smc"; + + reboot-mode { + mode-edl =3D <0>; + mode-bootloader =3D <1 2>; + }; + }; ... --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 2764D30F94D for ; Mon, 22 Sep 2025 13:41:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548502; cv=none; b=tK6oLo3a6cEbuTF75+Rc5vuG+jx48zBGG7nsvlS0K7329fDRp4ALIKaHIfP25Ahi9dWzsj8VmA9q8NGjKJ+k12RcRBssFrbPQauM0rLfZ0BJ+BORcqZGO9/o74/vTIDRH6epbykBUNC2aZ8PFp1nbDpcZ1iQpm3XBOS8QmmY+Os= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548502; c=relaxed/simple; bh=csuodKKOIftmMdPH0xW7mPcZsY63rR80pB6PrZ4SpoM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QJ+POVjkxC6RS00klxiz7INUE1QaAP76MPzVxou2n/MY4pjMmMz39asZLpBV/kg3bWl3ZVdEQRjd9uYMT0av6I86GPW+aNeYELd6qVOXeS1BLvj/Oz6SDf/sG2GoVi7gbA5rNtHoGi0clLV4/c8U6RPIRbrNzNTwdk74eyAvR34= 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=UrmfMML3; arc=none smtp.client-ip=205.220.180.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="UrmfMML3" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M8xEBc029698 for ; Mon, 22 Sep 2025 13:41:39 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= PQ5CkjpDV5GdiBCvwUM/d/pADry2aOxsx1xtl/RbIcE=; b=UrmfMML3FdOErJQT DxUFr4j2GLejeXVvZiUlaUCkhytXodnETtRiL+9pbk3utln5iC6L4Q4iyX15bejt B18c6ENsWjgznAvPcYQo5ZkPo140bzXi5ERmbmqrvb+aN62HairdgCuJtbxU2HxA D7bl9VK+ZEOXrsBT58OKagLUKuINORDoYQT3taMDIfyluZuqasZHS3weTl+Dnwj5 RE6NcpYVUlywYahsbeBB98nNAHBO1qMJ8IMYcxXHZL/p+O3xZ1p0RmXzB0rJHaa1 sC3MVM7bo4q1Fp4rXH0ccVcPBFoFccsu2V8fQ4FeriHzKjCxG28JMBkUNZRDqRxs 7zFjfQ== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 499hmnn6cs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:41:38 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-26985173d8eso71275475ad.1 for ; Mon, 22 Sep 2025 06:41:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548496; x=1759153296; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PQ5CkjpDV5GdiBCvwUM/d/pADry2aOxsx1xtl/RbIcE=; b=wfT5vqn2UeqYU29ha6Egq8eGs8tUX25kz1zSe6B2y/6MqNRE5qEdwMrRnnT3ihFRM9 9Kh878rbNzWBlMbUYI5d8BoH9PJmXdM05d1z2F7ybNaKp8vEYmUEehTqZmeUmCaGXfQv 8AHF5bgIIYyRLIi8lQzujdlvyUqK73YGlKaLjyf3E1rudEpWKm+X9tUxINjZM3zox7YK dGikcCzTJmQfLSSaXtO7jPMccalTmsGTVuYkWS1MSNZ5nY1DpCiWNSut3ADbJpBiKWus lfg1JpNvsGhdRxVtzra9pE5hjK8qj0X4Ir9R8u7VJK8W8XwnA8RztF5xmt/rIPa5cG1e hI3A== X-Forwarded-Encrypted: i=1; AJvYcCWDudoqdThbt700WUPgcG355v253e3MC7Gde/KsBZURp6DcRyT5i6Qzj+MrpgWMs5igqh4cTRti5zA+Xh4=@vger.kernel.org X-Gm-Message-State: AOJu0YwPA3o6JNcW3/z++ASuMkrNvtHzbVB2thyQxqNrj4tKHADlDPAI ZaeV9cFWr/yZkAkyzvKyDpmzZCEYfKi8Om8YBP0c48I3g9Ta3xFe70XJ4nh/cfIM2nFgUfxyzV9 WqXVDtTKMKVtxSPqUrAatu6Rc1W2QJqIblQcOkhX755wykB3xT4mSEwaLyuW7DmBSAnA= X-Gm-Gg: ASbGnctbOS7FY5UwxnTN/CSBQlNc9eXCyJhYiERzStnP3wbeEV8ykWNqPYurWx1EpwT ejt0pcybD0lOHaYnnhNmRj+Pll3lsmIm/sN4Ue51238kbMDmDBnMJlllP+kQWb2yxk4E8quCVr6 TDooolvD7aQfE6/xVwsfBNtNUS+AWHuenaWM8MapM7jEUzHXdtWHQYu3Npa5hTvCWWWBj2jx4Ny lH0zyCOKW8hqYbkFzZMPrOY8q1U8kF2Oyy1xed/1W9zwJ/7nbXQOw2IK/YcYbyQJxgvBNN0bYMT xzGSLa+nZhvKWEHl3kNAks3YaFbe13qokU3JPA4hp6ouplVsZFItfWifRwbyxdSmwSqyAXL5hDJ Z X-Received: by 2002:a17:903:183:b0:268:1623:f8ce with SMTP id d9443c01a7336-269ba40dccdmr148298555ad.10.1758548495735; Mon, 22 Sep 2025 06:41:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFeYpL83hvZcT0ZSaAkASpo+P2NbTj4vkGQKYjOTOfv1/iaI/NLo1r5L5RQ2zZQ/05PnYOT5w== X-Received: by 2002:a17:903:183:b0:268:1623:f8ce with SMTP id d9443c01a7336-269ba40dccdmr148298045ad.10.1758548495287; Mon, 22 Sep 2025 06:41:35 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:41:34 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:17 +0530 Subject: [PATCH v15 07/14] firmware: psci: Implement vendor-specific resets as reboot-mode 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-7-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=6219; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=csuodKKOIftmMdPH0xW7mPcZsY63rR80pB6PrZ4SpoM=; b=C1BsyRmsmmPO4kKpen0/8UPvJNM55hRlZuhyu19tdHSZW4BLLJnL5P6opj0haHTxaIoKilW1Z QVdD+Ga9tSwDm0AWXam0oX1WFBFPV3xbTtY6gKbVWC4Ygr6NRRGiXJV X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=YPqfyQGx c=1 sm=1 tr=0 ts=68d15212 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=1Y-8vuCXXADn_sFn8ogA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: 1sD8qIWjN0xnS00ZhJ5X_8qwAyN4Do7f X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAwMCBTYWx0ZWRfX1TQoNABko6+I G75yphNgxQLUJn2fSiIjeGr8uKSUrg3ZnhdalRS22bRn66MtVadaGiqpHXbEtUylK8mIy2xFeIt HH+9jF4wXCUb0e2PdSthqE21Lm+l0CSBhwZJZw9JZE6ZBOH2B3ZtrDtoksv/yFd2RzmPpclb5qB jZGQbm7oz7Ia9jDmyc7WR5BrgMA3XHDJnysqzryhl/gGvHN3sS6u+3ISU3mfopWr2Bsh0xrzGEe lMCz7aMH5A1G2BA7FlF7vzEltZXpk/ZzKEFeKblOpHyIJ6FI5E03f+gRQ47MXVQNcd2P0NP4TkF FwLNNSJDB4yziK9EomHSVAuJqsLdYsUXRKCFAEpOh+IgHoHkwWYNIhC51j0AzyqKohL5w4Ohc0X WZECxHs5 X-Proofpoint-GUID: 1sD8qIWjN0xnS00ZhJ5X_8qwAyN4Do7f X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 phishscore=0 adultscore=0 clxscore=1015 impostorscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200000 SoC vendors have different types of resets which are controlled through various hardware registers. For instance, Qualcomm SoC may have a requirement that reboot with =E2=80=9Cbootloader=E2=80=9D command should reboot the device to bootloader flashing mode and reboot with =E2=80=9Cedl=E2=80=9D should reboot the device into Emergency flashing= mode. Setting up such reboots on Qualcomm devices can be inconsistent across SoC platforms and may require setting different HW registers, where some of these registers may not be accessible to HLOS. These knobs evolve over product generations and require more drivers. PSCI spec defines, SYSTEM_RESET2, vendor-specific reset which can help align this requirement. Add support for PSCI SYSTEM_RESET2, vendor-specific resets and align the implementation to allow user-space initiated reboots to trigger these resets. Implement the PSCI vendor-specific resets by registering to the reboot-mode framework. As psci init is done at early kernel init, reboot-mode registration cannot be done at the time of psci init. This is because reboot-mode creates a =E2=80=9Creboot-mode=E2=80=9D class f= or exposing sysfs, which can fail at early kernel init. To overcome this, introduce a late_initcall to register PSCI vendor-specific resets as reboot modes. Implement a reboot-mode write function that sets reset_type and cookie values during the reboot notifier callback. Introduce a firmware-based call for SYSTEM_RESET2 vendor-specific reset in the psci_sys_reset path, using reset_type and cookie if supported by secure firmware. Register a panic notifier and clear vendor_reset valid status during panic. This is needed for any kernel panic that occurs post reboot_notifiers. By using the above implementation, userspace will be able to issue such resets using the reboot() system call with the "*arg" parameter as a string based command. The commands can be defined in PSCI device tree node under =E2=80=9Creboot-mode=E2=80=9D and are based = on the reboot-mode based commands. Signed-off-by: Shivendra Pratap Reviewed-by: Kathiravan Thirumoorthy=20 Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- drivers/firmware/psci/Kconfig | 2 + drivers/firmware/psci/psci.c | 89 +++++++++++++++++++++++++++++++++++++++= +++- 2 files changed, 90 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/psci/Kconfig b/drivers/firmware/psci/Kconfig index 97944168b5e66aea1e38a7eb2d4ced8348fce64b..93ff7b071a0c364a376699733e6= bc5654d56a17f 100644 --- a/drivers/firmware/psci/Kconfig +++ b/drivers/firmware/psci/Kconfig @@ -1,6 +1,8 @@ # SPDX-License-Identifier: GPL-2.0-only config ARM_PSCI_FW bool + select POWER_RESET + select REBOOT_MODE =20 config ARM_PSCI_CHECKER bool "ARM PSCI checker" diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 38ca190d4a22d6e7e0f06420e8478a2b0ec2fe6f..40a27bc2cc3a3393acc14c7b231= 4155540ed06c9 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -13,10 +13,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include =20 @@ -51,6 +53,24 @@ static int resident_cpu =3D -1; struct psci_operations psci_ops; static enum arm_smccc_conduit psci_conduit =3D SMCCC_CONDUIT_NONE; =20 +struct psci_vendor_sysreset2 { + u32 reset_type; + u32 cookie; + bool valid; +}; + +static struct psci_vendor_sysreset2 vendor_reset; + +static int psci_panic_event(struct notifier_block *nb, unsigned long v, vo= id *p) +{ + vendor_reset.valid =3D false; + return NOTIFY_DONE; +} + +static struct notifier_block psci_panic_block =3D { + .notifier_call =3D psci_panic_event +}; + bool psci_tos_resident_on(int cpu) { return cpu =3D=3D resident_cpu; @@ -309,7 +329,10 @@ static int get_set_conduit_method(const struct device_= node *np) static int psci_sys_reset(struct notifier_block *nb, unsigned long action, void *data) { - if ((reboot_mode =3D=3D REBOOT_WARM || reboot_mode =3D=3D REBOOT_SOFT) && + if (vendor_reset.valid && psci_system_reset2_supported) { + invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), vendor_reset.reset_ty= pe, + vendor_reset.cookie, 0); + } else if ((reboot_mode =3D=3D REBOOT_WARM || reboot_mode =3D=3D REBOOT_S= OFT) && psci_system_reset2_supported) { /* * reset_type[31] =3D 0 (architectural) @@ -547,6 +570,70 @@ static const struct platform_suspend_ops psci_suspend_= ops =3D { .enter =3D psci_system_suspend_enter, }; =20 +static int psci_set_vendor_sys_reset2(struct reboot_mode_driver *reboot, u= 64 magic) +{ + u32 magic_32; + + if (psci_system_reset2_supported) { + magic_32 =3D magic & 0xffffffff; + vendor_reset.reset_type =3D PSCI_1_1_RESET_TYPE_VENDOR_START | magic_32; + vendor_reset.cookie =3D (magic >> 32) & 0xffffffff; + vendor_reset.valid =3D true; + } + + return NOTIFY_DONE; +} + +static int __init psci_init_vendor_reset(void) +{ + struct reboot_mode_driver *reboot; + struct device_node *psci_np; + struct device_node *np; + int ret; + + if (!psci_system_reset2_supported) + return -EINVAL; + + psci_np =3D of_find_compatible_node(NULL, NULL, "arm,psci-1.0"); + if (!psci_np) + return -ENODEV; + + np =3D of_find_node_by_name(psci_np, "reboot-mode"); + if (!np) { + of_node_put(psci_np); + return -ENODEV; + } + + ret =3D atomic_notifier_chain_register(&panic_notifier_list, &psci_panic_= block); + if (ret) + goto err_notifier; + + reboot =3D kzalloc(sizeof(*reboot), GFP_KERNEL); + if (!reboot) { + ret =3D -ENOMEM; + goto err_kzalloc; + } + + reboot->write =3D psci_set_vendor_sys_reset2; + reboot->driver_name =3D "psci"; + + ret =3D reboot_mode_register(reboot, of_fwnode_handle(np)); + if (ret) + goto err_register; + + return 0; + +err_register: + kfree(reboot); +err_kzalloc: + atomic_notifier_chain_unregister(&panic_notifier_list, &psci_panic_block); +err_notifier: + of_node_put(psci_np); + of_node_put(np); + return ret; +} +late_initcall(psci_init_vendor_reset) + static void __init psci_init_system_reset2(void) { int ret; --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 0A68830EF92 for ; Mon, 22 Sep 2025 13:41:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548510; cv=none; b=MtyEybW1bwPbNDdoMCDmkBGeBl48DeDYh3rW4WGeUeNQz/lMcWpDmwid2cEZvXxFAu/dz8DTYlmXoOq04v01ORajlHD6ILKbO5Iyx11qjcspfpcwPusrNfsMn+ruYPKvbBL7LUckvUH4xkqpK7q4Vk0Unh3mnf9rlkG25ZE+cCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548510; c=relaxed/simple; bh=jt2htmKgLAbDjy2GYCODQ70+pePb2+pA3k9K3wbnmBg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nHeWEYMsD+gvj2ClwfNMI3OIpNfhSK/wUiZWrYtAyUdq1CTMQXV0s2iLqt9HVdiZ1MwfNFG5QZRpxMSx2GSowkkPXQoAy9cwHKsSJ4u6XZeJSGLMGIYDG0Fkzsr2dR0I1JOKGTMkAPoDHaWwHv6Hevf3XxLX2SbLBPmf/vdbhiY= 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=QsGWt0dE; arc=none smtp.client-ip=205.220.180.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="QsGWt0dE" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M92XUo023868 for ; Mon, 22 Sep 2025 13:41:48 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= /XX86OrjTks5Leb3+o6s3i4q/wmypiYTlR/U8wdD3TE=; b=QsGWt0dE/ChdseDI HZp7l9iSEIy852PjlP1haS+wrWWzb3edOqlYm5RjQQV8iKYM8IT2wY0hCUqh/nbE VLeJUC5lp8VL/hnXGWz7BaFyYyQA9Fo8BOrdeFGSo+IBGJvYA3TLimX4NYXt6Ujc xu4tIo3mrrud6cMxjUPrruolcdrSqOkUDFBWFg3NkZemrkaX6bt9kpdru/NGcU72 R0Lbfhsjf+13Fdiv4CaZAoNzanCXaSh1tZ8PZYehhf7wUO0ID400WL+6SY/LLA41 FmVozoctQwwmI7P7pkwYrRBTcrksGaWOazf68DQaITClPOQAU8rUzCh/e9Mo5/Wh 1TPqag== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 499mn7cwqb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:41:47 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2445805d386so50150665ad.1 for ; Mon, 22 Sep 2025 06:41:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548506; x=1759153306; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/XX86OrjTks5Leb3+o6s3i4q/wmypiYTlR/U8wdD3TE=; b=c+f/oIi40mLeA+xQORKJG//CRpmzEhfyHEJx1tNy5sd5OADkdDtwamJzRENNFr7Po7 WXVdRGoqQbIq57GVpURXky0X0kIp7GTk9wPavFN1u93g2hqwlhmFASl0pDBG20CP9prK eN4p4wlFG3NVXh/HOeiIewLULVACy+KbrId+7YwHWT57aZ0G6tcDD6xo6L78yEqTg1eU KeCRKPXV8YDzd+L7g7ZAuqbqHaTV99Q5MQvVuY1CK/+Apm/Flf5QmTkU33bZchcvbiSu 2JMEPUoZtHtVwBiden0pia4hotcuI09BYbw5GxM0vi3cmNPQIC0XQAhTmNcsTxHqTR/4 YOGQ== X-Forwarded-Encrypted: i=1; AJvYcCVIc9xQoQz/TuLBLWUtTw0cQnhEJGQB2xZ8gqFGLMsf0kUGryGgmIszvEv+gEGqBe6TvbmfohvwpIGDPOg=@vger.kernel.org X-Gm-Message-State: AOJu0YxRqPcXw79hYMxyFQ8CZB91zp5BpZo8+XpduhIqYrgq3HIpr4rI psKMHQxMmuD8NF4fApzXvO1FdIb/wOC/8nZS0scjwCWAT9J3lNSNOS/ci3y0AUlUaz4F0HSWZF8 AY/vzMuQjjv8U1t27JNQBVwN2dL3YBVjaQy1/yoT5S9bhfMoLHLwDuHcC5vTjrdhgRzo= X-Gm-Gg: ASbGnctzuVaZb/CBTrDzKdQpwIh0GMka2BMgrhm5Pdpi80mgoxn/BAmymh0CqW2JTqe wwQDlZ2Fow6buQYu7uUJWZUBCuVLwUXc9oOEoio7+1fDely73FAVziOjP5xuK/sUwrtsPV/NQBq dKELIhjKs1f7Wt+xK3nJES6NNFigL8+Kq4Bv7vnlLMc4WUyFtnoR6gGJALhz7cwIjqiTj1NdwGQ 7DQkduNZZIgF9aYZzlQYGh7K74wbCZwo3xDplqWDFW8jcbGibPnW8yFG6ZH/XimF+RNlBKOVNAj cUwhh8pL3BXTY1r1MXpbmuU/jADnwNq0VS7+l+5DkantD92tAKyY9zBkjmGG6ITBoXAWxL53EKO w X-Received: by 2002:a17:902:e34d:b0:24b:1589:5054 with SMTP id d9443c01a7336-269ba459b10mr113332265ad.23.1758548506375; Mon, 22 Sep 2025 06:41:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgNNvAsHHiGeaZP5VoAA68roYo+dylnrvlMM5UcciZSIuXaq9nHAxUEjxfhhDGauwJ/C7wsw== X-Received: by 2002:a17:902:e34d:b0:24b:1589:5054 with SMTP id d9443c01a7336-269ba459b10mr113331885ad.23.1758548505861; Mon, 22 Sep 2025 06:41:45 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:41:45 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:18 +0530 Subject: [PATCH v15 08/14] arm64: dts: qcom: qcm6490-idp: Add PSCI SYSTEM_RESET2 types 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-8-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla , Elliot Berman , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=1628; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=SNQVZvT2DjzWoTyJ6c2xvqRrn5RNzP7FXJ+E143gp5o=; b=cXxhuEtcDtlLV8MbUWnz95YMzEkXXM9COlMe1WkI4LfKje+lywF9OJa4i2AekHnGx7dhm86zA TeShTpKJYqcBxvl8B0sIHfHocfMC4IReLyv/Qv9fiQba51ttSWvHuez X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAzMyBTYWx0ZWRfX5vwEZsrMcsq5 RcaRXBU7uzrRWTapH2IpAX81BDT2Gptt79TlO3CMMMjtIvmF9EDK4Az2VSlKvwRtrHcI7eUK31t 2uvohHR9cf4HUB5vYNB3prap4cBUQIKVbXEhqtqFR51bro9Of0LHyvFthBDLBc3rE9BUwV0RbMP IF4b5JeeiLEVQb0FmsiJubh5B96/Vj/GLejTeHigW4ANi7K3W+FgBw6Cf5KcSQTrr7b6xFVNNEX gG9/QER8Dlx5lxOOB5BwopvaFBgY5HPoR8XOq16xHQa1Biy2VX3m8HVvoJVYJvrJf8levXxLHX4 LmWmtiuS3mctQZQIlFJD0YqnttpqsE+Q/rsqSrcPH5NYPhb5X1s0wc0HTjpbFTNT1AHjqmQUsAj hDU/18ed X-Proofpoint-GUID: egwTFeW9yJUMyeOd4R6SRHAL9vwcPFfa X-Proofpoint-ORIG-GUID: egwTFeW9yJUMyeOd4R6SRHAL9vwcPFfa X-Authority-Analysis: v=2.4 cv=EZrIQOmC c=1 sm=1 tr=0 ts=68d1521b cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=w06kbW2hXDg5FjFnD0gA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 phishscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200033 From: Elliot Berman Add support for SYSTEM_RESET2 vendor-specific resets in qcm6490-idp as reboot-modes. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Reviewed-by: Konrad Dybcio Signed-off-by: Elliot Berman Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 7 +++++++ arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts b/arch/arm64/boot/dts= /qcom/qcm6490-idp.dts index 73fce639370cd356687f14a3091848b8f422e36c..84322b74917f3a70adce5a4182a= dfa5d787ab11c 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts @@ -695,6 +695,13 @@ &pon_resin { status =3D "okay"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x10001 0x2>; + mode-edl =3D <0 0x1>; + }; +}; + &qupv3_id_0 { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qco= m/sc7280.dtsi index 4ac909214a8690111b2596d36a8e6e79d0f05131..bed389aec1c944a849fd2212e4e= 35e2a729fa935 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -858,7 +858,7 @@ pmu-a78 { interrupts =3D ; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 4BBB030E821 for ; Mon, 22 Sep 2025 13:42:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548522; cv=none; b=BEbvQ3+ida7AUftJqzzuLOLa+cN9Mrecu22HiltTMp58LVnp8N6SDYT1XTqwrXSayMk+NZSrPkZ6p9TXRp43Q2R+eRrSeFHVm/CvCGtCJSNHigjalqf51qLG2hVBBQ/x6Yl65M36QFRSvVoI9ePdOFc4tkChXigqkvQXkGPPZ+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548522; c=relaxed/simple; bh=BQbA1PfTf4T3catTnFJyQPDRyKoNlBdFRYRrfUNeAx4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uA5X3/o8uI6N1HWi8OJYzwYrvT+nDlG0mlhPSM66v98f3H1p6r4USgqKsf2SBgOofSDUJqHqgpmXF3+SPUxsVas5cd6e3s+rBw49jP/pCuqCiYeQ+08MemHnalpmsRi3m/1DakHcdxYXrOmptwGgQAmaeoL6GemYpfhJfJy/zkA= 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=NwYvpOg+; arc=none smtp.client-ip=205.220.180.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="NwYvpOg+" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M90U4I022397 for ; Mon, 22 Sep 2025 13:42:00 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= rJQkYNJ2ptgfx/Tld3lEk18PrZsK416NnAJeaB5RM4o=; b=NwYvpOg+xZS7eHP0 xDNER6FmPa5tBlNEMzLiHHu1qY+74UFzQbYQXWlr0JRsVQTkUi0v33MPdgcYFwix rz/0WJ2t380Rag2TMTjVmrBUe7pYiy3n63iSjuAoAeEMO9Gdp+gW4Iq9USX8XUk5 edOKM4JrJn8KVY1Y7ZwwBfGvg8OBlvQolFgGaSq/aknrz0Ouqup571qn+SY6OwfQ s0PbBgH/koWZSlemX+W6Dqbg+ojVDk0H+jzSrMBRRHnADxLN7RHhjBTMEPqCFP4A 1srZ3nofm5yzwt8td9ZGMIqLIMd16VP6bJCBMJB5XgIiJydcm7BiYENtMWBo12qP agglDg== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 499kv0vwbj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:42:00 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-b4f8e079bc1so3164726a12.3 for ; Mon, 22 Sep 2025 06:41:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548519; x=1759153319; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rJQkYNJ2ptgfx/Tld3lEk18PrZsK416NnAJeaB5RM4o=; b=s28UT1I0X1GllcvEfQWrtkmCbS2oB5/tpDAcVg+78HBKnQt0MtHuZQFmgPg0Z4rn6I +HY6rHNFLEfoQXrZZSqWgENjZjlIpZJR0VgJRUFKpAQWpenY6ZCMACpcqgsXZlGo69gY JDTO1jWtyP2jYUSBEJGhBBKdNrlhhaY30q1+3lOkGlWriJcxDgeYzInZ7IyblEbII2df KD+1AzXczrAILiQ7s+OQsLuYtCeXZA1XEGCexTgwLRO45kk74l525D54MDa7s14j4E2r oLACnyBRZh9JRXfqk8ztachvlsod2EE3j/8Nr5h8JYDg7KXafpMMbwO/8WQZxTRByQet Wa0w== X-Forwarded-Encrypted: i=1; AJvYcCUx8HzgGZwjG4Ykht6/gYNe68pPp2j6JRFljfOZXdM6l8eu2wE+jDzrQjp1uTM5sh/gDzh6sSFbTOcfGvg=@vger.kernel.org X-Gm-Message-State: AOJu0YxLc13NcXnrRL99jIipllPKEnOCBenddJLD4umL+rd6eMDcW0ex ABmCFyVWWfTbjThyCjmTJMU4OEHYwxWE3FVO2PSuh75tizj2JrW8oRB54HQnS+o9KMD063vn+Mm aw6K6P5yqq+9+QYIk7M50UML0aFvVIRcPnOi8CKfZBLpkMAQqTi8hK6KLX4kwpeXx4/c= X-Gm-Gg: ASbGnctS2EgvALpAZaeR34iuozJsC3PHbuezW1vpkrQ/hB9YfoUZLPVN1VTvo9asBAy C1xRvUtII1Y5Gkb+7f5bjoanJLPB1lmMWL67p1od1tMdEq3RXdGiI/+1IZ2o8fl9zzUWnEdyTe5 xMZNTonBc7zZLbH7Ts9wmslkY99d021CMA6WibQ8ZhIkIGDsd+TGyLR98e5nbiSFIhYEIy3qqXY DJoAmA0/2hfWqurW0FuUqBktRo4A8O/MnYDKrnpgWil/HvDGWfAYQBR4VxLOBeAAS9/LZV9gcgy ncMWnP1saY1Pz05lD/N8lIa3x+BrkkmTr6iKBWz9aO1VWL82otaf7kH9Y0qNjHDJAfSoF1h2MzH z X-Received: by 2002:a17:902:e94e:b0:268:5892:6a2e with SMTP id d9443c01a7336-269ba59b78emr169070325ad.56.1758548518389; Mon, 22 Sep 2025 06:41:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7GSFmhWYvpYF0EOoGE36KcGoA9Rhnhe/ZjWh/d/dlfb6rO08M9tGC4TLjf/3UCGfieqRxAA== X-Received: by 2002:a17:902:e94e:b0:268:5892:6a2e with SMTP id d9443c01a7336-269ba59b78emr169069835ad.56.1758548517815; Mon, 22 Sep 2025 06:41:57 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:41:57 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:19 +0530 Subject: [PATCH v15 09/14] arm64: dts: qcom: qcs6490-rb3gen2: Add PSCI SYSTEM_RESET2 types 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-9-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla , Elliot Berman , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=1185; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=fkRav5QA/W0o9Ycg3/xbut6S1Npfgr1jXzERBrOotDE=; b=nEF91WM16FRKVprlDcNfVQWq2bR49it9Jbo2EoH3aVuK0XkhCYHknxQNy4bTTsN+sz9xNq820 k2On/w+tYoKBrQpRIp/RsOf/hNnMynZS+XFJDUOtM528sIVCEEvrJ9u X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-GUID: ryMSZwxmDPoxfY4yjrSzMu89tFtas3TN X-Authority-Analysis: v=2.4 cv=RO2zH5i+ c=1 sm=1 tr=0 ts=68d15228 cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=w06kbW2hXDg5FjFnD0gA:9 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAyNSBTYWx0ZWRfXyqc4iKE6tgrz I7RhfUV93DH3UKEiqaI/uOBybdlgek8XRom53aGE65LdlF1UtkwJgUp/a/lMfet4Fde8l8QrjHN qmdmAdbrKwz6ffFvT8dw5im7XZVZdvZa/ruxT39Sf1ab5RzpIBWerC1wOoq0gm06TW+RaGdRtFA 8k+XfKz/D8H5W/KzBRKmcs3pPhWn8GXWtJmcU9rSqfHbqllcJ8+aIyq/DUWd96KwfrWOp+aStB4 yAretl0ROmEgx3G/7ygP/z9DcKHihQ232spXO8LCdzdCkILDpZmefC+I74W3u/PrQV4CAkx4hff LSusPdDo1t48GMrTuVnZV3HJDTpkqlj05ucr1Zsq7zpCPqHXMczXwB5sNBhwCUwQnOqCRZkiHtL XMdGpduI X-Proofpoint-ORIG-GUID: ryMSZwxmDPoxfY4yjrSzMu89tFtas3TN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 suspectscore=0 priorityscore=1501 impostorscore=0 spamscore=0 adultscore=0 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200025 From: Elliot Berman Add support for SYSTEM_RESET2 vendor-specific resets in qcs6490-rb3gen2 as reboot-modes. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Reviewed-by: Konrad Dybcio Signed-off-by: Elliot Berman Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot= /dts/qcom/qcs6490-rb3gen2.dts index 18cea8812001421456dc85547c3c711e2c42182a..f38fa2e52a635100a7505c615c0= e96f1111d0b5a 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts @@ -975,6 +975,13 @@ &pon_resin { status =3D "okay"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x10001 0x2>; + mode-edl =3D <0 0x1>; + }; +}; + &qup_uart7_cts { /* * Configure a bias-bus-hold on CTS to lower power --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 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 A5ADB30E832 for ; Mon, 22 Sep 2025 13:42:11 +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=1758548533; cv=none; b=BtVZsHBESZccX2t4NbQi75SKMZzzAbvx3Qhdkl2/Y4FplmXWVK5iGnPOSMnRAQgf+cshXR4r27WtJJr1qyJW+FonpYj5zDUm0ZVIDbTjFidXn19zFZ6DtU5CPgAUhOIyGlgd7AIRqxCD6F6PSKBgSDhvQ7HewyY0VjBXCPbOeZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548533; c=relaxed/simple; bh=QB4xC2r8HSjzjCt03b+mFUm7g8ywQrhMCL5u9OFpXPM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S+XbqAMLYxsaCuXD0kEe/T7V1+goc1xMUzClPwAiD2m+2I+nkxu8wnoT+8sRqvHILw94XQfZnPBVOJlgu3w1kTiTqbCkNmD46uVCAFxp6/9W7HpVmQI//pmqmYVxu3wLb/RHD5Fv0Q/p+G44k9do3OduRhDfus54bM6SDmP4HL8= 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=ab8DZ3qS; 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="ab8DZ3qS" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M7p0Lg005645 for ; Mon, 22 Sep 2025 13:42:11 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= Wh/7I9nc7TXv1Vm06bJQFYN7WbWsJIBlNpOLoUHm6eE=; b=ab8DZ3qSguQFoTGW kFTO66q2di3b8ZOp1YaEo7vrzMv+514XYEISEu8tFMORASuaVhlVvXIDM7jYv0Y8 jRI0zqXWNLQMjZWRib7HajrSWUS+11KEKzPO4xoQ4k8K4abCG1iq/IAKsGTmd2bT Pvat4Qzba6YaCfSu59iqqO7bblemphQ1CJWgetvHzlwx16aog4ynQUXJ5HhY0QVV wmvtcau9tXo0FqDTtk+D/hTEJktJ4EYA5Vm+vwGpoO1fmKJWnOSLwcL8mK00S16w YZpidBU51waE2iwIJFhQkBKIFSwNVaH4lSSLegMeRuvdouGAP0ackfSuJc6v7Yay GK8jSw== 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 49b2e112vd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:42:10 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-324e41e946eso7765779a91.0 for ; Mon, 22 Sep 2025 06:42:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548530; x=1759153330; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wh/7I9nc7TXv1Vm06bJQFYN7WbWsJIBlNpOLoUHm6eE=; b=Twcmv5zHHc5RqAxISv0OXeNOFKYTkLLWUbsAo6vAlgcevEguPl/zY2gtBPX/SQKPsv 90FC2YIPy8+qINxwnwo6RfucEu5r4XbmbuTnJ1U7HNHxlfAWfQ1kHuzgv5mGmu0+4bY2 M43R4xQ9Cd4dsDIagDKUwzoS+G8ti9FETRCwASQ7oN1Rx6UvI9RMtTV16waQHtSn5FAQ TGCRUBY3TOh2qEURkdPkhKVGRXGlMT3N0WTC9SOc3OCkT6qBit5ebaDwdvCLybmzx5n2 CWCIM3PCJvfosTJOeVmyc8h7rY5Bwyv3xuDL/YLz/BSkJeFUe9GRWaIK2xs2KlFf/Vrg TWJg== X-Forwarded-Encrypted: i=1; AJvYcCUdp6lxaRddyRmpwNL8KvuC71+MiIrJz0wyPwCs6Jj0LPknR0alzdvbbGjYn70wCNuY/L0JVwKZXX2dpJ4=@vger.kernel.org X-Gm-Message-State: AOJu0YyYpK4mqt+d9IDTTvA31ARlaAha7ov1DuePAGZhZ6W3T00LaCT4 cEN7nOoyVysdzdZFQdcjmr682FhRnh6Mu822yLiOKTIpxORlvlMuhwlev2XAvEgN9pLCyWYS66X o91kFtE9J4W4mIjkSZXW4g+ZIyAeWuKUJ0n548c6lHBi6pJOVrY48+fCh4hxNmOcUOgs= X-Gm-Gg: ASbGncua7RYZie16vYsLo1+xQUy7GimoDrZ3+QaysShw/pCBvMa4CX23xiIRkNqcxYN 0qYuGPqkLjZXSWuxRtXFCZ7VXjR9R1T3Oscq110QhbNfzUwQZZl/gElYeHfw0kDLmzhist1er2X CUA6/xRKmrfz2OJO2rZxzFueSlZd7XYFjluh3N5baZ4U0YkJ3+XwhfnWmF9L+ZLGEmNH555ytEN PsK0ti4/pjiUGeh7DtSiG/t4+BtisKaxw00f2UHTOAcMy2hCT1PMWXlvb5LiogZFXYd3zPGLoEv ABNHgS8Wb5v8kNzEKEE811BNEQuSfB6qzraN+sJ1qSn39G4X2za5XcDSvV0Mi2Ar0k/EKAQ3wLB p X-Received: by 2002:a17:903:f86:b0:267:a230:c657 with SMTP id d9443c01a7336-269ba447e6amr190098645ad.24.1758548529885; Mon, 22 Sep 2025 06:42:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpliuhHBSE5mQTDz2xt7nLTi+MDrburaFwR8LKRa9AbeTGPcx5opIE8WzGuUVQXBbgbn8g4g== X-Received: by 2002:a17:903:f86:b0:267:a230:c657 with SMTP id d9443c01a7336-269ba447e6amr190098175ad.24.1758548529471; Mon, 22 Sep 2025 06:42:09 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:42:09 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:20 +0530 Subject: [PATCH v15 10/14] arm64: dts: qcom: lemans-ride: Add PSCI SYSTEM_RESET2 types 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-10-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla , Elliot Berman , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=1694; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=F40UDJXOJIO5Y2uSSmyA/SwLwR5DxDqZFVD3o9nJtHE=; b=rvw3vrmSYr76Z78QZ7Ue0WKvVeCRs7jqZ3VeZ9VGFJkwFAAlLXQ4vd/k5os2ng/2rMWfZ/L1S +4jrGqxkOyDDsDg1MwLjnE2Ml+VRwxJrecPL7wUifnKqeiOCbgiaoK3 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIyMDA3NiBTYWx0ZWRfX1pmUr1m6iF0L TGRS5jAITVOzH32nhy4DC7Tks0W53+mVc7i1NjKz3B4EdKCG7CCMYfcAwz8YNegvfDnOgVYJfl2 fCFVaRJmCVU7NzKUy0ledMgShfRc14HAcT+1kkXrU4QTG7dvNaLTCoL6NALy/9u6QlIa3j8CoEu bwvnSKWFsU20WT+gS2ftA/khxxgJvUD/zMnvZgpG3rTAo8AlavM01AoPxGNJOIkhtjNqETR9rpB EKtoMYzRP6luD8BIgJhuG5gaERWcgrnAnhR4y53qPNWDgyuR7uOe+dP/PrFzadLF8ygjh5EqKSz GA/sSfgQcahy8uBgEW4seI5Vv2+4uGcPtSZ1fLd/d0E6YT2GmPDTDS8OBHjvc1lFaq9gmbnVmke kKJekS1b X-Proofpoint-ORIG-GUID: v8lNJ9dmiY6wfj-r_bl8yxoiuJQFGOwP X-Authority-Analysis: v=2.4 cv=HM7DFptv c=1 sm=1 tr=0 ts=68d15232 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=w06kbW2hXDg5FjFnD0gA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-GUID: v8lNJ9dmiY6wfj-r_bl8yxoiuJQFGOwP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 impostorscore=0 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509220076 From: Elliot Berman Add support for SYSTEM_RESET2 vendor-specific resets in lemans-ride as reboot-modes. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Reviewed-by: Konrad Dybcio Signed-off-by: Elliot Berman Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi | 7 +++++++ arch/arm64/boot/dts/qcom/lemans.dtsi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi b/arch/arm64/= boot/dts/qcom/lemans-ride-common.dtsi index c69aa2f41ce29f9f841cc6e6651a8efc38690e19..41ba0f4d437727cfe0c51e3d355= 427f37dce7f46 100644 --- a/arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi +++ b/arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi @@ -722,6 +722,13 @@ &pmm8654au_3_gpios { "GNSS_BOOT_MODE"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x10001 0x2>; + mode-edl =3D <0 0x1>; + }; +}; + &qupv3_id_1 { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/lemans.dtsi b/arch/arm64/boot/dts/qco= m/lemans.dtsi index 48f753002fc459a3e9fac0c0e98cbec6013fea0f..586ce54a374d5b3aa9d87a67347= 1a5a25410a9f6 100644 --- a/arch/arm64/boot/dts/qcom/lemans.dtsi +++ b/arch/arm64/boot/dts/qcom/lemans.dtsi @@ -622,7 +622,7 @@ pmu { interrupts =3D ; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 E10FF30FF29 for ; Mon, 22 Sep 2025 13:42:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548546; cv=none; b=Ogb2bA9wgWlyGXXCE4qtrmiUP9RsI/+vF/C9IheY7ul01PD5JRcfbsS9VwH55qWdA89mO/6yZPDyeTQMo2zv7XINofD2DPcTnt/2ox3zzgvHDCq4snpEqpHcwJYM6pZgo+t19aS6No8unggMXAOfS60bvEePOnQwbepCzz9YoW4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548546; c=relaxed/simple; bh=1jBpq+iZuKpAQm2NP3JS82veq+AIv0X5C7ExNAj56cU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tz5d81cvyJUyXARPwapM6w59PEwsmA4raGY7kxEOIRCC7jX3Q8/mve8125ozGIFKGja9O13L+HZY36lunM+H274ba3DUhnIsM/bYEfkCMRmZaKXyZRfIWA8brHDuIhaR8DJWGY6LLdsLz3bedKko66hAiHwC2U9VTkCvm65c/xE= 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=OqFk9OyQ; arc=none smtp.client-ip=205.220.180.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="OqFk9OyQ" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M8ni2n032343 for ; Mon, 22 Sep 2025 13:42:23 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= aaEbjaznfRKEBXAo6DFolWZjwipbscJpuOwEOXljFb8=; b=OqFk9OyQD0bojcrD 6CGV3Hmzs4zqpcpHvCAhRiiLafSENQFuOxR+rV3JrKvWvMBzpauFacz9A1ZcXkSe qfknBiEnEzoc+4Uf40SCTH3QgfT1ytxDAuBiJaXIrzxlWpWVzEwVzfdf5J/A/86E I1jUbjUsuTbqAgDM+hFWa0r5+0cNwP+1IpFzNVqXfQyC2B9o/JLaRdLAhWaZ/v4+ 6SRAjGYgLuEh15shauDEKmNAdP87bvNxQvgIcEWLxks7+sWruwVpkcmyrugwg33L sHUgd6xxi2xv/S1WB3ZfY0y4aSND8+/uj6rUht5q6GGNI7AMAWkQaQas1bOQrV3x z83BRQ== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 499mn7cwsj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:42:23 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-b5531279991so3362023a12.3 for ; Mon, 22 Sep 2025 06:42:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548542; x=1759153342; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aaEbjaznfRKEBXAo6DFolWZjwipbscJpuOwEOXljFb8=; b=cRKPfbX0LQFXtgZsgTCSALahnOq5FhXxP35K8uiO2uWGKEE5Ldo+CaabQVBfz1z3B7 F6HuiPEVffTqRnT5Cfg8Z0X9v/4ZMkBQJmI6z+u08xBRh2rnEC2ST1iPa3mFSmbCsbbu ymWRbNDJG4vTD838ZgV8V47WB0rLl6c8KNDe1YjBY9whEhUk6S/baZ4EXvcY3nOuNa6y kmulOTLgZ70cH2RHYeqxiR7ezRyRupp3ZbxpCnXAemBWq00GZvL5tVKTttbgaJE3+ZWr xkufkVv6R4BynuNLmX/8fq/H3C8j00IS+Zrmz+dyWTtAYkjCiQAMjDlzXxjfKOjMYesd MxMA== X-Forwarded-Encrypted: i=1; AJvYcCUyKtLnQ4hNQEpOkwWjIvYdXV7PVjA5N/Z+eqNpkfrskgoDnGU9/+7mvFcmbMx9bUrZLpHFb3lLc2AwBI4=@vger.kernel.org X-Gm-Message-State: AOJu0YwzyHnlR9eyCy6qX63KBW/ciLAWfiq7Le9lUoOicdpfDPAzUe9u lKzQX+0Vy+cXCy2u6YmdNTpRwd4iIRpYBehxi5zMUNC8UYX6dweaPySRvljr5robb03hOLVuw35 FYuuKKJCP5PZ6W2+dcLCm/utIEqro/ArcVwrTplP8X62HuwxL3tfkEZtFm88jmIRqdbg= X-Gm-Gg: ASbGnctHtJSRelhhgJjGt/YZWSfba8sEaNx/v2T3EvMgaoOTaDqHCoRLq1Gu/qqCp2h +7u3PlrP/sstV/EUFTvdJw5kxaEl3GF8nvdZMCgEMYNnaJEySy76gS4A3Ahk54qIDPYE/hvG02I sWCee1IIuKUhoq3KPtXDrXtsWjmDGO+JGNCa0R3mRo7crUbhNp0S0YO3ffRMn3y5MByc9UGgvHX RPykqimK7mj6yxHY3dUmM3DL7bxtuutIxN56Mfeh/GE5ECMny8f9GX6d4dSLy1tm/73HXqIldLR MNDHI5n++c8gTsR5lvVcow9KaevPuZvNAJBjN72SW7x8oHr9fprw6CqJERFnuc2MC/no80Of73A F X-Received: by 2002:a17:903:40c5:b0:24c:cb60:f6f0 with SMTP id d9443c01a7336-269ba5892b3mr158901235ad.58.1758548542353; Mon, 22 Sep 2025 06:42:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYaq8oly26Ao9AwkHXBiB7SkRKPK/ArZ104vPbq6lanvIWpYVCmWpjrPeli8srR+MQ0I6aZg== X-Received: by 2002:a17:903:40c5:b0:24c:cb60:f6f0 with SMTP id d9443c01a7336-269ba5892b3mr158900825ad.58.1758548541893; Mon, 22 Sep 2025 06:42:21 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:42:20 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:21 +0530 Subject: [PATCH v15 11/14] arm64: dts: qcom: lemans-evk: Add PSCI SYSTEM_RESET2 types 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-11-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=994; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=1jBpq+iZuKpAQm2NP3JS82veq+AIv0X5C7ExNAj56cU=; b=mqVVIESE4qG7LRS83vpCr3o4bWFn4SxgH4lxwuXGeOaww6B7yxmQGhmpCOj8eRJuKPkyfTyrK /NYlyvyI69bBCqQIJAx+wnZ+vdGIO/1FYRx9IKisQTRrT+MovMwe/xf X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAzMyBTYWx0ZWRfXx7NoP3COCobs m1u3OeCKzE57B4AgkXhqZd6wQ954mfPW8dBqoOrwQTMJqldCY4v4bjjruGl3lj3YlEC8KNA3suh qdJtdwlnLDz4Ha+VXfoLTeO/y8tvKDh2d0cImozxVhiVND+IoL5bS6MBtqvnSEY3J6ZoSqIc5bT qIOiHy1sNjig84hATXiC6QU0EexD+5r8+/SoD5qyNVgF8YkDYJGwmh2eAksVA1xisZFOf+rVt+/ sAsQGwk44LOophaRTwLq3FyUBt0sgk6vUQIbaATVB2COeS08B8dgXylALFMTi/2WOBJLYGj13rN Q+i9Q20k7+ByCdcNLWApzKZQFMigFXALp/Tstc2mJy1GPNcoMlDJ4NpyZ61EgQdODLjn2DvGtRZ YXUEfXrJ X-Proofpoint-GUID: esAz5h0r5L3N6LIFJ90xBaWHjgEzH111 X-Proofpoint-ORIG-GUID: esAz5h0r5L3N6LIFJ90xBaWHjgEzH111 X-Authority-Analysis: v=2.4 cv=EZrIQOmC c=1 sm=1 tr=0 ts=68d1523f cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=JGo1Z14By4IpQyqbhUIA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 phishscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200033 Add support for SYSTEM_RESET2 vendor-specific resets in lemans-evk as reboot-modes. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- arch/arm64/boot/dts/qcom/lemans-evk.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/lemans-evk.dts b/arch/arm64/boot/dts/= qcom/lemans-evk.dts index c7dc9b8f445787a87ba4869bb426f70f14c1dc9f..09460441888a7011ff613c4fe9f= a4b6872e12172 100644 --- a/arch/arm64/boot/dts/qcom/lemans-evk.dts +++ b/arch/arm64/boot/dts/qcom/lemans-evk.dts @@ -587,6 +587,13 @@ &pcie1_phy { status =3D "okay"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x10001 0x2>; + mode-edl =3D <0 0x1>; + }; +}; + &qupv3_id_0 { status =3D "okay"; }; --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 7BAFC30EF83 for ; Mon, 22 Sep 2025 13:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548558; cv=none; b=jJnAsEcFll0fJ6E3zy7PwtgcyAtac+TSKlKxLQZPiVd+uytyK8jCoFudxoahMrWOz6R/ZObsfBXTIa4XgPfEJMS1z7jnFH+u7vr9plYe7Lg3+aKLQ2xBgAYta8zJbRrKSXNJ8IDB1X9tGPmVOthmLqN+3VGNyDqe3IU7dTk7TFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548558; c=relaxed/simple; bh=wHkUdDS5bnjeIQ7bWY0wwHjrewyVMryPfMFT2XspY7w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JQ6gMTSO7ffpqJvp2fOtO4ZskeCop1dpqS9nCL3XWN54rlo9x9UuumUhK7KDTVXmE0HtdOJkMooyQqFkCGDxPQ99epLNbnIJ1cA+MGAtQLQDp1mg4RFqMmoeoOslXl9yrv1M2OylUmrg382yLm+SSKZjjfiobPqlrFsHGXM43gE= 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=YbgjbRoI; arc=none smtp.client-ip=205.220.180.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="YbgjbRoI" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M9FiiS005264 for ; Mon, 22 Sep 2025 13:42:35 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= 6FYXv947f4qPhFNPoWzY/DvCzODELrD0LuRjCAh5+0k=; b=YbgjbRoIqEyI/mOL GKrXdXBOINtnbNJ7xeXsPg3gIBkGvUlHOisSX/O5d6fp7ZePBEsDCsOIw4iG6cFC ZbDHhf8QHmqPhbY0H0xetHBF5czMShLIZX3vG8r42vYjC2obgE9Ta71+vXZ0d87E wQHb2rbW+1am0fDiVH8tVJ8h76ljLtnYnZPNnXsH529fpgqRK8M612u8xIaYjiuh 6ujhciW4MFKFxhbj36H6t8xPLB6wCkrya9a+NIW6DYCPsFssiThER/ySCXrFFJ9T FIxh8WVhcxJCUpQF1CuCZVVyeOeL0C2PhBzVSbD8abjTq94aJGJqZ5Re0Q86++7k I3Q2wA== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 499hmnn6fw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:42:35 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-b54a30515cfso4076386a12.1 for ; Mon, 22 Sep 2025 06:42:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548554; x=1759153354; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6FYXv947f4qPhFNPoWzY/DvCzODELrD0LuRjCAh5+0k=; b=K7p8kf4A1/y6Rgf7BprQTYLCJvQ0feAcUH/COonWGRk1foh9J99JmfEQoDrA9AziP1 /cvzsTtzo3Tq0QZyAknatf6ZKs08wQXOhd8lx6N+/9VsZxjL/5tTXyHATZwbbFtWhz1D eaav6RHTggI7ZT72JFE0jWCgSxx+28wWndCPeBr7gdeuX8rW63L3Cp6mMR1X59SxkHRK 0qMqLH7jUWTMoI5RAatFrIJ1hPrgOBN8bkbTj6jmSlJs8BXoo11qQk8o7cAeV+3wMmGC /nIx+uQkJk0pe0D3LJ504wvlb2IBdPnO0Ps5qfG3q0leeC5XrEVPNTPqH+mrauXiqwG0 aWhw== X-Forwarded-Encrypted: i=1; AJvYcCU7HPd8pT7UFXom73EGQVs0fCY1Q2l2HbZ3bSKEJwIVOKSe+UGXkZGTAhAVdkMXn4wAdYAHmn9Fc0X93Tc=@vger.kernel.org X-Gm-Message-State: AOJu0YzCgAjr+LRvxVTMObpxFrfZ0GU0VcRE8T1jFHGlKTKI2habHWn8 0wbOJJ1RqID5zOf/9ww0i/4qpedzWqDPgZyvt08vSQTyEIRkckBiwjUaiZ/MEO3eQJPNp96WfJb IVXj70AXeMvjSnIEwga23vQRmkzzqzaasSnNDtoJKAPWzHjG478SWSUZR6Z6WxqAOMh4= X-Gm-Gg: ASbGncvtg7Z6spk8XNljGIbsAznHf4441CgZKUvmi27V9gbT9Yf7IoDlfjyIi9NR2OE qqCF+hqPOdwJYSSTaaqCeZcxXBMKLVMws4T4jSXPRlkMffHc1zX56amxkxqPQEwGfyyAV1AZS4H B7QNVcPT0DWs2swDZ4uRLOtScvVdTTWgtwRu3TUKDeEIukpuOjfVK+JFVcliNZfdedW4dFqX7Bq nqw4SznlRnkfp5QbdPvWZoTlpJY6Y47iiLOusbXQVU6zt57EPmj3Flb99+P6nTPs+bpEMH5LU12 qgZt7WaHAE4JF1O68ENFm/O5wYftc6Vv45fvjbvuIsfw1Uw0JZddYf+4x4qKDM0ShTRaVgI34Bi F X-Received: by 2002:a17:902:74cc:b0:265:62b6:c51a with SMTP id d9443c01a7336-2697d795331mr139723415ad.23.1758548553896; Mon, 22 Sep 2025 06:42:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETbdwlhVXEjM7yM22/JEEvIiUoy202zLd+b4eWbRtUU2DHlwKHc8Op5CjIiXXHqrVv39UJmQ== X-Received: by 2002:a17:902:74cc:b0:265:62b6:c51a with SMTP id d9443c01a7336-2697d795331mr139723005ad.23.1758548553434; Mon, 22 Sep 2025 06:42:33 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:42:33 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:22 +0530 Subject: [PATCH v15 12/14] arm64: dts: qcom: qcs8300-ride: Add PSCI SYSTEM_RESET2 types 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-12-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=1518; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=wHkUdDS5bnjeIQ7bWY0wwHjrewyVMryPfMFT2XspY7w=; b=TCxpE50gt1pXJWJLnvp2Xo5vGtRfCb5g6AIRIIKP0dcKGqc/CJoCvd8l4Qh1JixBDFnugZCHt zRlWDkiodHmCXFvnxFbQqcB6EyEzV5K9RPrJ6BsZ68yVSoue50/SEZK X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=YPqfyQGx c=1 sm=1 tr=0 ts=68d1524b cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=tC4jzodRyx6YAeo6W6AA:9 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-ORIG-GUID: iPNcl02PE6y1Si4wLuF1VTACABUA_iaR X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAwMCBTYWx0ZWRfX6qA3rIOEJBHw qUm3OlFLlzl0SM3VeXUUao/QWsW+w4qts6KkBKuz3sXbUwMcPvdJImybNbhgdID1yjeXhoXER+6 Pbt9OtVkxt6g6sdmMShKAiU1v28d79N6QxcburbhRURGe2Sf+XXdb0Ok4QOvvYAJcWvu/LWTZZH D9UmSAtX/k9WjA9CjiEIhqq5ZB9lZlfeu5tqIrTHgGWgWCwJy0bPgeoQMHt4u09mCFIr/45cZmf XZcuaJyeZEEfA8R1reWa87AYJDzgfBG3K++94890if+u3EU7m/KDamSlTnNA8gGLcP31Moe1AHI AJSTBsiYRM7CkebrgxyvTUb6zXNZ6Ze54B9ojyf5s/U54m8CC7Mc9t8PplX0VniDJRrzYGsEr/H 0AbHLtEj X-Proofpoint-GUID: iPNcl02PE6y1Si4wLuF1VTACABUA_iaR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 phishscore=0 adultscore=0 clxscore=1015 impostorscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200000 Add support for SYSTEM_RESET2 vendor-specific resets in qcs8300-ride as reboot-modes. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- arch/arm64/boot/dts/qcom/qcs8300-ride.dts | 7 +++++++ arch/arm64/boot/dts/qcom/qcs8300.dtsi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/qcs8300-ride.dts b/arch/arm64/boot/dt= s/qcom/qcs8300-ride.dts index f8ed510477cf2d23c6bd1bb042abe46b45ad35e4..dc36296d2c1ac7731d9e741099a= 2cc0115f584f0 100644 --- a/arch/arm64/boot/dts/qcom/qcs8300-ride.dts +++ b/arch/arm64/boot/dts/qcom/qcs8300-ride.dts @@ -309,6 +309,13 @@ &iris { status =3D "okay"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x10001 0x2>; + mode-edl =3D <0 0x1>; + }; +}; + &qupv3_id_0 { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/qcs8300.dtsi b/arch/arm64/boot/dts/qc= om/qcs8300.dtsi index d35bfece60d1afa5205d71c3b1b621dce49c805e..7d256c2f9a9a430d076000ddf22= f8a56f074071e 100644 --- a/arch/arm64/boot/dts/qcom/qcs8300.dtsi +++ b/arch/arm64/boot/dts/qcom/qcs8300.dtsi @@ -663,7 +663,7 @@ pmu-a78 { interrupts =3D ; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 ED06230FF3C for ; Mon, 22 Sep 2025 13:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548569; cv=none; b=V+xMW1yA/UfkUx8CHQ+aRNbPkgL5Xlv+u854ylyOvXSXdnfOQL/zmXcRGYYGf54wKHBnczjbo6HsFoFf67iDXubOu1cZExRZjVwzKPm+jj0WsT+hy/jG0qrEOUlkpDMQZ6MUiuQvVVT2H+9ZX74TdEiE+h86TdbtCiXOn/GkZoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548569; c=relaxed/simple; bh=G1BondNwxII71bYVJuYm74JpYy3/CGfYOQJXMu36Xxo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cF724jXL6ie54GGG4Ty9hm163e3+QavoBMoqF+o2Pr1gKea0qcHsaRou5ZiFuT+GuZgIQq3Wbp/hOlXXUOIx7lGStyvb1D+emMd3v7YGcbUQireoLAUUnYB11exHmM4VeY6qJRL3ZLaP+7hHGnU3lOdHVf3TUaBwhrgrMUzKMiE= 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=ocyQqhIG; arc=none smtp.client-ip=205.220.180.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="ocyQqhIG" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M9BB5v029230 for ; Mon, 22 Sep 2025 13:42:47 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= xF282k7wXJ8WorsAqXbmD2TyrPkO+b2YocYCnInlnJU=; b=ocyQqhIG0/1m1nDQ Hylchoree55eYm72IHN2c8uwGfh65nZrwX5yMJ4flc2+MTHgXWUr2odlZqg+9uPN Q/JVDml5KIcNoxnAWjV8US/WqeXW1JtDruNb+9HBB5PraW/R+5A0/IJOkA3xtxtj dQf8yjqYJwhoRdPttHHE/WdoCur9htpr46Pk0a+DtBVqPl3/ZzXx7vfahW0xP9tm 3W23sTKkLBp4LS+dLpEz3bq0+JROFcYv2kpBy172i4qKRvAWyAjzUXQwUzHLGPnS 1y5v6P3E4Eo+przOQ5OUh/fYnPk5B65Aqf6RSkWu2xvo1UTUjwnSiTNkhU76qcsY irfx+Q== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49b3kk0rvc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:42:46 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-76e2eb787f2so4378077b3a.3 for ; Mon, 22 Sep 2025 06:42:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548565; x=1759153365; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xF282k7wXJ8WorsAqXbmD2TyrPkO+b2YocYCnInlnJU=; b=DZot+DGKYzRYXARXJGJPzV47LuGkyqdYGyBXX3Aw/UI1iTA8ZsYehITnvDgxxQrug1 Ibj2KupAg+XkSC8y+kpJ8Pz0OUYxTwpTFyta4FLha0n/iKxd9NR1VL5ImHkJ56MCP4gv vOSZgtjXA1kC+D1u+NVxXwqeF2MaodmNCgYPjY+wv3UGeGTWmGtBUI7u0dTaZkLGmZjE j4Y0Wlm5+GvUXG2CImRqoUWwzVBeNDhcFB/RQFLknJPMZ0FUBQy+0GLvKr4dWJZmKQ/a u1qA1l7gu5GaAas0rIyeiznn5Y9jWA17DbjDviZQUeoKmEH2upBpIgftBL+zOvte+tE2 o/Vg== X-Forwarded-Encrypted: i=1; AJvYcCWi/SXmrD4B1GmyH1GgMMqNYLLcMFKW/f3+DBlACwKPLQUkFKvry3TN3cn5VuOiahDGnXdL7AsbXAJWXW8=@vger.kernel.org X-Gm-Message-State: AOJu0Yyr5mIcCEz6NkGaysCeo1S7ZEatXdY1GT6//14WO8d3ty5OS7hL /09Yk/qTJfny+hUvdgYJhyUUNcqeRbiMZPtfmAHGIm6ID2oag6m+EnbXuSMdDXhAfJWzev8Nhn8 akhg0/o3HXBAC7pt6OoRlyJkTeoz5D/MZVa+wFqtuUhGVASvrSH9L/QAeVppfdJZWF5g= X-Gm-Gg: ASbGncsjiiQFUtpnvk1ZpTgAvwQzoUO3hYJbvuf7UvAbAeHDwRSxb/n+YQi+MIyIM6g hoNwh22fasPxz2+GuNlvuudoEunHbtQ5tF7GFz6ND8N5wUbRGPwGmj5jChG8iimJSHYPlprXrd+ 4OxYLQrjIkg1YAqk9Sb+Zw94yk4MRg6Aats8WZKysv+wAFCqLdgLxXCP5YmnIVJiWqyfP7Dd1k9 R+X4fp6st43WXA7Ya0vKKU3gZf0/IvvCIaBCNNeZffdNzK2Dxtf0uy1ZSkNVEVTe1w1GXrJLyRZ q2ioXJdIPK2/FxfSoDOBNDtOL9rgP02mk3V6NRczuXQuI1wNOrr/wLaZywGB87P9bWoRWb9s8BV 9 X-Received: by 2002:a17:903:3d8c:b0:24b:25f:5f81 with SMTP id d9443c01a7336-269ba439f8amr124646185ad.17.1758548565375; Mon, 22 Sep 2025 06:42:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4mN40qVZSWz0W9D0CtJAtXceZAK1xhkSEtmJIUXhTWTfJcTx6aXvqIGkYbWG9m156mJ0Avg== X-Received: by 2002:a17:903:3d8c:b0:24b:25f:5f81 with SMTP id d9443c01a7336-269ba439f8amr124645855ad.17.1758548564829; Mon, 22 Sep 2025 06:42:44 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:42:44 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:23 +0530 Subject: [PATCH v15 13/14] arm64: dts: qcom: monaco-evk: Add PSCI SYSTEM_RESET2 types 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-13-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=989; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=G1BondNwxII71bYVJuYm74JpYy3/CGfYOQJXMu36Xxo=; b=LFc5Z6nf29wlIhd1CXRGQpvPgzUhQTtOP/larFAQIWR/CtquNgknXkMHf4pmi6tx/hW8PRMHX 9bMGBVHYvneCjK/DFOFTeh3uB3CKgW8rGGV9kNEjFI+kuUQADQz7Q0w X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-GUID: 8f1qYFge4ZZlB37gKF3sbdcZi2-ksReM X-Proofpoint-ORIG-GUID: 8f1qYFge4ZZlB37gKF3sbdcZi2-ksReM X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIyMDA4OSBTYWx0ZWRfX3ULwMLOp0Dfv NT20seDYHlsSQuIv7AdyiDN6oMxvNQPSxYyN3qBRSPcnIqh522WSbb0Q1n1W3Qvup1j3bn5BMWf imkBt+AcpfyQ9PKZEITsaX3hHVy32HwvIpBPo2iBNQKfwyvvVfZo8skeTz0kJbozWFyXUx4eQcn IzS4hFS9SV2L1vBu3A1jdp1YxQH/IiW7T7lLbQoqC8mbuJnPalxhio/EQg/OTY0mcmFzJA0uudr AZalPlKSlA0Qbtj5LK997VZ79GkETawsmGCx4ZV0v/N4m54NMb2VIwPX+Ogh4t9Q84sNS3ZSbie JMWVwOhq+o4sQ8FjBJkA3Gi8GY8U78LA9KHsB3iA5fwRKZRJko0VKt2bboC55GofxVOmHQkDDdr Eg1b/cqf X-Authority-Analysis: v=2.4 cv=BabY0qt2 c=1 sm=1 tr=0 ts=68d15256 cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=EUspDBNiAAAA:8 a=JGo1Z14By4IpQyqbhUIA:9 a=QEXdDO2ut3YA:10 a=IoOABgeZipijB_acs4fv:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 phishscore=0 bulkscore=0 priorityscore=1501 adultscore=0 malwarescore=0 spamscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509220089 Add support for SYSTEM_RESET2 vendor-specific resets in monaco-evk as reboot-modes. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- arch/arm64/boot/dts/qcom/monaco-evk.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/monaco-evk.dts b/arch/arm64/boot/dts/= qcom/monaco-evk.dts index 116378d4ce7af4c4b37f5f818fd65c693bfa88db..fddaa8e3fc34fb26796375eda3a= 6eeb6dfd777ba 100644 --- a/arch/arm64/boot/dts/qcom/monaco-evk.dts +++ b/arch/arm64/boot/dts/qcom/monaco-evk.dts @@ -392,6 +392,13 @@ &iris { status =3D "okay"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x10001 0x2>; + mode-edl =3D <0 0x1>; + }; +}; + &qupv3_id_0 { status =3D "okay"; }; --=20 2.34.1 From nobody Thu Oct 2 05:08:10 2025 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 E58D330E0E6 for ; Mon, 22 Sep 2025 13:42:58 +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=1758548580; cv=none; b=PYHGpB2DQfBruQiP4nO1iDzBzxw55EPxAbrHdkB8pjBd+6SjSFwfeuuEfBO478tGgIPs+6sp0BYpCtyQ524mpUc0FScqGDx1B/7A3FduwV8a3dUt2WuH5d0tTx+Z0l2hJU+69TeUPn7c7vcNtRu4Uu8sAVe969uI7kP3Jve3SwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758548580; c=relaxed/simple; bh=q1pRzkuBh9GAg1JcwXGzO3FL3XRWgrlscAgQj90ENvE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f+jPSEBAGVRgvWZ3j4tbSkIK3rD4roxoha2Ej8iEp9DDWa0sAE2m9ohhq3ZosR2HskqxSAERhfvEOTkooeIx7D4diHXbK5MJ9U+4eEwKPQuqKfU0yfFW90WkwGSt91jfDdQhqN6Z+ALqiyVe42qOVkJNFkbpwYKUFBxU+Hb0EyY= 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=LH/XyQ6q; 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="LH/XyQ6q" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58M8x4aA010501 for ; Mon, 22 Sep 2025 13:42:58 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= gBo9gZrkew51yYf4IHpWDN66o41yYqQF87bJGWuNb/k=; b=LH/XyQ6q7GwQT1yQ WeHim8j9V2ZZjHoy2fZAe5Cx+ZEnl/rPdzHLyUaOvT3k/A9g7uRGjHrqPbYbrsFb LZh1puTfpkEzzxQKeVJSQ+hHt00Sc9g6Xfs4/wVvtBC7zaf3Rg/UDD1rDeLVKhci vJU2/gQBswsLjgqVpUXNKn/mcbZjgFA7Ov2omFTf0PLnoJhuA4I8/SkkFRCuVv7g m1ot2UQXTe2Tab111v9dE9FUCleOGeZ1HIAYJZKvl+2KGEJmdIBrDTUUmSGmVvUf Qe28XLX2PcKw163ImR7620Bwqzhr3YnuIc1mgD+91TCwSrepoJF8ANUbstT2IFhL 1JReNw== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 499hyen6ch-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 22 Sep 2025 13:42:58 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-b549a25ade1so5954155a12.3 for ; Mon, 22 Sep 2025 06:42:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758548577; x=1759153377; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gBo9gZrkew51yYf4IHpWDN66o41yYqQF87bJGWuNb/k=; b=OMYAWvNVtUZpwf3umTskF0oFC7wiO2KUqYV6UO0uhlBe6hIYNsWZlbzoOfy0BxWSU4 GZn5y+6os7+wgO6Vj78UMk/LNyr43ziMaapUqaan4Ov3xpjqwSi4eIgh4xFHUh0GYuGb VtT1qD3bM2nUb7y10WmBTEJ6XSskImFXJze0JE/ubG3DiLAJxo54bGC1XhgjCaykiWek XMNSsFCBwKOkV8lxJg2pmVR9BLkN1BeCk/MMHZyBmx3Mxsa5YuUPONiMPxTgRConV3xU +aD2cdWfXz3txIsa8PD1DW/g/SJCr59jB6482A7+OLBkB12TSOUGI2R2NXgLIG9cW89Y z9kA== X-Forwarded-Encrypted: i=1; AJvYcCX0NrBnluC3vwadfBVMNY5gP+Akz3XABgULFSJ/HZR3QIaveFL7PhIMcHAzV/aD/TGcV9NWC5XJY7IYjGk=@vger.kernel.org X-Gm-Message-State: AOJu0YzRFxXhE3/VnPFo4YSswQmu9zjaT++Z29soQJUjJMvrxPy8jTnW 582icZSVRbiikvDsY/+gsVagrJt4TACTzOFPcXElzJE8SYxQYoXJiUetmcTetmZULjVLAKAmH0H lM4xNF5C9BRJ4lf7StjrIC6MjWgigtRazFa8yZ0HDfvpaTI3Qx8dmiTBRMf5POHSf1pE= X-Gm-Gg: ASbGncvmvL/FcgQPRHSohAM5DJP4OS/kHMTv3yoEPLUN5ZPNIsTizMnRGOZqUi0IUzB zPEN1ExLo/FFo/75JGeEArm6dT048mR27iPZHnYeaTyrdvqBtZEZeF19KnNdXv1D9p6HUOtFUuG BUY6hIf6p4lSfQBD17O99uCofqxBAsFKN1TwPiH8/aGFUn6JcXzfYbSL4VmWox0aQZqXI+4+O/V AUHrLntiQcMlCrqCrSuQZe1Xp4b2NwCPzYwOzm2siTn4Hv4no16Tohs/SKQ8r2/h8zzJyNL5YeB N8WbZpvW1ApY3AVu/D90aPx5Md/MAo8A0gywgEO3Tv+N/QuRnB+ugy/sMJeWEXtc7F1UTyeLNrJ V X-Received: by 2002:a17:902:8c8e:b0:267:bd8d:19e with SMTP id d9443c01a7336-269ba45a535mr124622555ad.22.1758548577164; Mon, 22 Sep 2025 06:42:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9BBG97Vpj3NlcI1yrqR60H0FcR5ZfUsHTr+DhIzuL5+cXzftJ2Gp38ot3VHtbSZDVJiXbZQ== X-Received: by 2002:a17:902:8c8e:b0:267:bd8d:19e with SMTP id d9443c01a7336-269ba45a535mr124621615ad.22.1758548576412; Mon, 22 Sep 2025 06:42:56 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2698016c13asm134246755ad.46.2025.09.22.06.42.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 06:42:56 -0700 (PDT) From: Shivendra Pratap Date: Mon, 22 Sep 2025 19:10:24 +0530 Subject: [PATCH v15 14/14] arm64: dts: qcom: qcs615-ride: Add PSCI SYSTEM_RESET2 types 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: <20250922-arm-psci-system_reset2-vendor-reboots-v15-14-7ce3a08878f1@oss.qualcomm.com> References: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> In-Reply-To: <20250922-arm-psci-system_reset2-vendor-reboots-v15-0-7ce3a08878f1@oss.qualcomm.com> To: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Shivendra Pratap , Srinivas Kandagatla , Song Xue X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758548419; l=1528; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=st897fJ7jTPYQ5eppZ6+OrlCOSPDdAnpzJ0eoXTLNbM=; b=dx2gCn3WRde0MdcHSdLFfQA96teEFnP5jmCVlplECfz+ZgOkk7Vh9CTblgMabl/rAcdZv7g+T im3TWdSIkojClaPhaSQhYBwkef0ZZR4dKCb5SzLOTZbseQpb9mhDVAz X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-GUID: -ZCPI83d3J8vAmJ_vQNuCNf_fwuW3EMB X-Authority-Analysis: v=2.4 cv=YMOfyQGx c=1 sm=1 tr=0 ts=68d15262 cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=pkXgoPqwvIc8jTsVjBcA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAwNCBTYWx0ZWRfX+vQU3aLcEwOY 2S04X2YsMgTQTZfp3TX6Tulxr0RA64BbKcDbh25kHkqt44MZjyKe/2p0PihlyKcLtC/kmlpg4J3 mq6QpFSffV/OsssspBz7vRB6bQzx7cux7cNoJ3KvbNuophC9nxm6V7SllKQh5qnW9h+X33AbYQK xgVONFPUiCJI7GEpQKgge1hsAhVDKptGT299FejkEzcDMatyQnShpRu3OnoYSat2iqAOt4nXS6g UGPZLIuhWOO1DG/kuVeb65Gd0xeDSryAhM0eJ0ZGmPg+9wjaUdSq2IV8jRYxxQP02xu5nphhk+P HVuQgez5Q3JpEypAKBpjooQUQiIhsZYSHzPy+E5UCtMddQkd9LbZszrWNc+bdYodoSID8ZXZMtl lXRbjBK0 X-Proofpoint-ORIG-GUID: -ZCPI83d3J8vAmJ_vQNuCNf_fwuW3EMB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-22_01,2025-09-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 adultscore=0 priorityscore=1501 spamscore=0 clxscore=1015 suspectscore=0 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200004 From: Song Xue Add support for SYSTEM_RESET2 vendor-specific resets in qcs615-ride as reboot-modes. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Signed-off-by: Song Xue Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli # On ARCH_BRCMS= TB Tested-by: Kathiravan Thirumoorthy # IPQ5424-RDP466 --- arch/arm64/boot/dts/qcom/qcs615-ride.dts | 7 +++++++ arch/arm64/boot/dts/qcom/sm6150.dtsi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/qcs615-ride.dts b/arch/arm64/boot/dts= /qcom/qcs615-ride.dts index 705ea71b07a10aea82b5789e8ab9f757683f678a..bfb504db43368fe73ff200476ff= 5220334872c8a 100644 --- a/arch/arm64/boot/dts/qcom/qcs615-ride.dts +++ b/arch/arm64/boot/dts/qcom/qcs615-ride.dts @@ -343,6 +343,13 @@ &pon_resin { status =3D "okay"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x10001 0x2>; + mode-edl =3D <0 0x1>; + }; +}; + &qupv3_id_0 { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/sm6150.dtsi b/arch/arm64/boot/dts/qco= m/sm6150.dtsi index 3d2a1cb02b628a5db7ca14bea784429be5a020f9..9df5e94069f604e5393350f5d89= 06097d6d01209 100644 --- a/arch/arm64/boot/dts/qcom/sm6150.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6150.dtsi @@ -416,7 +416,7 @@ opp-128000000 { }; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 --=20 2.34.1