From nobody Sat Oct 4 12:44:53 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 F0A0F225779 for ; Fri, 15 Aug 2025 14:36:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268601; cv=none; b=CVXFHeom3uH5UcBPIWtoLSNbMIzBfdqm5Jslw67vs2Xyqj7m55XG+dw49A+2vqIuiX2gdbaVZrJOXss+Qe5z7txY55PA+I6aZ3t8SRE7kGDwKvid1txIMOVQzwKxB1ur8UwedWf+FJ/HUNHwwzO+qnILTOEziT+v6rjLKx/HMwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268601; c=relaxed/simple; bh=FC7RrRfjKXNVyHBQzF6uwLhcss5N7idT7lbjBm/hwDg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QRs72XNIiO14ockA41kXp2Xl603LjEL956LDJMuHSe/hufPRVuQWe94cxZtj3XA0QJ1BzRIBWTte9BgtZykoBteigcuCLqa7qfK3iUJDCzcCJTnf/oWQapMPpywQCoMAxjaimUcZe5T4M6X1yY8nXWUDh1gL26hgTNBwiV8RVk0= 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=bfxoMusV; 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="bfxoMusV" 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 57FEKMY6021968 for ; Fri, 15 Aug 2025 14:36:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= v4YCBWmY0mp9H7MQ3j2gakQJBYTosZxb2APt1bK5h/Q=; b=bfxoMusV+UeHpJYS tVHWrsfZOEK6xVzwa+eAnGLEM2Aqciwlq7CI4IB/UoLpjhHfbPoE84geqQpcR1Eb F9+4fXqNoElfeUEf9uaXJKS5XDsDnOkxLR+ecgcutM+weSBgFXlPM4nbSlJKZqls uQYv05X4h+nVUeqkh6n7bsQquvWvji90fYjVrnzLX09FDydmJWs0SXz2DZH01mt0 Vs+E73FQwjQ+JO8YT1IwprMQEHiHb41mrB+0cYROltsng5+7Jr1NlRY7ggiE3jUT IwHtnJd3QOne8M5AQNbq1oUPoIQ67YJyeTR38pJDbkwij2/AAeKrn/lohfHNFuFJ m38lDQ== 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 48fem4q613-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Aug 2025 14:36:38 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-244582bc5e4so22166125ad.2 for ; Fri, 15 Aug 2025 07:36:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755268597; x=1755873397; 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=PIT0TeypYf/FLduJDMNuc/THO5O2dRRDjktHbxb6ZS+IQ8icznPAhHV4TPaOB07+5/ 7HjcKXkiZe26FHUmz4fVeZyKnVeYw1Xqh1R/Bcu4frhKHLZVvh195X9tPI7P4NybYD8U qaATaB+3AwEbRMCvIO9Ph7xyt5p1m5KzXpi6TL/FnkrWUocsa6c+XlAZ3j4ko5uT4met 78EhGdPNc+UhI/ZKTVbRA14sNv0M2UMIipVupe5msL9cPslaTrIM+bqJU29PHKVz0F8B qpJnzgvyc4Z5vTedbslky+8G29aCezBS01CY7AE41J9bYI5rbQOORGmqIVq/bMulunIo +tbw== X-Forwarded-Encrypted: i=1; AJvYcCWg12QpXd2yqwE66sHrRfFzHFjz565vARF0MaLtBwM2/+VAoo+MAnwJsA46CbUTra1sNXhdn5mOzTq4BOQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwdefTTkzc91q8VywyPqxj0O2j9g7gjAydb2MdgMrISRjPegaeP +/7dLCbGVRo97KC0QLnXbXOHg6YSfKPPLt07D+SbtwGeZBFSmHXU8kKjiBmq326E87LlxfYQ+EE IKHOpurIt4pQqqyTYQMI4VzHXvFZUydkeJM6rHbXuigNOyMD6Mh8zLSHQPVWb/Tp2+6I= X-Gm-Gg: ASbGnctnMX8swqXgU12nVZMfqgk+bCjxq1KUxzNqrD/rEBhuEIJnaP+pCi8clcQIxOC tajudDfP3lpi2iQUzeK5twyRu8uemT0mQI6MucX4qqkN9EbTGa6oKUCu2wWHaVhMQLCWSGST/5/ XsWYbLfUOWCcvJVYrYVov5l6Kj2Wl0xELM5bar+T5zr9yuoKr4QZPlb4CO9j4lt2bxPgb+t4roi Dm3EG9HjlSsK/PPPoCPN8zHmq/PnN44ohH16Sv8lDLTzJQLr6eNHfc35RLE6f7Mw4iyn/Y/4MkW sPVz14sD6MmM2VM6ylMwCA0WBT/5c9h8WxApPH/1POuG5HKsqmLjahivnOZGypsX+yUKWK54bGV q X-Received: by 2002:a17:902:c404:b0:240:2145:e526 with SMTP id d9443c01a7336-2446d5bced9mr33643405ad.6.1755268597527; Fri, 15 Aug 2025 07:36:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE8j2DBTSDu5n5h8GFZmi+daS6bzM/R0ejhF0k7J+060Go5g2KE+vK8hO6LMHELOHeOiEIIIg== X-Received: by 2002:a17:902:c404:b0:240:2145:e526 with SMTP id d9443c01a7336-2446d5bced9mr33642895ad.6.1755268597056; Fri, 15 Aug 2025 07:36:37 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b472d73619fsm1437576a12.39.2025.08.15.07.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 07:36:36 -0700 (PDT) From: Shivendra Pratap Date: Fri, 15 Aug 2025 20:05:06 +0530 Subject: [PATCH v14 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: <20250815-arm-psci-system_reset2-vendor-reboots-v14-1-37d29f59ac9a@oss.qualcomm.com> References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@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=1755268580; l=3679; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=FC7RrRfjKXNVyHBQzF6uwLhcss5N7idT7lbjBm/hwDg=; b=g4yjAP/BCuktcWiGQdYaKnjeQsltqIlsf61mfAvCUxLEzZySADm+zJuHV9ye2qZLIB3RDyx0V W/C8BqZAcwoDo313Sw6zzqFi+iyDxtUYtypSJx0xwxb8KDxTU93zSzF X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-GUID: gTw473eaEjFIfZKfmUsKGAvySdecZxy5 X-Proofpoint-ORIG-GUID: gTw473eaEjFIfZKfmUsKGAvySdecZxy5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODExMDA2OCBTYWx0ZWRfXwtNzfPfYn8EU DqdYi1PBKFUHkOhMh52K6gFy+LtTjZaetyJdvVqRxxIOBsJ5VpaTZ1XCo6K+xDMiMjwapqFSMPR 9OAknhEmMYV+9qs6UodKZx+XdvGHuuMmMu0v0mpxSteFAohzFgcvzkBoccqzlIXVZSDQ28CYkPv vzr6hH10H9DxSwEyUoAZoYMu02v+k3WUDIp78R+n69vhs8dapqjVmr5XXZK0bszEblH3eeKTMsZ sc1hlOucSHK1L5w1drKPQMNAc3pE6LQAMpYMIYywdlTDhkaFuKMiT+wzz8nBIFM/6iKhk4S0tT8 HuGGKGdG+s1+0QnADEVhhgfs69jk9q5WJCtzqJ/m9zv4SUBDeqB9rrXBTwH23wUz06cGXb/iu+D TFdUMPsc X-Authority-Analysis: v=2.4 cv=YMafyQGx c=1 sm=1 tr=0 ts=689f45f6 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=EUspDBNiAAAA:8 a=iWTyA_h5fkyOTIp6uasA: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-08-15_05,2025-08-14_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 priorityscore=1501 spamscore=0 suspectscore=0 adultscore=0 impostorscore=0 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508110068 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 Tested-by: Florian Fainelli Tested-by: Kathiravan Thirumoorthy=20 --- 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 Sat Oct 4 12:44:53 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 26FC4224B1B for ; Fri, 15 Aug 2025 14:36:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268609; cv=none; b=urHO/HuDC0qcxgZq3jpS73bDDPTkn13HIVJh2BS4FPCIFNyJFGbXMhpJgaCYkpbcnsxPicgPwUHzpe1HGBiGTMEqZvbYCgeKBJyYIwU11/HF0huJltemG7yj27EIpkDJCwYaFVyacKl01/+dXua7lEzfJn3I3VLpu6s5GptdXw4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268609; 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=fzMrB7yE6hOEBjq2SUHZDgMQjxAg+ci0FIKCHPhB7uxRwGz8pBfqUv9sM/BIkYYypFv//zejvF72GmqD/O6bUPABOBfqxkAOUdFRNzUgVrnf/3zWB4uGp/S0lOrtAjJcaMHTUtYR7jB5YNGZ1Xc7Hi3qEIUa4YlHmeIbt5qpAD4= 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=bMHDQ+fe; 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="bMHDQ+fe" 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 57FEIlIw017486 for ; Fri, 15 Aug 2025 14:36:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= FDqwUezYGa9CZCaFbdXED7PEdoZ055Cwe3xHxx1ns7M=; b=bMHDQ+feRetjFTrc m5JlDNqAhot64rJRTsRRmgf7cf42kyAgR1V+l7Y5D0ECygAxX4/yeec64BsqKnlY YbDiwkw7JnoKjaykTWPb4/xiIxDtwRWb7v3OmOOG6xxAbQZBxLLAd+vdmrfjKd58 BcfrdO21VrJvSfRqBiGzNHKrs30CIfgpmwi82btpa+9v4qyVrNIWuivMx/TBmhVD upp0jI3exh1jVPrg5Kj+c9k32yJPhbZienJxS+Oi9N/hKcYwSan3SSZnHvcpAuFN sCUpMqtH5WUAFL4CVbXZYrIqQulAhHSOkM4WvjmhhspFX+4NmbY91pUpcVOoE+Wp 5VqMzQ== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 48eqhxhfw0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Aug 2025 14:36:46 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-323267c0292so1940572a91.1 for ; Fri, 15 Aug 2025 07:36:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755268605; x=1755873405; 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=oh3jpE3hF5pnnTXwrvK3KlBkXKpDScPlKTjpthcLhE3SbmbMoK57PHkph+GtNYYb0E FxCJiO5BcALUxG1I2Znd5zEFNdMwXxyMsmfZAQ3JbXvXg2Wuq/te2vgTMW6UK68SSL6n UNR+DCmd9MDKHoRNNMkiBViQOahbuqV8CWdLhJIlu00/QrYSu9zZFS92GgpcrbVz1537 /nEGxKZdjJ4OLAQ5hvNP4i35YvfWsVVFJ8SXzIoitbs0AexieOibeHrpdEmvFPUxl0JT /tbhoKkBkMLBT0/7eEp2bP/8EIawOcVUo5++66K9hpOMV0oiNz9XDbe3satHhkUS6CRq bTlQ== X-Forwarded-Encrypted: i=1; AJvYcCXGKGOqLb8KzI/p5zb4f/+p4pcZIO4eRMNACGNzZ866e/UUQXrdRorW6tUs+iRPqoyHO+K6qQiUxp6PIO4=@vger.kernel.org X-Gm-Message-State: AOJu0Ywu6ZjK6yjqGnAHGTtPWgoxRq1x0C90wG0+ZFOSYPiXgLmWcDSE gcmDMXEdPXIm3vIBn9caFE+naNFBU0TyGAb0jHLmrIj+cFRNCvW4Nev3Q8U6ej0HVYpjJqv2e8R bzjtXLGt7Rw88xjOEab4KUsaP64WBTFwQIL/9nzq5oogZ/qivfXH1OFDHJzWN1fZbOoE= X-Gm-Gg: ASbGncuakIfSgDmOezkrDtDFKCJ7qBwnoGS8l7XAWktn79JKJ9eBvA94O/1ONLK9sUT TwiqM9Tmp48M94LZxLCU9R1dpfiI2Kch8X+LDNMw3FR0WOeNobBXbfFLTF8aL1K52y+mqVLU4FT YVMZI5c0ev8oT/AyrEn5NYxQzvxHOfOlb7J6vfI+orCxo1cOd2X921QF7k7Hab8V86p7pnf2VHF /oE5L1peVlFVggx7+VYMpWcRkxR6Jx+HQgXjMp7sS0k92cmRILx9WjLRSGT36ISIlnzsIluJMwD kkPq7Yk25jenGJuYbuRgJTPf9VDCSxbwleGkM3at4YAFeq4D870Bc4v1m+9emUx+qrPQ6CVwRwm y X-Received: by 2002:a17:90b:2dd0:b0:31e:f351:bfec with SMTP id 98e67ed59e1d1-32341e5e0a4mr4204549a91.0.1755268605447; Fri, 15 Aug 2025 07:36:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqZ62D0ilw5h3pOxyKsD9atT57r02HUkM9y580UM4/h+lMlRwpO5+zb86tLI7CTdiz0ij7TA== X-Received: by 2002:a17:90b:2dd0:b0:31e:f351:bfec with SMTP id 98e67ed59e1d1-32341e5e0a4mr4204499a91.0.1755268604960; Fri, 15 Aug 2025 07:36:44 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b472d73619fsm1437576a12.39.2025.08.15.07.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 07:36:44 -0700 (PDT) From: Shivendra Pratap Date: Fri, 15 Aug 2025 20:05:07 +0530 Subject: [PATCH v14 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: <20250815-arm-psci-system_reset2-vendor-reboots-v14-2-37d29f59ac9a@oss.qualcomm.com> References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@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=1755268580; l=4877; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=BzWfToJE3ECxETuJZ3k/sBp7q/SRF/jEhj86+u2O1rk=; b=RYuLdurTXlXjQtCHE5nX18yZK2e4lWHzqk3OBDVjfSP6IPXK9bBT/5bHpFJuKNoKQTKctA3aE EXCLcCs1FcgDo9wc3NWVVqzdZmL2XVhAsx81HO1e1vIlJH9mOiOFdu7 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODEwMDA1NyBTYWx0ZWRfX/+Xid+FguiSV NARsE8fxZWQu6Eoe6sH9OukO0YBO5yNB+v5NWUIwWQwN9nOjIVlWdWJlpEmtbjuDk1L4nvHI0eW o6p+zJsZGO32CDQ5IeMeBMB9v4ErkeetbrHm2lsNxoubP6sP1GSggprPUKwDB3cpOODGHeimwDJ EsCrocp9x4Ummi8oYSKY6pZ9WitM3PEqxQaysDWIPIkOrNYYdl5O/MRhamIk3Hlt4fNZXHcrzbk GoWM5Spb1snpl/HDqE+8x3ffFmELZ/A14JfJHW9MZBx0ZGzG5lkisRN20UOusvVAFAxPgE5UdTu d9oAECLb3EAKdxRZ/HfYkd5ZPlTJ+RefCJ5uWn0ncKtuxnnLU/V75TPQ+UHbiTUZ77ztVCHtoN1 9zgZQ+6v X-Proofpoint-GUID: -COjCgXA0WhOvCCXbsnEpC8iSiFkvvAA X-Authority-Analysis: v=2.4 cv=aYNhnQot c=1 sm=1 tr=0 ts=689f45fe cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=EUspDBNiAAAA:8 a=IcmTHOqSNbDvJ54L4SUA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-ORIG-GUID: -COjCgXA0WhOvCCXbsnEpC8iSiFkvvAA 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-08-15_05,2025-08-14_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 priorityscore=1501 suspectscore=0 phishscore=0 impostorscore=0 bulkscore=0 malwarescore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508100057 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 Tested-by: Florian Fainelli Tested-by: Kathiravan Thirumoorthy=20 --- 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 Sat Oct 4 12:44:53 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 7288722A7E4 for ; Fri, 15 Aug 2025 14:36:55 +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=1755268617; cv=none; b=VfAITbD+l0ELBJSUeOfEqVfrZjQHE3tiWM19ZfjVupTLIStR9k2DkXUHkiG9B3mq9mpIp0TwSnr+JrUXJ8YhGJsHOx3yzInVRZGzueSM1W3lg1JUkzDhmyi2UqEU+9xHnftiIkCbH9vUN2+p5X4xM1XC8tHEkAXWc1FU4isyhl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268617; c=relaxed/simple; bh=RHatRDIyZlkowVAM219pHMxjJ5gZoVq6CrecsaGvXwc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jW09fD5SueeBhVobTayQKQU7vDgbZ5hGxAzqJFeeuHUPovsO3+qBEwrvrB2L9MBoo6h/Wj0uv11y11O321n3MC/Rv1ywxCv1y4/n/LBS+2Wn+i2iZy3f4nZASqG55afvuQmvRK7ufhF4snif7JHzyVwI0NrFoUp6l6K6lLSoJ3A= 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=o9l+JPgq; 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="o9l+JPgq" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57FEIpIE027226 for ; Fri, 15 Aug 2025 14:36:54 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=o9l+JPgqVevviFZf 7h8ErX3zGgmrd+xazm9yhFlsTZDt9jRsBvDz4YsPdnKyEUQu3Ko3h9uluDMQaVVQ 0w/F23gOQCRNbpsVMVCPEfjWjIHMxEZ2uVJm17/LdWS8EvjQN91fOaZqJgXDQuZl 4TU9nwH3pG+oX+WEPDXgXwa5S/AfLh//HWYFUE7NdFpM71y+g476MRaJGT8/e7Jy mYd0WJ2mJZOUDpVrfBc2s7eIV5eLC5L5LJGKbenm+RqmSAl5ngMfO3pe5vTkNxHL X2IrfDfJaoT//jJsa12zJ5htSlY88pqxJfTkPLTNq9PVkRncRwAde2cnM4ORGrJ5 RLQPLA== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 48dw9t3g2a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Aug 2025 14:36:54 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-32326bed374so1914584a91.2 for ; Fri, 15 Aug 2025 07:36:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755268614; x=1755873414; 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=ETm+WN6H08BGzF9zaIgKeKMCB2Y3iBhTrS3Xql4D3G1u4ROnGjOdsOrgmnOxN6oKlC PkVk4sY8pIRZTYk6ij6TTYytAjn0fOJF2SEVCml98UdTQWY1C2i/LiGbjyUBUrsHa6oi d6ZWcTwsL1aVe+8Y9g/9wGStKKEgZ4/+WxCpEFr2daIktFVotqnAD74ZGltAhxp0bNpx 0JPs69LLtSJJXAygA2/mLP8dJLC88XuhYMTx2qctpwzTSfr20AK4SARkXwT6TB2emECX CAEz0/vWTWLAdVRe12TRI/fq7O9bfnDwPpuMbP+kgxbblzNVy91Fnnv3MupA8w91xA/p SuOA== X-Forwarded-Encrypted: i=1; AJvYcCV5l4ZRWxeJojub4QJRS3qROXH2mIrlSbTH5VvSd89JtKdqoJqYRhcD/RLwi7bnoj+sqWpUxxcr3Qef3PE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5lQ2oT/OM2jdlmb+ioDOLr5LlKCWHr6Dbbs2tBvChNm+p04mo iJqD61v9ag64wy+tJaDfnfUavLP947zFe1Yrbom2FR9R9MrleDg8rX1/lnXK1CfWF2IDPlamhTE hRbkfnopjVTuW6fG889tqC6CAMQTYemPvY4e50Zhzuro5dRwb/j3AQGJ7SIi2TNm0GEk= X-Gm-Gg: ASbGnctO/UO8BQtNCsroI4cRiCje+7yNc6jikRPO0rEMXkLVS2I2xi8IiTOFd8SUAGs hjv3HnZheKnER3qloqR6HjEq5cph1y+MJdFa8Pi/VKOven6f6fxYE8bxd76nMS/Wo38YuT8Nlbs oCcjZVF5ebxntHH86j7wzhXUDTntGUO28AV3yorxlZH5R9xf8tw6XyIB0owtmwUZwjEum//ACM1 2Fk4Vz+Z2Cta/gvTA2BZIL9+8UlrHeJrTjqXcKyGan09lonleApf4JGv1ciNptomiSD755XeKcz nljiC2lGf28GPgHAtIZzq9QV6SmU6zy8oHIoS58w9yJmgyUGlHQUhhtvxLOazGFSD71eNzSp81L t X-Received: by 2002:a17:90b:2d4e:b0:321:157a:ee73 with SMTP id 98e67ed59e1d1-32341e12d67mr3916439a91.6.1755268613544; Fri, 15 Aug 2025 07:36:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGj835wE+DH1Bq5Gb7SwvlsRfgqjTmxMNFT2lHi97z0/St0F54cIRT60UpOAXEzfTFojVrzMw== X-Received: by 2002:a17:90b:2d4e:b0:321:157a:ee73 with SMTP id 98e67ed59e1d1-32341e12d67mr3916341a91.6.1755268612916; Fri, 15 Aug 2025 07:36:52 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b472d73619fsm1437576a12.39.2025.08.15.07.36.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 07:36:52 -0700 (PDT) From: Shivendra Pratap Date: Fri, 15 Aug 2025 20:05:08 +0530 Subject: [PATCH v14 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: <20250815-arm-psci-system_reset2-vendor-reboots-v14-3-37d29f59ac9a@oss.qualcomm.com> References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@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=1755268580; l=6956; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=RHatRDIyZlkowVAM219pHMxjJ5gZoVq6CrecsaGvXwc=; b=KeKthTtaeCctuQ5sIvZNIc3NH+m5E9prhiXDQPj7r2yZsLv9zM6Td/2W/u4clW7QOvHnGfH3u zYfoe8If4sJBfB4nhnSm6KdYLNV8APXtDp9dd5jFoRhk+ZZt7gklgo8 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=J+Wq7BnS c=1 sm=1 tr=0 ts=689f4606 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=EUspDBNiAAAA:8 a=bqVjg2-MoX4cBg1ZSeQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-ORIG-GUID: ucOD7zBHqss91qgoyqbb3IrBG7c6Z8Tn X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODA5MDAxNSBTYWx0ZWRfX+JKEOro/+NEI SgpJu+pftqmeccQgV8TkzlUj97BQ+P9lkpy3Yfp1NcpbYAsdALvh7WGSfWBACvF9uyq1eBbhOwk YSJjZv5Lwng+yBLH2VNqw4DwNhbP8dowBBjoO8ycMouSGCiUdG5aUIO/bodg4tunwQWKxUDBCAn GAZR1LsUTrC2oX5pwkWgXFYAK3zp3TqqBc9jwEVfQK9q55V9srCq3ON7W9QLmoZl+wg5+4zCzOH QXZf4EB9LHyZM4IepnrSQV2hWbOua658M9/4rgHt/REuWQh3i4ZueX4d+L++F/e85ZaKsdyLk6k 1rvwCJ+nT+DhiApDJDqn0USrjp1uE57EGlz1c38G6x5zHQKigoyt2G+R6Cw+OsF/tPHDHukP9Yj EpfyG0SI X-Proofpoint-GUID: ucOD7zBHqss91qgoyqbb3IrBG7c6Z8Tn 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-08-15_05,2025-08-14_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 malwarescore=0 impostorscore=0 bulkscore=0 phishscore=0 suspectscore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508090015 Current reboot-mode supports a single 32-bit argument for any supported mode. Some reboot-mode based drivers may require passing two independent 32-bit arguments during a reboot sequence, for uses-cases, where a mode requires an additional argument. Such drivers may not be able to use the reboot-mode driver. For example, ARM PSCI vendor-specific resets, need two arguments for its operation =E2=80=93 reset_type and cookie, to complete the reset operation. If a driver wants to implement this firmware-based reset, it cannot use reboot-mode framework. Introduce 64-bit magic values in reboot-mode driver to accommodate dual 32-bit arguments when specified via device tree. In cases, where no second argument is passed from device tree, keep the upper 32-bit of magic un-changed(0) to maintain backward compatibility. Update the current drivers using reboot-mode for a 64-bit magic value. Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli Tested-by: Kathiravan Thirumoorthy=20 --- 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 Sat Oct 4 12:44:53 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 97D00233128 for ; Fri, 15 Aug 2025 14:37:03 +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=1755268625; cv=none; b=uyPDSzSPg/NsJ4YHkjWHLq5RaTUCh4a0qqPz/pkEIWoHv3RW5pLJKAPq7xnOw27KocRE3GOJwSWPXTdUJmCtuxM29wlk2J7QJaVsCKCh8W7Kldg217vzaDnzpUFSR33l0V/o6LScMENL0I60t/UgMxDN6mF/KqFOReVX/eKYd34= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268625; c=relaxed/simple; bh=6UpIHQY3njE1j0TJ0MawV6xPKXDH8pCRBbCtZv/uOBU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DMZi777Gl7EWxTeTAllIb7j9zuzDcmxlt/+sgKPn9KBlunCbQF6ps1oUAYLLSz+Ly9WfUahXb4RNzPUHoBFIU8uKlR1gOJVjmqa6d0P0AIiK/5edplMWZ4wKjtqc9np4hl0822enNkEcFKhS++t2k4A7yMzEK3sNVyRmAVN0gnU= 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=bevyjEe1; 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="bevyjEe1" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57FEJAxS022207 for ; Fri, 15 Aug 2025 14:37:02 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= pcKQYC44F7/HHxcJTpRMsYVL1XCMKVcn/AI2FZIwK50=; b=bevyjEe1jwPxZDjU co+Z1yg48mvM4gR5g1/hLZR7nCxGHFzQPnmmWJS/jMuLs1emYPNrJnn8QySNmg+R QdT3Rrtzndmv22skEBf2Ysp9vh4V1azFsYDLq0Fl/DEjhJWSsZBjLOfNItU+UwKe XP6kVVrldoMQ8oraGGjIVW/pk2T3mNKzLjxXv6XZX6Ag3bS5YIPs5iD+D0Cjh3C8 Q35pq8PeYKg2KsluX/XgQruLdSH0UDmC3aVf/CSqlqmJ6kn//cBXVpqJI8O6Nx1n a/DNSUAW+sZ7JFOKwgqFlgb36I6rUV3zskhT6ZS8cwDmXpQjlVKWEfFNVsv5nl6Q 98ZWhQ== 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 48g5hmk7r0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Aug 2025 14:37:02 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-244581ce388so41554485ad.2 for ; Fri, 15 Aug 2025 07:37:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755268621; x=1755873421; 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=pcKQYC44F7/HHxcJTpRMsYVL1XCMKVcn/AI2FZIwK50=; b=dAuugye18S7G2hSOGHS8F5JFD6yRft2dAMNgt1tzN8dNcUhtaGyT8RsU/a4reXo1Xd Re1T4UzwmQ7QH5VIxlWgK0xhDnWT/ae/2ZdUxSd631UGWujJU3lXP/to+H8DjXS4ZWVe CbOisgIU5M1U4n8YuR2qNEFra1yIOqQiYh+AbnTsVSAo14RUu+htkQesEBCa77EsIpIP 0mJEOye+z8zQIRXGmhHvrcEyttRL0v8cAf3kf2NicHiSGwwWySpZwFdwWXCP9qNaOJyA oB0WvNqeFbHZhxuw+pSSr4ot9kRYa2aj2qFe2ySaGEnlUnfmioJdWQLcw3mzVVmEwrTH vw7Q== X-Forwarded-Encrypted: i=1; AJvYcCWqR2T4T1Q4TxVSXp1YuA5ATVREILZygKIMfRXIIRtC5o/KkL6iOae4WHcWdPvbDjAeOpHWgCRUpOSQPVM=@vger.kernel.org X-Gm-Message-State: AOJu0Yz10xVAFVMWhBYR4XEKvqyqToxxTsYwSA/6zb6Ogvs5jEwg648R VFkYJYGRXwOLdLKI0NTiv2RKBvG+W9HOU201BXZwlp65owrrNOCLXA53GJz7h14nAhGCnxIDsxm 5SybtVN5FUqqazlMLSep7KxP0B8aG5XPxO3JwFe4PkzwskcUlQBnpm1sPuZqO79gTm7o= X-Gm-Gg: ASbGncvMkVWRLpoi2Z4HoD9e8lnZcEQrr2z1v57RHo650OtRlhDxvskaI+HG3DD4Pdz OCDhYVS69kFjxTsNLQjyS9VCr1NdObrmdk6CUUD7CYXgZEg2JGpgILOWW/yzuauR2dQqNkqE229 MaUESlOm4cTbI1yRhwJ3zjMSfmbg3bwxR53g1x1RIbUqucKDyNM0nlXVW0GSe0Y+zg1aKbFtIfu fWNb3HrdWJb4AyOqsLhZdu7NiIjs9Noxf1gkIwvFNXs27wvBfWFkOGrRn2lylWYv1BjJQ/kCLvl QIkTmNP0wywx3SbLzM9vLiKWEKVacYe8yEmRQE4IBqzOkYVU0tiYVaEMlfwnbOAl9PVkre5vaLk T X-Received: by 2002:a17:902:cccb:b0:240:a430:91d with SMTP id d9443c01a7336-2446d6d389cmr30088225ad.10.1755268621232; Fri, 15 Aug 2025 07:37:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQkvO8cZ+sj/6HskI8jsjG4+3pCl14X8qRamDdNfNjEematfPmBfjPeAC5kVjtjoUPPQXU+Q== X-Received: by 2002:a17:902:cccb:b0:240:a430:91d with SMTP id d9443c01a7336-2446d6d389cmr30087955ad.10.1755268620832; Fri, 15 Aug 2025 07:37:00 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b472d73619fsm1437576a12.39.2025.08.15.07.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 07:37:00 -0700 (PDT) From: Shivendra Pratap Date: Fri, 15 Aug 2025 20:05:09 +0530 Subject: [PATCH v14 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: <20250815-arm-psci-system_reset2-vendor-reboots-v14-4-37d29f59ac9a@oss.qualcomm.com> References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@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=1755268580; l=2315; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=6UpIHQY3njE1j0TJ0MawV6xPKXDH8pCRBbCtZv/uOBU=; b=XeumJxHHSQYddSy6MNLQxD92Q3Za8c4lIAtTOM08N/hqVoheKPVBZa/SltPTQWNExalssa0Qn QigkEEeOxnIB/yuhy3wZ9mBC4A+f3iDZA76ZIqaST67YodcJl1HgDMC X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODEyMDExOSBTYWx0ZWRfX1+ykAGzTABx3 KEDs9UKWggvTjLlQ1g/xuMKLL3E657mqXmUjxijebQ5MyVTmocfFaFkEgI75WVkkxtbtYnuRluk gyrxkpGizApw0C53hWiTB2lLDNaMVObfTTaHq+LTFdDiq+gNvKXKILc8CPDxWbEGEoA81zyu7Ck 3Okttsm8dXMIMtvqh7wmWM5c3z7OzbU9eVhj0oU1ADrKOVJl77FbpufV5/WbmUsw1LZZZr1y9fk fV5MRX+G7irxLV/kN8spxyseT92ga6mYk4/YCbZISLRA6aOI1EwIvLGQxJvhz7CUS60MgKV8JLZ kHgur8u1VsXGrt3H9dIh9F9qMsi3nLbj0+YxGU+uENxHDO9u5S4IUY2FhvSbOjx1VcW2O+uj2hx CxcVmsOM X-Proofpoint-GUID: mT9NjV2jcYebB0TrPlvLxd5X3TIIIDu2 X-Proofpoint-ORIG-GUID: mT9NjV2jcYebB0TrPlvLxd5X3TIIIDu2 X-Authority-Analysis: v=2.4 cv=d4b1yQjE c=1 sm=1 tr=0 ts=689f460e cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=5CgfHzhl2afHKY-Ush4A:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02: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-08-15_05,2025-08-14_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 spamscore=0 phishscore=0 adultscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508120119 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 Reviewed-by: Sebastian Reichel Tested-by: Florian Fainelli Tested-by: Kathiravan Thirumoorthy=20 --- .../testing/sysfs-class-reboot-mode-reboot_modes | 39 ++++++++++++++++++= ++++ 1 file changed, 39 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes= b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes new file mode 100644 index 0000000000000000000000000000000000000000..6a3fc379afae3a6caf56ad0b73b= 1c06c43a9fee7 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes @@ -0,0 +1,39 @@ +What: /sys/class/reboot-mode//reboot_modes +Date: August 2025 +KernelVersion: 6.17.0-rc1 +Contact: linux-pm@vger.kernel.org + Description: + This interface exposes the reboot-mode arguments + registered with the reboot-mode framework. It is + a read-only interface and provides a space + separated list of reboot-mode arguments supported + on the current platform. + Example: + recovery fastboot bootloader + + The exact sysfs path may vary depending on the + name of the driver that registers the arguments. + Example: + /sys/class/reboot-mode/nvmem-reboot-mode/reboot_modes + /sys/class/reboot-mode/syscon-reboot-mode/reboot_modes + /sys/class/reboot-mode/qcom-pon/reboot_modes + + The supported arguments can be used by userspace + to invoke device reset using the reboot() system + call, with the "argument" as string to "*arg" + parameter along with LINUX_REBOOT_CMD_RESTART2. + Example: + reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, + LINUX_REBOOT_CMD_RESTART2, "bootloader"); + + A driver can expose the supported arguments by + registering them with the reboot-mode framework + using the property names that follow the + mode- format. + Example: + mode-bootloader, mode-recovery. + + This attribute is useful for scripts or initramfs + logic that need to programmatically determine + which reboot-mode arguments are valid before + triggering a reboot. --=20 2.34.1 From nobody Sat Oct 4 12:44:53 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 E9C202264AA for ; Fri, 15 Aug 2025 14:37:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268633; cv=none; b=A1mAj8OPwAxwvvmmsiCX4kx8XzgR+eir4AKNq2+t2tVPa/sGo7x4nGW2VR3FdyMEWN6BH8eKTrYelKDdansG9WfBytJSx3hyhYMNxwiRYwgKY0UuHWXF9nCXdE6SnwQqB7cE7GMB1QRATbsrdFhiak/Rxgwxs2Q25SofuR2pt6M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268633; c=relaxed/simple; bh=/cq18pjLWig5FtkFDIdwUtfrzOBXNV40XqrxsOZOo0Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sVEUgv4/z41H1PBT3IYTvDyE2Ev76yAX824mCQdWz2S3EqrFnOSyJsiKQqtIL1en/hpfSwIIaMt8Zpt3lg52OobpibnKC3W9C4abg8rtYRbGbmt0RWhizOGn0u8prpcrnvJF9swV8lAf3ld+Ip0VvgW4iWC7SqhmSWXBm6L+y98= 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=X80UDi5p; 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="X80UDi5p" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57FEJE8e027558 for ; Fri, 15 Aug 2025 14:37:10 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= 3zDTag6B0PbaB1+ygZD7ZZ/pAHwEXMw02xGe8CGFm0U=; b=X80UDi5p8jwKanti tZZF6okguAFZd6oPl0JQ4U7uJ4Zo8tf7829hjeuYEz11g0MDd/QpTWBHM8jeeKqb 5rw2pyYndyUmPCF3BBN8qAxMgtnotE4leopT0MXV5pV76tpUMr/m+uUV3pW1tgi2 2C0nv0uO/fk8d7DcsWCVXaOjv91ClFiu4RncuLrd7fmf0ZX6NQceSjoUIfDn/Rez Smfm03FliLkI+5zPfLTXs4QirqqFpaNnGpHcRzERkwMgjLYetfD6HoW740UugByy xplvisF9WJOu82stjlrPrfedv+oijjVG1ZX8voPGZlC0O8o+sjHk7jNcUQoYGF/U dKM8OQ== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 48dw9t3g3b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Aug 2025 14:37:10 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-323266b41f5so4027344a91.0 for ; Fri, 15 Aug 2025 07:37:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755268629; x=1755873429; 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=3zDTag6B0PbaB1+ygZD7ZZ/pAHwEXMw02xGe8CGFm0U=; b=wFTBtDzw3m+kr3HC2TcqZ+atFFSW0OA4zKVbQY/14LZotM/ZIU2DUhvHHjzh8dXLaH XSVS5jAA1afrRKGzorSdK8oVxz5GeX7TVaGG9uL+hCcAqvUw0TTz9vVcaZzW7bd0sHxx 5H0OdkQKHqox6Ejs07184mBChXVb/NRUqqWrOdhl/ZOvUkum4zivrQ4YTbHgIFxpcC6l SBO+/h/BkaURXNwlAUt4KbZMSlsLjKT5zH2s4jrac4Kq8ltW8naqprhRc389bV5ls02T LRyZFn9SYmE+RBNv/xBXSbRPOGqXme+T/h4wU0Qk2rrpHR++yg+sQN9Dp2S6rLmDA1q+ PKeg== X-Forwarded-Encrypted: i=1; AJvYcCXA5fKTPJ/GzeiJVuBmYdX7C5cI/Mz3GVPa7OcdrXL3oACeDATKwyTZtqF0muEhY83SwFMg1KJNeCiRc5w=@vger.kernel.org X-Gm-Message-State: AOJu0Yy61h65LFOf9mUsfcYBcJcPAnWbeMnRHFpED6GdISxznjPkQXf7 PgT3c08xPO4hZu7fgZ08Y5MBJEctLfaU4Uw7wsM1KEm+ob2g0EB0thK32ooYGJQClQfGHGs6ExI fjnR3Hn53HsZb6JRiYcmyyVJov0Dlp/B+tFvYT3lyOH2j2uStZJB5LEU0a2VWCuMiCQ0= X-Gm-Gg: ASbGncv742mgXgUbnmiUnIsgETdrAAIGkwyA1iEt4q2FoassjyO3fP2KoGkNTS/GkP+ 4Xym2EEgEdG8qjxtDJbkCeHRAdZYuezXGllN3vTHF3f6Id6jbhjBZJ1qXs6LRE9Z9gN+7MKQTM4 8FtXmWDo0puncELjIDDapUI1PyLs+zpdVTvys+l9PRD6ud9Sm/ACnb/P55m8g2HmVIlMDiaBJxN qIb2lEIf2uhsK6WEK5r9RxRa4PEaJqJApG1OBUp4RPGp/XzsEGIK+oeQQa9PORUmSVErzOCFBfG QqZxiZ1QDz2aWznh9rQhQ49sEgPDB7ysfrrTgBWpvJLbGYswLbqqqmTAhSHa7afJfxzX6SGRIf3 D X-Received: by 2002:a17:90b:54c4:b0:31e:fe0d:f48f with SMTP id 98e67ed59e1d1-32341eb9ff4mr3586693a91.10.1755268629200; Fri, 15 Aug 2025 07:37:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGR9+JNwAnkNnpK95babxi24ft9HL9R2NpwxxciFjgDeImk29mC5ZpyJI7qlPsUL6h7I4vrew== X-Received: by 2002:a17:90b:54c4:b0:31e:fe0d:f48f with SMTP id 98e67ed59e1d1-32341eb9ff4mr3586639a91.10.1755268628704; Fri, 15 Aug 2025 07:37:08 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b472d73619fsm1437576a12.39.2025.08.15.07.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 07:37:08 -0700 (PDT) From: Shivendra Pratap Date: Fri, 15 Aug 2025 20:05:10 +0530 Subject: [PATCH v14 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: <20250815-arm-psci-system_reset2-vendor-reboots-v14-5-37d29f59ac9a@oss.qualcomm.com> References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@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=1755268580; l=7924; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=/cq18pjLWig5FtkFDIdwUtfrzOBXNV40XqrxsOZOo0Y=; b=/JH+an9qBrDld6l1nDJbKdEeW2TlWDNSo1WgUW8EKdMYS5NkP1Uo9v8cx0bCY33UJxKONZ3cQ 2AfXxFbS358AppaJGKg6KtJ3D4Gdun7JC5/GmZnORltV+OSaZDvQhNl X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=J+Wq7BnS c=1 sm=1 tr=0 ts=689f4616 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=EUspDBNiAAAA:8 a=ty-NMr1YQicgvEyun9kA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-ORIG-GUID: W6Fn_ZHdxtO7N-1aV-rQMDYg1f6mgODP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODA5MDAxNSBTYWx0ZWRfX+OwCzlK6NbaH v3eTcacRtqX7BydyBLaAQJOdmCZVEmSix6xo05nFxRQm/+S+TKCQ1FX8Ck+kQtwZb4duhwU2hN2 7sNA8a2lsg8ZMKjGL2ffoPd4jOB1oW4iU8hKuHfyJkuKjozmOAOwnWBX7WX5FM7mzBKr8+PWe3F MeHRqRZ7YbPY8bFjwZVjO7MR9KtfqiFqE0u4vtyyGxef94L6/bTX54DTtUqWhN/JH4nEhP9xUIC 2nn+RVXbKayahanu/mAniufseSTF09539tpQ9nHpFrywV58YgNOJ/knWGSTfGE6Hua5FSSdTk/H v3yN9UakFFzI1YgqnrRKB47H4CPrUCF61PjOdj0JeJjE6GcBy/gURIKoButWetOar8J90OrxSdR vUWHt2cR X-Proofpoint-GUID: W6Fn_ZHdxtO7N-1aV-rQMDYg1f6mgODP 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-08-15_05,2025-08-14_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 malwarescore=0 impostorscore=0 bulkscore=0 phishscore=0 suspectscore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508090015 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 Tested-by: Florian Fainelli Tested-by: Kathiravan Thirumoorthy=20 --- drivers/power/reset/reboot-mode.c | 131 +++++++++++++++++++++++++++++++---= ---- include/linux/reboot-mode.h | 4 +- 2 files changed, 110 insertions(+), 25 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index ac81b8b0a9b7fc31f8ef21024333a050087ce90f..7ecab050e496af3e1cc01c1a461= 4787707cb74b4 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,121 @@ 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) + goto create_file_err; + + dr =3D devres_alloc(release_reboot_mode_device, sizeof(*dr), GFP_KERNEL); + if (!dr) { + ret =3D -ENOMEM; + goto devres_alloc_error; + } + + *dr =3D reboot; + devres_add(reboot->reboot_dev, dr); + return ret; + +devres_alloc_error: + device_remove_file(reboot->reboot_dev, &dev_attr_reboot_modes); +create_file_err: + device_unregister(reboot->reboot_dev); + return ret; +} + /** * reboot_mode_register - register a reboot mode driver * @reboot: reboot mode driver * @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 +242,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 +254,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 +283,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 Sat Oct 4 12:44:53 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 A263B2264AA for ; Fri, 15 Aug 2025 14:37:19 +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=1755268641; cv=none; b=ERm4Tfth/h/Fjq/fzhm30QvTj+a0Z7lyhmRGfkxzXONVCZXBZmDm9MiYpubCM8bJYdCJwbQg5dsxjaKhDawBP3MG2eXbox7tZ0Z757ZkEmdaHkyJ/uAxSW6b88PNvIAcUdVx2VPJhuY9nN4gIKE3XYcOnKVTC4YRQgSWR9koABQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268641; c=relaxed/simple; bh=R3BNXlzor3OWM1UHW0bocrQrgSVBuB1WLn0clYEcPVU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LqsDRH69DjokeMY+DxVs+KnppfaOeCA/h6SSvaqbfj2lq7y4Nm7lFY8sa971q8T6aeUIQD1VvCNLFvIB4bmMuJIb96VX6QFE55nffm2MPnRpG+QYveRUIQBj9S3SpXrxVU31/xAl5mLmNvnvMJBdTSUMm8S2kOWTycKFCu2bkp0= 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=TqQDhu5N; 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="TqQDhu5N" 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 57FEIlsL017485 for ; Fri, 15 Aug 2025 14:37:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= PIWnFWN9JswVjgeJAZVSk7CUtGSis2EJBGP3G7aJZqM=; b=TqQDhu5NO39E3C9c DlAWrzjgii60srxIcxtdQyWR3wXwcyKy9JAwK0Wkm68iH40LRlh4KF0IrrRmhpXr 6qFAGIJlaLFBGp7JjQUdRqZLfsXN7WRXhs7Xlm2ZTFtbq5352fFbqIiMDh26xN13 ThczYxNAiAWCrLaa7K8ni610KyzVaIo6QiIvBA33rjsw/1A3TntedMJwrz/fTFYK /rruBS/CdTEwRshhZTH7JB5THD4K/PYqwPIT6cSJ2v2WA5NDCBSTXCDOtSS0+1Cg DZGcn8ZPjpYxUoLBpIetD3zs3PVyvbG9Kwo0SwF2Px2+vy9drgX/osuS7JZ8kfxv mf+r1w== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 48eqhxhfxe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Aug 2025 14:37:18 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-76e2e8908fdso1688362b3a.1 for ; Fri, 15 Aug 2025 07:37:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755268637; x=1755873437; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PIWnFWN9JswVjgeJAZVSk7CUtGSis2EJBGP3G7aJZqM=; b=t99XKrsKwtfb5hTEf6/P6CRLQzqhPsbZKVRFq6vCRE1sokpIVtTf9Jr8Cj4Gm3W/Ry /95+VQa03ZYNNaUUS3xZDq1xREvAAiS/9Ernl6mA6NQHqI0XsubWjSPvKLrOIlYt0MbA XpY4Lohts3iVD9c4TR9Sj6TCVZ3Wt+bX0j/U/EPCdma9DuQ73kVmtXS++2+UTMtH6qFX hFMNwv77kyzzQlk5fO/AXPyjNKGln6nX5jids41UojyOgTPug4V91hFJhPeWXOQunzOx 0e7uJhQUnGeTBH/7EmGPTZPd9Ck1dNV28ZrxIwwFTn5ymJAO7XRVskQE88uQpxw4VAIR qdnw== X-Forwarded-Encrypted: i=1; AJvYcCX+1TCye3YJSXyxN+IP+Q7HOL93oTa09qjp9ppYB5RrUS5jKTOh3R4FAwOGEfylepIXz5lx9BiP/Cs+uuA=@vger.kernel.org X-Gm-Message-State: AOJu0YyDll2gtzU2IfTOl9NusRUInPmO2g4Ew5Ci59QpdK+ugXPXMv2+ xICXzgQLyO5s8twE8QYKyKE+qUEQtBOc9+WXU84Fuzd6GfygYhWsM7z1NwLy+JE0YDya7RAE8qN SsXv1vOFQy8ODZTu9/hafRjWsfcYfMCop2lZQKo0FNdSD9sdhz+3Hws3g9FVTMc7iTNU= X-Gm-Gg: ASbGnct8OfftSeshFD67caUe1fFsh3q3GV5XCI9yDSziyoihVQdlkKugCgHwkRqBPar Q/EyejphjOndhpe1dWg7C4BzBOAhjuDumtOqx6Qb/jxAuMNcSEmOtz9oNrG05QhZ0uzEMTdBnrw cxXBwvOLRl+LSm2D5z738egZk4O12UhYuUXEOHMKwHtOKoUpGyg7HEKyPU50UPZSoA/EvhVP2Y/ jfBE4r0nfe8DdqRMzTKQMNak7tgY3nmHVazy+NBHP3G96fhqvxeSrwSmTyiLXt8aDe4EsfglYNV sYqAE4T0Fpt+ehasJ2LUlTBDMPXfQ8cGVPbpyvGc0i8A6uFMolrzdidjaUfYgehEL34RLePisB0 B X-Received: by 2002:a05:6a20:a11e:b0:21a:d1fe:9e82 with SMTP id adf61e73a8af0-240d2f2190dmr4142982637.30.1755268637293; Fri, 15 Aug 2025 07:37:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgsIwndiwgMO/4XCfpnGqesl5qjzt37SrqS5fvAaqtJVwQCB8jw+J4FEIU2+q5voDUoc+zew== X-Received: by 2002:a05:6a20:a11e:b0:21a:d1fe:9e82 with SMTP id adf61e73a8af0-240d2f2190dmr4142925637.30.1755268636830; Fri, 15 Aug 2025 07:37:16 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b472d73619fsm1437576a12.39.2025.08.15.07.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 07:37:16 -0700 (PDT) From: Shivendra Pratap Date: Fri, 15 Aug 2025 20:05:11 +0530 Subject: [PATCH v14 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: <20250815-arm-psci-system_reset2-vendor-reboots-v14-6-37d29f59ac9a@oss.qualcomm.com> References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@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=1755268580; l=2577; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=SmkKRQQh3S8Gtdgd1oOIc80Ljvpw2jelYZ428aYXpJY=; b=L8V9bS20yn3EMfaNLrrEhrT1+PY4b++HwWpE+s1j0w7TmzQIDivAmjeMLzPy07SYrEuOq9kBl YPAwB3Zz27LC1Og4aQqxUCjphfUPn6ESHta7Z0UgqDXniNuFgLUnQoZ X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODEwMDA1NyBTYWx0ZWRfXyzgmqkuHzBfN HMytdmGrDkcRHuvsSTjwDw6Rkg/jbLWlpfToAWK38s9ohpmxvTB1b3yvsTaYGOICkNKm4auSYXA TyWHOCbwU8IK2OCH1pr0kvkanD1Lo539pwPf1lZqmg8M5R9XH4QkcSFc9+nm71GXeUwzCrO5oBI NFy2mH2NLSl7GLyFdEl2SQtZlZE2uhc4M9CkM86r12Rhd+8w7MN4+HCamOgQMD0pxuN1pSl5IJL qpI2lbp73HCiN6nFjl9wD2pN0DOhL2XNduL0zcrnTqZAPvxAi71G3LBiinGLBWfGPlj/wKSKzNm cdGLrL9tVk6+2jUeVH7vl/U5TAje/0Jt/fw/4xS+OJpAmIZfCmr717G+c7J7l712Fq9w7mn7aef PELPDOPq X-Proofpoint-GUID: 33sb9jbLbrIHYq86gzrNI9A4t1pnLKyd X-Authority-Analysis: v=2.4 cv=aYNhnQot c=1 sm=1 tr=0 ts=689f461e cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=UInjrUrXc7y1C1sAkbYA:9 a=QEXdDO2ut3YA:10 a=IoOABgeZipijB_acs4fv:22 X-Proofpoint-ORIG-GUID: 33sb9jbLbrIHYq86gzrNI9A4t1pnLKyd 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-08-15_05,2025-08-14_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 priorityscore=1501 suspectscore=0 phishscore=0 impostorscore=0 bulkscore=0 malwarescore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508100057 From: Elliot Berman Add bindings to describe vendor-specific reboot modes. Values here correspond to valid parameters to vendor-specific reset types in PSCI SYSTEM_RESET2 call. Reviewed-by: Rob Herring (Arm) Signed-off-by: Elliot Berman Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli Tested-by: Kathiravan Thirumoorthy=20 --- Documentation/devicetree/bindings/arm/psci.yaml | 43 +++++++++++++++++++++= ++++ 1 file changed, 43 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentatio= n/devicetree/bindings/arm/psci.yaml index 7360a2849b5bd1e4cbadac533c1a7228573288d4..eca38f8747d320e8371c1dc37ce= e2287d71821c4 100644 --- a/Documentation/devicetree/bindings/arm/psci.yaml +++ b/Documentation/devicetree/bindings/arm/psci.yaml @@ -98,6 +98,27 @@ properties: [1] Kernel documentation - ARM idle states bindings Documentation/devicetree/bindings/cpu/idle-states.yaml =20 + reboot-mode: + type: object + $ref: /schemas/power/reset/reboot-mode.yaml# + unevaluatedProperties: false + properties: + # "mode-normal" is just SYSTEM_RESET + mode-normal: false + patternProperties: + "^mode-.*$": + minItems: 1 + maxItems: 2 + description: | + Describes a vendor-specific reset type. The string after "mode-" + maps a reboot mode to the parameters in the PSCI SYSTEM_RESET2 c= all. + + Parameters are named mode-xxx =3D , where xxx + is the name of the magic reboot mode, type is the lower 31 bits + of the reset_type, and, optionally, the cookie value. If the coo= kie + is not provided, it is defaulted to zero. + The 31st bit (vendor-resets) will be implicitly set by the drive= r. + patternProperties: "^power-domain-": $ref: /schemas/power/power-domain.yaml# @@ -137,6 +158,15 @@ allOf: required: - cpu_off - cpu_on + - if: + not: + properties: + compatible: + contains: + const: arm,psci-1.0 + then: + properties: + reboot-mode: false =20 additionalProperties: false =20 @@ -261,4 +291,17 @@ examples: domain-idle-states =3D <&cluster_ret>, <&cluster_pwrdn>; }; }; + + - |+ + + // Case 5: SYSTEM_RESET2 vendor resets + psci { + compatible =3D "arm,psci-1.0"; + method =3D "smc"; + + reboot-mode { + mode-edl =3D <0>; + mode-bootloader =3D <1 2>; + }; + }; ... --=20 2.34.1 From nobody Sat Oct 4 12:44:53 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 073C023D7EF for ; Fri, 15 Aug 2025 14:37:26 +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=1755268648; cv=none; b=W8iuA8Ca/bBNBsqqgGhe+OCCfUT6mHiZO0LFqF2Ff+qjEmuS8USHxntIOK7huhafg9q2WybptgV3/mqJORqX4WuSluDKpjWZR2gOuDHTITmW54DmJVGAbwJUB0CbXdjHFnIrl3Cw+MtIVVdDXegylKPQ1bFLBM4OmvXyl1QTSEs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268648; c=relaxed/simple; bh=og8XnRqKfVb51an5IrfBWkxse/KEsB2Ct6wg9UArW14=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=piXrorPGpTTl/mFwFdJ5IYZxLdud5NdRdQApONs8HC9ivTnDEsApzbU8zm8qSrE/3MtEB1DGFT7j/zVIuIzWoWflXBfOprX1Gj7KYd7TdFBLVTFrySH1/seqruqknN6wlPx5cbd26El/1gNbZIlph3rk1SwzF5Bdnx2uYwVrZLk= 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=prI6JzXP; 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="prI6JzXP" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57FEJGv5008943 for ; Fri, 15 Aug 2025 14:37:26 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= eryQnSzToMXu2NfIgCMW4EZtH1S08RlhZnH4d4Tc+IE=; b=prI6JzXPMsCUeTaY Am3qa3JVxjxoIWp1Tsaum36GyqO8Dmp/fAQ2DQENE59Qgj8XHs9zGFjN6f+pkO0F hImIKiwsvor2Fgj3cV8Go83bVJPBNXfn6ITeIbJvQICAaQPaV98lR3lEv1qrfTfB iMl0JJCaTGGNkTfUMAuRbeyCRhqM1PrfgnyAoK/vHe7Rzyl6gGEKancFXprsck7G 3CdOQD28CGAct4bqVAqCcjLeq0+1gipQecH+SQPf46xz/TTNAZDrmKHWXdwRhz2I fju032U2g6IltkHwhlsE0fA2dNULxGmPO0eMj5UCdWkJulqZ23ri7AH2TnkXqYWS aQJYXQ== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 48ffq6y6b2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Aug 2025 14:37:26 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-76e2e614c60so1722323b3a.0 for ; Fri, 15 Aug 2025 07:37:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755268645; x=1755873445; 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=eryQnSzToMXu2NfIgCMW4EZtH1S08RlhZnH4d4Tc+IE=; b=CUVaqH4ju8Hyz0TsGRAxBy2BbqebLY+Yzz+l7OP5WTRbhua6fz6zUV4iUAhadRneOS r+b7e/i16MLHXaKZBW3+yysRgjnvKX8A+JTYhe4PJ2wADbtofynNsUUzDo+B6T1awjFq qJmdnKtC3yL9l4WD1aP0HfBXirWg74LSQych0ThUFWf3kV0dq+pRWNGc3q+jaDRKTq0y dyDUU8y7ujw5QptiMO07jkgC+hZeHdNbzzH3y2NIpG0o8/W6pcvbK6NW7EhlRRysuP2o 47l9LLNHkKkzp3nw9TEaHB+TgCEY2A38k4PyyBE6G7vD1ZfdplT79Mank4pqa+4REcjr gepQ== X-Forwarded-Encrypted: i=1; AJvYcCXTOuYRO/f8lHLEUqroaxLXVTKScnZpD0/Xc9z0ofA1idXgt7qUNGYiqfnmEKW/bnOqnF+hxBZTp7+5ABw=@vger.kernel.org X-Gm-Message-State: AOJu0YyHVbY3QHQLt8f8g73pu6LtoO8EmGWs9LShUPXkRoxRSfpZMvIN LHFFjFqY6vXeZVDPnDtrOHe0T8I5iaZ2qRPK4PTEE494DrKq9aexc1xoBTAn6biUdEITXFqhp2X yFXKWpWxFzA1Byeq75yVMZ4u46MZG7A1OsbYRzweoPebE9IVZYp+PzgHJoAifMrNdZ08= X-Gm-Gg: ASbGncvs8fHHV+XhrGf81/YItRidyj6IwxVbJlKj6Uxx49wZuniaqk/bcLhs4wMt5RM R29W5xFDubnC760PV0sXN9/8hBye1Orenhn3cj84bXsXrNtmCPeD/UnCwgIveAlTbQlXVm/7mWT +Arx6MNBhSG4D8+miApGld8RWfhzS2EoNbLEXM7Hj3BU3RdAg2rUJfS+xE/vz/uMat/53sEnfAm /ubAESvXs7zB1IakUC8dJyv7hdRSCpy8zQT6HfRQ1TLq0vgeXurX3M8FZ2ei++7HjPpR8oYU4e2 SZWbljJVebS8eDvomMw24JkXrprBq0ABJLeZY4n/zB0GFi6BKrjD6neKVzLdVqeBDeNag+aLIvw q X-Received: by 2002:aa7:8881:0:b0:76b:ed13:40c4 with SMTP id d2e1a72fcca58-76e447b9b8bmr3092653b3a.13.1755268645308; Fri, 15 Aug 2025 07:37:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjwXYQ6zanSH7puhitmJD8oHNe5fi85xTYBsR8TwQxzGrZOZWUsgrQ8UEiFxyMbRHqeD2fJA== X-Received: by 2002:aa7:8881:0:b0:76b:ed13:40c4 with SMTP id d2e1a72fcca58-76e447b9b8bmr3092594b3a.13.1755268644768; Fri, 15 Aug 2025 07:37:24 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b472d73619fsm1437576a12.39.2025.08.15.07.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 07:37:24 -0700 (PDT) From: Shivendra Pratap Date: Fri, 15 Aug 2025 20:05:12 +0530 Subject: [PATCH v14 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: <20250815-arm-psci-system_reset2-vendor-reboots-v14-7-37d29f59ac9a@oss.qualcomm.com> References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@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=1755268580; l=6176; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=og8XnRqKfVb51an5IrfBWkxse/KEsB2Ct6wg9UArW14=; b=4WNyXqesgIx7FKl6l+NReXTBEJXlBlrW/RTfkV6O6RK2/9teXBUqOPbrPjX+x98uakLoBhySi NwpNFUPgl2WBZdfE2T4tTXdOXj8gER+5RztwJZzPJjfIVSkGXDt2drO X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODExMDA3NSBTYWx0ZWRfX4GphtyTHyjhD EABLaMtfpoPjWqpnro926FRDW91YJXHMtvS0MPsQHK6hnF8OKMSPYYkiGyvmzKgNrExcY02koH3 NDye3rvTBXw6Awl3akakjM3CoH6PJlmCztH3GkrB5uCijWGFYSj0ndOSUXRTw7teqkz2wpO/CrW P70uEkCYuStW75X+S+kJwciW8O02L6khYiuXzrAptp3mCVhhp7dvQnEVfIs+Y6JoToxRVKaAavz lDtGnxqJ9DhHYbEh3HUoV30xtEt5j8CEAkjxZlH/EdpQI3YARg57ZPnRukOMhvrktCw4JgTIH0Z y/KDM+AkY+A55vNqAlLdJavNNDpjw4WYLdFK+FzX23hxFxbxE/9JCjjxYP9VXUgmf/p0g9hVzF+ kydgw3Go X-Authority-Analysis: v=2.4 cv=TLZFS0la c=1 sm=1 tr=0 ts=689f4626 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=EUspDBNiAAAA:8 a=TMn5MJ8t-PDmeowdJScA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-GUID: XJTt8miDStnJGSG_pwtaliGuYKvThkoZ X-Proofpoint-ORIG-GUID: XJTt8miDStnJGSG_pwtaliGuYKvThkoZ 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-08-15_05,2025-08-14_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 malwarescore=0 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508110075 SoC vendors have different types of resets which are controlled through various hardware registers. For instance, Qualcomm SoC may have a requirement that reboot with =E2=80=9Cbootloader=E2=80=9D command should reboot the device to bootloader flashing mode and reboot with =E2=80=9Cedl=E2=80=9D should reboot the device into Emergency flashing= mode. Setting up such reboots on Qualcomm devices can be inconsistent across SoC platforms and may require setting different HW registers, where some of these registers may not be accessible to HLOS. These knobs evolve over product generations and require more drivers. PSCI spec defines, SYSTEM_RESET2, vendor-specific reset which can help align this requirement. Add support for PSCI SYSTEM_RESET2, vendor-specific resets and align the implementation to allow user-space initiated reboots to trigger these resets. Implement the PSCI vendor-specific resets by registering to the reboot-mode framework. As psci init is done at early kernel init, reboot-mode registration cannot be done at the time of psci init. This is because reboot-mode creates a =E2=80=9Creboot-mode=E2=80=9D class f= or exposing sysfs, which can fail at early kernel init. To overcome this, introduce a late_initcall to register PSCI vendor-specific resets as reboot modes. Implement a reboot-mode write function that sets reset_type and cookie values during the reboot notifier callback. Introduce a firmware-based call for SYSTEM_RESET2 vendor-specific reset in the psci_sys_reset path, using reset_type and cookie if supported by secure firmware. Register a panic notifier and clear vendor_reset valid status during panic. This is needed for any kernel panic that occurs post reboot_notifiers. By using the above implementation, userspace will be able to issue such resets using the reboot() system call with the "*arg" parameter as a string based command. The commands can be defined in PSCI device tree node under =E2=80=9Creboot-mode=E2=80=9D and are based = on the reboot-mode based commands. Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli Tested-by: Kathiravan Thirumoorthy=20 --- drivers/firmware/psci/Kconfig | 2 + drivers/firmware/psci/psci.c | 88 +++++++++++++++++++++++++++++++++++++++= +++- 2 files changed, 89 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..58fa5fae40f6643e46a1efa5f3b= 2f5d1d101a1b9 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -13,10 +13,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include =20 @@ -51,6 +53,24 @@ static int resident_cpu =3D -1; struct psci_operations psci_ops; static enum arm_smccc_conduit psci_conduit =3D SMCCC_CONDUIT_NONE; =20 +struct psci_vendor_sysreset2 { + u32 reset_type; + u32 cookie; + bool valid; +}; + +static struct psci_vendor_sysreset2 vendor_reset; + +static int psci_panic_event(struct notifier_block *nb, unsigned long v, vo= id *p) +{ + vendor_reset.valid =3D false; + return NOTIFY_DONE; +} + +static struct notifier_block psci_panic_block =3D { + .notifier_call =3D psci_panic_event +}; + bool psci_tos_resident_on(int cpu) { return cpu =3D=3D resident_cpu; @@ -309,7 +329,10 @@ static int get_set_conduit_method(const struct device_= node *np) static int psci_sys_reset(struct notifier_block *nb, unsigned long action, void *data) { - if ((reboot_mode =3D=3D REBOOT_WARM || reboot_mode =3D=3D REBOOT_SOFT) && + if (vendor_reset.valid && psci_system_reset2_supported) { + invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), vendor_reset.reset_ty= pe, + vendor_reset.cookie, 0); + } else if ((reboot_mode =3D=3D REBOOT_WARM || reboot_mode =3D=3D REBOOT_S= OFT) && psci_system_reset2_supported) { /* * reset_type[31] =3D 0 (architectural) @@ -547,6 +570,69 @@ static const struct platform_suspend_ops psci_suspend_= ops =3D { .enter =3D psci_system_suspend_enter, }; =20 +static int psci_set_vendor_sys_reset2(struct reboot_mode_driver *reboot, u= 64 magic) +{ + u32 magic_32; + + if (psci_system_reset2_supported) { + magic_32 =3D magic & 0xffffffff; + vendor_reset.reset_type =3D PSCI_1_1_RESET_TYPE_VENDOR_START | magic_32; + vendor_reset.cookie =3D (magic >> 32) & 0xffffffff; + vendor_reset.valid =3D true; + } + + return NOTIFY_DONE; +} + +static int __init psci_init_vendor_reset(void) +{ + struct reboot_mode_driver *reboot; + struct device_node *psci_np; + struct device_node *np; + int ret; + + if (!psci_system_reset2_supported) + return -EINVAL; + + psci_np =3D of_find_compatible_node(NULL, NULL, "arm,psci-1.0"); + if (!psci_np) + return -ENODEV; + + np =3D of_find_node_by_name(psci_np, "reboot-mode"); + if (!np) { + of_node_put(psci_np); + return -ENODEV; + } + + ret =3D atomic_notifier_chain_register(&panic_notifier_list, &psci_panic_= block); + if (ret) + goto err_notifier; + + reboot =3D kzalloc(sizeof(*reboot), GFP_KERNEL); + if (!reboot) { + ret =3D -ENOMEM; + goto err_kzalloc; + } + + reboot->write =3D psci_set_vendor_sys_reset2; + + ret =3D reboot_mode_register(reboot, np, "psci"); + if (ret) + goto err_register; + + return 0; + +err_register: + kfree(reboot); +err_kzalloc: + atomic_notifier_chain_unregister(&panic_notifier_list, &psci_panic_block); +err_notifier: + of_node_put(psci_np); + of_node_put(np); + return ret; +} +late_initcall(psci_init_vendor_reset) + static void __init psci_init_system_reset2(void) { int ret; --=20 2.34.1 From nobody Sat Oct 4 12:44:53 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 B24CC22F383 for ; Fri, 15 Aug 2025 14:37:34 +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=1755268656; cv=none; b=CSwUbdtSQR/u6GK9nHK53eDWft1uLSKHyIcnSH98N66hIhbBBOLmcSI0hEhjfWjkxaVL24WkqW3r1ee/7qjYEslEAK3bsx7aWvdypBj5N++8YJB7TGskHHMrNl9zORhWCitGLKWa6ez5cySNWIKggl7idR7dQSBQS+9k6JGUrIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268656; c=relaxed/simple; bh=cDK0uRnpMgSKSIzk24D2d7W3Iv7lYhf3EwNLLYWok5U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZBFoWPdh157zoBm1G71pIZwsrERDhLnKegj6yi2iLTZ7xY3gABgW6gftpVNKRmfOO3nhHhLwlk2Eu1C4bUu+WOed4zdCPFXb2NDkZxIoW4os6Ls963pc8SCQrt3p1qJhZmC8giPsvLp9JPChGmnYAfECpOZhnAVo+4Dog6KyrRw= 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=H9Zqoocq; 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="H9Zqoocq" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57FEJKxd021813 for ; Fri, 15 Aug 2025 14:37:34 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= eZI1ulbnp33sSmZzOl/WukD84JC7rm/wreXUDUVjjRA=; b=H9ZqoocqVzOu22rQ KmYlkKXCct4rsXUqtMwuL99d67dAemPz3Z4ECLC+DfY1v4FUHx5W1dplPUt4mS3B k75VEJqDi7n8KsFPDfJuTBQEXS0IcDQeXwRPZYKmp5n6ZhXSKK0GJiXn4aFJnKzI tveMC5u+gh9HdfHrJPWADiDLcMMfrztP11sMbhkKm3OzoBCQQeIrvbzBqqRyc+Cp 9rY+wQPz5YNHJ4Z3K5tLalxqQEb42qrTPOCGZzhQQAWQtionjqMaxQ3GtzTXBROR V7HDgtcgAelaQf9acbhrZx3IQ84kN0avR0bIUAqX9utq8ADIK27dP1qLambGa8Bi dfoiPg== 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 48dy3gk6q9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Aug 2025 14:37:34 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-b4716fc56a9so2681349a12.0 for ; Fri, 15 Aug 2025 07:37:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755268653; x=1755873453; 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=eZI1ulbnp33sSmZzOl/WukD84JC7rm/wreXUDUVjjRA=; b=b0WCdGnCtwQ43yQx4kDun+k+uUJOEw4hU+NSMIV8yzQNgxg2Vpxy9BammYbbfKiOyM /9Tc8xaV5SKa2hgUnFpf8X0IQDURWaKaqf+w4JaQbETzY39t1FKr3tzg0WjEOLRxJA0a EOmxklSjtUOAeq2mZTv3WxZTG9duWX3dJw4r8PxOM29c9ilG8d38fR2tyi/bFqdzlu6z pJTUTMgcfVX9+lcTNmXcjZGh6bWLlq1p1zKp7e7BztI3zwNaeXm9MLlZYGMer1YbYt1R 9HcVyLtJtR6dsN6GXR/BWjwjVAG6f1a+seHasn5plA9b0Zm438s0k0HUwln/lfzE2skD lNHA== X-Forwarded-Encrypted: i=1; AJvYcCWJm2i7CoEEbGkEbSqRZadejLU6W5exFWaA4hyNbndqhPYlkii3JwK2qAdALLhdg8eEUIBxbN56cbsRm70=@vger.kernel.org X-Gm-Message-State: AOJu0YyHV2DCqWH0v3EG0eyMb0ex4kvM1PJUGCAOfHm6+oykGr9HSPGh Zp6UL3qHucy8TONFjdHnWXLpZCVj3AO0mrWURJeIkK8wy5+0al0ZmRTsGeET/YwU7H3joiqFJkB +/GYJJQiEhUwQhXDaf6E/iIIVRLt+OZK8AHI1W4/Dy/HRm6NeN9S00pa5QHoeZvuLAi8= X-Gm-Gg: ASbGncvV8PIvsolRHuErqmb+o+aJDrUnXGALXv+JaowJk8ZFSk+KDMI7gxsIrXiYzWx nJw93H2Q9PNKJ8mgbK38OIr17l8bVNxHS0kMX0VnHHHco1a9fb8/lSd3NJ4Tfu3oKqJvFffcDNN xn0YBMTAurudwa3qHrPfJDlSGxwYBZZDvx5SlhBL9vkXN6my3/Vy32YQp9xcoxjMnsDrxozFKok xc2az4rGB16OkQ+eqflyRCvuJ9MX/Y0mI1wz5WOEqfqipgKTSJ595IlLaqA6CEngStXtf+JYKe1 Cp8aQnUjMBuvavIwUp4GyvGRyKFo4BPDa2wNBR/K8nB8wUkWsQuvr9y2y7M/BLF4QFTz/Yf3te+ i X-Received: by 2002:a05:6a21:3393:b0:240:1c56:6495 with SMTP id adf61e73a8af0-240d2da1ab2mr3983844637.14.1755268653292; Fri, 15 Aug 2025 07:37:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGICSeKOM3amu5cDfHsCt6tTSoS71zRuUcFNv7sC0jlLIlPMtqsbosekt2XumDOgR42afsnSg== X-Received: by 2002:a05:6a21:3393:b0:240:1c56:6495 with SMTP id adf61e73a8af0-240d2da1ab2mr3983814637.14.1755268652889; Fri, 15 Aug 2025 07:37:32 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b472d73619fsm1437576a12.39.2025.08.15.07.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 07:37:32 -0700 (PDT) From: Shivendra Pratap Date: Fri, 15 Aug 2025 20:05:13 +0530 Subject: [PATCH v14 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: <20250815-arm-psci-system_reset2-vendor-reboots-v14-8-37d29f59ac9a@oss.qualcomm.com> References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@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=1755268580; l=1628; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=Dajt+SLbZYuP9ZjHPqwB/7XOdBkGsUiHd4YnzMvhaQQ=; b=MEXYaGDuDuUFhmah2GQbSrJ4wEfwuNgDwr1BX5PcCzsPjhFaX/Ovj9lBCsR/tOhqe0QLmR7rY mE1K9DazWzSC7lUWsHUgB371f3yxxZgg08tvl3sOq0dw32CLkCKQbcp X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=X4lSKHTe c=1 sm=1 tr=0 ts=689f462e cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=w06kbW2hXDg5FjFnD0gA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODA5MDAzMSBTYWx0ZWRfX0YGbzXIrM5D3 T05XOpRryEHkdCW7l5Hn1yzSjjosNDZ/fGuz0FFezAo6pgJHllPHr+Spz+Pli3KIEP2ybZ6wroG edGvWlrfwCbarxZj6crGbj11bVV2lbbToK1bvpXllRUOGRNNZVqYh0wd1x/j01XvjPfGgyCrcKG uzIWuP8YbbI/WF5546+MYmLwbAhdY04Ijf4X/z9MBSocz4+nITZEve/B1B9v8mjLvXTQvt/NHxr x+ZKbnyrYeSX4YjTsFDpEc4cTN2+TYApS11voGUEmd72nWT5gXFWs+mU1PdOYuKh4t1lE78hEFN MMmBO2u6D3xRN8tn2IQW7XC0+TgyHJgQtCGLMazoXfvkTFvoO4gsQyy3HmbTFTX8HN9hX3Kt7c5 KJmsKKhN X-Proofpoint-GUID: nGNf2qo80Z45NqQn5GFVfjGSX1Zwp_4W X-Proofpoint-ORIG-GUID: nGNf2qo80Z45NqQn5GFVfjGSX1Zwp_4W 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-08-15_05,2025-08-14_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508090031 From: Elliot Berman Add support for SYSTEM_RESET2 vendor-specific resets in qcm6490-idp as reboot-modes. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Reviewed-by: Konrad Dybcio Signed-off-by: Elliot Berman Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli Tested-by: Kathiravan Thirumoorthy=20 --- 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 8ed6e28b0c2977b831a1f156014eb9d6f70d0243..51d5991a5c392d2b7afcb5dd772= 6a01ededc199c 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 0dd6a5c91d109c78333f6b90104fa51fcf3bd64c..0db3fab9915b247d3c30d748462= 5fbd89a3514d1 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 Sat Oct 4 12:44:53 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 63BDC242D7B for ; Fri, 15 Aug 2025 14:37:43 +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=1755268664; cv=none; b=qV4lgHu26jg+sm7c2jlCqJ5sKvVOU74eL6gfvpV3rd+pHCklcIcy0qJwL6V12A8c/Vnr7FtwXzfPSHa+UYblKZWNZlZJem5oQ54hi1qNcgpQY2OcySGk2RAhyXK6DI/Doywfw696+7cJQrEXOHcnyokr+CNV9z7eYZTOGauAajc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268664; c=relaxed/simple; bh=yWDpvk/g5ulq5XtwiLjjXMBryGLsje9g0j50Egsq7B8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pDAMYRTDw7mDrS7h2t51kihlp7kLcDDXO3KDhX7KiNCFX5zXHPESSNpWgHO4HnIrvRZwdFOH+xg1k+FdnoykOGdkxO78x4J2SgeHZpbpg0LVbiSY5aqhH5VhEDoafiY/2o6ebnU8dNCuNo06AmPtiIGl10xa6oiLfULfN3chquw= 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=aa3g5Nsz; 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="aa3g5Nsz" 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 57FEIo3b011654 for ; Fri, 15 Aug 2025 14:37:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= s9UkRA4sDNiNVDXOCr5lj213AjA/7qAtrMJayniryuo=; b=aa3g5NszGnvkQYXM XP1rBUB0Qqbto9SgBArkapt9Y/U4STlPLdmYuJjspx006Q4jIHO/tmyFA4/Ay0Hu YPMNwFCzTyiFm2kepSFeQrzdXVRjpuEqvyuBnowQfeQBilpi0m83TBS1tLJiLqGl vcSvydvI2CJ0HgPlEPhY24Y9AmZ2E9qb6h+DagkFy01ClOLRsCcEVriD4o6brSs6 qHYKhpJMzZUPpiONRKpO5vCXo156o2QT5BKCCkLt7mjOKZ3gT7YhWMMhUZ+bb6Zb DcZf6VdfI8JZ6Wu7UvXtyOWPLdWh/Vb5/vBYK+GGPY71RD+uxr6lZ14g2Wc9mum+ jzRyMw== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 48gr9ryxhr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Aug 2025 14:37:42 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-76e2e60221fso4135202b3a.0 for ; Fri, 15 Aug 2025 07:37:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755268662; x=1755873462; 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=s9UkRA4sDNiNVDXOCr5lj213AjA/7qAtrMJayniryuo=; b=lf6hcwdmnTL1GRecLPLLfAV0XyqDa5cUHcCVq4yqxQZcGr8ZdWEzE1+dcDLlRpK0q5 9SqtaVS2SKAO2IJo3aNKHo5S1w90s0Vqy50ymuiYc62P/2li4IRhqRyEtHqiuCUeYYO9 MzNi74mFbIr6qtkz492hkACR7lyXNNMvlrNcAPaehcgGwMZoI60g7lsUp5HTV1LqEiuv O44P3rr+64QDhaxbejo9d7lUXoJons8cYOqNGkcKuuOSTQnmJdTw6NlOHchfBoyO6a/O sWznVDkWBP0ipGKkTqK8Zek3hptKRs96oSe2/94eoRaybnSZQPYlWe/ca7jO3zSl2v3/ f3wA== X-Forwarded-Encrypted: i=1; AJvYcCU4KcJhm0Y8qx6asT6wflMjQ70vMWduwqtQW0TVyYc86f69js9JQ5pfZ9UAa/KCGCi8BNYnjDB6WuErJs8=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7rDPpnuetErVQE/VR+Z/wPcAVyXLKFpVH98lVmWuWje17Qi8M h7+npFK8xYulcAy2rZfVBPqQDd9FEGiGKLmA8escsBkmw+4VyosQSKvOKgzGCtBEyB36gGHnx+a wrys0LO+k0ny8FhA/c/viGfoIfB8VxAGO9ojhlqfFRPqTdSrR3TWEh6HLbYGy2YlYs+Y= X-Gm-Gg: ASbGncvWVYAmZ2b04GxF/M3yDVyNkjWbI9CF2lD3j7FLBRyQ09w4HRZZREtNf8fTpUF JIxHGdHEi/TEcyRZsxoIjHIck1P1rL1LF1JuqLEJjEfTM6n70qEcCzShMJl9U4H9FnNrJKSdaA5 8QyqAGj5ILaSlwKNh7Vdzsgzzf9+s1KsTzOv6IwU4yxOmvdKMx4S01xTE3UnOdA/TnDRyC8PORw 2LE7Y7bMP8FujoazpCvn5tnUU9o+BAFwj3ClKFlSdHY5utjATTzE3BjiAD9tPGtTzZtclNp+bNt /DiiMrGUbsUPlFBdw+LtlytWvp5PqoHuBNEpTnZ8KoLh5gza4dKHpxO0JP+MM4z6kocVEhC2hzV u X-Received: by 2002:a05:6a20:12c8:b0:240:104c:8e14 with SMTP id adf61e73a8af0-240d2f2145emr4641304637.38.1755268661623; Fri, 15 Aug 2025 07:37:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEYKvm7YlLHtN5zoWFya9n6lHhS331aexLq0ePnq21K2fM39A6b4KRmUKen+GVL40Mqu92Hg== X-Received: by 2002:a05:6a20:12c8:b0:240:104c:8e14 with SMTP id adf61e73a8af0-240d2f2145emr4641265637.38.1755268661201; Fri, 15 Aug 2025 07:37:41 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b472d73619fsm1437576a12.39.2025.08.15.07.37.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 07:37:40 -0700 (PDT) From: Shivendra Pratap Date: Fri, 15 Aug 2025 20:05:14 +0530 Subject: [PATCH v14 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: <20250815-arm-psci-system_reset2-vendor-reboots-v14-9-37d29f59ac9a@oss.qualcomm.com> References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@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=1755268580; l=1185; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=ux79/gmiZ2LdMiEPzsFxhfTKa+YcpSdHQfwMeKSsyq0=; b=W31B5yI47L4hb70bhxr6KolbTw/wP2Y7bRpdOBNeoS+yDhcadTJqAp0/QGVYybfT5t8rTSAjW ZIxT3KTCjkHA+dUGzT1lsBcJ1JaQEXxYPQFMBN5CETvMfxeM8c5RxeA X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODEzMDA5NCBTYWx0ZWRfX7LWLY9h5hi6C N5kooh7r5nDWBCdH3fUB/O9YUO1PVEWiScXsogUFI54JNj8aqgz6EMoF7RdgN9Qhjo01wVrLhK2 haSqLmhNO3ivFT4UH5umrbgS6QzWz2ya/RwT2vhR7uPOFFi+OysoNM0ROcIINwK5uUBQvQ7YEQY ln3K3j/iWo4zoTlyl8Bc7/ukC7w+hIvTJeyU0U4ifFuWmJMoSZFmYw9pP31KazV2sTFmdn/Bj2o xDVS+2ZKNLsswNaDYAQQ5X7eR5yBG4Yk2hgY3SkiUiez4DQWa4VzpwA8q5Pw5bbFI9ZNu8NPRsy lKnr1dsWVKPIKrJvYRmP3KQb0CyF8v41mGVIfwPA/I3Hq+ShY0/YW+YdaGkp+i5lJq5DcfMBSSx Dmm0RmkX X-Authority-Analysis: v=2.4 cv=NIrV+16g c=1 sm=1 tr=0 ts=689f4636 cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=EUspDBNiAAAA:8 a=0YKNsV3nudetVglqpTMA:9 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq:22 X-Proofpoint-ORIG-GUID: Omespu8c3r2NHYtBCMjQu2ykn5IJEjcK X-Proofpoint-GUID: Omespu8c3r2NHYtBCMjQu2ykn5IJEjcK 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-08-15_05,2025-08-14_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 impostorscore=0 adultscore=0 suspectscore=0 spamscore=0 malwarescore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508130094 From: Elliot Berman Add support for SYSTEM_RESET2 vendor-specific resets in qcs6490-rb3gen2 as reboot-modes. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Reviewed-by: Konrad Dybcio Signed-off-by: Elliot Berman Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli Tested-by: Kathiravan Thirumoorthy=20 --- 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 7509c27bd3f8f3e43877ded3b898205bdb66a847..621628311a3e36cea70697872b6= 3282d1ba83e1d 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 Sat Oct 4 12:44:53 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 B4A4E253F2A for ; Fri, 15 Aug 2025 14:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268674; cv=none; b=r8uPbiQF6Z/0mQx1MFPMg1OfB062BJZt+ZEGS5G94zMUv+gioHmYvCr1aFU4FyeAMGtSneIN8ZRTzgCPqIN0hSpF7+3xuRb0LFKm8IJDKc/LIJpDUuGmvC/H5IB+FJAXTU5HJvmIkBz70MypeYBdhBru031RMTKccmJN6cZYAkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755268674; c=relaxed/simple; bh=aVjEWL7maG/antUwRZHya+dEaFWljgNsHEfhHp0HFy0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kphrXkEfaHIZINBr0jep+8L3M9DpCTBDJ5JxTL8D+GIXNK27407K2u+PIK4qU6AJg5ofPDYhUdwDzsiPFh/8l/iXWTEjAoClpfbMDbdR89OhAlnFCOw3MMGAI92D8BFQh5U0sjXqzG1G7XRWDoDBB51DTMkacuvj7tQFj+LaF0E= 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=nmiFe25X; 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="nmiFe25X" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57FEIw0l022082 for ; Fri, 15 Aug 2025 14:37:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= i5lrrc2avf/a05fFSkE1yarwBF8oN7CO+XYLX3+cBU0=; b=nmiFe25XvVMso1Gn lLZBRnJ8G4H+V4CN7xAbTqbzeI1DmCo6p726nc1gFoxpqMkHSm5pl2FNhP4Q4Zxs S6f0MKxXXxf4dE6a2wOQJ+aYlOhRqEU8z+bFNEn9NkVDLAmGW6U0iFd+Gxykh6xx ke0oGTrB7MqSXt1ez9Mfjq/uf92PSMC2jN5dpuF+p4TLtzmH9Dg8aMr7tx/CkBuT Xp6+yAyEfdr5oczi8tABkaqyJkFodahG9SQ/Bdkj7mQy8AFfpI4+mK+e09gW8WD3 6Jaatv/Pm1OSKqQtNt7WEQo+jvU14+Ru0KBkJIOa3nOw7HIAKV9DPx94nPl8c1A2 F5cYRQ== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 48g5hmk7t4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 15 Aug 2025 14:37:51 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-76e2e8908fdso1689023b3a.1 for ; Fri, 15 Aug 2025 07:37:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755268670; x=1755873470; 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=i5lrrc2avf/a05fFSkE1yarwBF8oN7CO+XYLX3+cBU0=; b=RfRhjnyQH3NfEsNreMZwHPcg6KTrXu0U5cWiWFYYLy6pYEtEAV4xC3nZsFovw2uR55 RNLm1v5teRAeojuHCgW5AFXgZnmHn9zJw64NDd4cQDXM21aH/wMt/XEEO6RfgqaS5JJX HQoo+50J1C9TBjvdomj2krQuabFgyRs/Cdzuyq+s5TMi9kkxAuukVRTjCMist8vivPEQ dxCG69uVo5AWr7sgW0AwRImw0gnMStNC4i9TjiK4Yy8pEJfagEa6pRlyMxn8z+72RByL ly9LttTrBJZufPKMynhye3ixJ4qSgn7m8DDuTnvStzm3qfe7h/tvEtpB36nSHd4zMPqz 8WYA== X-Forwarded-Encrypted: i=1; AJvYcCX1cKCnHFGPgsuLQtMeAbjQ/dKr4RbzJJy03o9dd90t7VnLaxHQSA/JqgU0lr9/9eTC5CLFDY783tQ5aBQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yx+Rd9XGNk5Hc7YBE4ZZENwmV2jWOZ+b8isMN8yEJm2klN1pTGu FqgjtvAz0dLFYXs/n6rPQossD4php84WWoNo3K8zd4RBVR7+ZFJNG8yq6udoN0TSxIBSANPaScZ hnyyVkROSM8jnjsqiif8Il4AelO9unCWnjfdeW69n1e0EYe6gmEfD3x0Fi3L37oZdUpo= X-Gm-Gg: ASbGncvnO6T6SJdRg4FoZNuyME7exT4oJlEdG/qIQAk3XxLf5if95LEUaUWKTRXXwmN LPlw2GprHBFWi9+aHdDTIQJizZlghJr1Vir9LU2QT/OgEJp8/+amU88pZjlhVailoem+O4IJpj/ +/jRPsNAOJuxOOq5FS85D3uv/Z7JZocPtnDK9ioYvPAuXCZZbmi2pMxjyPxJdUaspn68VwwflXC nyKTZ2NXl+9lVZlLCx8IcyVlSD2XCyh/CxJumkXWP4e9VnfRkno1Geup4IvHTgBtCYsVsQwjwIc nIa4frC+iZxXyNZ60dtlgQzeXc0pOYwFpDOZO0lRF9LtSrz3v/tp3nph7JKpIRh55FpOMSnlLUV C X-Received: by 2002:a05:6a20:a11e:b0:21a:d1fe:9e82 with SMTP id adf61e73a8af0-240d2f2190dmr4146108637.30.1755268670029; Fri, 15 Aug 2025 07:37:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgzJYKQGF6HZbbUlkil5MvM89MNKhgpQynDfRIXAkhE45tUGeJKiRVkBH5qpZTooaymsp6Tw== X-Received: by 2002:a05:6a20:a11e:b0:21a:d1fe:9e82 with SMTP id adf61e73a8af0-240d2f2190dmr4146065637.30.1755268669594; Fri, 15 Aug 2025 07:37:49 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b472d73619fsm1437576a12.39.2025.08.15.07.37.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 07:37:49 -0700 (PDT) From: Shivendra Pratap Date: Fri, 15 Aug 2025 20:05:15 +0530 Subject: [PATCH v14 10/10] arm64: dts: qcom: lemans-ride: Add PSCI SYSTEM_RESET2 types Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250815-arm-psci-system_reset2-vendor-reboots-v14-10-37d29f59ac9a@oss.qualcomm.com> References: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@oss.qualcomm.com> In-Reply-To: <20250815-arm-psci-system_reset2-vendor-reboots-v14-0-37d29f59ac9a@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=1755268580; l=1694; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=/6iy73dToa0i0suzb1dVfuaLnEqyIE2pxMqX2jMdr0k=; b=GVK2pWwSQM7mtpgjB6rhLQwgDjqbyLzua5XFkOc/igbeTVSvy58+vU14vmU0QTk6gS8dAb2Ji c0DpCdq3PJFBnBgg7nhR6dYlM97gnoUxLnYhZvf4MXEdg7rrxKGCddi X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODEyMDExOSBTYWx0ZWRfX4Fxm+aQsUxvH G2MTdZcDCpFJ1//XXkTdcp3nFE62GbBgfNejoI0EA9++Kn8ccWIqo9+IHeMVs1/9ic38LC9UxGK KpaaOEjxMdqjfLujEdmVNcFXhTCnmdWpagoP6WjMSIAnSbUYkYWSZMiM/UIC/VRpdgZhgLjkAsH RWy0UOHN3uaEhTAnoPAINVwWY7h4sSjlsTFnA6ckLnMHPSKOsz9Gl7uaAqCoLvbtQLvFLMgGmJR 9JtQTEWTpfHS4qeHXzFDJ5JWpE31ynEM/u48DH5eoe27PAdP/WHUzINIYPBsZeOcJNGuj5ghV01 ag59Q+I4SPKqfwgVQmmglZfGiRPYt2Krfj79jgaMJbDDNSXiNSOm4+uyi88D6y0y4zGC8rBKdSG 5gwxdwkQ X-Proofpoint-GUID: 0t1OGjdvg_idZuRqvQvWOYK7hUcHE78F X-Proofpoint-ORIG-GUID: 0t1OGjdvg_idZuRqvQvWOYK7hUcHE78F X-Authority-Analysis: v=2.4 cv=d4b1yQjE c=1 sm=1 tr=0 ts=689f463f cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=EUspDBNiAAAA:8 a=w06kbW2hXDg5FjFnD0gA:9 a=QEXdDO2ut3YA:10 a=IoOABgeZipijB_acs4fv: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-08-15_05,2025-08-14_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 spamscore=0 phishscore=0 adultscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508120119 From: Elliot Berman Add support for SYSTEM_RESET2 vendor-specific resets in lemans-ride as reboot-modes. Describe the resets: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Reviewed-by: Konrad Dybcio Signed-off-by: Elliot Berman Signed-off-by: Shivendra Pratap Tested-by: Florian Fainelli Tested-by: Kathiravan Thirumoorthy=20 --- arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi | 7 +++++++ arch/arm64/boot/dts/qcom/lemans.dtsi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi b/arch/arm64/= boot/dts/qcom/lemans-ride-common.dtsi index 25e756c141606fbe0876ed48a54809b372650903..016f0a93a432b5e3f5b095b428e= 0c3de026edd45 100644 --- a/arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi +++ b/arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi @@ -722,6 +722,13 @@ &pmm8654au_3_gpios { "GNSS_BOOT_MODE"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x10001 0x2>; + mode-edl =3D <0 0x1>; + }; +}; + &qupv3_id_1 { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/lemans.dtsi b/arch/arm64/boot/dts/qco= m/lemans.dtsi index 64f5378c6a4770cee2c7d76cde1098d7df17a24a..dbcda335fe117e608950c20de9a= 87c7eeb6b5475 100644 --- a/arch/arm64/boot/dts/qcom/lemans.dtsi +++ b/arch/arm64/boot/dts/qcom/lemans.dtsi @@ -620,7 +620,7 @@ pmu { interrupts =3D ; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 --=20 2.34.1