From nobody Mon Oct 6 01:24:27 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 006E4220F5A for ; Sun, 27 Jul 2025 16:25:13 +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=1753633515; cv=none; b=OhJAZOQ774vQOT7k0wu3sDjV8I4u1jDzxr5H+RCHgnCmmkZF2lR7rZCF2+4jKimrc4tggYk53TA8/kEvOZzC5cv8+hx2GFeRWfAtcW+LSPPKzWJbHcAjTS2kPLJo1mSJYNy70wm/SC+rh8ro4xKNC6MTsVWk8Ozknk4h3RnwMro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753633515; c=relaxed/simple; bh=FC7RrRfjKXNVyHBQzF6uwLhcss5N7idT7lbjBm/hwDg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fRiIGuaBAr3LWjS1U23rmNQd+WBvIcYABvIxRy84GQLf9LVwcN396P+eJebHbd4ds/pf1VfC39ph1qVPrn2+4WFHI3w0ve3wNLX09YWIfC3hE/aQlbWIcnkyFqneeai2exvjVnpI0MI+NdHn3zc/9wDA8GiqWB7UoWJLgg2A3zw= 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=Pc3A8fbH; 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="Pc3A8fbH" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56REOHNj019954 for ; Sun, 27 Jul 2025 16:25:12 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= v4YCBWmY0mp9H7MQ3j2gakQJBYTosZxb2APt1bK5h/Q=; b=Pc3A8fbHKs3Uzph6 DOtrmF5OwSYALF4PY5i7D4F9VXczqAzOrGND4qpa31lWhSlECsdAM/Rv4UFEdQ0i PItIVzMOGcrEIvfVFmOaH6NMP1HobYfzXXQ1ND/NB3IBKJhSIlUqY6TA9APIg+Tt e1sTVP0biTCkzmhm7UJZ3sNscRVQP0mN9u4tZburAFKw1BFE7BUi7xcbw6c5A1VA RX8LUHXTMNCktcb+mBTF5LuLW/dF9nwiio3oRhv7tX98JxczkchN69iHw3NzOnQY ZN4w5vyjeIdcPP26WobDOofu4PNgdsS2iG+5STLfwXKwGW+iUlu86bPbW6Ca8HDK LnMiEQ== 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 484p1aach7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 27 Jul 2025 16:25:12 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-23fe984fe57so12533115ad.0 for ; Sun, 27 Jul 2025 09:25:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753633511; x=1754238311; 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=v4YCBWmY0mp9H7MQ3j2gakQJBYTosZxb2APt1bK5h/Q=; b=ITwkYNCSj514BhyevN8I6/mJw2gxId1Y3dq1l7l4S1IYvtkg7A+UXdO09iUzoPh4nN rB4GwG6QNkersyjMGYKfmVQLA8qDdRJTpUZU5iUhvxumbzZC3UUAi4kAGxEaCIMJ9NXf hrE9SuM0O58jAu5Xcb1Y+FSLD78MusxhoE7ZyUXA0evZ+JtGAkZA0SMyfORlwNCS2GxI jMjaKZfUmh/nestoMInQUiQvcVUw7MykPPw3lOC6AIzlqTK7OmWwJvKenak1+gAV8OAB /KA/Zct5c/6O2yMSVPxvEaWSPG9Blul/gg8uQW1OkJeIrvffwBwcFXF7AZMnwZ0Zjx2h 5vlg== X-Forwarded-Encrypted: i=1; AJvYcCWZuhgDgczR1oNcLK9iTcHbQfHuhsmPNdKPpUXq8nE+UAQ4nih6SKV9HAKVxSFQQNyRTo0fd6Jn6kfMJno=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8/M/ZGG5yAK7svHDJL3ed8LL1spb3qSzbbV631aGHRiMvqjSk kc+Lw2ZenjU3QdCr15Nw5hAzgumHyYZOK0dDo25w6SfgMY5q5bCGApAdTh8Mq6T4eq8REEjcXVb 2UZDeOq7StXvzet6pImWuCp5MjctSgrVR+NrocQNf5TwpRNOGVp+zzxMRvFpb3Zk80Cg= X-Gm-Gg: ASbGncuxW2kdfRWsDIDGK8lzUO2sIUNI2CP9IqubuHJ8QsVfw4qf89qd5obXMUNW8Jh ETu2Mg2JX0vY3w2kv7PGfRn+r9lxv6vJzXkxNe7afkVbx8x2JN2K3Qoars9bART1EYl6HVBxhK8 tADw244v9R6EnUDaKqTwaEcBotvZcCt8inwNTlCXtQQAHRTA16OymqyNvZqqh3KWBsOhlIzwEy0 L6lclnZ/qYVtgptxoKOqGtRHD7ycldFhp29uOHR7yraw+53Gh+hg7m5DRRruE1dybOxeIHFfs46 gh796LdkH/OrrWyICK0ApbRlbOLOLm4ci/VhvhLCr3bPq/0HqGw0oENqMmh2KuEYRnvOm+e7dOO A X-Received: by 2002:a17:902:ccc9:b0:240:2eb6:d5cc with SMTP id d9443c01a7336-2402eb6d9e9mr9977065ad.17.1753633511476; Sun, 27 Jul 2025 09:25:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVQHJRnmueFVtjE5Xgx+LUDsaynix8FLVjXOCUqpUqvT52MAlWGQMEYT0tAC2uOxsMT2zpuQ== X-Received: by 2002:a17:902:ccc9:b0:240:2eb6:d5cc with SMTP id d9443c01a7336-2402eb6d9e9mr9976695ad.17.1753633511036; Sun, 27 Jul 2025 09:25:11 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fd9397ebbsm29110325ad.210.2025.07.27.09.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jul 2025 09:25:10 -0700 (PDT) From: Shivendra Pratap Date: Sun, 27 Jul 2025 21:54:44 +0530 Subject: [PATCH v13 01/10] 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: <20250727-arm-psci-system_reset2-vendor-reboots-v13-1-6b8d23315898@oss.qualcomm.com> References: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com> In-Reply-To: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@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 Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , 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=1753633495; l=3679; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=FC7RrRfjKXNVyHBQzF6uwLhcss5N7idT7lbjBm/hwDg=; b=wuM7Ud9mvdBgYMygF1JESinqXl7pH9Sn1j9nV94LYy4tSZEq96eslDnylVV4vStbiMeqYy+l1 Cs6ZBdqK3AwBOUismrxPOsG47QSiHQe0Arf9SH5ULtsQcLsU7g18Y+3 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-ORIG-GUID: ndZvi3G0sJqxshyNBD0vJk-PMXHc_Vuf X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI3MDE0NiBTYWx0ZWRfXyPtXv0D4dpQ6 heMaid6sxtWPp0R7MgWbx3eA6/PIYwbmK8mnr00RjTfOfK+SndSqqxjKH7pomVZ/QNPaNDs1AL8 HwpuhvvF3S4HHYnjkrT/XGvJs85DB3sO2dWLeac0g6Zg3NR3PGqKdKnR6yNwPVF+/MS20FlsMd+ oZaqUsgiKrOxOu1Y5j5XEs4Gg1KMQoJkEKPeYJCLOJja0pbvlLAQBA6AZ18dlxgOoYGiYAARaQA nYa84/TI0I1RBKo66LV4AQyjIfKa8XicT6Sje3Tw4omFm90lPcX/dsdpT8FImaTgTVNW6Lo3f5V WBrKAECTIBeB/87a3sOYWHXvBqBww9hbsbrXkHHgcpXErVX8V004ZPIa9pdB1EmXySGbhf16U2q 1kQQk2NLDjUNBpGnpk8zhh0NiJhXjDDhILIvhOVks9cOWxi7IHUFNe2L46gxjwJ33POjsieF X-Proofpoint-GUID: ndZvi3G0sJqxshyNBD0vJk-PMXHc_Vuf X-Authority-Analysis: v=2.4 cv=KtNN2XWN c=1 sm=1 tr=0 ts=688652e8 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=iWTyA_h5fkyOTIp6uasA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-27_05,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 malwarescore=0 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507270146 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. Signed-off-by: Shivendra Pratap --- drivers/power/reset/reboot-mode.c | 24 ++++++++++++++++++++---- include/linux/reboot-mode.h | 4 ++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index fba53f638da04655e756b5f8b7d2d666d1379535..42bb99128ed3846d4bff62416dc= 31135ddeaeb90 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -29,9 +29,14 @@ 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)) + mutex_lock(&reboot->rb_lock); + list_for_each_entry(info, &reboot->head, list) { + if (!strcmp(info->mode, cmd)) { + mutex_unlock(&reboot->rb_lock); return info->magic; + } + } + mutex_unlock(&reboot->rb_lock); =20 /* try to match again, replacing characters impossible in DT */ if (strscpy(cmd_, cmd, sizeof(cmd_)) =3D=3D -E2BIG) @@ -41,9 +46,14 @@ 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_)) + mutex_lock(&reboot->rb_lock); + list_for_each_entry(info, &reboot->head, list) { + if (!strcmp(info->mode, cmd_)) { + mutex_unlock(&reboot->rb_lock); return info->magic; + } + } + mutex_unlock(&reboot->rb_lock); =20 return 0; } @@ -77,7 +87,9 @@ int reboot_mode_register(struct reboot_mode_driver *reboo= t) int ret; =20 INIT_LIST_HEAD(&reboot->head); + mutex_init(&reboot->rb_lock); =20 + mutex_lock(&reboot->rb_lock); for_each_property_of_node(np, prop) { if (strncmp(prop->name, PREFIX, len)) continue; @@ -113,12 +125,14 @@ int reboot_mode_register(struct reboot_mode_driver *r= eboot) reboot->reboot_notifier.notifier_call =3D reboot_mode_notify; register_reboot_notifier(&reboot->reboot_notifier); =20 + mutex_unlock(&reboot->rb_lock); return 0; =20 error: list_for_each_entry(info, &reboot->head, list) kfree_const(info->mode); =20 + mutex_unlock(&reboot->rb_lock); return ret; } EXPORT_SYMBOL_GPL(reboot_mode_register); @@ -133,8 +147,10 @@ int reboot_mode_unregister(struct reboot_mode_driver *= reboot) =20 unregister_reboot_notifier(&reboot->reboot_notifier); =20 + mutex_lock(&reboot->rb_lock); list_for_each_entry(info, &reboot->head, list) kfree_const(info->mode); + mutex_unlock(&reboot->rb_lock); =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 Mon Oct 6 01:24:27 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 5E38B3987D for ; Sun, 27 Jul 2025 16:25:21 +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=1753633523; cv=none; b=nv/WsDl8t+c9GpL70Y9aMBqllIfFh+ZHSk7GoXq7WE5T6WB6k/iHGX6mNCyyq6uTfzOthvDNU6XF3pOqif75e4xo8IHEthdt8vgbMR/HWm4hdrLYgMUad5Xc4rWyRWBwTB9K9JnBAJK3yAvf2rg9lCPOHvJFtwqYxBhHRJQQ4nQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753633523; c=relaxed/simple; bh=BzWfToJE3ECxETuJZ3k/sBp7q/SRF/jEhj86+u2O1rk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BcqMqJah2e6pObMk+2/LPdW7BWn/QBlrvmzgKBWC00eYB2AMa+4aUeeLu+fKYqNE1z1xEY1JU4G7VLemO0/Tu7Hq6ZUubysdTSfIQLwXUL4wjb3LlUPnB/ySQY9r2kVwqWthTExG2FXUQPRh9S6INuWeY7kpdLbT465aT7cUnkA= 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=J/BytHoo; 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="J/BytHoo" 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 56REO52A018384 for ; Sun, 27 Jul 2025 16:25:20 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= FDqwUezYGa9CZCaFbdXED7PEdoZ055Cwe3xHxx1ns7M=; b=J/BytHoonSw9xSUD 9FUMpWgPz9gK6FghJ2oSve9fB3dXPTaQWoIwi4uo+sq4SZJ8zkLcgZcJqKR2MIZK PMFc0ro77zh19a58xKnV9dWNpschQe5SynxvLExHlGci9PSPGhUhXlKdAonkUYwL cY1ZxMD2u24cA6asaUYxmijyNP0xbxl0ag4KDzhGREZRnwGyAbumFG3Oi0myZGJL +jV1aJlVeBkS3rEFK6ZiPQHk62sqlRXrVkz3ZaqZ4uEI4XAYtfiJc/DN9x4evNpe OBp5kPanJl9IgAUz30YYYOUj4YvA7rxOmj34vIEEyix2utgUcT8HT1g7Rvm/nfVJ +KWMlA== 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 484q3xjasj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 27 Jul 2025 16:25:20 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2356ce55d33so59429175ad.0 for ; Sun, 27 Jul 2025 09:25:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753633519; x=1754238319; 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=FDqwUezYGa9CZCaFbdXED7PEdoZ055Cwe3xHxx1ns7M=; b=cqQ1vV+4N4zydhJ6zUo5h0MCRt3ic/w70RYeQ/BTP3ACmzZ3bG4kP8FXWRsNcyhJhL Hy3G4R52X3mwhO0GsLjFJ88mbnT3d3wonOOrYU2+wQm8/iR88eWrGoMMKoG5QU0Ec1jz lKjM5LzqtHqCGLzZ3sB5tFx5gJ2yAS4m4YRTO25nZrpGDMUVTuQ08FMC6/ELwy8QTyHi mTPo/jhmpWf8+yim4LWibGVMjo8bouFE3Hra40J3zst3th8BiKbm+0MAYuUpmhQjbX0n GEngC1ewcXfnWCV6Ds3uOuvk7FewUW9TOmHNNseMGUcJ7Q8s2LUlSNkmq5Sls8D0YQA1 Vvyw== X-Forwarded-Encrypted: i=1; AJvYcCUSShyogWQPwxnf3jjIsQmFusyPe/vM2AE4Z30q/zn18AV7AHY3E61honxmPmHQDyxYuuiVaM5JczgfGvE=@vger.kernel.org X-Gm-Message-State: AOJu0YxKfe4fVi0rf8U44diApUBfPCRUqolklG08ZE3lEbYy2MFGfU+k r2IFpKQW9tO9phCiosIQWSCTGUPcylVb3nAtZms+LwBRMP4B276mRYblAewxvbpuXVqnVhLWDvW GJjgmRg+YngJrIVh8qQNw57tH81lW9x8UbfmtyVJzOj1C1oGe9Gru/K1JnoSsWOl/brM= X-Gm-Gg: ASbGncv/FwL3xxfCGRPjYhN5N7t6ZjSSgEctlYKvWjhX5X7lnon1RzMeXCrh4vn6I/1 dTMhfsInXhtpB9p8Xh42IL+XtgPu6nMkhSk2Lsq7RivkCxS47fGJzCxeqxiQLUel/jiT+WYZN3x MK+jV39tVT0DCQT4WnTdURYLYadqBQaUKE/P8XQnCV7C60npbnL8uQ0y+R+IwmOooKhPObEjNYK pGLojz/WMXZng0OApNdWywvySVp6bqx8QfQITh9RWpQahFKoe2UTpXKgFlFHFnjT794VjKW52ha 4pEUWL2IqDR3bZDFzmS3zFYGAdX+Yi49+2Y2jE+CT0K4LUIXNzViaEkp49u+sOS7b+bFFbe8T6H T X-Received: by 2002:a17:902:c7cd:b0:23f:df36:5f0c with SMTP id d9443c01a7336-23fdf366308mr55454815ad.29.1753633518972; Sun, 27 Jul 2025 09:25:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IElN+SPhw8k792Rzn0TYr1j23uV/PBVvafh2zJyXG1hP+afi01ZKCrh30mmgw+pZFEK3C4rbw== X-Received: by 2002:a17:902:c7cd:b0:23f:df36:5f0c with SMTP id d9443c01a7336-23fdf366308mr55454455ad.29.1753633518447; Sun, 27 Jul 2025 09:25:18 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fd9397ebbsm29110325ad.210.2025.07.27.09.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jul 2025 09:25:18 -0700 (PDT) From: Shivendra Pratap Date: Sun, 27 Jul 2025 21:54:45 +0530 Subject: [PATCH v13 02/10] 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: <20250727-arm-psci-system_reset2-vendor-reboots-v13-2-6b8d23315898@oss.qualcomm.com> References: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com> In-Reply-To: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@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 Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , 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=1753633495; l=4877; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=BzWfToJE3ECxETuJZ3k/sBp7q/SRF/jEhj86+u2O1rk=; b=GE6STsqGX975fKj8Z1KrwsY62SN2T3Ty4HgdyhnwjO42V4WyuNyRkjHVvNq3UY4UsFHB+HdQi rEVqNY7DrZ5AQkVVZqOBQUd4giAmSraiKzKugXbVhvKrIpJAQNPgyan X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=JovxrN4C c=1 sm=1 tr=0 ts=688652f0 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=IcmTHOqSNbDvJ54L4SUA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: cn_IUv_-ymxk570n9aSAC5T7wMdJIcTw X-Proofpoint-GUID: cn_IUv_-ymxk570n9aSAC5T7wMdJIcTw X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI3MDE0MSBTYWx0ZWRfXy3pe5W/1RxpF I+G+OfS568g8Qq1naekIJQrBR1mr4HZ63r1z5zoGJ8qVwynh1N1H2D/9EHvIfHAUIZ2Kky1JQmX uQUWlGmmBbM95iU5p36kqhHSsiUa/QFdZSUywkaacYFNyscKX5dbtcKTDd+FrLUPpgM964Q5ACj 6+6M/0xfXvnwnAhLHBbyySZA7BVMVoe420Zwdbr3FNnmWmDCu2C9+bItPKdQEIXc289QCGlM033 rYcPiO5goaHQm6Oh3zWhtMCUZ6KgTY44JgL5G1LWRbmge0Ycn10alqD6D78gTWBu+HlUQ6QdDj8 vNVjPM/SW/Nhi2pXhr+inNuYyt4wT0ZZWmPINCIDw3xxr6NkXkEGSHUGSboAg7Iy+Ch+nMMUqt8 J1FibnnAgHjTKxKgldxwNXj/3SJvT0QLHh4RTPhiKPzvPDQjRaL4bw5bQt27t76nj/bk5BnT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-27_05,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507270141 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 Device Tree (DT) node-based registration. This enables drivers that are not associated with a struct device to leverage the reboot-mode framework. Signed-off-by: Shivendra Pratap --- drivers/power/reset/reboot-mode.c | 37 ++++++++++++++++++++++++++---------= -- include/linux/reboot-mode.h | 2 +- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index 42bb99128ed3846d4bff62416dc31135ddeaeb90..9bb97bcd33cd3d58c75c791e9b5= 68024e810e5b0 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 @@ -75,17 +79,21 @@ static int reboot_mode_notify(struct notifier_block *th= is, /** * reboot_mode_register - register a reboot mode driver * @reboot: reboot mode driver + * @np: Pointer to device tree node * * 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 device_= node *np) { struct mode_info *info; + struct mode_info *next; struct property *prop; - struct device_node *np =3D reboot->dev->of_node; size_t len =3D strlen(PREFIX); int ret; =20 + if (!np) + return -EINVAL; + INIT_LIST_HEAD(&reboot->head); mutex_init(&reboot->rb_lock); =20 @@ -94,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 @@ -129,8 +137,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 mutex_unlock(&reboot->rb_lock); return ret; @@ -144,12 +155,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 mutex_lock(&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); + } mutex_unlock(&reboot->rb_lock); =20 return 0; @@ -178,7 +193,7 @@ int devm_reboot_mode_register(struct device *dev, if (!dr) return -ENOMEM; =20 - rc =3D reboot_mode_register(reboot); + rc =3D reboot_mode_register(reboot, 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..98f68f95c9e8460be23282c51ef= 7fcbed73887bd 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -13,7 +13,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 device_= node *np); 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 Mon Oct 6 01:24:27 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 51EDC21C9E4 for ; Sun, 27 Jul 2025 16:25:28 +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=1753633529; cv=none; b=BPhrpvJ7CXRDTm3cNxBpgOy06XRmXUxm03WqnSyv8/5Q2UKDKGyNcP/e0pDO0TE2BH9R0/iBIeyJR5HlbCtqDg2pO81m5apW70E9PEMw6cI1KXPG8ugohTkzuNtK5PoGbI85dkU9Y5YVazVwR0iernzGzaKJyaT5oMfc3HYEVHY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753633529; c=relaxed/simple; bh=RHatRDIyZlkowVAM219pHMxjJ5gZoVq6CrecsaGvXwc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dT1hoCltI62DkZxCRzFGvqZ3aVMAyZjeDq4RCdDTpRqOZx3poeetRji7/7ZApCnBFknG7CNU4vP7FN4/SwndHY+kNG8D+Vuxi3F5i6d0XXv23q1ZNR3IbUClO2OQmbXu/YUGs6RjOnZ3DtWtwrMDEQu3Ue7+F1VhYZcRNVyRVcg= 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=psFPyugQ; 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="psFPyugQ" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56RCxMDq005978 for ; Sun, 27 Jul 2025 16:25:27 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= nz/boegyCEkxuIz7kRr7NgSo8XrC5KjpUvLZlqKGYvs=; b=psFPyugQu8PfrMwL GKhB2/DTMk/Z9JKf6x6arpEJ/ynffGL2R/5dneTvY4n/HO1M8F9dtccnzOpLiSYv guHpMb+cVTVbhtljACXcNC4gyl7NOpXsQrr+3i6qGcn54HPkuKi7HGGjdwjdatCo TW/fkp+bk3OfJNLIInNXK9oo2lOpcqKUx8+W8KwjWJRJRR1quZFTWR8L0gjN/BaP vLUqEAzGmVG2H2C4q4i2nTV80svCO5DIIo7wAl+XvpEUO5SrsrO+Y2bHFiuoMugK UVLPnTWeyA+LFEuB4HZWAbedp5068tTa+I9YaKmRjvjsYrOZESo20g1iI7aG9k9a YbyMTg== 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 484q85tbc3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 27 Jul 2025 16:25:27 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-235eefe6a8fso28064915ad.1 for ; Sun, 27 Jul 2025 09:25:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753633526; x=1754238326; 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=nz/boegyCEkxuIz7kRr7NgSo8XrC5KjpUvLZlqKGYvs=; b=rHW/j27/2hOOeiXVRvXqoy0OhhWyaJ1hgAmISHbFySTTP0fmyoszIUTey6w3JBX1YD 80gqcjabK5YksKWt5OWUUuVkHnlhmHvXEkOL7kOehsMSY8N7prTAQz+NuZelbogbPM/A Bro/UTAC5rEiSgI4wGIhJ849CySH/tqBn/xBDkS4KScyA6YEUvxa77y3udgRVl/aGMuT FyTGI8DJOn5Ai/rn47CBWNuW5zU29WCOsvSkn4DBK4GtAVNau8rqtC1yLcjSsmTIdm5n /l6sTo5YZ+KivNpSImQEpy/oDW1A9PI600LSQbA/wtZeoRcyCOoWLWWba3eSxIl7kcM9 eR1g== X-Forwarded-Encrypted: i=1; AJvYcCVk1JetQBcWWpoue243PxHKvLcddIxGG92+lbDGjyYs6eQisyWWKwO2LyvI3MICHoHEH54YziCOPCK4Btk=@vger.kernel.org X-Gm-Message-State: AOJu0YzNZf7jnYtgGZryKOwVmNexom4w3qKrf0gRfmlXnWMqmqH5PNYf z4gbxrQ7ZOI53YkC3fMlhYegIQh2ObUxDYmtnSuh3A0/fKN5W+o1tf7krYmZ3kR4k7OtjuUNNhN +PhD2jqaiyuJ7I672MhHe7RGHcs+aB85DtMU6AkAPpwT0BjyV7YuC1C1HZd2/lZ/1Nz0= X-Gm-Gg: ASbGncs4GqJYFrMuhG1t4DunXj5M3iDXj2+t9LjRYDp6wYqHugNF6+KG1ZFZQPa8dKv g4euABHl53ryK/zllRPazHFSTIHnhxgA0z8+ezFn44azg12wl+KWcNDjnYSJ8XeTQiMET+aG/aq bRWRk89Yi5/ttBzGmQ3VOSU6TBOGDTCpEEVaKKUP+CsKY3naXl/SubPj0JAQX3eDCk6lm0LC6c+ 5i24P9Jv6YxxA0eOW9+xwQQ4Go93/dUvzWed6Bv6+jhYkshVj6PM5Xw+HM4TTsrghX/BN5v71Gw pXB4u7r6W8gB3/kBKcJIjINDibG5LTB/NVRoKxzmudj3+7BkVnFOIsWEBOrYPMM7O3PyiHOYeTM 3 X-Received: by 2002:a17:903:46cc:b0:234:8ec1:4af1 with SMTP id d9443c01a7336-23fb2e7c3e1mr130462225ad.0.1753633526346; Sun, 27 Jul 2025 09:25:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcLfcP4DWud+dQHLaFr4TwKmT0cP13tCVOrrDCUpPkeJPY7Si6qU2vgqkckPcdUpuIiilxyA== X-Received: by 2002:a17:903:46cc:b0:234:8ec1:4af1 with SMTP id d9443c01a7336-23fb2e7c3e1mr130461965ad.0.1753633525824; Sun, 27 Jul 2025 09:25:25 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fd9397ebbsm29110325ad.210.2025.07.27.09.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jul 2025 09:25:25 -0700 (PDT) From: Shivendra Pratap Date: Sun, 27 Jul 2025 21:54:46 +0530 Subject: [PATCH v13 03/10] 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: <20250727-arm-psci-system_reset2-vendor-reboots-v13-3-6b8d23315898@oss.qualcomm.com> References: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com> In-Reply-To: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@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 Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , 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=1753633495; l=6956; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=RHatRDIyZlkowVAM219pHMxjJ5gZoVq6CrecsaGvXwc=; b=52Q22NFhjGYVUrMs0Fo4KMiutv/G56uSyH0ijdtSPbYFl48A2e2/sYcodSS6LzS/lXph/bhvN vFbY7FnkOPHDzPpMUGfqxfUATJMWWtlticzkRbpu6d1DjFmugSJrTGl X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI3MDE0NCBTYWx0ZWRfXy9eGP1GcjV5C y6hOvD3zYB65BnqoWBmTrZOt0AvhPaDfRGascYqjgA0od7x/nNzJm3gXt7DMLpoX23Z5Q1ouwBf Wdo7zLb3fkMSin9G0PkpN+zOG5/29HNEvYjkzpTEs5M9vaflBy16+OalpGHOq1jZ8NTI4Z/uYg+ 6UL3r4v1EWB+htEJRynUxm+maoMOuhApPIXaEOte2ucjD18YKq6mI2br0IDpk1BrNCRezch8R8J RzHnCCH4b7Vo4hUQYZAUHa23HqQKC/9K5x5nTvoy5UQdvd8kdvibcNIanRHeNVjv7G/+W+Mi2/A wNp3gwwNupGvwm4bchZKlSwYdZJrJsAS88wK0nUDRIFuYbrpvkdQq4MccQMrMUPka/QQ54/A6Z9 kro6fo8jn0JUJNW91w/7t1SEsSgR+mLlQPHuaf0BzjLtiuMXmidl+huF6MTZVm3FrsC+oMC6 X-Authority-Analysis: v=2.4 cv=TqLmhCXh c=1 sm=1 tr=0 ts=688652f7 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=bqVjg2-MoX4cBg1ZSeQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: ce6TbcDShv3xuyPL7J_hGLSpM-CvNE87 X-Proofpoint-GUID: ce6TbcDShv3xuyPL7J_hGLSpM-CvNE87 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-27_05,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 adultscore=0 spamscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 mlxlogscore=999 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507270144 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 --- 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 9bb97bcd33cd3d58c75c791e9b568024e810e5b0..ac81b8b0a9b7fc31f8ef2102433= 3a050087ce90f 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; @@ -66,7 +65,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); @@ -89,6 +88,8 @@ int reboot_mode_register(struct reboot_mode_driver *reboo= t, struct device_node * struct mode_info *next; struct property *prop; size_t len =3D strlen(PREFIX); + u32 magic_arg1; + u32 magic_arg2; int ret; =20 if (!np) @@ -108,12 +109,18 @@ int reboot_mode_register(struct reboot_mode_driver *r= eboot, struct device_node * 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 98f68f95c9e8460be23282c51ef7fcbed73887bd..370228b5161963aac1d75af752a= da0e8282b1078 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -3,11 +3,12 @@ #define __REBOOT_MODE_H__ =20 #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 Mon Oct 6 01:24:27 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 EF4DE21C9F9 for ; Sun, 27 Jul 2025 16:25:35 +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=1753633537; cv=none; b=TxrIA7w1U0nlq8u3uP6PKp93/9sCMp27O/tXjj85E082UIdgIVSNNY9aw5TUjX+o9ATbEvdbVSoduBxrF/TPuE4hA7EEBIuZga+BS1uS/u9UmslHvxvLNNf6puh7m0WLHTYt0zJ2T7ESW9L1xjJLUUksagXm+DbbvSeVf4H53Hg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753633537; c=relaxed/simple; bh=B5BLAbfGWAu1tjZeNLd2S/l/pA+itiinQJEbqhqQ7Iw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YiXgU1nGCtas44rC4ColRmntRUWQ+rtcSVF3hCB3ApCl5+5ynL/1BsxFpQlyeIrXxAqHDEsE53xQCpOx6g4W5/K4QRC1BQAED+ZgGwu+M3eINamaXMzTNFKNjd+0WE3u3YNLqCoSuW3wOWSSkA5XvTb79VZaXjB6p9SD5RHJs6U= 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=Ll2dnarX; 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="Ll2dnarX" 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 56REOEuP018457 for ; Sun, 27 Jul 2025 16:25: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= LAjdEtX3RT7zSV5WrhnDDtIT/eTrigKKIJeo9CD77g8=; b=Ll2dnarXF3tA763o n0D2snUMmai1xsB9hkOvnb2fifsSLg1eWkxr6LBWGPBJWONv1lc7QUlNM3CJ5E3H NMm/+P1jsD/L+TRxS2KeEdHs1QuQ+5eeZ/Bxyz/1Ko/TJAVN90y0DFU0kzbO7TZb 1uazZIYQWW2I3TZJoyZconGYcOXvAs85jsqQwgeH903e71Uy8IM6YxYyE9LMN25K 2RCMgvxVUxaIDe3Bm0tJjyp/b7K82bwNDMIheJX9tSheGicesNanxpmyUXn2PzGP /kc/qpXNoKhDl9WOfzHEPgFE9zdV/Ve3LVmgzyG7HiI38Rn1+tN9+5y5JkxJg5p2 qDCFEg== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 484q3xjat5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 27 Jul 2025 16:25:34 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-b3f38d3cabeso2561533a12.3 for ; Sun, 27 Jul 2025 09:25:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753633534; x=1754238334; 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=LAjdEtX3RT7zSV5WrhnDDtIT/eTrigKKIJeo9CD77g8=; b=K5J4EhnKRtPDq7MMrhgEYa3w9YDs+5H5eR9TGtfq3ijuU9PgpemGKNPkKBgIjxWcMn wbHuFPiFw2NpFzzLHfhs1t01S46I+G+ubBVfxJRmrUo7HSOODuzuc2iTS/AYDtCg8U9d vAArQ0xztNh3VJSa+1LFvEkNTZbvLEoGS4X8m+GF7EaXdbQSfcF9H2XnlPiBzxVLmDrb EhPu30VHbcTt7mQJGf6kF9J/XUN+38r9Y7p3ptxtpUt+Qn2D7BPCnY1iolzZd+MHXfil 9cvkYKyevLsdC9aQ45Mi2SQ6mxFs+51qlcCYvGTxna/vMcKsfxam05HJvhG+6FIta+Eq 6x0A== X-Forwarded-Encrypted: i=1; AJvYcCUMy8+ISWJVukLwA01msxxt97R4gn3fr+6vC2KDem7Yxh66yc6yejB4kL6E+LEYMfnqIWmrQC3NvIqmeWQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxkFwYdVjPrvVX6QP58jA0WJqAvQYW2v3pD/B8NWwZKBXf6QC0T zSmJRPxg1dr8sLGywlP6K1Zp5TPe++YX/bs2lJQiQpqmoJrjrcWYg8tl2SH+t211j+Q1QdIE10j fnGNInR1f7JxVZx6Zf58UqkgNdB7Ju272GDXQQGSUJSuAaJKQAmFXhHsXtwN8kRvNItU= X-Gm-Gg: ASbGncvoV3zeRtjxsmKm2KIuYrZJeoPSFxxH8kt0snzmtFHwg6sJEcFYhf8wsIn7Y7+ vdhfeX2iDK0IYz9dD/2zAXYTg4wcUmEAK/M0cleJSb3Bem9ShmrtaFipD+cuUQ2f06zENIHyq/4 0tEJRN5kl5bnwidE2HOu3647hu8tgWW5WHaktlEEYIsNvNWURKcMlO3iY5Nth1MuqIqrx+n1Huf RIXXEQT8t5Rto/VsXKSvGiDxtdN0g2oh+sHom0XT8E7PiHKsFsxcil4h73bnX3Sjnfnh9kO88LN lsotuui8ebyt6IIN+FVR4Dg+iewZIRtH9EDnOsigkqc36UN0/Q7gC+hSP+ReWDDo7FwXfp2xUN4 B X-Received: by 2002:a17:902:d2c7:b0:23f:8df8:e7b1 with SMTP id d9443c01a7336-23fb30b3224mr145314595ad.32.1753633533666; Sun, 27 Jul 2025 09:25:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7X/a1NVbBv9ysYl7a3wo9LMuxbvZnRFcCXyu7AESYMzqbL9vACORQwwTa7YynJTdngrt2rw== X-Received: by 2002:a17:902:d2c7:b0:23f:8df8:e7b1 with SMTP id d9443c01a7336-23fb30b3224mr145314215ad.32.1753633533214; Sun, 27 Jul 2025 09:25:33 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fd9397ebbsm29110325ad.210.2025.07.27.09.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jul 2025 09:25:32 -0700 (PDT) From: Shivendra Pratap Date: Sun, 27 Jul 2025 21:54:47 +0530 Subject: [PATCH v13 04/10] 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: <20250727-arm-psci-system_reset2-vendor-reboots-v13-4-6b8d23315898@oss.qualcomm.com> References: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com> In-Reply-To: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@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 Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , 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=1753633495; l=2307; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=B5BLAbfGWAu1tjZeNLd2S/l/pA+itiinQJEbqhqQ7Iw=; b=pgH9mIPi7GA0ayDqkKnR2+E/P0dq3sd1IZAeVGSFF5+JaYFGGS/XBZthLHPT9KAF1UJ/RpQH4 Hoy706MVMLNDID9ZV+MW3XmZWBEhJJ0oZVWXtccIrzCMNUZQ3rPFPly X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=JovxrN4C c=1 sm=1 tr=0 ts=688652fe cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=5CgfHzhl2afHKY-Ush4A:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 X-Proofpoint-ORIG-GUID: u-08hAgoo6lHwWlrK46iupfw8obYeWkD X-Proofpoint-GUID: u-08hAgoo6lHwWlrK46iupfw8obYeWkD X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI3MDE0MSBTYWx0ZWRfX1vdLhIhvgvdA tFSlTMgYSlRL05TJCl2Tff0GGL7DOSKhn+MpZhgo+/yWxCKmjoVtCO6h8LYdWpQOOjV7Y5CekVX kVOtGTnV4bgyxXR54Chnsskm8jerJoPGN9M9fcXKvhpmvfnFS+pid+xg6lYyALMnqolfZoE9U4A QLt0wwK/Op8b/4oxditNCiyApXsuCFysBJkJh1K52X5RSlWzlPDuY4Xebkonk+YZnlMxYoMm7te K/Kh6fSTh7V2sBA12kYjnIBVfgTXzWqbi7Ds4Oc5C0+uHwgz7QWR+yaG5xkhsVdXEiP3qanptcE FF3V5M5hlV/7veGbLCHYVLhLtvbufl6xzmSy2/rElUSo80LcKLCd9UoaC/OYFmeh/5rbyEcVJDR RToe+4hupyzcfQFJn01tViXge49v0hyN2O9V0QWvqHhsni/1+3oH+1MviTEXq4pGvcoDSUq2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-27_05,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507270141 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. Signed-off-by: Shivendra Pratap --- .../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..7147a781e5d4d11977c3a156bf4= 308aa13310e39 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes @@ -0,0 +1,39 @@ +What: /sys/class/reboot-mode//reboot_modes +Date: July 2025 +KernelVersion: 6.16 +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 comma + 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 Mon Oct 6 01:24:27 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 225EF220F49 for ; Sun, 27 Jul 2025 16:25:44 +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=1753633545; cv=none; b=O+lilgwDDqxs7lONDgtLfp9BqBOM7TmvmIoZemzEEVI+BGkkJrwDdDX3ra7NUd17QvM7/t9aJbyudAqUAPy0kXNFSKxNwVgZzN64Fo4giksFryZmjOMr6egKq3NKHc3I55pIMxQKX9DB3oO8DPGxFM+94ib+1xSesuROP78ZoRI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753633545; c=relaxed/simple; bh=UwAuk0mKb9rcWWrnqsEINzklGj3BCiY6oFtAQLs8bEM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V5fIA3JJcEE7SORBcXmTHnZfR8npxIHhFZQKeLwd2IwUIakpUGwYNY1TcodqwE200nQlHdYUdHtNVvGCIx/CQzW01S2+PjT42Fqe9XVFwKvOcNthEJ5KbAWefFQQxNYb7xfZ3dTA72vHg+9JI/eydlLPkqfnnoJa99tfZXLr57c= 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=enerPKAI; 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="enerPKAI" 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 56RDcfOv002055 for ; Sun, 27 Jul 2025 16:25:43 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= kjg+v7QmECaMK4O0WsmDewSJVWQyUa1xzMTrttC4DDk=; b=enerPKAIDY9iQur+ upaFxsO25ySiMDPy3qQArSQxC+I2irkVoo4+2300XOd9qzQ2YHaeA81CvKi4ZX69 9L9Z/yGrQhgbhK7E4/XYg/GNIyii7W1W+JHQ+TbjrH+HXyDTQao2CmA9I3RpZGjP 8zsTgesorYKkKON7WCPI3HcPdaEXaYMdAzN9k0OPhpMRwQRsBzrUkl59I8yA7gOo J82r72GwebN3IZ4cC3nFZ4MJBHUOzD8Y9BSyncgK01e+ApQzwvZ7LuX7hZNyiKr0 fo36EHW/rQhN5HKdkngLyzTYLZtbVY+KdT95Ua9wRa5jPzLkFmmEgkdQ8x6jA0Aj dVyQWw== 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 484q3xjath-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 27 Jul 2025 16:25:42 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-23ffd934201so5497455ad.3 for ; Sun, 27 Jul 2025 09:25:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753633542; x=1754238342; 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=kjg+v7QmECaMK4O0WsmDewSJVWQyUa1xzMTrttC4DDk=; b=qh6eVF1rIp6OApCKV/n9htobNTEAtIs5F7FgQWu+Uwg9kkrLwqn+Adhxxta5IABHhj HIQOAf8X/K8Fchvo2SpomLs0H4Cl8JaSMsU/PfZOUVA8QrT5jNpA4EwSFpSQa8B1ABW/ bAB9UeywSiXr+8bbAoRrhgGTErrWRKuzTlDsPtwye7KCo/JsAFrjh/lQBLDsXC+qHfcr 5qzS8KLHxS1YM+gxY5CNGJYYmwmd+Y7bMUccCHy263752kSyA9vrkj5gQfdef2YY6FHq Au2gbqM876ffuFGCdpEKo4WKo73qSn+a9N60z9cjWrfi/JpJVkOYNgEM8mh6vjdahvZ5 KA+Q== X-Forwarded-Encrypted: i=1; AJvYcCUcTgEoJ+c1mlfZwSP/N7JSixfLdyA5XziS0SC2pMw0aw+77PrPVUEJFoHJ2dVeK7yEtmd8BDKj+oFyK9Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yy8hHmVdvFuytnaNUMs7vcBscVZTTdLUiEAnFKkAFP7BHbSrbPW SlwLPc6UYY9vcBbFa69o2DXUOk+DoYn2g//bfsb7ZEFpqKcQisCrpoynS3Qmaaj0nWNfiyXKjXQ TxsItIwkVkQBoKE2lD58PTDJKz8MS5pqfJad5HBL/rW4PpuTWD1latFRzT11np9mlwbA= X-Gm-Gg: ASbGncsavVL5b8IWcObN5wRmr7o3gTWFQg9Xqoe1rP1wY83TdZ73CpSnOjyAP9/Upnf AS4KGpqmy9jWTq6x2oM7JcmmoO2BqrjIunFz1p7KhOu7ucGSyAsM6L6q/73LEIKYIhAQB6iKdIJ yFIlrlhJ0bYhfawKCdKDAV2uJxy2g4igEllb0PIMlzhG/BrC17mdv69FFdq3UtnA1PHxLPmJIK3 uzSWlx6CgYAH1lChrC28QtHrcSC6/dpLCcQ2ghmI2s8cw5e7XkMeWQnG/tLpoo//cUlLCOMc6vz xwiYzdL5il6op/1iQV76RMkW9Ut0TnHzLd201WtfGed0iwakpelUU94+Av6b/uhBdYQlegMLUEe G X-Received: by 2002:a17:902:d4d2:b0:240:11cd:8502 with SMTP id d9443c01a7336-24011cd8924mr21873835ad.13.1753633541676; Sun, 27 Jul 2025 09:25:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF64zD926zPgoLnZHbfxHUg9o9btJVPhQIA8eXNOi4vpCwnfXohmuBfaMQGx77pfDBk/lpsfA== X-Received: by 2002:a17:902:d4d2:b0:240:11cd:8502 with SMTP id d9443c01a7336-24011cd8924mr21873545ad.13.1753633541102; Sun, 27 Jul 2025 09:25:41 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fd9397ebbsm29110325ad.210.2025.07.27.09.25.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jul 2025 09:25:40 -0700 (PDT) From: Shivendra Pratap Date: Sun, 27 Jul 2025 21:54:48 +0530 Subject: [PATCH v13 05/10] 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: <20250727-arm-psci-system_reset2-vendor-reboots-v13-5-6b8d23315898@oss.qualcomm.com> References: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com> In-Reply-To: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@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 Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , 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=1753633495; l=7789; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=UwAuk0mKb9rcWWrnqsEINzklGj3BCiY6oFtAQLs8bEM=; b=5nCCrPxu1hs4B4gaNuJable+RSLEjWkwStVjMUm8ziF5OEvY3BzxS5O31XsXPhhUfGLthjPmW eujejMPAi+jAogRbdwDQd0+i/4GzTqmLR3CE7VsSLtixoLYokKDmMLb X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=JovxrN4C c=1 sm=1 tr=0 ts=68865307 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=I4qJSSq-i-5ETPqSmjYA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: o2rVGBGeWhKC2zxoQXiSS5h5hBxUQm8i X-Proofpoint-GUID: o2rVGBGeWhKC2zxoQXiSS5h5hBxUQm8i X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI3MDE0MSBTYWx0ZWRfXxzw9tQxJmsl4 dh9sgb63+ZCGFtF9wBIFEaqxW3cUXz/RvP2eeuPd+HaA0cdfVy5ye9Ah4oFFIOTmryOWKcXoHHG yBLrV/QHqArZvzaD/GjHruq+2VQuZJGg4KlH8EY7udbz4v25yOyQvPvPMf5N2/u2RIwi+xionjE lDkov4viijqvtgy/XsPH0Yd8rWgRddC7zndLxjjYOMdpLDjJBcZD1LBTICFBL9iTaEkET3oVt6j diRz9B2sSAh8yegZ9gktOQ2M1y6IU1oS9p6KxzlbuZsgkDOY40Kzw6k7VzTTkEEpQotR7Fw1AT7 b/rHArzH/oTDJSTxOEuX+U2Hdrr6S09dzZ23bhRmT29jtGl1eWEG3QkonCxiu/KUO1854ra06b4 9Hw+1O61lmw0Qpe2dFWBoxlhMMjgB2vzojbUvs8KfutJBXthc9jxxt1bH0icyNdagoG/dkbC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-27_05,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507270141 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. Provision the register function with an additional parameter to get an explicit driver_name. Create the device using this driver_name. For platform drivers, use the driver_name configured in dev node. 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 --- drivers/power/reset/reboot-mode.c | 126 ++++++++++++++++++++++++++++++----= ---- include/linux/reboot-mode.h | 4 +- 2 files changed, 105 insertions(+), 25 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index ac81b8b0a9b7fc31f8ef21024333a050087ce90f..4c23ff912fc6afbc6949bfdd660= 7781eccb4e85e 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"; @@ -75,26 +78,116 @@ static int reboot_mode_notify(struct notifier_block *t= his, 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; + mutex_lock(&reboot->rb_lock); + list_for_each_entry(info, &reboot->head, list) { + size +=3D sprintf(buf + size, "%s,", info->mode); + } + mutex_unlock(&reboot->rb_lock); + + if (size) { + size +=3D sprintf(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); + + mutex_lock(&reboot->rb_lock); + list_for_each_entry_safe(info, next, &reboot->head, list) { + list_del(&info->list); + kfree_const(info->mode); + kfree(info); + } + mutex_unlock(&reboot->rb_lock); + + device_remove_file(reboot->reboot_dev, &dev_attr_reboot_modes); +} + +static int create_reboot_mode_device(struct reboot_mode_driver *reboot, + const char *dev_name) +{ + 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, dev_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) + return ret; + + dr =3D devres_alloc(release_reboot_mode_device, sizeof(*dr), GFP_KERNEL); + if (!dr) { + device_remove_file(reboot->reboot_dev, &dev_attr_reboot_modes); + return -ENOMEM; + } + + *dr =3D reboot; + devres_add(reboot->reboot_dev, dr); + + return ret; +} + /** * reboot_mode_register - register a reboot mode driver * @reboot: reboot mode driver * @np: Pointer to device tree node + * @driver_name: Name to use when exposing the sysfs interface + * + * Registers a reboot mode driver and sets up its sysfs entries + * under /sys/class/reboot-mode// to allow userspace + * interaction with available reboot modes. The DT node is used + * for parsing reboot-mode arguments. * * Returns: 0 on success or a negative error code on failure. */ -int reboot_mode_register(struct reboot_mode_driver *reboot, struct device_= node *np) +int reboot_mode_register(struct reboot_mode_driver *reboot, struct device_= node *np, + const char *driver_name) { struct mode_info *info; - struct mode_info *next; struct property *prop; size_t len =3D strlen(PREFIX); u32 magic_arg1; u32 magic_arg2; int ret; =20 - if (!np) + if (!np || !driver_name) return -EINVAL; =20 + ret =3D create_reboot_mode_device(reboot, driver_name); + if (ret) + return ret; + INIT_LIST_HEAD(&reboot->head); mutex_init(&reboot->rb_lock); =20 @@ -144,13 +237,8 @@ int reboot_mode_register(struct reboot_mode_driver *re= boot, struct device_node * return 0; =20 error: - list_for_each_entry_safe(info, next, &reboot->head, list) { - list_del(&info->list); - kfree_const(info->mode); - kfree(info); - } - mutex_unlock(&reboot->rb_lock); + device_unregister(reboot->reboot_dev); return ret; } EXPORT_SYMBOL_GPL(reboot_mode_register); @@ -161,26 +249,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); - - mutex_lock(&reboot->rb_lock); - list_for_each_entry_safe(info, next, &reboot->head, list) { - list_del(&info->list); - kfree_const(info->mode); - kfree(info); - } - mutex_unlock(&reboot->rb_lock); - + 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 /** @@ -200,7 +278,7 @@ int devm_reboot_mode_register(struct device *dev, if (!dr) return -ENOMEM; =20 - rc =3D reboot_mode_register(reboot, reboot->dev->of_node); + rc =3D reboot_mode_register(reboot, reboot->dev->of_node, reboot->dev->dr= iver->name); if (rc) { devres_free(dr); return rc; diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h index 370228b5161963aac1d75af752ada0e8282b1078..0b9844a71224b3e4bcc0d1e396d= 6c9cb11ad8c97 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -7,6 +7,7 @@ =20 struct reboot_mode_driver { struct device *dev; + struct device *reboot_dev; struct list_head head; int (*write)(struct reboot_mode_driver *reboot, u64 magic); struct notifier_block reboot_notifier; @@ -14,7 +15,8 @@ struct reboot_mode_driver { struct mutex rb_lock; }; =20 -int reboot_mode_register(struct reboot_mode_driver *reboot, struct device_= node *np); +int reboot_mode_register(struct reboot_mode_driver *reboot, struct device_= node *np, + const char *driver_name); 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 Mon Oct 6 01:24:27 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 CEDCB2248AE for ; Sun, 27 Jul 2025 16:25:51 +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=1753633553; cv=none; b=fyRgN3iOyihCfWA5ZqHSmxDYWQ2cIvpOYNmikQM3jsY1AwRr0j8cTy7BCh59wfSjeJAvV9ZDgr7PxtOL83CVzZQ+ibhm3Fz6T1vg5LELcpAfmHEspmfEUbC50iJo6tKRq3DQE7yAWfX6YQCOoI9966kpabTNElzx/XOE0C63Jo4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753633553; c=relaxed/simple; bh=TXtx922bW7Cthax35l5eL6qlXJtqJfd163vx/p8QQUw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jiClPvg8BfHB7LTLmvk1Vkv+9qqT669Cfem+vOgjBvtlNtvxOtspWh9MjdrXhbnC7VOsqWUE1neBO2yguNC9bQw9pZYyiubk5orrc7KSptRcf+SxpWPljDLq/mKMx9sEfrjkk/A1Jq5lx7m+YqRbDUXX6hZZ0ltSnbmYyCNjxl4= 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=OZynjd0b; 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="OZynjd0b" 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 56REP07G031953 for ; Sun, 27 Jul 2025 16:25:50 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= dVmI/zpQBLHcmY6/km9+lnVLqKzUs1cGOy2afpNbw1A=; b=OZynjd0bEGHbnJJ3 IWW/B+kDbmJVKigmjkl1uTDl5LCq3FVamQjo/ab340CcnS6W4wYsKSqRSuDZ2xkI uz8pouY58AIthEQHNdVJwGEj59ZvtTQXhmLF02qtSg7q8eiTg4WaYmnR/CIQ5D0B 1ZqsG+u5s4c+Jsx5dpDME/gZh48EggAr8o15CvWkLUA2/YO78dQ34EX0bxrsGKGw OZJ21VI9E33OgyfTJcE+YqK9O+ShZptev+nOH/8JKUHXN4NtqY4X98m+vKoXn8rh yUXH9MTJfN6Mi7Y6Nv9MoR3L0UOP9zON8kbAUOP/PewWsFd1oJ4Vb2E9CEwYx3J5 Ylt8dw== 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 484pbktb79-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 27 Jul 2025 16:25:50 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-b00e4358a34so2468424a12.0 for ; Sun, 27 Jul 2025 09:25:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753633549; x=1754238349; 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=dVmI/zpQBLHcmY6/km9+lnVLqKzUs1cGOy2afpNbw1A=; b=h/NyXNCr+36VRNxuDQYWYiZjAGt4iyiqUrSSkkq4iL8TcVShILL8i11E30T3sASZMV OZlUoJuLSRVd/zYbVzJVv9vjJnBbRbMFiCUBLHVgVoqTx/GwnGH8ETF6gRDPN3sm2t6n E6X9APb6vzse9L5vRmVEL5vm9yBjpiI8ZkbQU025zRfGEPjZtrmxsTxgQZUg1EqB9YE4 Lav7DlkDE0vjFMkv67iNsSDo1nOdsf45pVAnDPppydv2KJ5etejSRmvz/Nsis1GYHVaw tFPqtTae4bp90ICc0FXO5cyeJ6uivpZsUprBG2uHzUY4wVtnvoUadAcEsWzW3I0dKUTD itYA== X-Forwarded-Encrypted: i=1; AJvYcCUNU3Vb0iuhuYI5gJEMB4WMOCmlTCLb/8zfZOxO17n7YEVlhqZVLySMMgg3RQ/g8o2QNp1NkUSxHz9tIRE=@vger.kernel.org X-Gm-Message-State: AOJu0YyCGW5jHtFHik1og25KVtVIcJ2YXep7DewBlZ06F7IpDjQLgJ/z J6Ks2E+Wp459MnBoPgruTG5n/Ku4RB7Nj6dQzkCGriYDy948+3PYN3skKtxTwvt1Sd3TSqmuHa6 e3EE0hzM2glC9GQRNhd2ZQrgpmNue3Riqe1FY3jWEuP0vE+ToBRz+vDMdVZolWfRX9XU= X-Gm-Gg: ASbGncuq/URxxoJjlh2ELo9BwiPG4QvGax0xAWh5upTP0n6y66ZDw3R7uMOhzD+RfDY 4E7amHxTHPyIncpC6PLTbCtbWn9xN2MFi14Ma5GJzs9Mral1q/dV9YCy3D64k2Fp+OaEGAO5M5f tx+2CwxbMi9TX+agYTR3WuTsoWOwfnaQ8z2si8bv5GiozWaI3Kbd6N5H4PqbBdjJbQe8qt/KJ2d AMPF85Etfu4nfaENz++TGnAm1fgfwcgnQCffSqxJzwkPsqX8KLzGXdKYbKmtI70E6tIkDJFaaDh 1iMPeAupo2XISM1XYNJ39qJ+gEZGpug0bFvtreom7O8yIunekju+TpoBospUalnGipdbjejrBvX V X-Received: by 2002:a17:903:1107:b0:23f:d903:d867 with SMTP id d9443c01a7336-23fd903d9fdmr68042015ad.35.1753633549291; Sun, 27 Jul 2025 09:25:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEL3wWdtZ6aYUyxBwD4I04sxzmNGeS8xOyoLA0/pGD4nypDDQZu/utCQqLS7ndqtErXNjHKbw== X-Received: by 2002:a17:903:1107:b0:23f:d903:d867 with SMTP id d9443c01a7336-23fd903d9fdmr68041555ad.35.1753633548710; Sun, 27 Jul 2025 09:25:48 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fd9397ebbsm29110325ad.210.2025.07.27.09.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jul 2025 09:25:48 -0700 (PDT) From: Shivendra Pratap Date: Sun, 27 Jul 2025 21:54:49 +0530 Subject: [PATCH v13 06/10] 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: <20250727-arm-psci-system_reset2-vendor-reboots-v13-6-6b8d23315898@oss.qualcomm.com> References: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com> In-Reply-To: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@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 Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , 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=1753633495; l=2577; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=Pb0JW5FgpXpfFWALyentRdrGNmebMgVj4WCNzS0Y1bY=; b=q2Cpgc5X/5vvp5IW+bSMM73MNGrPdxZ9TyGWHgnn7fEPw/7YCTssgw97rASyUi8M1FNatC4RE D62Y1b8i1PMAAg0ElzQjqtUuEhXWnmNzMVrBj50GG82dX0mbqehtdl0 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=LsaSymdc c=1 sm=1 tr=0 ts=6886530e cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=UInjrUrXc7y1C1sAkbYA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI3MDE0NiBTYWx0ZWRfX5eTsiFiqPnLw ZtqgHi6UbdTv2FGdaF6y1iKqcADVwL9NALrfm2RJRnI5YgK5vf81e/rKAJjaQdKRCpW3t7VUVj3 7ks0nb0aQ+xsF3S3AjOB0Lc5szGE6qzSghhRwGCETs47jw3S8hxvpAB+7C5BVTQqU+HkIjusUE4 r5pko6DjNrbYLLdx9qgtRYAPV/AgSW8/pZfvN+Xz2+UPy8bBT/1JBCAXIsNVF4Xsq3keaJ/GOeI lBHpmmtgN/d/XAt1ay0610IdzPi17q9VHTeI/lFlCavZ0XHQI1ZUjMvgjkQZsxoS14vjuBJSIPt 4iD7CFHITbBNO8Ni1wZaX/CAJQOtACVlexWYrwu/K1U7XmKmCfV3HI+VH/EernRAuCSxACUjaXU EjzIoMOjTTwA7zQlmwySqrIQiw1Md1yP/5GPqXlTRLkQ37i37sTOSonaJQVA5ZVJn35trEnD X-Proofpoint-ORIG-GUID: 1j--TDbcwLsa7or2R3LnbxFePVQ5TmUv X-Proofpoint-GUID: 1j--TDbcwLsa7or2R3LnbxFePVQ5TmUv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-27_05,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=999 spamscore=0 phishscore=0 suspectscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 mlxscore=0 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507270146 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 --- 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..da3a584c76b48e313a5d4cb7c8e= 0c3a3628fd1bb 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: + reset-types: 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 Mon Oct 6 01:24:27 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 1C22322156C for ; Sun, 27 Jul 2025 16:25:59 +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=1753633560; cv=none; b=VCF3Hedf7z3USbSTo/xIXZqQNwqOQU6XewQO1QOEoqsPvyXAs1nMbO6xf5g9fcUnVJrf/33Gj3AknomdgWb3NWpPPJEWoyDhvHuE/iknGTSQJ4c6mO+RrF87lItVSOBOBJe+Vg2Dtx/7JC67KSo2uUu69IbeyVPgmcIqnA4bJbs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753633560; c=relaxed/simple; bh=+KHfR7YYD+HrcoWjVGljO4mWJmBVgezl4q//08Hz/cA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=moSa7LyIICWOqtUgrp2XvRJMcmkiIVxqOv01asHgf1KyfMGNFaN1/wd8ZwoPz/4ocuUwoa0PIXwbSXt5U1OcFk2Fx4GttKbWlbPLbATKoW1RRoIA8H9By4d2Ox/zp6gm6rPOrup14mz3RxZ3ryxGvneNo7chSynUe9CDIe0ChyM= 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=RpdS1mly; 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="RpdS1mly" 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 56REFjPY022873 for ; Sun, 27 Jul 2025 16:25: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= Gc7Yk0tdJEh2i043+CGDqIsAu2bVqNeh81O1rVbonp4=; b=RpdS1mlymp2idYha E4d1zbOJta6tFlbE8A8sQAawxgBHCK+MwVNgjnmz8MTi3R64v3Z8Eohnd5L89uzB lw5oHluHZNb+MhkKzhr9rCu/qtt0hPnnwaBXL27nPN/BFSvk3TXEEV2A3+/PI/zo pdPgTSYhVqMCsd804qXnWEtp740OjV++9ThLfjzESs8M9DY+eyZ71TYDo7g5Y126 46qpSum4HdetuQJzKcj1gCU40rPyqIwXqQMP3FHTa0PmcamafDdtthfXnIMxDpvp 1e2iyHU4ql8emTyU6y0yMORGJv3WH9prDkIoCP49DBBjRTRJb1DyULRv8Leu2/9w miSV6w== 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 484pm2ab11-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 27 Jul 2025 16:25:57 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-23fed1492f6so12245455ad.2 for ; Sun, 27 Jul 2025 09:25:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753633557; x=1754238357; 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=Gc7Yk0tdJEh2i043+CGDqIsAu2bVqNeh81O1rVbonp4=; b=N21a3aDKV7DsNxYlvOynL2HLhqIomVaLrMOU9drC5n8xvb13s4er1nlENCRhTAvhhs 6VR6F96arbGNvgHok4x9llQGzxAP5ZalmyIKZxJcfEeiKn2OXlHQHa9+gZWpxFQUQuJ3 D3dIZVi1G1YtoXZ6ma6i5RWPX5OPf+piO5TQg9O5G0nCfsQjM9C/feR/1DWMkdsaJnJG t7wWdgp4Zf2P/ebzZxh81Rm8zXxhoa3V17l/2H72aHdwq6fJphjmSopsXZYi4YcwCRMN P4BXpfKkmAV6j8f9gjuC3wmyqGUqVwLsuQQLqMacMwXn6foSdiab8bwx2hBD3CmYhltk XUuw== X-Forwarded-Encrypted: i=1; AJvYcCWjIHMXUq+o8KmVrm6TYP1TJqdb1ie5EDDh8zImyt6kyg+W4w7ucrHKpeYo+iiQFtL2DACf2OQQSAYmRg4=@vger.kernel.org X-Gm-Message-State: AOJu0YwqmTECHuRS+YoeUMkuPujg7Ai4ZnipAr9DxK3WxlH2WOEUtldk 3I/Qd4Y/jSK/NAtEfBcYuK+CyJBcc58fr3eno/xGKIrzmvMWrAoSCuW90/qTHFG4yCtWBohKT4R ngDA+PFtbrDg0HBNUv5io7o11WE1mG7lpHLwHwS6gdqSrSJ0nRhELSWPZUuZdCx+ww48= X-Gm-Gg: ASbGncvm0VhNbRAPf1antfTe04LPyRW7lh5xWvhtq69uchMb0WzzaxmwNCNxfPMV4zz LQaYRNuFzCg8MrujBUB4D2omU3ISJ7cPcnsALbngwrOEThJnWPJobEVAdbZS9rXNe6JboHqO0wH gllxnChjpjFNfqBpn9/JUUw2fU7vzOLM+6XldnODRRIMNCa1Wgqm/WqbtnqvShpB0WCUPWGaKx+ SWrErRP0OeVNJ6Tpu1gM3u/HqVphz3Tpo3ZP6d/3z+9JMjYh2/rVhEJd7zqy8wZz1u1aV3m4wLg 2Smz7gpp3//QBmjc9pL5w8N4Fkqzl+XMfwxXhSik+ri0UCLelUWDr4agIJ1qhCLgUwefSKEgdje g X-Received: by 2002:a17:902:db12:b0:240:1441:1263 with SMTP id d9443c01a7336-240144115f8mr27743685ad.50.1753633556662; Sun, 27 Jul 2025 09:25:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHn1iTzmUSFNFbd3ipwa4rZSJcimOt/VUock6+Z1tVlZwgy+X3u+ZNaz/MM8wr2kq1viBngjg== X-Received: by 2002:a17:902:db12:b0:240:1441:1263 with SMTP id d9443c01a7336-240144115f8mr27743135ad.50.1753633556115; Sun, 27 Jul 2025 09:25:56 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fd9397ebbsm29110325ad.210.2025.07.27.09.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jul 2025 09:25:55 -0700 (PDT) From: Shivendra Pratap Date: Sun, 27 Jul 2025 21:54:50 +0530 Subject: [PATCH v13 07/10] 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: <20250727-arm-psci-system_reset2-vendor-reboots-v13-7-6b8d23315898@oss.qualcomm.com> References: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com> In-Reply-To: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@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 Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , 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=1753633495; l=4777; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=+KHfR7YYD+HrcoWjVGljO4mWJmBVgezl4q//08Hz/cA=; b=dlmeEc85Tf8+gvzUvKK1aMpV+xuClWa/Th4ihsRT8Ezne4CvP1qA7JZdX5O1gHgnHKHU7hkOo zgSfl1Qjv44C6njn1gnhNTZqnu2HRx/cdPpRXp3S6baG3nW52Dqo4nU X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-GUID: grhR7mwtzMKSj5ayomHC8wsowkvB-oSj X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI3MDE0MSBTYWx0ZWRfX6bjRmgkrzb8Y 68f2rOgXKNcCh+3l19o9opoqGkIODKk7+58UTPQ3pKQOfPbImEehDEQMPOc46Uq9vPmoBPxrAnY q8pCnjPeJFoYai6JdvkfBk3U+zmWjkVRvTgRtyUAiZ/k2WlH1twMLZs03krr1yGxkMUK5F/yvKW AkdIIEXts/oR/nYoEg2NhO7fAN+fzWyo+odOXHMVTuQrB5LvVwkmBsM410wrpZ5Uuw6jQxRqeLo m701aHc+ScY4H1z1mnLtJodH8mM+IWZ67fgmpOz1nAnowurh2HKxckSeQH6NVCFlihSvQqCICv6 dUlx6pYAAZO7AJZQ2qT0cVVLXAvFWxe2w1C1/MRwSQ+rU3NpFGcng5vewFKGQcDGiskdLRd2Xsy XcbpIo59CY7q7gRoz4DNMvIJJlloyf8e9+/3cfkMgQuJDSohVgOumZ+X1x5I3/pjMnn/HWbt X-Authority-Analysis: v=2.4 cv=HfYUTjE8 c=1 sm=1 tr=0 ts=68865316 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=EdS2NIbk_1D2FrBATFAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: grhR7mwtzMKSj5ayomHC8wsowkvB-oSj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-27_05,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 bulkscore=0 suspectscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 phishscore=0 priorityscore=1501 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507270141 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. 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. 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 as =E2=80=9Creset-types=E2=80=9D and are based on = the reboot-mode based commands. Signed-off-by: Shivendra Pratap --- drivers/firmware/psci/Kconfig | 2 ++ drivers/firmware/psci/psci.c | 57 +++++++++++++++++++++++++++++++++++++++= +++- 2 files changed, 58 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..e14bcdbec1750db8aa9297c8bcd= b242f58cc420e 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include =20 @@ -51,6 +52,14 @@ 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; + bool psci_tos_resident_on(int cpu) { return cpu =3D=3D resident_cpu; @@ -309,7 +318,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 +559,49 @@ 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 *np; + int ret; + + np =3D of_find_node_by_path("/psci/reboot-mode"); + if (!np) + return -ENODEV; + + reboot =3D kzalloc(sizeof(*reboot), GFP_KERNEL); + if (!reboot) { + of_node_put(np); + return -ENOMEM; + } + + reboot->write =3D psci_set_vendor_sys_reset2; + + ret =3D reboot_mode_register(reboot, np, "psci"); + if (ret) { + of_node_put(np); + kfree(reboot); + return ret; + } + + return 0; +} +late_initcall(psci_init_vendor_reset) + static void __init psci_init_system_reset2(void) { int ret; --=20 2.34.1 From nobody Mon Oct 6 01:24:27 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 5E64C2253E1 for ; Sun, 27 Jul 2025 16:26:06 +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=1753633568; cv=none; b=reEiZtwjA/r9ZME2CPwDAo3rp+Odys80EmRD//3edecKtwU9ivlnR7dAseGq3mIrouydgtdizbStl5p+0hXvzg+atOEEVtFvKaovAESr2JJ6kQ3RpvhRBr6Vnw/yBO+XN3lr9/ydlF10HVfgw/TR0urd7wJQakRSnYOrr1iXJlE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753633568; c=relaxed/simple; bh=n0wa4AEusSMKTJa2REb6Zm/CPFmojeqETl81QHufxBs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CxBnyAAY5AT98BEwKFuHQ1mCFIxvtbu3zCLCHiFcNdnK5d9mHu7tL0AMSD/DbHWt2pmyZhPb80CZJwS+u26J5/ruGuOiuoIyG6FOsbfK16w9QlN2Ymmbb29xQTNlhjnTmSZk+SW73CuobHiehSmlvq/Lpn7ym+A/yGSuVUrK890= 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=LnRUUNJG; 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="LnRUUNJG" 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 56REO6qk017552 for ; Sun, 27 Jul 2025 16:26:05 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= IiMmHpQ1bB+met8QLJcdnw+SCuV4S6OJO6VsyYvdUS8=; b=LnRUUNJGXUIhPCL1 JnvGQKD2L6Lbi2jzEYnYkIfcAFZkQ8b4XBogLRdUTJgh7+AeZwmfupFsATieWcyC +4FLiCJJOrQlECVglxl32h2h3SlMtG2Uye2YMhDwWU0o1wuSQRjkNtPAh7ExSUAg huNpNknEJJ7U4FAeNWcO0Wakusb/uHCLl5XpFdKd30lL5V7dscr5baxdyQL2lELq N3EmJrem0eFuht6RRvJ/aL6sehCOvK7JECySyPfowe7EHRrbAte+SiVg/W76J5nn OYIMhmkUssp+Z6hlJF7czQPJQx7cqwDWurZc5IhV76VQnZxGbk5TPuiBP255VIAf IADivg== 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 484qd9tasy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 27 Jul 2025 16:26:05 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2356ce66d7cso60423995ad.1 for ; Sun, 27 Jul 2025 09:26:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753633564; x=1754238364; 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=IiMmHpQ1bB+met8QLJcdnw+SCuV4S6OJO6VsyYvdUS8=; b=SYEwJrU2+r7/B5qBrIa+imXQSK+NJ6JyA5rxopS4Z9POeAHFEcBtDfq9x59GBBWOUx hMlyyMm3xmbhCkxQjTEw0ScSFsr8pHpI02p+IT+F/abmkjGe3al+IO4uJELMxVH1x1+A O9tQDwFxw1PQd7fl9SZUtqAjqSCSAS4QQrTo6E0a+aJN3mqvKQu/wuCf83sRkONv8eoO +V4FRoHzqeLwkq2HGumXZSTcMjCQtKnFWiJ5vdLngaxH/sZDVh5ZHNRCGWyRKx6FGZGy fCKuT3apYzDenXryH6JiGXbwQ39BQNl5hsZ5uZC9rlQLvQK2ym5bQnY2G9bI5nvuKOkk h/bw== X-Forwarded-Encrypted: i=1; AJvYcCWcecgLl1DEk57y+qFivOUiuxcZJpGn91pmQ6/1GTyRKwJwb6SMQFQZ7qtpOCDeghCX0xww472DATxVfnA=@vger.kernel.org X-Gm-Message-State: AOJu0YxTgyp8wvxgWmxR/eWl+3MEyF3Ai/zTzM7YpKQwTBs4l9tKPKbd qomwxyBPf4TMJ++cDy9YBsH2DOapVHO8Pd//HXeRvNvMcDgdXBLYDAzOJha0L6NI6Rs1a5qdBCw nUPVcVVG/2WMwHcvamDUufxu4jQ9qdVAY48gevxZP8SqbFpkyemfFWZrCipaxIZQhmaI= X-Gm-Gg: ASbGnct7fn+Gg+3mvKgBaY+6u/rAv0T/dgS82cxmmaBBzeD0SXolvs1K9I+l1wFEZZT jHCOia+L4E+Y4jAeg6VE81gLu+QbfCkP0exrv4jOr1LQ05oWxzpfnBHT/VFom3VLuoJnqi0U7h8 DK2q+npYoGWcP4yI8JTtWtxwU+rOoiQo5ZpGeWjFRscogO9KkBZ9CDotZpe0vcN26XYv8lM2GbQ Y0qMwCKXKOHBHfI5Pn+9TZhRdDREDOM0yhPbDyZPkFtySDMoCJl8Iz7ra0yiKD+SO73c6cVo9Hh PcFsygdTNBvYsNE1daqdwbDCDo39IMU2EF6DSNegmXPgrOP4Wv9AVlISPxuDNN6FZ7nodi3j8/Q 1 X-Received: by 2002:a17:902:ceca:b0:240:2bb6:d4ae with SMTP id d9443c01a7336-2402bb6de62mr9628245ad.30.1753633564187; Sun, 27 Jul 2025 09:26:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcv2kVK/ZF8/3NjRyqdhDR2HpvnWClMUSrwh0p1UvaDUQJSXqzTIkgTv+rF7qNzXfsSV+sgw== X-Received: by 2002:a17:902:ceca:b0:240:2bb6:d4ae with SMTP id d9443c01a7336-2402bb6de62mr9627755ad.30.1753633563720; Sun, 27 Jul 2025 09:26:03 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fd9397ebbsm29110325ad.210.2025.07.27.09.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jul 2025 09:26:03 -0700 (PDT) From: Shivendra Pratap Date: Sun, 27 Jul 2025 21:54:51 +0530 Subject: [PATCH v13 08/10] 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: <20250727-arm-psci-system_reset2-vendor-reboots-v13-8-6b8d23315898@oss.qualcomm.com> References: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com> In-Reply-To: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@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 Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , 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=1753633495; l=1628; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=/OISjQAhUBAIE37ASE5b1kssDpdL8gfQSFob68FR4qs=; b=/j9LuLfgeFti1wex62JLiS+dW57tWBQjp0c2zfR2CnLi8HYpUl4wkARBVtzMP3Jg2HbR5Td81 AGDjWH7b1EqBbUwIaroGDhq9zWeYEc/3o7sejilFBpLNay/t6KxhLuP X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-ORIG-GUID: EJzeOP0ljYWBV0aPoQVg9bBmH06n5m7a X-Authority-Analysis: v=2.4 cv=Pfv/hjhd c=1 sm=1 tr=0 ts=6886531d cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=w06kbW2hXDg5FjFnD0gA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: EJzeOP0ljYWBV0aPoQVg9bBmH06n5m7a X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI3MDE0NCBTYWx0ZWRfX7Jas93Leba+s 9v7fSQ52RxEpUhBwu51pOYogcuDsdijKz1bD5H6YERN84UiX5cOV3aB//Ea21KEEEPrPhFwksXD r9YzC4DsCX98aK76FkxscbU3sPn+UStRJK8XUsQ9CpAcYzTzRrVD+b7pij0tkpv3SD4xnF9IXSV ZQeKlqHPwoP3Be524jbHSrFA7k4VjaERJHJxa2U/YXLMEJBQm7mMZ9f0NdeHi+boAkgElKOS5av tPSs+ivi7Vui3rM29eqYjcPu8CpdHPpoKx7Makdc40KIJPIOzRDkEslAecrNshE5XK85i55Bdr+ dIxFoG3u6gqb32z/CiIx9fT7uKYvjc6fjdxBaBFm5phCr2zYCtj+8f3z27fTWAFwOWEBJteX/ki hcIw3Ooh5njWmRZ9FnEZGhs8YNw1CUnDZuspYDHfUEgDNXJjzlkn6V+lH9b8eYXNKkVflkyz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-27_05,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=959 clxscore=1015 adultscore=0 priorityscore=1501 mlxscore=0 spamscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507270144 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 --- 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 7a155ef6492e176390faa3f2dbe419f5cfa62f0d..d25dbdde7dcee9fa3f1bd48a38b= aeae0f063023c 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts @@ -654,6 +654,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 64a2abd3010018e94eb50c534a509d6b4cf2473b..e6a99ef50b9b9ade9d2a71a14fc= de429f8076dd5 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -857,7 +857,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 Mon Oct 6 01:24:27 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 1A74421FF36 for ; Sun, 27 Jul 2025 16:26:15 +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=1753633576; cv=none; b=l6v1eIp6Wxc/HxUVHPW4mUK7wI2gHHnq+xj+1Ae+2xBzcrjUiSE+ZGxoD7L2WEJRjiOfjEN4o28U3K4VtM50gG3jsrGVFD1MigJ0TMFkS20H+mTTqJcOqCMWKTHRBn12H+M5X5XmH8aXkgxS2HYWiCuvzMeNk8nksNvLcb+sc2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753633576; c=relaxed/simple; bh=wwP0wgs37G7SIgdBXKyajalMO8uencXdkJwBMyqMQK4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E4Ybz8c9JLSHqov8BwBrihfgMGH7ijzlsQ4KBQrHrQ5d5A1t0ChDhwJakmwIxTtHXgD6iN+9ejJlVUgHPkDYOGgfmN2+1zgMNW6X1wSuSPM+QKwleFEgOD9Gre1ixiEKUHzBSBydMXs6SdMG8oa2/Zg2aUHDgkPfRqE9n+6RGm4= 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=YCssGXc/; 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="YCssGXc/" 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 56REQ50q023289 for ; Sun, 27 Jul 2025 16:26:14 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= 751t52RdbCcwhdqGfw2MHgsiZQ8ax24R2DVj0BioALo=; b=YCssGXc/+PcbODIr BXsd8GOGDMLCWgs7k6oqWgd/Mt+EYW4PYdHwCAC51JM3WXsGly0s2Xl2SWEQlsD7 m062UagyoNwxlvT8cnTgO6jhxwArBz5Asuazzpj2LFiV7e7jZ16mjdXVtwlyMAgO sHxoKGuNl6xKDsPftS0vRgRwrXBlNxRw8kh+8II88bxIpWrzYXZL2AhLGC7kQY4q zEaj9iFyW0FuFbmofdYOCoRruS7FpS2RQ4w3tSrXqAeWbI4rnS9eivL1F5DsHRn/ UC9VyBKexA++NL1WOE+uRXRcZyxKDoKkIsb/TvWyeWIPDym9Ni7FCpygFHHQ4AfJ D/xjQw== 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 484qd9tatb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 27 Jul 2025 16:26:14 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-b362d101243so2692086a12.0 for ; Sun, 27 Jul 2025 09:26:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753633572; x=1754238372; 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=751t52RdbCcwhdqGfw2MHgsiZQ8ax24R2DVj0BioALo=; b=RZI8JkMAsbjZ3DQjQ32z7vy76UaDeE1rXjNpv7q1XkU+eFl8EUyzNJD9UpwjDrmHo/ GJJ0kHnvqwrkx6h12yLf1fpLTb0WyB4MCbybVztrGmDjjMYgA6x8m/gh/Ejz8ixT9LuD lAsuvgV/oy+RM4QDJH4r17sPRxf4ri110tUXCnocB+nuRTbMImQv+JpwKEcvbSbux+yI +7ycwRcUTzdhr8UzqESoRBzwhx1inqtNo0PocXvTKT4aFuHDNSC9HLs8gagF30BeOot6 J01KCEAKgFKPJ4Q8rstSTaZLjjpJ/H3RsG2SgkB2fOEgDen2m+77ktqIUtpTDtPg6Grz b+6A== X-Forwarded-Encrypted: i=1; AJvYcCWvTfLxxEmfe3nl39sB9PwJsnW7QOH3+vEUzYvzyfRvzs9fgk3JLdQ0sN2Z5yWLJudQLWkR72p0a7Mo+G0=@vger.kernel.org X-Gm-Message-State: AOJu0YzUWL4bp58hfC+1fCIVZ4FGa46ZHn6AqoOc82U3x44yDAJWOAO2 rHDy1y+RI2ksRXth5v8Q2fvlD2EXoGvyFniqZY7Xo2zdmjlp8hxrdIENI+Erg2kqOL2ixfJZsaE jiAYAy3kA9/5ggE5Xo1fopbkoXpu8HKOPmDctXtz+L6PLlfqQfDDsoZmtRgDGXHvvoiI= X-Gm-Gg: ASbGncsln0EnG1CnOTRhJAwddp10BuhNd/KZF/4IuCJ0axnfTtSF7BI+A2dE58+2g+h /HfOtqeufojhpvzjCOPpxV1Hpg7zMb5fu2P7RPIw/MrtwHW8Uv+RFMddnfPfIQ94+L8dxcva+2D CerNfxZ16P0i3VG8U08glrS8muXt8hz9mXvWckXJe1u4pI7NeIo4A22c6b87UiW2svMK55Rx9zJ uM3cebM5YSPtJsb6DnKDio2Y1exw3CpPvODyT12JRtS3aw+79Fkd8qMCogmOCqhRbHO+8GMzKVp l8nvlEnwVHeBupbL8TKd/6mtbFMfwWHFi+KElPaBH9zafiHiZ24CsRGs7t5IjrMXn5RQ3yqF374 e X-Received: by 2002:a17:902:ca8d:b0:240:35ae:506d with SMTP id d9443c01a7336-24035ae51demr1133845ad.35.1753633572022; Sun, 27 Jul 2025 09:26:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkgKR95HfbF6oQwB+eiE+UGyj35NLc2nILT1f4/5kpa8bLrNcUqa3To0n7rXU9i9uwnvwD2w== X-Received: by 2002:a17:902:ca8d:b0:240:35ae:506d with SMTP id d9443c01a7336-24035ae51demr1133435ad.35.1753633571483; Sun, 27 Jul 2025 09:26:11 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fd9397ebbsm29110325ad.210.2025.07.27.09.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jul 2025 09:26:11 -0700 (PDT) From: Shivendra Pratap Date: Sun, 27 Jul 2025 21:54:52 +0530 Subject: [PATCH v13 09/10] 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: <20250727-arm-psci-system_reset2-vendor-reboots-v13-9-6b8d23315898@oss.qualcomm.com> References: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com> In-Reply-To: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@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 Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , 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=1753633495; l=1185; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=rmo18nL+UB7XAtgXRRqne0fPUU/Z0j3760cEPwsemB8=; b=Q7kRckRAJ/nnrtAocNnkqrdbMErSSbliIlAcnFlr5Am3UV00ZuO0f1aKxMH6JVpoxOHtlYRiG CXP4DUR/vLfCVMCZcSZwpLotxiQa0+gmmIkxpVhVAWNxL8A6eWqj+4o X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-ORIG-GUID: MnxTu7oMiApOw9mD68ezlMHzhpekaD7H X-Authority-Analysis: v=2.4 cv=Pfv/hjhd c=1 sm=1 tr=0 ts=68865326 cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=w06kbW2hXDg5FjFnD0gA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-GUID: MnxTu7oMiApOw9mD68ezlMHzhpekaD7H X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI3MDE0NCBTYWx0ZWRfX5ZEiI+21iVUO QYGKzRYt9tI7o1L4XwEnSFA5hrJFqnoBuYSR9ZStxhGHS+SGiwu0EvVu1QmBI+uCvaLTsRNIiWV f6+tOKwKQo2yrnqkwt2ePgG6njbj3HwO2uyD4XHiKAviLTaaRJkc8ZMIzGZTdH4DdTzn2kgP6zu l1tF3zWOwv4QiG025aguVSEnUw8fqrg+eSwpltMcWwhz9Bh3THiTOkNthw9LOpTtRnEfMZ82+5l 9uOGaRdOZB+Wna8WnN5bdc7MUU3JP8KXs7/RnqRl0upBOE84kcBAukQ8+gxyvZ0SO+ux/WNEI/t WiW3c2Qzf29cwlDBaHdtQqZGTqdFhlU0128l8C2BBSEYKhrcUS0EqxrjHRlOWice6wGq4JA9dC8 pLwqeSghTToVOzNLanaBHfwIFe23+h9x/JuU4rztuEWzlwv69M/MTyTto0VrMjwwMHt69XBK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-27_05,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 clxscore=1015 adultscore=0 priorityscore=1501 mlxscore=0 spamscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507270144 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 --- 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 5fbcd48f2e2d839835fa464a8d5682f00557f82e..8cf289a3cfc4ac7014885494c27= fb003a7258519 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts @@ -966,6 +966,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 Mon Oct 6 01:24:27 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 0DA9023184F for ; Sun, 27 Jul 2025 16:26:21 +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=1753633583; cv=none; b=bIEXN2RaRAcWOwUo27dPiJeRI+Yw5KCIh64uewqyWNx6C5J5iUcEHTNdsaYIkKdAoRHXZEPcMLKF1Imcilx5tpX36kjzeqGhmOJQsCDrGANvTGvSbxNu/EFuKCRDhJAovzf+RgtBhoncqFKpUGY0VIeka+QH4BYOgYcaCrVM67o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753633583; c=relaxed/simple; bh=bDYj8SCrzcBMYL0De2l91EChlN4ZQ8qlnKnsadPkWH0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qE54vjC/NyPoTgBIDw8iopkARMzyUHd9XakUc8SWPdbM1esVFS/08vCFWt5oT2Z/NT89q0M+qirUsDttzG048ZfqcWPBa3iq0gPEmnOtX/6mm8KlnBjAAHPeezNmNRrEBlJ6R/cRwgKoNdyuaa+7fola0B6CEJUMMB9uyP+FbtI= 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=fUDksuNJ; 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="fUDksuNJ" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56REb07r008554 for ; Sun, 27 Jul 2025 16:26:21 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= zO1m4Mu1s9USWMxZJk5OY8bYzy46q5JS7Is6cMJU9ok=; b=fUDksuNJD70l19bX 6Bp4yt/V7G/bjPloVzd/OlS5eM0+YroiuqBGLwcrg9agTSJo5+F8RCQRj3CQb0Id iNaUwmG4q2Fbqkip3En/1HtzhZB9lV3f1P4Ia5tfnxiAlhk+VggNydXAt3i2gzOJ 57zsbO569dh5mSwQ6bueeXl8U7s21JVaJmdfzHk3ipB7Ag9VB5YwbDmgSadrhUMD Sf+iTjmOctGTI5ilmWL9G8zC6taZRvRzMG87y5fsBUIRBS8Nnus47cysgZvjFKvg nkkn8saCL7hHEwffzjmuR3rApsCutOEIrpvXWfMcvxjHPNct+FcwhrTrwBhj7kKM IP3nbQ== 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 484p1aacmu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 27 Jul 2025 16:26:21 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2356ce66d7cso60425505ad.1 for ; Sun, 27 Jul 2025 09:26:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753633580; x=1754238380; 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=zO1m4Mu1s9USWMxZJk5OY8bYzy46q5JS7Is6cMJU9ok=; b=eu0hyB98SLqt4TBLd81NUSdIFM5kRVSZqjuNo/1FsxTxfLjhHnd327vX1j16QGWvjy IVQBHuaRaWCzwkqfPJXZ+rD5saDRfLDWJtFMJ0LdbOquNPLAkqun8DqvcGbXsCboNMQL 7t9zhNmg7n0QN+tZoB1TTo1cWBpjgCyZGxGkrhAAOXL6I9Sq2dkZglD2w32Tiebu2znf gJ/4KnR4iZn32LugntRaepw4HeXVpDZ3SAh10UfkWnHcbqVP6Wjh/G8usK3rH/djZpvW oz/q63fNeD6Ac6vhSHUWcGUOdOYkrnH4OxsXSHgJPi58CKm0TFzFyYpqP2YBdtBd5Y/K QJ8g== X-Forwarded-Encrypted: i=1; AJvYcCVHbBoUw+AY0L7rN03ScJe0VnCvGo5LqRAGWNUZ1vp5t+qWWyZHFhMI04wsTJsscL6qGAErDALPX8lzF8o=@vger.kernel.org X-Gm-Message-State: AOJu0YysibuhbSfF2kZTXzsE6e7qOM6BZrhqGalofyrGU9rpPaZkWM9r Bu7eYhRw8ZGSz1TPPyYMKV0SfuCStAoqlV3VeZl1vNE6pCizlBL3MZ8QSBxNr9b9wVeyGlj67QM lGlAVrk8UnWHdFz9s/R2gqogVre8Y3stL3uA2RtRqexHNKP9V2e/dqM4ZUNv6ANvZSxk= X-Gm-Gg: ASbGncvkPa1pg87dKQaFlvhG5rBOKg22HYa40GVNMI5jO63zmia8++gCSkLpTz1Jmnj DSaASM182mrrZjwnv+7C7sU1LGzm2CW4ouOW1IhlQbnyMZRcWlrWFKGqOPvvIVoftwDOUeBIBdD WLnzPl3QsOt14xghZndy9ApuKBfUHITb5XO6CBxHWGvSWHHmBxb2mh8gTQ1TJVB1YYmpijPhsJe gVZPKsVajtFm975kZ3egAbuVLLaWBOjswsKwyU1+p1vcVadzLyxxmtrkTJXdQ0Z6mnEojDpP2G8 YYEW9xxx65wyVTyjkaCty3nOL6RIWK3ncjZ8Etc8FzKtXy1GeKLDAHav5gfRHi4KYX0A4zNncDL y X-Received: by 2002:a17:902:e807:b0:235:1b91:9079 with SMTP id d9443c01a7336-23fb31795bfmr154382685ad.32.1753633579809; Sun, 27 Jul 2025 09:26:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwc00XkR+di84taiD/OffOGEpCSV4NomuISb8nymc7JO+HaEUAMVPaylTxckUGH7O8K1y1Vw== X-Received: by 2002:a17:902:e807:b0:235:1b91:9079 with SMTP id d9443c01a7336-23fb31795bfmr154382295ad.32.1753633579320; Sun, 27 Jul 2025 09:26:19 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fd9397ebbsm29110325ad.210.2025.07.27.09.26.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jul 2025 09:26:19 -0700 (PDT) From: Shivendra Pratap Date: Sun, 27 Jul 2025 21:54:53 +0530 Subject: [PATCH v13 10/10] arm64: dts: qcom: sa8775p-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: <20250727-arm-psci-system_reset2-vendor-reboots-v13-10-6b8d23315898@oss.qualcomm.com> References: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@oss.qualcomm.com> In-Reply-To: <20250727-arm-psci-system_reset2-vendor-reboots-v13-0-6b8d23315898@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 Cc: Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , 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=1753633495; l=1668; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=nykICX8hQVOI73Pb+LH6QfNsfIbx6Lek13GmZ+0SmB4=; b=qv8WQ4rhMzRIfBTQPcknLWKzfFESP1pOGTqD92zp0OFhxDqrgJbvV6E1LADfVHcHGcJQzUbqr o9Pw1v/PWgrBJiJ8iJ/4KEdXWIzCIiK4N7VGCBXkE8I4eFNERL87qYr X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-ORIG-GUID: 3ttbrmb8lbxEkOBWq4A81Wxg7QbdJofD X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI3MDE0NiBTYWx0ZWRfXwzZ9Gdwr1mOe abWzhKRpiiLIKNQp94FG5ZYngLEAtd4cGrIv0H/CfQH4DGnLXQGZcjuHWpx57IbbbSrBCWXmyOr 2u6DMDlU/OYKgDYCgUoLzBJJ/yXi1zXwT+xoF2IGTRCOkpuKCGsGyHkaHalCZh9OBsXsrjKrs8L n66TbQ0Ssycf2FJkyqBP9Q//Bt7+iRkIIDa4j4obQPnmxsfqwJRsXMzlkm3NQUPC2bG6C1G6JKV lqid3nZK/MsJVv79hA/l+FhoBugUULvO+MGKqSq3SIO4YIUY+f/Q+Mi+AsJAjmK6JBm/t4/Fyph X6t9w4dyUtZ+EITeJugCgPYetHbvWbwWXguO2AW+tEEDb1fTgCqZPf4XhanL88L5O6cEbWcVGoX HWFnA1s3zPrD+Vxf3B8umZXWAIhdE/ARJigPPyrYpJUahcljSEODevNEy8y0dSTdUg4PfE8n X-Proofpoint-GUID: 3ttbrmb8lbxEkOBWq4A81Wxg7QbdJofD X-Authority-Analysis: v=2.4 cv=KtNN2XWN c=1 sm=1 tr=0 ts=6886532d cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=w06kbW2hXDg5FjFnD0gA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-07-27_05,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 malwarescore=0 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507270146 From: Elliot Berman Add support for SYSTEM_RESET2 vendor-specific resets in sa8775p-ride as reboot-modes. Describe the reset types: "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 --- arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi | 7 +++++++ arch/arm64/boot/dts/qcom/sa8775p.dtsi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi b/arch/arm64/boot/d= ts/qcom/sa8775p-ride.dtsi index 63b3031cfcc15fe2cce58c0fb7502b19f058b80c..b1bbd3270afc65e9e036e8098ae= 7cec3d3363a32 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi +++ b/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi @@ -874,6 +874,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/sa8775p.dtsi b/arch/arm64/boot/dts/qc= om/sa8775p.dtsi index 9997a29901f57d7894dc1eacb6a809caa427c6c4..52466607035e663f4dc6e5c9722= 3d5c0404650e2 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi +++ b/arch/arm64/boot/dts/qcom/sa8775p.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