From nobody Tue Oct 7 13:49:02 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 3A9EF293C69 for ; Thu, 10 Jul 2025 09:16:46 +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=1752139007; cv=none; b=GkAP1VuXUK20rcxPO9XF0a/cGnnx8H8GeSItIPyHCRjNza9eF0FJcxfHdDa7N1xxoFBLcZqlfI3KVQZizAkb+wXvtaYvh47o2PXGpyBbKW9Bd1P9fnLHVy+E/ziVoaLTPg+BNoK7IohbkaK2E5lR9DmNv9PgewonDgUOR2iDoHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139007; c=relaxed/simple; bh=ALwJqxoH5zAinvmbBAPI1a8edV2GbWb9vLZOWS7SaNs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jCWCrwJ9PFuKVbmE051CvJCTXPd+3hh2yYkfekP9najZRE7W5BJPsGaQhb0/BXY7CkGefA0cc02n4Pr+yRBbrOuoVoU1FKgocJjrUXC6TwYnF0GJaazrSLmZ+UdymWrRuHM7nTj3iDu/jJ1J/n2XVU4IQx6h47TqKjPuAJlqXbQ= 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=hlnz/Ynw; 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="hlnz/Ynw" 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 56A1W5MV009952 for ; Thu, 10 Jul 2025 09:16:45 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= Omsp8mXp75/hXn7qkFWCOKSdc9pZVj0sVSquHLqjEXQ=; b=hlnz/YnwwphwltN1 B59JKt/4Cda3W++kZCcYOo9CUN2kq5szLGlvUjEnJN+hHg6XkqySGAIX9kQIIt7L yrSufKUVrc/KR4S2bSfNKA380RSozNd9AgKSBBzx4eS3yMxCVAZm8j8y7yOClmvp LLDXTzNmRH0uL2jaQlSmOisOnSjCMULev+gXx2boFoy0eodr5fHT2uH0Bp+9Q6LT iSjO6AjrB8xVeHDwSwL9cFkRia7oTfDG9y/2LnYkem+xoIYk11EbPDgd3Kax1Do4 1+8qtWyq/c2hdkNwC+lwYBwx017JrvAnatQCzfezEv89DTTcdRAjWFeIrIAypGR+ T1I8Bw== 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 47sm9dvbd5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 10 Jul 2025 09:16:45 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-3141f9ce4e2so1379353a91.1 for ; Thu, 10 Jul 2025 02:16:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752139004; x=1752743804; 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=Omsp8mXp75/hXn7qkFWCOKSdc9pZVj0sVSquHLqjEXQ=; b=mIA76gnNN6rTbBhE3uY5Ym50hapyS65U5bho5z89NwjkbtHvMoy4JV+UBcanFPGZCh fPOJkEtJJ0fVq8EZYc1ZtpPCCcMMr28lZUC15NzVh8hKAaoel+SuFNwfiudQVia+/m3Z K1NnNghZ/Kzigm7DwV5E23i1chAo7NqD3MC5HTQzh46LzQkKYKGKdOSC8ayFr1wqeIGx neeV058JN162QruXkwL7wik2OkEEW33ti9qhG2lCij0DVxCD4RnQL9phhMl5S3CBK2jd 2XGlCqKY8Anr4qhqGcJS7x8osvjgmYYENFt0ML61a414iqY9cnbDKuz2rI98ZkX98jJC 034w== X-Forwarded-Encrypted: i=1; AJvYcCUpi0BHeP/UQaG/JyVDOpkVwVgaQiMztj3zMlCotp8eD4+wqTJJyPN8a7qTlVnjYOpuWUQ6KxEv5+zll4s=@vger.kernel.org X-Gm-Message-State: AOJu0YyqqaE2rPL0ApwYM2SJn0iA+05qmYteO6X6d4a8OFdBK7UoO+19 9YGBheEoIbeuMZwru4VInJeV/6BO1ZGUDzI4rLWV7imTVmeW9i2UcktXmD28d57mBvxrhXh2wJG zBZAqiTzW1VYCUwIGCTyBBKll7zp3Bmi6zLQpl6r1L8whJtUo5/E5l/EEmgBQhQTkHgM= X-Gm-Gg: ASbGncs7DoElmf/oSYmPiBLsusdRa4IWQYEKeDA+lttWx2c27FWJ28QQSlucp5SWm1j 06vwX6JpgWG+Iy4kn5YtyvYAUzmu/M0TnYmLbxNUF9M5/ti8FUWylVI6SgeErA9AMDYh6cVXsc4 uqNQxnJFG/G/VfrBtXom6O21zHXRhA8pyRvwR/IU/VgLxA4YDoLAUVVIpqqon5b/Qf56Cjmze4A wtD87KNSyA9w14OQzC21pER7+VBQYzpcZWjgx2sB9yH6kHJeKtZChsDRIPP33Iuj9D4j9ayukkT 3tC2us1ThztItoBTzm7zs1q2mQUBjKpIhTwX3myn4PceO/IVZJqa59e+qpA= X-Received: by 2002:a17:90b:4b83:b0:311:cc4e:516f with SMTP id 98e67ed59e1d1-31c3f0524b3mr3115604a91.31.1752139003756; Thu, 10 Jul 2025 02:16:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRkahqT6M3goz801R4gyUSxZaZcpl0nbaLVmNgBBfdCc7fPM+qe8CygBRAKPCeG1ssUoQs5w== X-Received: by 2002:a17:90b:4b83:b0:311:cc4e:516f with SMTP id 98e67ed59e1d1-31c3f0524b3mr3115552a91.31.1752139003251; Thu, 10 Jul 2025 02:16:43 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23de4341d51sm14837765ad.189.2025.07.10.02.16.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 02:16:42 -0700 (PDT) From: Shivendra Pratap Date: Thu, 10 Jul 2025 14:45:43 +0530 Subject: [PATCH v10 01/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: <20250710-arm-psci-system_reset2-vendor-reboots-v10-1-b2d3b882be85@oss.qualcomm.com> References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@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 , Olof Johansson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Elliot Berman Cc: Stephen Boyd , 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, Andre Draszik , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Wei Xu , linux-rockchip@lists.infradead.org, Baolin Wang , Sen Chu , Sean Wang , Macpaul Lin , AngeloGioacchino Del Regno , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Ferre , Alexandre Belloni , Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1752138982; l=4006; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=ALwJqxoH5zAinvmbBAPI1a8edV2GbWb9vLZOWS7SaNs=; b=zmpgmDmSEZpp9iMryNZpCeFDIhc8RonTeW5+eqo2M22DtBxd4MaQSjx8XESzBCnjrPGhO181y zLKXkvptGoEAg7h41Z8ubtMkQzWYl+N4cZV+M+0O/SV3DXVGoygQFwA X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-GUID: mnHchZdTZwe-YRQpS9NKZhIbMb2qpxt_ X-Authority-Analysis: v=2.4 cv=W7k4VQWk c=1 sm=1 tr=0 ts=686f84fd cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=i5N5rYY7EEs6P5za-RUA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-ORIG-GUID: mnHchZdTZwe-YRQpS9NKZhIbMb2qpxt_ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzEwMDA3OSBTYWx0ZWRfX+RKVQ8mLDmF8 jX2GRlNHWMu2QM+1DFjgcHUE/ebT8GhaoRqBCJ2Rb52bjNO02HgRyx0MfqBondUK+6d43zMPyVc aHX2JubHUAp7AvXuRqGStYcc3XI12iWcFj4Yrhjn9/BpCpRfbOa4EfTGLb9H/M+XNwrsf3Mhbo2 mg6+uK+Tn6L6l3XAj/l6DxjLx6K3MaNz24BrkzeP+aDeitMlOVgoz/1to5PPGUPGaah806GIAN9 cEUTP7AY1q8Nto6dZiDB+YHhIe2WENfBUEB0gtvZgfWOoeMJVDk58FEftGQDUBBJdAo+pvdbSui Buov14020rMCao7rV/TH7Au1jWwkVNfTMvQUOcj+MaqnFowVInrB9VrMKtQeUHgPmglB6ZajfGp QM/y27Bv84wBjwZ2dAVCTkqyQec5qXUllBrvUiwWSAahlt+6lzJe45d38xLtTW1iuMO9LJpd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-10_01,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 clxscore=1011 suspectscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507100079 The reboot-mode driver does not have a strict requirement for device-based registration. It primarily uses the device's of_node to read mode- properties and the device pointer for logging. Remove the dependency on struct device and introduce support for Device Tree (DT) node-based registration. This enables drivers that are not associated with a struct device to leverage the reboot-mode framework. Signed-off-by: Shivendra Pratap --- drivers/power/reset/reboot-mode.c | 23 +++++++++++++---------- include/linux/reboot-mode.h | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index fba53f638da04655e756b5f8b7d2d666d1379535..61f647b23959789a313f3af0bd9= 67abcad45fa43 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -12,6 +12,7 @@ #include =20 #define PREFIX "mode-" +#define pr_fmt(fmt) "reboot-mode: " fmt =20 struct mode_info { const char *mode; @@ -65,14 +66,14 @@ 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 property *prop; - struct device_node *np =3D reboot->dev->of_node; size_t len =3D strlen(PREFIX); int ret; =20 @@ -82,16 +83,15 @@ int reboot_mode_register(struct reboot_mode_driver *reb= oot) 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 @@ -102,8 +102,7 @@ int reboot_mode_register(struct reboot_mode_driver *reb= oot) } else if (info->mode[0] =3D=3D '\0') { kfree_const(info->mode); ret =3D -EINVAL; - dev_err(reboot->dev, "invalid mode name(%s): too short!\n", - prop->name); + pr_err("invalid mode name(%s): too short!\n", prop->name); goto error; } =20 @@ -130,11 +129,15 @@ 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 - list_for_each_entry(info, &reboot->head, list) + list_for_each_entry_safe(info, next, &reboot->head, list) { kfree_const(info->mode); + list_del(&info->list); + kfree(info); + } =20 return 0; } @@ -162,7 +165,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 4a2abb38d1d612ec0fdf05eb18c98b210f631b7f..36f071f4b82e1fc255d8dd679a1= 8e537655c3179 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -9,7 +9,7 @@ struct reboot_mode_driver { struct notifier_block reboot_notifier; }; =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 Tue Oct 7 13:49:02 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 6CD62292B49 for ; Thu, 10 Jul 2025 09:16:56 +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=1752139018; cv=none; b=FgicPpVkRVlmluK77TaJr639vOgMJXWexkWbDMKuLRo6EvBl71HZu6THXCCLW4ZSTAJ8kDWY0qnaqwdrESgJnRMcQBLystryMNvKFxpiy6Of6+HpBzcEWspwmATGeoMUuqzgAjKgJZ6F3vimlN7HX/apL+nfo+pa8Grn8mu8LbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139018; c=relaxed/simple; bh=viCb3VHco50oE5St3/+zoJqA55BoCRGQlTkgrUYg/Ls=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rbFV2t2bac9X4wk8tAHtcGJkrCSXAbN17q3oKl4BjUok0R3YDFv4v0BXZQgHDRnDF5NOm/8xD00St4yRr9P1U7onf9d5joe3vBFCnAIK3Kvq7Lw5K1hnbsVMbw2d4CfqvuP8O3AK0FxsOmSCjDibVyLttLT3hyEnlgn/oI3bquY= 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=NBeaEdjd; 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="NBeaEdjd" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56A95YMk016649 for ; Thu, 10 Jul 2025 09:16:55 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= 3JHDq4xNymeRQPJylCbaS/K0qseIZK5kd41UanSbGBs=; b=NBeaEdjdL1iocVeu /rYDdybPhTfaKd04D1Ltrm02Fx08mFrP8+Y/le3PKMA4E6Yn7JRUshnex1oLmzO4 V17upqXQFqIWJW0VC2elJMT6XUKi+D6UCEpKt4Cnf5Dma+uw99D57W+ke5kFMZAO RZskEFFLo9fkAQzAEv/tQkbxDBDoMomQG3H75Tb8LgpktM7xhfI/Ecb3qclcxFy8 hWOhYUJLNH2lqiMKsnz8McR/KxxeV0M8+ukKzBtIgWgadj+51FAihBM5uLeIVOzV GXb8SVOKU7QRsZW7Q2+WK8Bryx+WBb0Ifr1WrlTIWvq6wS78CokNJ7xx1x1abvlJ z2a13Q== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47smap4ch9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 10 Jul 2025 09:16:55 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-235dd77d11fso9170405ad.0 for ; Thu, 10 Jul 2025 02:16:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752139014; x=1752743814; 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=3JHDq4xNymeRQPJylCbaS/K0qseIZK5kd41UanSbGBs=; b=EESM0k/v2/JvL/WUHYMkmZKmXmgyPfrAbeTe4Fd6tGa7KUkrLGIMh7bVd1/rCoRCCv lXAPXTMjXtkvL7rwseAjoR0LlVeGHnrnaLnfw5CIo1dO3vwe6vzLZyLgoYDoyYQHdrmh 4XW0UTg3J/AMwyHSvBIkkmnty3eLC6xFq9XXL52YME8h0pRxUuzr87DFoBU+0FSz6x0k 8ZwcPyHna+3RiosDEnTClpki2PAw3RHE4/VVHB280TbejlqAeLbRf5u+upvGQkFHa5SU 9N5VdyqEqR3aVnmi2IbQLYl4p7ugxqmdYirQ3XH84cNV4sjbw64JHQ+XNkeSuJAoQGuy CZmg== X-Forwarded-Encrypted: i=1; AJvYcCWvOJ/5r5XGvB7G+NzDOuFNS5Q+vlnL4hNjNU6WZ1NriIki969ta232vr//xr0/l7c/d5j1Ej0MSbRtVLc=@vger.kernel.org X-Gm-Message-State: AOJu0YwwpVJnn2X95GY8u6Me8Nn05vs7xOby9Mib/P0LJ5Z94+x0uoYp ++B7c+VZ4TxjUiDaYZrvj7qEioU1spk+PFmDs2tu2eRLbkF8ns/SytXlZF3Oo8cj15k7aCXjXek r54hkqBIptu/px0z7MsiqztuibOy1MC4LdkB8n1RdPWuhRf33VrTk3O2euZb1/COqjqc= X-Gm-Gg: ASbGncuqXxdxpyl24l/BzpbHYfls7eUjXALVqTihSKCK6+T+ZU7P22dFkGJf1qhk7jc y1wpsDiC+TvqwAVzH1JpzvZknh+b1/coC9XuN35qoeGudFj9MFCoHkNyYeB4NwlJQAlk1bI5o8a C+SHHXFygcaA5l2V2Ev+IpEOUOIRzVtFP2IhnMwR98uWSCaTPy9KcYCPEN346GQsf23Z5cGRjBN nqZkNrpk+7htlbYyV7txMZwLP4gFaInvPna4n5Jn9pnFFqxIvSbDSSTfOBIG1x1J3TlsIp8/ahb XqaD/DB7kysK8uXCwErfpQqW9yqk82R04L0JpqR0quwAON2f/ZUx5rOSM9M= X-Received: by 2002:a17:903:19d0:b0:234:f580:a11 with SMTP id d9443c01a7336-23de245ff1fmr43551035ad.19.1752139013956; Thu, 10 Jul 2025 02:16:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhuu3BMPy6+m8LotTax4Q3myhPb72nZbkwXLoKvQavuh7mNiBOrFXL2YDf4RnsCd1Y59kqaA== X-Received: by 2002:a17:903:19d0:b0:234:f580:a11 with SMTP id d9443c01a7336-23de245ff1fmr43550425ad.19.1752139013557; Thu, 10 Jul 2025 02:16:53 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23de4341d51sm14837765ad.189.2025.07.10.02.16.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 02:16:53 -0700 (PDT) From: Shivendra Pratap Date: Thu, 10 Jul 2025 14:45:44 +0530 Subject: [PATCH v10 02/10] dt-bindings: power: reset: Document reboot-mode cookie 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: <20250710-arm-psci-system_reset2-vendor-reboots-v10-2-b2d3b882be85@oss.qualcomm.com> References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@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 , Olof Johansson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Elliot Berman Cc: Stephen Boyd , 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, Andre Draszik , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Wei Xu , linux-rockchip@lists.infradead.org, Baolin Wang , Sen Chu , Sean Wang , Macpaul Lin , AngeloGioacchino Del Regno , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Ferre , Alexandre Belloni , Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1752138982; l=1990; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=viCb3VHco50oE5St3/+zoJqA55BoCRGQlTkgrUYg/Ls=; b=+tAQXKo/oQadh3EVPYHeqksr67cJmLufTnVdZiv/vcBJ0BqSY+aKThnGkD+4p/OYWNsrrETxS MZV5O05idFJChRAtYALBJlBTh7VUYG0QMDDrgODlWIE2AZJ0ZArgeR3 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=Ar7u3P9P c=1 sm=1 tr=0 ts=686f8507 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=s8YR1HE3AAAA:8 a=vfvPc3r3pdiY9V1EK2IA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 a=jGH_LyMDp9YhSvY-UuyI:22 X-Proofpoint-ORIG-GUID: _2aTjNPOvAROlPIiCH_ALArUddzttrke X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzEwMDA3OCBTYWx0ZWRfXxVezjYJf0M8J iA9VnYbGHGEvq7CQD5urZvWzlIP5Hw3iGTFFHE0YueUSS9CvFxW4+8MjbvJE0KFBMgf8mqsZwNB vyoHMbZn7QGxQ7j6KavmZagu7051U0Siy/Ct71OuzpUgdq+nsxsr09fm0DfqXuc7YEkal7pgqEL sd30Rb5fehLuzEmEjaxN2IJBNnuQ5FcrBA+4HTXOYqfdC1vit+wlt7kBC376ns8XzuKpft3QMZ4 aYA6OqZoj4Hsj0UGHWiszkILuRCsKDQ//oBnaQw0HRzHCw8ugXsHB8h8SNCu/WiDY+X4CXRX1TK OYcYADOyvSKUUVlQ6xJbkbNwkgLEAXWKSIZYf2D5n6lVIHEi5JDPfysT4FTtaYeMpzVmwOKZDjP +ho2lZz1Hs/q4eaiEEQdC4B9y+4PZp0vxudN4xX73BH5FT12+juKexPa5sVFspBS0o/K4xzj X-Proofpoint-GUID: _2aTjNPOvAROlPIiCH_ALArUddzttrke X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-10_01,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 phishscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507100078 Update the reboot-mode binding to support an optional cookie value in mode- properties. The cookie is used to supply additional data for reboot modes that accept two arguments. Signed-off-by: Shivendra Pratap --- .../devicetree/bindings/power/reset/reboot-mode.yaml | 12 +++++++-= ---- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml= b/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml index 3ddac06cec7277789b066d8426ea77d293298fac..a4d2fe1db51e0c1f34ebefddaad= 82b8cc0b1b34a 100644 --- a/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml +++ b/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml @@ -10,14 +10,15 @@ maintainers: - Andy Yan =20 description: | - This driver get reboot mode arguments and call the write - interface to store the magic value in special register - or ram. Then the bootloader can read it and take different - action according to the argument stored. + This driver gets reboot mode arguments and calls the write + interface to store the magic and an optional cookie value + in special register or ram. Then the bootloader can read it + and take different action according to the argument stored. =20 All mode properties are vendor specific, it is a indication to tell the bootloader what to do when the system reboots, and should be named - as mode-xxx =3D (xxx is mode name, magic should be a non-zero va= lue). + as mode-xxx =3D (xxx is mode name, magic should be a + non-zero value, cookie is optional). =20 For example, modes common Android platform are: - normal: Normal reboot mode, system reboot with command "reboot". @@ -45,5 +46,6 @@ examples: mode-recovery =3D <1>; mode-bootloader =3D <2>; mode-loader =3D <3>; + mode-edl =3D <1 2>; }; ... --=20 2.34.1 From nobody Tue Oct 7 13:49:02 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 342A2291C1F for ; Thu, 10 Jul 2025 09:17: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=1752139031; cv=none; b=rsoyaesWptAOdXl81P6Enya7zgd4BUtJ+a0icsJinAmCqm/l51eIpZWoWKVAb81Be1sssKyBOJdeTUetPCvjPmgo5XRkDwPBOzGVUYgPYzpxJ8miUrk7a0bPTO2o4wVj7ssb9nYGgZraVWgg1gPLdSahyo+1DhjrzoIhPkhOMiM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139031; c=relaxed/simple; bh=Ybw+njJawUkDJ2EQIbedFhNekca67Tu3POKilli7L+k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j+kXpUWKWd6mMomtAxNLOxHBNswwEVJHXgXw+C0mlS2QcBPizGgIAru2pWDyI4itP13vqoqns0PuybzKKXs1ZAMEiPLXLe3IXgwov/ajzDYLyUwLhNAuyuEvN7/gH0DRecem4QMsfwCRJGKSAZedIsXl2p7mHTGUQe59bGNbDBg= 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=VMahjaXq; 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="VMahjaXq" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56A6HBYf023864 for ; Thu, 10 Jul 2025 09:17:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= +Mf1tUCyPlRBD7uh7eZr0NKbyyezdmIRIQMRpteYEvo=; b=VMahjaXqgpX68aY8 Lb/ksRM5tnwkuGncVOPSKi/u1EmtxqbncDxA6/Jc7xl4hg5136BZtkBeKoBeXqZG QHyUDI25izQBtZSk/2FI45c8ypXLZAM1fkF3VYdAkjnBNJtekmLwnL2MSz1SeIf7 Jm2eWkdg46hQ0rp9qt9d9vYF+PebWBD5h8/kMzdcU3dd6o+KihZ0lpu/dQ4nzkUN 2mYf7Ne8VIzw1U/pIVDIzd4pByM+X/guU0AXAPmFeSy6l0A+nhCUmbIJEvZwFDg5 XfpaS/w2SGcWuHY4ZWTe/bCTDGwfW2xehETqrEbu9oILa1ohGINfF7UTVsJRWvim WpFzeg== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47t83u0k0t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 10 Jul 2025 09:17:07 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-b31c38d4063so643534a12.3 for ; Thu, 10 Jul 2025 02:17:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752139024; x=1752743824; 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=+Mf1tUCyPlRBD7uh7eZr0NKbyyezdmIRIQMRpteYEvo=; b=uvYHhIxYfdUeR6jgH9L78Vye72odfHMxiZyt3lvYeFqcSnAHkdKX5voqQdDLzh+Wo/ u+OdxseDoY/+EptOJlb9h8lhwOMSxSrZdk6EUrC6bK3HHKCPIDr+672mqk+ZtHYBFT2u CS0zODOjZ53keBBPKJNM1jGLC+cF7/UDfVs88PQWhhFpFi5GcSvm/dCxGeBAgth0dmZp btSxMimB1U3TFO/LulCKaJSVXxVtEKN4X+0HT4518v8HSkAvIT386YFvAwSjiAPKE2nM e3qCYzyl7SOqETj0bBGs9v71VZib5ddVu2vHWAer3miz7Qo/nD1yWq3WEndbb4WH8uab z/UA== X-Forwarded-Encrypted: i=1; AJvYcCWATgSGS26QMJw963xuqkq/8EVXoTifDghTZNQ0fUPijER/BKWff91MppR1qCFwOYanHINTmouWBUMpkR0=@vger.kernel.org X-Gm-Message-State: AOJu0YyzkPXvBg4rjSPkvI0mYE8MzY7ScvJQ9vBKveaq/nx+/Bjknbif gsLmtfzrlbCIsUdFJu7yUYmfZIjmFleYZ5yyYCr1nR8MipbJBXuuoxS9m9u+vi2YIkC4bZA0yGX wKPTPIBxTYlkDaHm3qRXisbyTQD0YLaifV75b4NyJ2blzajZd7UQXk+pW89abxjomIkc= X-Gm-Gg: ASbGncvLgSRubEG8Ie/kJHFSS/dTm3yrWMUI3OZEzKHsXKtKNM5a/GmTRDksB8pNwfZ Xtp03J2WM4oslmDHzlk+zUnuqxPtj7ebChIfB1YflLSjsGw7kc8RdBDDBcjPQY94+quIlNAp8u/ mb3jmhGWNBqGreqMdtFf2hfDMmJtywh4PDWPJUkOYGuVRNm60JL8qos56ziuGDT/EDGPCzI4iAA MPkcMyBG3yEciWnpNQlz2U2Y3f2zhynbpqhzotyQYqFPD1JCrTv5t8nGlOnQL9mhpIEMRzZrF1n LOnpKrYsLj4nEekRqVu/pxwEqGRLX57kKqTVY8NML6Z9BDDual0GFzGDQRY= X-Received: by 2002:a17:903:11d0:b0:235:7c6:ebdb with SMTP id d9443c01a7336-23de47cd531mr27606465ad.10.1752139024298; Thu, 10 Jul 2025 02:17:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaTKG1M836vj85DWnJt0R7I4oMnJq5iahq76ixet4o2OdBW9MxUH5ZENGIwQnEllXEhSYfyQ== X-Received: by 2002:a17:903:11d0:b0:235:7c6:ebdb with SMTP id d9443c01a7336-23de47cd531mr27605765ad.10.1752139023772; Thu, 10 Jul 2025 02:17:03 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23de4341d51sm14837765ad.189.2025.07.10.02.16.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 02:17:03 -0700 (PDT) From: Shivendra Pratap Date: Thu, 10 Jul 2025 14:45:45 +0530 Subject: [PATCH v10 03/10] power: reset: reboot-mode: Add optional cookie argument 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: <20250710-arm-psci-system_reset2-vendor-reboots-v10-3-b2d3b882be85@oss.qualcomm.com> References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@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 , Olof Johansson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Elliot Berman Cc: Stephen Boyd , 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, Andre Draszik , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Wei Xu , linux-rockchip@lists.infradead.org, Baolin Wang , Sen Chu , Sean Wang , Macpaul Lin , AngeloGioacchino Del Regno , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Ferre , Alexandre Belloni , Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1752138982; l=4147; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=Ybw+njJawUkDJ2EQIbedFhNekca67Tu3POKilli7L+k=; b=YFgAo1XczR69Kp0uIrUveOMYfDOdwaOYVutqLUFprgRmdRqIgHvcUhdeVirp5t0t+SejIfQMq ReHm/DNkrNjBb1zWeD+v46tG3Z6QZCEZi2q4dlboOoqyuJ8ZGkvyl9N X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-ORIG-GUID: 4Q3gvvsaJ3OUCTD-SznsmM0PQ0jqHCT7 X-Authority-Analysis: v=2.4 cv=OotPyz/t c=1 sm=1 tr=0 ts=686f8514 cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=VUHD6Ma6yzaK34Q8qnAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzEwMDA3OSBTYWx0ZWRfX6ljX7lsSdF0C 3KXLmT6LkMvIiOb2Xo5Al84CjRaKJYflHIkCre6Fi92l1KhuDriaL1rA/06VZXUVDifktK45g4j ButeM9ieYZt1fdHPvbAED6tDrwTp4LmE8d6qUFwg3BiAgydzlpoqCsUyUM8zAsMEalnkLHJbVOT mFbyrHdPyFtKaZ7gq8d0ximWjLaYi8Oc5JwX7xxSQ/IwMQIKsbhkMnyip92jPcaoH1jb2xivyi5 hbQTK89URgqmTQyB2mfpAa+soDeYxeWpptAvEeG6sGp9TXYHngfDZWJSnNFVadujpNvh4HCkQRM h0BQyLa5GWjZzixN4fffzbBa+rFMxQseVw5UNnhwgrUV2Q85Q3Z9Hur9x8Z5jXfGb/penEMxFQ2 75VR82zogiq66a225GOfeEHwrWUGX4Nzq5N82JjSOOAZf9zs6wQDIsbEP53iTeE7N1dTxeWy X-Proofpoint-GUID: 4Q3gvvsaJ3OUCTD-SznsmM0PQ0jqHCT7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-10_01,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 mlxscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 clxscore=1011 suspectscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507100079 Current reboot-mode driver supports a single argument(magic) for each reboot-mode. There may be uses-cases where a mode requires an additional argument and hence 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. Add support for storing an additional optional argument (cookie) for each reboot-mode and introduce a write function in reboot-mode that writes two arguments for each reboot-mode command. Implement the read and store of additional cookie value for each reboot-mode defined in the device tree. In case there is no cookie specified in the reboot-mode device tree, mark the cookie as invalid to support backward compatibility. Signed-off-by: Shivendra Pratap --- drivers/power/reset/reboot-mode.c | 32 ++++++++++++++++++++++---------- include/linux/reboot-mode.h | 2 ++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index 61f647b23959789a313f3af0bd967abcad45fa43..afadd823d62d0f7e7e645746b97= 8cc8fecfb9ac4 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -17,11 +17,12 @@ struct mode_info { const char *mode; u32 magic; + u32 cookie; + bool is_cookie_valid; struct list_head list; }; =20 -static unsigned int get_reboot_mode_magic(struct reboot_mode_driver *reboo= t, - const char *cmd) +static struct mode_info *get_reboot_mode_info(struct reboot_mode_driver *r= eboot, const char *cmd) { const char *normal =3D "normal"; struct mode_info *info; @@ -32,11 +33,11 @@ static unsigned int get_reboot_mode_magic(struct reboot= _mode_driver *reboot, =20 list_for_each_entry(info, &reboot->head, list) if (!strcmp(info->mode, cmd)) - return info->magic; + return info; =20 /* try to match again, replacing characters impossible in DT */ if (strscpy(cmd_, cmd, sizeof(cmd_)) =3D=3D -E2BIG) - return 0; + return NULL; =20 strreplace(cmd_, ' ', '-'); strreplace(cmd_, ',', '-'); @@ -44,21 +45,27 @@ static unsigned int get_reboot_mode_magic(struct reboot= _mode_driver *reboot, =20 list_for_each_entry(info, &reboot->head, list) if (!strcmp(info->mode, cmd_)) - return info->magic; + return info; =20 - return 0; + return NULL; } =20 static int reboot_mode_notify(struct notifier_block *this, unsigned long mode, void *cmd) { struct reboot_mode_driver *reboot; - unsigned int magic; + struct mode_info *info; =20 reboot =3D container_of(this, struct reboot_mode_driver, reboot_notifier); - magic =3D get_reboot_mode_magic(reboot, cmd); - if (magic) - reboot->write(reboot, magic); + info =3D get_reboot_mode_info(reboot, cmd); + if (info) { + if (info->is_cookie_valid) { + reboot->write_with_cookie(reboot, info->magic, info->cookie); + } else { + if (info->magic) + reboot->write(reboot, info->magic); + } + } =20 return NOTIFY_DONE; } @@ -95,6 +102,11 @@ int reboot_mode_register(struct reboot_mode_driver *reb= oot, struct device_node * continue; } =20 + if (of_property_read_u32_index(np, prop->name, 1, &info->cookie)) + info->is_cookie_valid =3D false; + else + info->is_cookie_valid =3D true; + info->mode =3D kstrdup_const(prop->name + len, GFP_KERNEL); if (!info->mode) { ret =3D -ENOMEM; diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h index 36f071f4b82e1fc255d8dd679a18e537655c3179..cfe18cdc2559be249969bba6c02= 2940a508dd188 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -6,6 +6,8 @@ struct reboot_mode_driver { struct device *dev; struct list_head head; int (*write)(struct reboot_mode_driver *reboot, unsigned int magic); + int (*write_with_cookie)(struct reboot_mode_driver *reboot, + unsigned int magic, unsigned int cookie); struct notifier_block reboot_notifier; }; =20 --=20 2.34.1 From nobody Tue Oct 7 13:49:02 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 8FF4622330F for ; Thu, 10 Jul 2025 09:17:17 +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=1752139039; cv=none; b=LSz4bYgIifUfnA6gfiHSlfeBFSYNtL/GVqtQL7B5BNcbHn2CVuH2iaxvXUSQoZTPg+846nA8RgRM6UY5mm/Mp71dua9MYvKtATpaKc+8Zbi/bzhpHkGIrpIBJqEPIPuwFfAqOmxg36cMc9K1vuU9t+LQ+SYgrjSrycXUtmgA8Ug= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139039; c=relaxed/simple; bh=khn8GMlrTtxNNR634wsCseHe/a7/+U/2qtnSEpHb+ZY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Rzzvg7YNRSDY9/lMmTCGKH2jY7bTpaMU3vmxq9RPlr3R+AtX4CMcV+sxoxfcF2YGwjDT+jazWVKYYgdblKQ3Pe/LjqQTSHZIriicGop3cQhfG7nglcNaxJOSfoZk1ja5vvvFrmRMBM9xbsGl/7iLhAiHiTeD4qgabp6KHQwtPB8= 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=ni2uPbDR; 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="ni2uPbDR" 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 56A9F2f5009964 for ; Thu, 10 Jul 2025 09:17:16 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= bm688pDoN1t58GLFHGhBI++/OTcmZdbP8x57uiG6loQ=; b=ni2uPbDRJeSqMnI1 f5s4NXc92iTmeb4IiqlqTefRpdkV3ssbPXnkVqXkAAld3lrVzQD1hX4klx2Ooj8f 89z5aHK6uVOdc3rE0936FhwbP75pr+yoDnkQdLYtqtjf4Sar4xpk3loikBcq+FMK Cjch2UovUfMG/CMATQlqe6GOo0ToMf/kqj++zc3uQ9+bzXtydsNwW5n4FVoD+5Bq fMfP7H12VkLkSD+aKEin91RVxLZIxvtZJiQJhrbRpFyboJbPSLnEmtbxNQRf+A5C +IESMd4WSO4/mANV5+oUz50rfb1+fMNHA+wdy+B2XuxNBwCqx4L1RpgEaUTPS/Q8 vnPlQQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47sm9dvbk2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 10 Jul 2025 09:17:16 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-23536f7c2d7so13341145ad.2 for ; Thu, 10 Jul 2025 02:17:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752139035; x=1752743835; 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=bm688pDoN1t58GLFHGhBI++/OTcmZdbP8x57uiG6loQ=; b=G1Eg7njjus8gWZ1TDlufL1ibEBseoL3u6e+FrisD2TP3840gcFuawq6HZZ7HBhBhT2 drPV4frG5Ss3iTWQ7RlH4cENy8ZfxcDCbWzK/Xn/lnno/D5yeGMuVy+6+GYd8ZkmZllO iNQTagvAK5jwKKe+eivv1uP6Swp5Sa3DZKKrsbw8PF+H8GDVr0/6l/ZiXJKsvBSk7AEB Jzvpk6YqT0yugIjl9Xsu7oy/kMqpJK80rX/kj6Khs7rEIB4agTb0BtFKKwTdXT/O7oJ2 IAqqFUrWu5Qo/FT6CpaOWH/6xCWNN8X3FFU3etB7hI5AO8dIA3dNcxEXtL8TnVjxr487 9ikA== X-Forwarded-Encrypted: i=1; AJvYcCUwtJ2NzRhRi7NdjCpll9EHAJxhR1UySQFDQ9rBVdsflI6C/IekyXhKA5jTntksfTKf03rARii+q8PUVmE=@vger.kernel.org X-Gm-Message-State: AOJu0Yzc4N2uLMW0j3hKkNdf90TiZK1xYm2pvLiuFhuSgsPRj61wD/Iu dwSaf1bhpiXmouGxYSScQEFpGIvfoqC1719M78ktTM2AdLWQk1TjrZlRtX6A+7DEeI3ajRGwcSQ +VOTQslZv2izorQfKuD8cUkjQGCFHVLnbOc0EfM8RSmiziK3+1+3k4n191T9sa+MrWKI= X-Gm-Gg: ASbGncue+eZdq06ruXDCZk1+Us0jyY4lnCtB5q7c2BCK0XVKZr7OKtk2maiTMHmPPZ+ kzPlhPoHFuEH7J3r9b7HHZtl7lCWyi+D/KFxIDWyg3xzFWUYHtSj+nivnoClfACAFelN0ZvUFDd 96lEKjULTocBPzH/je4GonZsHhK/qMD7AhxgpgY/gj8wuU63PhNxLm0dTA4G4vHCoeC9dpHqshb 87bHODMKCgMQ2/FgfAyGhI+suYeLemi223+UsLsL+ZzSTf2zZOTwqvxKufXom2+YRL1x+MCZIQl /m7UFnhQG7EyauCNMr+Qgr6qxx4hp08Z/koU03ZYwWRNEtlFzLI+rkknXcM= X-Received: by 2002:a17:902:cec2:b0:235:1706:1ff6 with SMTP id d9443c01a7336-23de46edf4bmr28705325ad.0.1752139034624; Thu, 10 Jul 2025 02:17:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwquEcV/DEQgNHo5i5rKIMG5wYJOS8HD0ETiQ+J8XjUT4+2RRoWOqCstZDWnrO0s1dBiyXug== X-Received: by 2002:a17:902:cec2:b0:235:1706:1ff6 with SMTP id d9443c01a7336-23de46edf4bmr28704665ad.0.1752139034147; Thu, 10 Jul 2025 02:17:14 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23de4341d51sm14837765ad.189.2025.07.10.02.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 02:17:13 -0700 (PDT) From: Shivendra Pratap Date: Thu, 10 Jul 2025 14:45:46 +0530 Subject: [PATCH v10 04/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: <20250710-arm-psci-system_reset2-vendor-reboots-v10-4-b2d3b882be85@oss.qualcomm.com> References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@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 , Olof Johansson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Elliot Berman Cc: Stephen Boyd , 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, Andre Draszik , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Wei Xu , linux-rockchip@lists.infradead.org, Baolin Wang , Sen Chu , Sean Wang , Macpaul Lin , AngeloGioacchino Del Regno , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Ferre , Alexandre Belloni , Elliot Berman , Shivendra Pratap , Srinivas Kandagatla , Elliot Berman X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1752138982; l=2500; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=LJQmaaDtgt8TROVTUTsTmEnpeK2uj+7rigIrzNpy/l4=; b=iy9PU4ZJOiTEn2epqZUOkW8+Xr7tjFQnf02iWN5UFpijHHJzDb+DQE9zwiCZcqY66/IiKYTBH Qa8lCfgZ15ZBxIImBn1nkijQHRDyoW0jh2GQrhRaXOvI4e1VEJRpOEa X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-GUID: ZJG3WZ1b-GOT6IOFNTvpmwotoFA6dQ59 X-Authority-Analysis: v=2.4 cv=W7k4VQWk c=1 sm=1 tr=0 ts=686f851c cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=UInjrUrXc7y1C1sAkbYA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: ZJG3WZ1b-GOT6IOFNTvpmwotoFA6dQ59 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzEwMDA3OSBTYWx0ZWRfX7FKznJCNTfNb yLeWWexyFOYeDxPX0iTq+wQjuJqedvBi17yPX1oWyhlPBqc0or+5PNKbKz+ZtFKN8/nE4eR98ty BMf5BJAmbo8HMAbDPLoXyGoTYkyLwG1NDj47wuuhgHgiSNfsvZuBA4cwrTwAolyzKGUE88nZmiX TxK5kSiuSVqsjyj0nad03psmrdTbYAOw7VwK+mXOH4M9urCcgvp/SWI1zr7IV2q095zvL4LRUP7 49KdNYJqUbxstGniHclIEdBzsNEjZ8ZrfjSazw0qMQhVPo3/EqkiIs9HXcy7OtQNgpqO56pmfMK w8wd1kYkTSat7cnYa5Pn5iKrQYBUUTJVvvwn7TDiBN7K5x2FTK2+NkfmjoNmJrtVmdR4++FeHK1 wjeuRPpyL14CJ1JF4oQGtVFRGaLqqedxgDdk9TQXO5sC3MOdghfTBSTHcEHvc8Bv7v+nFAZp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-10_01,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507100079 From: Elliot Berman Add bindings to describe vendor-specific reboot modes. Values here correspond to valid parameters to vendor-specific reset types in PSCI SYSTEM_RESET2 call. Reviewed-by: Rob Herring (Arm) Signed-off-by: Elliot Berman Signed-off-by: Shivendra Pratap --- Documentation/devicetree/bindings/arm/psci.yaml | 41 +++++++++++++++++++++= ++++ 1 file changed, 41 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentatio= n/devicetree/bindings/arm/psci.yaml index 7360a2849b5bd1e4cbadac533c1a7228573288d4..672fc28f69ed7cfed4baf8c2185= e0cd7b2024376 100644 --- a/Documentation/devicetree/bindings/arm/psci.yaml +++ b/Documentation/devicetree/bindings/arm/psci.yaml @@ -98,6 +98,25 @@ properties: [1] Kernel documentation - ARM idle states bindings Documentation/devicetree/bindings/cpu/idle-states.yaml =20 + reset-types: + type: object + $ref: /schemas/power/reset/reboot-mode.yaml# + unevaluatedProperties: false + properties: + # "mode-normal" is just SYSTEM_RESET + mode-normal: false + patternProperties: + "^mode-.*$": + minItems: 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. Both reset_type and cookie must be specified. + The 31st bit (vendor-resets) will be implicitly set by the drive= r. + patternProperties: "^power-domain-": $ref: /schemas/power/power-domain.yaml# @@ -137,6 +156,15 @@ allOf: required: - cpu_off - cpu_on + - if: + not: + properties: + compatible: + contains: + const: arm,psci-1.0 + then: + properties: + reset-types: false =20 additionalProperties: false =20 @@ -261,4 +289,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"; + + reset-types { + mode-edl =3D <0 0>; + mode-bootloader =3D <1 2>; + }; + }; ... --=20 2.34.1 From nobody Tue Oct 7 13:49:02 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 8EE8721D3E8 for ; Thu, 10 Jul 2025 09:17:27 +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=1752139049; cv=none; b=kaK9yOoRCKPRjoZAPHXUHjYmQnggVtvyWN9OyOpRAPKuiUYPax/ULVSap//7tLA1VE83TgaQjGM5tevgQTVAGor9KMRNlvOaAqgcs1fzMIR62fRQEjuhHPQxfR5hAOTHG/Pxm7RGPe6PQ1ZLd9dFsPgc9W29yi/rrKdDmO2iAHY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139049; c=relaxed/simple; bh=uCGaHKxMyCT6Fr1GicW0dawysRNXieqTwFGMzz+YiHM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BWkHtzo2FbHaJVInzE4BJvXwLL7QTm0g0easRStIjdrI1pN3PpjVKUkd2Q8d514LNhYOZQ8nMp26d0pelc9xoDPnyFndCFspfXULKmtp520Bjvndx4wtkAQ1rfYubBpa5CXAWTCRPPNaE00FlzyznxH2k/xb5T3fIcMwfaKxwAk= 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=KoMnbHJw; 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="KoMnbHJw" 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 56A93uA7030247 for ; Thu, 10 Jul 2025 09:17: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= i1S0YgYBWkNzPgMtsFsB7pmoBXpykrq3h9FvayJsue4=; b=KoMnbHJwHusbb1Qt y2PFwsxuIQm6zGmnPcpqg+sVft6aVH0zNR7Yy9ShnB3fA+GXaB0BHbyRG7zNPdgg nuhvYKJK01osK5kPqkawUTY6mADECTNdPwcsys2xUYV1Wunoo7ZVGAIT5xyx8Yo0 vNFjzoAcU0U4L8RWM//QM1jVVyl+ryExg3Rom5uSHPZ4oqiCZBPKauSZUmaejCAE MTVA7+SGRVuBGcU7HBnoU/fOVwaEVQQSDo7oAQL31zditLY+7kLpZF4Motuj39Tp U7m/fVN3hkmhaDq6gUnvwABeYLVLYOyyTXbt84iDbECpQHUQSoU3eHoSM71hWA9z QS3T9w== 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 47smcg4b3p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 10 Jul 2025 09:17:26 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2369dd58602so9257245ad.1 for ; Thu, 10 Jul 2025 02:17:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752139045; x=1752743845; 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=i1S0YgYBWkNzPgMtsFsB7pmoBXpykrq3h9FvayJsue4=; b=jPA8W5Kfm2S0zIZxI1sQrBrZfWJXMRg5IVuFIblj+N2GyMMrxwGM+VeJVLx3ZW5M0u UatHxkIB0rPGS1mL9ErTBTPqCVPVpk05tlznfrbrlNOIAlOUBCHO8fW6VwhmTtrV8w0K cSvQist353Nl1o3h6qDnrYb4D6K1T2EUTPFBLLNtgz6C2GCGLeze0rTY+/FQBtgv9dSv pzoqNghEJDJeTO6+GMKgEd6dcWmVnD+78w3z8r2cK57tIpOKDVztOrJpCPB1obFXqNj0 vken4ujgDKgcrJff/Yr1eB5TXKHhrCO8ZEPw/fksNmcQ640aJACoYicQwAECJLSGYO2V 0swg== X-Forwarded-Encrypted: i=1; AJvYcCXoucFIrW6DIl3m2EDUEFegEpBEeiI9NCgG0rnzu876Uo6Ge5gaK1k2EnD+5Yezm3l86U0NmPBqL4G9xqU=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9xf+9C+DvbphOR8shyry1zQ2DK+WbQqgvxXhAdcKiFvu6Ey5G tZQH2rXtN7xp7QeUNLT+/2cuotMbZJz/eIA2mY3YoFmDalD0lYEr5WUHxjfa0wmjooDkS6Ybf8F WGYTIXLbtlpnjcoGkQQUDZcoqxCjOcRWVD84IhE/SVDhKM+UByuQ0yrQSeitnhncxKUo= X-Gm-Gg: ASbGnctvGrZ/1uOyZpKWkWeZw5ZlL+1XNnSWYqoyd4VySMQZd5CoyrBtM5jpdP3Sdyw L0CIiQTg8fro6kEl2jwkil++8LgQ9MVb2m9OLJiMQQET7bJrZ1RLGXjUBRnma5TUF8z5KDLcVXV NawU0SwxhIcZgiPEM+xU8mmivcEfrue4hm3JFObdJylkSBrx12d4KZEmYwi0yxMmhhOKEqjyA1u JytHBY9YOR2VBHHQDZdS/aEiss1Y+C3/QdtgH9Qtq75sKpZhK/6Xc/TlUKr62gsYGXb4aRwlAV8 ttS7DBuZIXpUGUaHlthXQEjuP9wSFnV5iGP+cQffE0kwMSKhIKGvHdYesKw= X-Received: by 2002:a17:902:ce91:b0:236:6f5f:cab4 with SMTP id d9443c01a7336-23de47cd652mr30055295ad.5.1752139044832; Thu, 10 Jul 2025 02:17:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFg4RsjrMw/RBbJfUGCCXCUR+6pZ/OBaJOmKg8tfZNS55C/Jm0lOpHvhHWh1xVUlIOgo8dYHw== X-Received: by 2002:a17:902:ce91:b0:236:6f5f:cab4 with SMTP id d9443c01a7336-23de47cd652mr30054705ad.5.1752139044303; Thu, 10 Jul 2025 02:17:24 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23de4341d51sm14837765ad.189.2025.07.10.02.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 02:17:23 -0700 (PDT) From: Shivendra Pratap Date: Thu, 10 Jul 2025 14:45:47 +0530 Subject: [PATCH v10 05/10] firmware: psci: Implement vendor-specific reset-types 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: <20250710-arm-psci-system_reset2-vendor-reboots-v10-5-b2d3b882be85@oss.qualcomm.com> References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@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 , Olof Johansson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Elliot Berman Cc: Stephen Boyd , 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, Andre Draszik , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Wei Xu , linux-rockchip@lists.infradead.org, Baolin Wang , Sen Chu , Sean Wang , Macpaul Lin , AngeloGioacchino Del Regno , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Ferre , Alexandre Belloni , Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1752138982; l=4973; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=uCGaHKxMyCT6Fr1GicW0dawysRNXieqTwFGMzz+YiHM=; b=L6QqHX1809AdVxBa+yUIqV+KzAjQCF49Na14f6bM9oifTFAaCspHqvngk9jAg+lDYE0q+ZxwI FcFtJ72BHDNAXJDB5RiTwPW/EJPMBTS9YMfKspKEOgWPjTlQJLQUjhd X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=P7o6hjAu c=1 sm=1 tr=0 ts=686f8526 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=eXBxmsxbH67dAx2arOIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: DT8LBJvY6QCToxq3Idy77Q1iy0Klmvaq X-Proofpoint-GUID: DT8LBJvY6QCToxq3Idy77Q1iy0Klmvaq X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzEwMDA3OSBTYWx0ZWRfX7ohkdOWfIeFD KrhA7XRQPzdmcNNApAmJ/7MUulvx1xAcilIzrpjkroKmBSXlQTB3w5AV3RPXJnwkv+dmHHAQhJ9 BMwSGjddS+ekXicrxKc5fNcro/nTurm3+3uATP1Mp63q7g4Gdg5Bsa3h8Jal+aNPDmIGLHYj82u r84v0wI2lE0hcyU7xw8dOqnEWDH9LvinE50db6ZNsgl+KAvgeDqln1RqU4ldqvHZU9pxzT8Tzl+ MEHYqY2VXHohg1ZBxXaUxZB1t3D47pQTHxJZLLM9GTEWxbS63xi6ZrWwjFj8zPyvg/idKUBqdvM h3e+uW92Oun5l181csvWvb8WOey3xrxT7tm13ja4ZohGo18/1tM5SxOkVQJXYlGOpYrMUOh8wn0 xQ1Zaa+WWd05GKqZxcd6JwKnIvPTwnck6CVYzaJTGPe0j6dgTZuyswXZXmL7ZI3NgkKrR4cM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-10_01,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 adultscore=0 mlxlogscore=999 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507100079 SoC vendors have different types of resets which are controlled through various hardware registers. For instance, Qualcomm SoC may have a requirement that reboot with =E2=80=9Cbootloader=E2=80=9D command should reboot the device to bootloader flashing mode and reboot with =E2=80=9Cedl=E2=80=9D should reboot the device into Emergency flashing= mode. Setting up such reboots on Qualcomm devices can be inconsistent across SoC platforms and may require setting different HW registers, where some of these registers may not be accessible to HLOS. These knobs evolve over product generations and require more drivers. PSCI spec defines, SYSTEM_RESET2, vendor-specific reset which can help align this requirement. Add support for PSCI SYSTEM_RESET2, vendor-specific resets and align the implementation to allow user-space initiated reboots to trigger these resets. Introduce a late_initcall to register PSCI vendor-specific resets as reboot-mode arguments like reset_type and cookie. For a SoC where, PSCI vendor-specific system_reset2 is supported, the appropriate value gets filled to reset_type and cookie during this reboot-mode hook registration. If the secure firmware supports PSCI system_reset2, restart notifier will make secure call to trigger appropriate requested reset type. By using the above implementation, usespace will be able to issue such resets using the reboot() system call with the "*arg" parameter as a string based command. The commands can be defined in PSCI device tree node as =E2=80=9Creset-types=E2=80=9D and are based on = the reboot-mode based commands. Signed-off-by: Shivendra Pratap --- drivers/firmware/psci/Kconfig | 1 + drivers/firmware/psci/psci.c | 53 +++++++++++++++++++++++++++++++++++++++= +++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/psci/Kconfig b/drivers/firmware/psci/Kconfig index 97944168b5e66aea1e38a7eb2d4ced8348fce64b..9d65fe7b06a6429de8a26d06f93= 84e5c93f36e5f 100644 --- a/drivers/firmware/psci/Kconfig +++ b/drivers/firmware/psci/Kconfig @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config ARM_PSCI_FW bool + 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..87293f78ed83eb33ba67ded7372= 8729811693ea3 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -13,10 +13,13 @@ #include #include #include +#include +#include #include #include #include #include +#include #include #include =20 @@ -51,6 +54,14 @@ static int resident_cpu =3D -1; struct psci_operations psci_ops; static enum arm_smccc_conduit psci_conduit =3D SMCCC_CONDUIT_NONE; =20 +struct psci_vendor_sysreset2 { + u32 reset_type; + u32 cookie; + bool valid; +}; + +static struct psci_vendor_sysreset2 vendor_reset; + bool psci_tos_resident_on(int cpu) { return cpu =3D=3D resident_cpu; @@ -309,7 +320,14 @@ 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) { + /* + * if vendor_reset.valid is true call sys reset2 with + * the vendor_reset(reset_type and cookie). + */ + 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 +565,39 @@ 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, + u32 reset_type, u32 cookie) +{ + if (psci_system_reset2_supported) { + vendor_reset.reset_type =3D PSCI_1_1_RESET_TYPE_VENDOR_START | reset_typ= e; + vendor_reset.cookie =3D cookie; + vendor_reset.valid =3D true; + } + + return NOTIFY_DONE; +} + +static int __init psci_init_vendor_reset(void) +{ + struct reboot_mode_driver *reboot; + struct device_node *np; + + np =3D of_find_node_by_name(NULL, "reset-types"); + if (!np) + return -ENODEV; + + reboot =3D kzalloc(sizeof(*reboot), GFP_KERNEL); + if (!reboot) { + of_node_put(np); + return -ENOMEM; + } + + reboot->write_with_cookie =3D psci_set_vendor_sys_reset2; + + return reboot_mode_register(reboot, np); +} +late_initcall(psci_init_vendor_reset) + static void __init psci_init_system_reset2(void) { int ret; --=20 2.34.1 From nobody Tue Oct 7 13:49:02 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 30473292B3E for ; Thu, 10 Jul 2025 09:17:40 +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=1752139061; cv=none; b=YDMTmuIZZFfsr2W5OaNKOGK7clsRREfotUAQnq6MmDff/fj+FraxEwOdMf/5LrkiXpMyJN7r56bi1K4dauOUKXTMA2i2Zv4KMrWzGZnbd0Bo1Y0UyKXD0XvmlG8tt90CjENufNo9BvTZ4vNavS3aCw18VIx0C7o9DJk2lMONXdk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139061; c=relaxed/simple; bh=WRPvBg2xZwSvVeD0jkJE2F2CXCNgW24WQEv0gSZ4OPI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WNBFk547LuH/Y32oDsHjj4LHW2nEiRqwH803vxbFT3ASID2FGKiwD6b07GRY8p9+ST6CIWoNLEvzGWPfkWrx/NZLp1cmr7MNsleMl0mgy9HLxRPJQd9ZvjJzYA2mvQEbiWvD+WWaOrfPOjHfNpHH/7S72k05Xg06HSuztVdLE9I= 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=LhOfv43e; 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="LhOfv43e" 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 56A9983I012557 for ; Thu, 10 Jul 2025 09:17: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= jjnERpSzmYvkUrDgRq9M98U0DkVLcbK7HnoX1+rdKUQ=; b=LhOfv43e1mI+3rdy MtydXTK8trGflHcht5g6SX78LUPNwCXfdtA298j+BxH/JPAD9RvXS80ZufPUoHAH Rx+KtMNwiNLV2XoVcZyQT4MRrK7zmmoW+sggNLGpPSCyjFxfULRd2nThxkaqzWAg +U9UvWbcN5kAt9zbo143R1POcWIUvsCwUWNhPbbjgIyq/o0kc68husWRTIzUEPqG /4xAHa1uFkYz2RnMyGSEhSb57YdSKgOfEpsyAfoOgJF71wMfYazlTB6N9GC/dxdN IiQ14FVJS9bJlCtQ9JhS1Ii4RLDjJ9O54+W2XapvtazbIbGXzOozVR1dfTKMJ3sZ ODBNwA== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47pucn7vpj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 10 Jul 2025 09:17:36 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-b26e33ae9d5so1049931a12.1 for ; Thu, 10 Jul 2025 02:17:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752139055; x=1752743855; 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=jjnERpSzmYvkUrDgRq9M98U0DkVLcbK7HnoX1+rdKUQ=; b=ZiXZ2oeMAI21zhJw5V3kkggQe+861PwI6avYDXYw2YSDLULCQ0E0BJzI7DCPsE+v6m VVvYZGAkv10V3XFfiGnhCF26XRVFTvg+NJHlqAXGPWozNLNvlpfvQdWrbcIP2ZOaVSH/ 05fNBw+pZQM/AIt3nTFE+9GW6lHXWHtEvIocw4ihXK/ih5KYddoVUDSJirY50WjNOAGC qwJw4aRIrP+etHE6jwh8TfTlS2fWOreNcJCQhWnRyHiCY524ZMyp7QsXKX8hZRFrn2Oe tij0zcvFS26BJ6YAHTOPAg4onHdjgGYtSl/n6rBp809LT3Ocview9EDp4H0tb0Ai0noR EAFg== X-Forwarded-Encrypted: i=1; AJvYcCUNefHwevZcoXPQGNkmt0YiuywMPdgv8rCENBGjS9yg4sKWsGLgbakW2JQbJZseCq2PX4RdDioiAlKuaik=@vger.kernel.org X-Gm-Message-State: AOJu0Yzth58OPGuYHk47hG9mod9I4tvVTTa6tqpoaJeG8RZgzvbbnQMR uakaFV7dU6MEm0gEajcuCFjeUBu9vpj75YpTcjgew3WrdPAZhhfR9M3iAd0/kcpyJ+ejkxtGlJ1 kKyO3fJ5vHgTxXVWxY+EmTd6LZegVG8wErfgpgT1NMkqE0s5vMYBK7gUm8NFTOUc4Ps0= X-Gm-Gg: ASbGncvl3cTtgRO4mdHNC8LcfRefLKpODhxfctFdY+JwZdOElgix2gfhilmaZMa4e0h nhj/105EjfILBHCvvfd8mYL9xtBnsUFJhTaWNEAhZLETe8h2yQKKnfPpTgk5ntaGs1r4BCqOxYM mny6mOJDunu/dAdXAEVUMEjOEZgae8EIvFdmi8iVk+y7rEo3Jh/WOTTsM5xPenzDY2/c76i/wxt /KpDWhn8ljpVFgRNPNkJqb9feVzMzMnNrQ27HQywRrWQ6RhFNj8mXKVpVP8dcQ8weGL2LMclDYa v1I8EffoitqMxHH4uDvWHLUuOqUlG88GzSTroGGVP7gYgaEoumXd9CVRnfI= X-Received: by 2002:a17:903:40ce:b0:234:bef7:e227 with SMTP id d9443c01a7336-23de480b01emr22477325ad.18.1752139055198; Thu, 10 Jul 2025 02:17:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOJVHab5T9iz/Q1OPBfJ6QDcI7he8gMDHrdEtDIQENvV9ux+bR1aR59bdZF7+Pu5JDOhCy3g== X-Received: by 2002:a17:903:40ce:b0:234:bef7:e227 with SMTP id d9443c01a7336-23de480b01emr22476875ad.18.1752139054755; Thu, 10 Jul 2025 02:17:34 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23de4341d51sm14837765ad.189.2025.07.10.02.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 02:17:34 -0700 (PDT) From: Shivendra Pratap Date: Thu, 10 Jul 2025 14:45:48 +0530 Subject: [PATCH v10 06/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: <20250710-arm-psci-system_reset2-vendor-reboots-v10-6-b2d3b882be85@oss.qualcomm.com> References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@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 , Olof Johansson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Elliot Berman Cc: Stephen Boyd , 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, Andre Draszik , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Wei Xu , linux-rockchip@lists.infradead.org, Baolin Wang , Sen Chu , Sean Wang , Macpaul Lin , AngeloGioacchino Del Regno , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Ferre , Alexandre Belloni , 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=1752138982; l=1684; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=C/j1pRyxrqegE9+HlfozjQfjDAmabEKYItoLHtiCbfY=; b=oe8WmAtH5g0NNJLno0zytsw/dFU5witrI2BFN5XbefWtdYq5E2r0zaV+zXXXQr+UPw9ahC1h0 tBeRlLEJRy9AsD9sm0fL0JabkRyYC2H18E+hF15CP1nzH43tmkUZ5Im X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=GdQXnRXL c=1 sm=1 tr=0 ts=686f8531 cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=rzkh05IFTCqOtWkwyAIA:9 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: c67dA2BrttkMsVHeHaBTNoaCEC6-GqUW X-Proofpoint-ORIG-GUID: c67dA2BrttkMsVHeHaBTNoaCEC6-GqUW X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzEwMDA3OSBTYWx0ZWRfX09mgdUGZgRyf acMIYyeN9+gpiDnSe3ARTnhhP0sd5GQeDBExznQptHTnysdcbh6PSgQzMS0WzlgS+ChF94pJ4Fc dNo9pNu9PAk3z14zeOUDrwwqUCWPEi7ZcJ2tE/LPi+39ZInreYxM+uuPO4YZmopby8m2gZ7coHt 4Y3Z9YImshkHKrf/R9XWVUpbLCOM7txX0VpBz/g+dfwo0mRv0D+YN19J6TUB73nzF+1LEt2jJR2 KqIZZUKg9kbywSwUBB9Htax//dTs0r/qHi1LawMDZ4aIh15LLsQNR2CCklV06CHflCdOhPDYkvp gXMHDo75KTjVCBbuZVqFYMJZZDPbKXPzAF0zCUoXrQHI6oyG7eafwG2KWX+JtACLIfa2vp5o6e+ NY3f2zaYIOuOOi2YoBzyhmYsMz5hj1bjQS9WJ4IFc2pJCjNWLZnG7iBC4SQmRuUMR4AX9UDi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-10_01,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1011 spamscore=0 suspectscore=0 mlxlogscore=863 priorityscore=1501 impostorscore=0 malwarescore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507100079 From: Elliot Berman qcm6490-idp firmware supports vendor-defined SYSTEM_RESET2 types. Describe the reset types: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Co-developed-by: Shivendra Pratap Signed-off-by: Shivendra Pratap Reviewed-by: Konrad Dybcio Signed-off-by: Elliot Berman --- arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 7 +++++++ arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts b/arch/arm64/boot/dts= /qcom/qcm6490-idp.dts index 7a155ef6492e176390faa3f2dbe419f5cfa62f0d..6de4b140ed10b0da72f3bffae52= 4f65406d8f571 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 { + reset-types { + mode-bootloader =3D <0x10001 0x2>; + mode-edl =3D <0 0x1>; + }; +}; + &qupv3_id_0 { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qco= m/sc7280.dtsi index 64a2abd3010018e94eb50c534a509d6b4cf2473b..e6a99ef50b9b9ade9d2a71a14fc= de429f8076dd5 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -857,7 +857,7 @@ pmu-a78 { interrupts =3D ; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 --=20 2.34.1 From nobody Tue Oct 7 13:49:02 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 1E4D8290D98 for ; Thu, 10 Jul 2025 09:17:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139069; cv=none; b=jSaGZTnsbvFgLxRWH6f9DewnO8L4ikQZvULUN/na1LzJjJAdzNWLVYtPi8EFiYhSa0vf7xw43bCSo7KqOgotl+AQOyusIfNkZl4MbgCYSG1W1TDYEYUhyZPIm+2JWsKs9RJZl+dn85RQ3jdyWVtUK0Xi+Ll7u5xQujFagYmbd/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139069; c=relaxed/simple; bh=BcXSb8+CR0HgJL8ZGlO3s8zt5KfV3AVBmUeP6D5jawo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qZ1fudFBoFI05D5Pk4XKo/yShvUpeVexa/UEX3DXlsgYGGJ5gdqIXL1pyJjwBiwZ9SANp6AdFQnmZYNi76wdfIpNBLeyVlrZBDF+WRGpUnth4oBzcSO5xpBxWy78AixQCNGe3bx0h5OIV+zt+k/9H9TULbFbkUgvLdho5HUolLw= 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=T2leWwQn; 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="T2leWwQn" 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 56A1NwAO011520 for ; Thu, 10 Jul 2025 09:17: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= LHGeVOx0U2s9qP0ikhLwIs2P+IuUNoY0lfi0EgG0DtY=; b=T2leWwQnvLvOkFT5 FqxaS8UlSjT2B3VyMJW/m80MFFazSucqvPBpJnIE0FykN9J0Jrnn0TBJjigP3BFp HC5rSlMxaCCXV6ZY8ZVsx2Urc4vVFfdjEmW+OiaYUeRYXredSnDRdup+9khzzpxk Y4ZoRaX8ySim5buzzTB5VFaujIvS3dBRpSSReF0L3SahKEkiyGO3vRBSfzieGYtv EKKUQszXEPp+NWhoiCHdFb5cw9Jrn2WFcCYkOeug/I7wyK32bMS4J026Yl3ZbmLo 4gtNC5Ddh9jurzukUaEA3mUSYVGUzXqUi9P4m3rUqXQDK215N6e/BtyeWqJllsVF D34PwQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47smafmas4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 10 Jul 2025 09:17:47 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-23632fd6248so8563385ad.3 for ; Thu, 10 Jul 2025 02:17:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752139066; x=1752743866; 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=LHGeVOx0U2s9qP0ikhLwIs2P+IuUNoY0lfi0EgG0DtY=; b=ti1MVbeb2FcJ2NwpJ+emFs9M5doK9Ef8qKkGM21REst/4WrP0lsmtzriMv20nhUCWQ Cx6XZEMkTfFp+x7YDXgSChfaknw8aqp5zIXyyP31Jmgz83CTaFpdiJqhCkZQU7vGHF2A 1xajTnneCRY5b31D5fhhed4c6sAmVaI9FbQi704ObbNW0ZeiaJjYbAyOtvvxT532Ugrx upUSZEz8LY31wLNVMSAcP4EuCQ38J9ZGAHlUuc4ANqfTuakp0kyxh3qByMi7fRbqWj/T Et8GRbG7l9swbOVTLyes/+JM79LAo/T5rQ0ec9lVPjmiJZb6X7VCFXXbjkr83zW2Acnn 9dzA== X-Forwarded-Encrypted: i=1; AJvYcCW8hJPF+v3E1rggo2nUI/SxlZaLm6ZEEuv4GcTp/4YARXoBIwAdH02a2y0Lda5Ant/XIAh7A0OAOxRp1f0=@vger.kernel.org X-Gm-Message-State: AOJu0YwR2pfgkZc/xKrbEI1yyXW/8ByRIZSP2ZXiZVecsH1+n8Ym5jpR zUPxHF2sdGxnRFsgZFc9T7rRw0X7fcgPBqM6yVBSEZKE6y5YMrrVRPoHM5vs2n0YfDrC/TiiBVd SGEFsAwkGbBZSDzfyTPUUxjs/FBsuUSJEts9Q4jSYg7zb7FDqEmBdtpPnhbF4PvZGufo= X-Gm-Gg: ASbGncsnRdgs7CBVI4hYolog82kfnkE63CGNyMAzgZv6iz+IY6IRJuqcFtFcwCVgCwi aCcKDfMQJ75gjPmLWGYsQGEg1pEuMwsvxey/GcC6Qk174xUXHEzspdQKpC4VEyFjlhRbakmu9fR htX5xhrD+bWPhKMbiAMgSQ7vRxjdkMcqQp5eAMpozkpCBfk60WpPWEYDktayJ5yPxX80mfNR0ON DaY5z3cyMrwbHx7nH3u2eU1/JNxuTyCT1VBX4T+GLxywQDcfiZbaF9PYZXGsasenghLdBrjI6h9 onMTpU2vQlES5VC2cMdRw+pxVLsjdaS5mY2Z9VeOg473/yXGunXaxpdxNKw= X-Received: by 2002:a17:902:8f85:b0:23d:dd04:28e2 with SMTP id d9443c01a7336-23de24f375emr43328075ad.35.1752139065781; Thu, 10 Jul 2025 02:17:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRrq1v9TOcKehLshyNd7Q9DOKQg1TlB7iqx+awqZ/WY5auAdU7wXya8kio0FJy8iSW3PY2Pw== X-Received: by 2002:a17:902:8f85:b0:23d:dd04:28e2 with SMTP id d9443c01a7336-23de24f375emr43327605ad.35.1752139065322; Thu, 10 Jul 2025 02:17:45 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23de4341d51sm14837765ad.189.2025.07.10.02.17.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 02:17:44 -0700 (PDT) From: Shivendra Pratap Date: Thu, 10 Jul 2025 14:45:49 +0530 Subject: [PATCH v10 07/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: <20250710-arm-psci-system_reset2-vendor-reboots-v10-7-b2d3b882be85@oss.qualcomm.com> References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@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 , Olof Johansson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Elliot Berman Cc: Stephen Boyd , 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, Andre Draszik , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Wei Xu , linux-rockchip@lists.infradead.org, Baolin Wang , Sen Chu , Sean Wang , Macpaul Lin , AngeloGioacchino Del Regno , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Ferre , Alexandre Belloni , 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=1752138982; l=1169; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=hDcOEnYaWsyU0iqVg0jGaDC9VsmHgvyimm+9MopdURY=; b=LLxxdiwC89+T3X5nLirDzCvhuvPRD/c3MNOaVzUQd4mRVGpcSzTIh7ADcfoFeLkJX+zkArk/k 5kif1NoHvivCPiFySaWIVEsxNKuvF2Bu4vUXGv4gtaXwnEgWXYmX131 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=ZJ/XmW7b c=1 sm=1 tr=0 ts=686f853b cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=mlMSzhu8tE62a9u_TvcA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: Nn1lbRhs14nURKbIGhDB54s2ACAv9naU X-Proofpoint-GUID: Nn1lbRhs14nURKbIGhDB54s2ACAv9naU X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzEwMDA3OSBTYWx0ZWRfXxTKYsvqdsX7x W6d53bddqfHWnPvPAZ5KyJ4K9bm9vUWK9Q2msLW8ADZRmG52D2hd3rKQ+AsbL+Xm+d/45E4ihFz 3L7r/kbNOzoRFTcMyuuZkChPbD0U3uvGgIJyKwamyqmS2BAuPrtS1Qj1heUKuc37yc071EvuUf/ T/bsLn2gVIK+5ZZncNEXeUCGpTI80wiDUi4FN37NeVeCT/TNYikgvKUwE++OrB2s2rFAYcZvBOv YMVXAoAF7ijrSZUG/6csPowTf3u8dn90hjdqPZi+ly1vb8xC2YYwi7yokUr8jaWSIgjjYRbmSHW mZiTxiPNw4pl/pC2w3KDw1fr/+plht77zVJWoOzR0S7uBWzivOKw1o/89EWjOYtbJ9brs1yPG6M XGc3bUkkjvbMrRi+yXMbrJS+21Y+e40CLyT6a0vmorVYU4oAzsFcvr90IE5QoTxLI9TKjOwQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-10_01,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=963 impostorscore=0 spamscore=0 adultscore=0 clxscore=1011 bulkscore=0 phishscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507100079 From: Elliot Berman qcs6490-rb3gen2 firmware supports vendor-defined SYSTEM_RESET2 types. Describe the reset types: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Reviewed-by: Konrad Dybcio Signed-off-by: Elliot Berman Signed-off-by: Shivendra Pratap --- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot= /dts/qcom/qcs6490-rb3gen2.dts index 5fbcd48f2e2d839835fa464a8d5682f00557f82e..7c06fe496e800e758d59ca79378= 5d7c2907df8dd 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 { + reset-types { + 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 Tue Oct 7 13:49:02 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 62B0329A313 for ; Thu, 10 Jul 2025 09:17:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139080; cv=none; b=qsrJ8685Volg/aDzMYYqQZbrKoeP23BN7rjdQB8xyDxxGAZu/YJnRNq/mBkfAPKjnHGQ2he7uirqImTlW//SEl/dd3aDUWgf4ZYCcJtxRUjs1+Q3od813mohwbg2WKVGYsCKj0Fed4G1gzXCjvffrJLgnRk2IjcOR+m8hi2oTAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139080; c=relaxed/simple; bh=SPFjUorJ1LNNt6IjkgTIiv1ZSNVUKKr2QMBxhxlfSyI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SEueTm9Sc1iCc2P4mspKCWVkEiBQg7AwKiKRlqRSBt8AZaKWagC8Ij6GXlIahOtBbUpddtm2AvCWAtAa4f/nujdDx9jzShi8WnwbI0EYCwg3LeXOVA0QzW1lX5IVx1VdBdCdoLumw39Q0PtW1zYsQcRQItsdAIeYE6VUquMDGJw= 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=dmIfAR97; 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="dmIfAR97" 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 56A9Fq7c030103 for ; Thu, 10 Jul 2025 09:17:57 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= 8ty1qg4MgFp/1KipjRpIWVF3P1K5EDIoLCixxlG+pA4=; b=dmIfAR97TkwUQ7Lx RnPSqBd6MFiaq/ha9POQEwKOOxDLFMXwItwBfB7t+S8E+OcVlnLQQcYZtKe0ReYA OF9pKO366O8724350FYgb4Kwacsi5oJVnpdxufv/kGOeJrQ0mQr74g+8Bm3AaMDb DwiWWhHUmMys1IfijrkU/TBXVYpziQl1l3xZj9lfbp9jxbAyP8F1qak3bAR6A8he KCkhN/ILC08Rrng235FTL4y0eSAnGWwX49oDBo9y6mPKd8vEXGjodyjzk9RLk0st t8P5q33CrixLGGswukojELhulegDKWVgY2P35xajEekZ2nwErH/5Z9g/SdOFFcXi k6S9nA== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47smcg4b5c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 10 Jul 2025 09:17:57 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2356ce66d7cso13845625ad.1 for ; Thu, 10 Jul 2025 02:17:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752139076; x=1752743876; 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=8ty1qg4MgFp/1KipjRpIWVF3P1K5EDIoLCixxlG+pA4=; b=sZuymZJYasmPFJ3xS6UIzQl7bYYQljSDHc7Uryyify2sqFnJZfBHTXCf96fnRLiVmp YYfoN012uJl5rm0ItMMcaCi/GCI351bO420JplfzKKMuCO806ZCdoRsNMPS2xUg2qY0v N1fm7jyGz+EP7m41tYbTsEFtkbHqPMCHYWf2CmidHmCtzbkZGVvI2djRlKyjyG/a9oez rcardWoRH7sjzDoqAYhUPnwvw0LKGQCmRAgS7ODDK8fGDV3bsfOfqO6zhHedvdtmX1kQ CP84gWOuR5JZzwFg+UfpYMiSmnSySU9PELc/bTPt+X92Rg4ap/z+QclbpCx/IsXL2yLb rfEQ== X-Forwarded-Encrypted: i=1; AJvYcCWIEtG3aAlYFeFflwUBAgoc7Y3GBw81X6xRTxqdWmk3gc6AgwwFVBtKQxsv4i+dE/1B6ELopjB7WHO3Dbk=@vger.kernel.org X-Gm-Message-State: AOJu0Ywn2qvsdMqMe7g7Njap8KlzY0/gem9pBDHxiXbNfmvNWWdgfaWE tkL5gjP0CEH+aEmJSUzgM4AJlLYiEXWrad6KN/TafSkt4jkdHoJWXM7yKGHCnXHcJ/xsk/Yynu0 +QLCQPZ7VFNcqVrHr4swGEWbkmlRVQ02iH3b7vTofsE60LlJZtoBVRlNtHzhxCyOYtac= X-Gm-Gg: ASbGncs5sJguiNuKjK/ZDJQU3dgshqmEGKWNAGOA+aidW5QheyYytd7uwyqmbYcrQD8 6aWoqWijy+h+s/9baTaQLaHkimBwEIb83BVqjwtqv8uE0JebY09aNkh0s/IxeE6aJx2hPlHrMUZ SknLcli8M0MxT0a2M/V3Nfrs/skbF9u2pWJmRNhnXUgPCTAh9pHMTxcCBlpdoxo/3OO3Pjno908 8My84IXGc4Beu6DiPp1bcOJr9QKpxg6esG4GLnigRx/W07vozDMaVtOne4wH3vT04xsE0G9gwv1 hhttpsmpIK2Nw7OYanS89F8FZ8NwqKWhGwkxonbC3ppBzzPm5SE2wu9MYA0= X-Received: by 2002:a17:902:cf10:b0:235:1706:1fe7 with SMTP id d9443c01a7336-23de47c3198mr27936155ad.4.1752139076514; Thu, 10 Jul 2025 02:17:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZ5DuAv4hQzhi6yKoAY4RR5pKmk35nKETW7dTCDtaIHn7ZT+nH76uc5gC9jWo86sxbpSIxlw== X-Received: by 2002:a17:902:cf10:b0:235:1706:1fe7 with SMTP id d9443c01a7336-23de47c3198mr27935715ad.4.1752139076096; Thu, 10 Jul 2025 02:17:56 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23de4341d51sm14837765ad.189.2025.07.10.02.17.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 02:17:55 -0700 (PDT) From: Shivendra Pratap Date: Thu, 10 Jul 2025 14:45:50 +0530 Subject: [PATCH v10 08/10] arm64: dts: qcom: sa8775p-ride: Add PSCI SYSTEM_RESET2 types Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250710-arm-psci-system_reset2-vendor-reboots-v10-8-b2d3b882be85@oss.qualcomm.com> References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@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 , Olof Johansson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Elliot Berman Cc: Stephen Boyd , 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, Andre Draszik , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Wei Xu , linux-rockchip@lists.infradead.org, Baolin Wang , Sen Chu , Sean Wang , Macpaul Lin , AngeloGioacchino Del Regno , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Ferre , Alexandre Belloni , 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=1752138982; l=1717; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=wgknhYAt4nROUs/wPHMPDduf8A/Qll4soAM+xxnL6qQ=; b=3xptDSMJeo3n/kz2bsmlg89oPR2D+s7/G71KUw980yLr9mXAK6CEeli4EB/FEKrVloHBfPGNw SkdWoG5CPJdB2Plv4VSr76tB6ulp/v0kXwZhRefVTk3eBv1h3UuMEBA X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=P7o6hjAu c=1 sm=1 tr=0 ts=686f8545 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=agHhT1tg99JF3qhwDn8A:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: MyOSi9DuT1oyyGyoG67DIogXyROm752p X-Proofpoint-GUID: MyOSi9DuT1oyyGyoG67DIogXyROm752p X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzEwMDA3OSBTYWx0ZWRfXw7kYKkvq6gjP DszhzMZmLxV229k87ljsP9htGWFujX9SBr1lu++DZUvSMa7yXQVni5AHEydR+M36t5SkcfhQ1q5 0wA9hoFcxaAFWXxBsg1ZCgsmibJSdBaY0B1yhbkrrDNIc4bVrdWss++YysCZefFmmN3WCfNJtYi 876YmPQyXRtWnGo+UO+DS++bqbufcgr8O28wYFbCD/fXZjgGXgGn7LpShq9DvV7QVp0bevtrrdR 94/ASdV+gUQALBMOfaWT9DNLHSmdEiiqRFUWVNcmot6aJ7BCgZDAywcOOoEKeY8OTzgQGdYL012 9jJcVnYDQlmO12shEwJjmTWmOfU5Kf6xUE2fEm9wAnkfwGc3fnNhMIREVjUOte+3G+vdRW7Kg6T ghRV18OUG+VwvYJQx82LzB1iw8iyfAV9drMDR5+9iL2Dc65aMC8CUF77dY/Ods9c+HUe7iI/ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-10_01,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1011 adultscore=0 mlxlogscore=943 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507100079 From: Elliot Berman sa8775p-ride firmware supports vendor-defined SYSTEM_RESET2 types. Describe the reset types: "bootloader" will cause device to reboot and stop in the bootloader's fastboot mode. "edl" will cause device to reboot into "emergency download mode", which permits loading images via the Firehose protocol. Co-developed-by: Shivendra Pratap Signed-off-by: Shivendra Pratap Reviewed-by: Konrad Dybcio Signed-off-by: Elliot Berman --- arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi | 7 +++++++ arch/arm64/boot/dts/qcom/sa8775p.dtsi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi b/arch/arm64/boot/d= ts/qcom/sa8775p-ride.dtsi index 63b3031cfcc15fe2cce58c0fb7502b19f058b80c..44840c37c2f102e7939f64c8eaa= f8a872ba5a140 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi +++ b/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi @@ -874,6 +874,13 @@ &pmm8654au_3_gpios { "GNSS_BOOT_MODE"; }; =20 +&psci { + reset-types { + mode-bootloader =3D <0x10001 0x2>; + mode-edl =3D <0 0x1>; + }; +}; + &qupv3_id_1 { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qc= om/sa8775p.dtsi index fed34717460f060e6a9dfdd4e29ca4025c401b83..b1f151aff478dc268e3405ef5bd= d85e67bc25cf4 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi +++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi @@ -622,7 +622,7 @@ pmu { interrupts =3D ; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 --=20 2.34.1 From nobody Tue Oct 7 13:49:02 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 16F25294A04 for ; Thu, 10 Jul 2025 09:18:09 +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=1752139090; cv=none; b=SiUu+rL30UHG4rD7k+kTVhQMk8wdrhEvEA+hhJpWg++JRp72qlyXCLWiZHUzMs6hs4vzqCpy+im5XYkztIurubA9Jos5ivkOQO88lr5T6nK9/oWHpOEjHZhYtKbKUBM7naMSopKqHXXC72gkLVSkWY95Y2bB/dE5SmB2ZftPcGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139090; c=relaxed/simple; bh=sNPObCAn0hHlmeXuawxrFyQE6vuwG7PdJUJ999/BvyI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A0G3Ojx7V3fFaP6bV93p/l44P9JCzWq29xU0TbGYEpow2IMjVdG2+2GIoxhaxuAVaHwnMpHxkmC9FaNknpfd653dmayUlfA6veOhC5xnYmAcEkNN12lqDOr+IL8oT5Gj9BLp5G4laQC3UphriAT1FCaFgDuP1hII2ZFiTGtMj1k= 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=BuFpUYcf; 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="BuFpUYcf" 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 56A9FNT7011560 for ; Thu, 10 Jul 2025 09:18:08 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= vBKj3/crUvYp4Ips85Vws+1r2KlgFDtGQkXcgWnVP/g=; b=BuFpUYcfun8Vz84J pQVzInUwJbie1KwsmBsVwgfqtoydkX3bU4J6CPTHbCijc/jrxpUUsklvC45H7zoo resLbWnzGbGbhwXIBUDRRSK3+E7fQ8ZzMGyj6riDtHsXvrdnIUQAYkAiR9Hg8+kH 94jMFaC+g3gd8x18/Uo2tc+U+xEniso/2x70Ho6yErR2Tf/a9MGoxpcVPvdgrjqS N5tZUkkt/2drZR9/ffl6PkDZg61/lsxcbNpUjMeNXF5kd3695KT+eNqfHod9y0WL rBGymV1q4fqaccvOQe/1n2B8W2lQ+bDLZdgazSQYDsq+vsZ8H4ReDjMMfgn2lFJP a+TTfA== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47smafmatv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 10 Jul 2025 09:18:08 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-235e1d70d67so8816335ad.0 for ; Thu, 10 Jul 2025 02:18:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752139087; x=1752743887; 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=vBKj3/crUvYp4Ips85Vws+1r2KlgFDtGQkXcgWnVP/g=; b=hcBlOKvHMMH2niZTKpFuImxS+d7+3Rv0qje06ILSS+owheT6r6MpA5m6a/aH5hhc6H f7L+IfxbTMBSHOaWT58qZ3XKN6aq0RUmojyndaUqrN5MO/16n6xoEhtXjw1mOH5NCbnn ZN7yMhfP3TKLKVicOu+N1p4e1ZjVkqlfryJI0bhMeIH923BWEBu+2iFkBs2ByOqQBbL0 HluZbQ9x4HeP9sG7H+aufocpWOhggfUmF+cBREVSY4rmMdQgRdxytLtC6W9j2M418ojF GXSlg2xlmJO7ZKLm7xN+l+SO8fVwo+p90MTJWpUfuizyF8FtbIklyXnAh4yPURoqtext e4Sw== X-Forwarded-Encrypted: i=1; AJvYcCXGCpQ32XlAXelZcCg1f9x9IDW0mSVoOWTfbW7fGiNhOBTl0gPwkDykw4BSNzdghza39/NdS1yES6ydg7o=@vger.kernel.org X-Gm-Message-State: AOJu0YwM61qK9Bm/Bs0GT+2ou8pgUhZByy6SSh03zZMjKAzgDaahkV7O hoO69m4e3/8eQsgiLC3sX23oYrFUFeg3RU414zeqMxyP2BwlwS9yqiLfGfBi1gNuLRSpnn696Aw BBstkE7qQCK37Da9Qm9LnqL4B+wn/UncA4AmHhAgRaqiInpG6+TqDQaYrv1Bx1RsFgYE= X-Gm-Gg: ASbGncs+hHcuYBo5LLzjTWTnp5V0ieIuM+KUw5jUouprwN5cATnpbQFSQLngQNaeSw1 s8QDCnrqXTnAfkrQRFfHzhW0zJgKo1ayXGpyfrBK1ERO9pwhUR5BqK7xmoENJjMg6kCQl0/xpmV Qh6QCXZW9wj1niUr84V/RArQCsoSjXPQ2GQRMnOnvGuv5wbG7IQlH86+rbtR1NwOX/rb749kDed AtOuU57E67pQQEJE0829dMC8x2YX3Pdk/4CqyF6aR3Q3JtAoOKQuqIyw0FL+Hadr32F2MSN8rlz HT6KzHY68DP8AhsvVx3s7cZp7pjzDpSskgb7X8p+niui8lzLdWzdxM8IhBY= X-Received: by 2002:a17:903:1103:b0:236:9d66:ff24 with SMTP id d9443c01a7336-23de480adf5mr26726185ad.8.1752139086649; Thu, 10 Jul 2025 02:18:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3++zCHPG72HaamcNpmeO+Bll209rYHNgNyYOmL53l1Ne2aXD9CjDh3cQHGGPnX41YVpDvag== X-Received: by 2002:a17:903:1103:b0:236:9d66:ff24 with SMTP id d9443c01a7336-23de480adf5mr26725325ad.8.1752139086179; Thu, 10 Jul 2025 02:18:06 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23de4341d51sm14837765ad.189.2025.07.10.02.17.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 02:18:05 -0700 (PDT) From: Shivendra Pratap Date: Thu, 10 Jul 2025 14:45:51 +0530 Subject: [PATCH v10 09/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: <20250710-arm-psci-system_reset2-vendor-reboots-v10-9-b2d3b882be85@oss.qualcomm.com> References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@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 , Olof Johansson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Elliot Berman Cc: Stephen Boyd , 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, Andre Draszik , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Wei Xu , linux-rockchip@lists.infradead.org, Baolin Wang , Sen Chu , Sean Wang , Macpaul Lin , AngeloGioacchino Del Regno , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Ferre , Alexandre Belloni , Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1752138982; l=2284; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=sNPObCAn0hHlmeXuawxrFyQE6vuwG7PdJUJ999/BvyI=; b=2a7c4y1EVymbu2XIDK/bSBzOWXavwNhKH+7Kgou3PJREQpHdjfWF5P3WklEYYjhjkesTJleCj E7fEUYVuTpACaFQwTlNOMKw/oaee09IuFwlJ2c2sTZy2gFGks/QjdBN X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=ZJ/XmW7b c=1 sm=1 tr=0 ts=686f8550 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=5CgfHzhl2afHKY-Ush4A:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: 9oV-9QsAj6bW4qvEuhVMuKjEalscZtpz X-Proofpoint-GUID: 9oV-9QsAj6bW4qvEuhVMuKjEalscZtpz X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzEwMDA3OSBTYWx0ZWRfX/OFlqkSrHgIt geo2cZMqZmzGWMNn7G9Ve20bQXWYMITlFBoDBi0pWOkpZHK+uxuHDktSAtShhkcbnJQVtrShg29 QRyEAm7cfG4G9Kh/SDDjd8Zk7ydBz0w5MYXnvGHyhE5WW4Jny7++8K7oM547+1zQcTgcjyhWySZ NN7Sa1dZweo7ifw//2oY17TapUpxHK9s4PsWs22ozgvDYR9xCI2JLg9GeAFhVJvzRiTsZUWrwiq lwvxfasjmAJToIvH4Onrz4HPcdlAAmi+7l926IkuB56yke4P68DQTkcVX66WFumIlDOS5gobRsc OUhXmqwks+S7NGytXiIMgXuFmEFi7xS55D5H+W4pBguseNNtoypZ8b99PZUcssOPDMCTyRAeS1X 5zTn3JJ4+RZ0IXoKJIkGcWvuzbtBLc/2awkfVOBAx0vXcikUFg6gutGe0RSwNaAmda1tMGh9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-10_01,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 impostorscore=0 spamscore=0 adultscore=0 clxscore=1015 bulkscore=0 phishscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507100079 Add ABI documentation for /sys/class/reboot-mode/*/reboot_modes, a read-only sysfs attribute exposing the list of supported reboot-mode arguments. This file is created by reboot-mode framework and provides a user-readable interface to query available reboot-mode arguments. Signed-off-by: Shivendra Pratap --- .../testing/sysfs-class-reboot-mode-reboot_modes | 39 ++++++++++++++++++= ++++ 1 file changed, 39 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes= b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes new file mode 100644 index 0000000000000000000000000000000000000000..bf49e6c1dee6f48d791987a50c3= d0b349e6714bc --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes @@ -0,0 +1,39 @@ +What: /sys/class/reboot-mode//reboot_modes +Date: July 2025 +KernelVersion: 6.16 +Contact: linux-pm@vger.kernel.org + Description: + This interface exposes the reboot-mode arguments + registered with the reboot-mode framework. It is + a read-only interface and provides a comma + separated list of reboot-mode arguments supported + on the current platform. + Example: + normal,recovery,fastboot,bootloader + + The exact sysfs path may vary depending on the + driver that registers the arguments. + Example: + /sys/class/reboot-mode/reboot-mode/reboot_modes + /sys/class/reboot-mode/pon/reboot_modes + /sys/class/reboot-mode/reset-types/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 Tue Oct 7 13:49:02 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 4D4E0295511 for ; Thu, 10 Jul 2025 09:18: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=1752139100; cv=none; b=L8z4OXXFWERSM/jWNV35b8jzFXGllZzCAK+0aCJZuA1N+OroJhStpOcFWPk3KMckqAOe1cR1Xyq8+UtWtSbjBddWCwAFiRNCR+eIUGHYsBNPQy4bfNoEvT9I9736Y6Dh4g5U+32u8ANSedDZEvGsiyZ3p5wkMywozFUgQVaeh28= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139100; c=relaxed/simple; bh=Gh0wKF8f8obJZBIFY+YXRq0mvEFaXxY4KjC0e6ESP0U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PrheH7tvuS1pTOC7DIZOgwjq7/N9yQdf8bQryAs5BYf3VDPQt9zGUsTdOIh9BVX5Jwmh//aF3e4xHO5R0LhmXsE98ryau1MorQUZ7zlZKG9BfGSbXMbyip1qQzQINCpDSCLZy6dhDEDo3bkjwwPXOXi3b/FITvJiLiwfeKvOOFw= 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=WhW8TMTQ; 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="WhW8TMTQ" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56A8q2mD016847 for ; Thu, 10 Jul 2025 09:18: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= KEQrgZfA5rhK7t8SJQh+Tq/CWC0djSnOhUUgfmLwz64=; b=WhW8TMTQz9Or+5Ut JV77FzjSJBAAEaojl+gFV7Zt/eGLI01ypAewarNdVghtsxF2oIGT3R2uBsC4Fifz sZXNEm7OopBVSXerUVYv7zTOkEXYpRO0bqiv5AukWGyOSFdNGBm/QrajE5LLYJKM dtKH00yzERyxM/vIxhFGx7QNoKPRFkRIXXVg4r5cLhNAXPMYx9UIxBKwr5x9SS4x axJWAO4HzKZ833OVJ8Vt0OP68tWBjTFuYcg2lr4jT+qoxOOSEe/ILATnfYIsFtvW uW0iOGtC3IUBiKhfuHzJBf33uzKm1hkJg3B9OANZv2zVPByDU9gF0N7j2D60IdR0 2lv4wQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47smap4ctr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 10 Jul 2025 09:18:18 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-23dc7d3e708so4989805ad.3 for ; Thu, 10 Jul 2025 02:18:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752139097; x=1752743897; 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=KEQrgZfA5rhK7t8SJQh+Tq/CWC0djSnOhUUgfmLwz64=; b=shgJxPxm3w3KcolKsaPNBaEivE1ym54drrshHy7C4idaYMvCNaa+1ll/EV2ZHdKwEV Ej8uaR6RzPmmOHAhmghZRfK4xDINYHJEpViHGWsYOmFcl8U21a4YPULWRqFpUzUuACvJ Lcgkh/uQGSkiQOJQfjv8zo0kZuaRJTSX2UVGm6cc+DHlY/TTXrPKbPQnLUYQkjbr/xtQ fuVKzMPZogwBUZAQnC57b4uKWVPWe8oHg4Gx+Kz0KwV3ILwQZSJW//Mhr5iXqAfJv7i7 kaMqG/X/c0XmIEvSiN8cd0dDBNjn0RjyGYlKxt+7Rftu8hlErL5JTAvXHVMsl7SP4yNi xEjA== X-Forwarded-Encrypted: i=1; AJvYcCXHYn2o9YRyK6SEd9Vl3rXvSXNG4fyUL2s+FyG11wWxBHTFzHY2ZHWtk5J4JQNOd6gSODEqp3AWRhwadV0=@vger.kernel.org X-Gm-Message-State: AOJu0YzDsX8Jabba2BFKEiw8Euh7Qwy1+Yst0sr23s7rKOBisroBgCxH B3p3QxuUlNiAKpqNcUzSD5dA7yegoYIOP/KyiyaxLXwmPXSppqoYo11FjTOjZNYQ3886/7u2mbr YRxRPHMQcbaAxJUv8o742X3lhq9d4TAD6p9XAkLd8Q5mHvH8nSFlq06qPdG31Vg+guiA= X-Gm-Gg: ASbGnctC4P6fII+bF4/oy1JohvQPOfaJOv9JRjsadfiXtefa5cDDFKPwNtusxXCmL4T KL8hyMH1Tkz3xKP2rncbDKWnaqdYgXXxAeEPXTMAbTu5XiZAd90AMXFviRRhV4/9vYa+NyhuSZ+ jYn+c/jC/MNf8o/K90mwhIMAjcKg6tP+tzjW0FMm4UbFNU97hqyi7AllCgO3SNm5gjwanpYOOYm g2uoZNOEaRi/orLVPpoS2S5YIlUs+pTtrOathB6XIaOeJ1zu8hEKU3BlGZrE5o3S/Yh8bBGttlp 2v+LQ3XdDaCWGIdpPkCaec2dNUgJGtYUBuA9XMnhfHqV0R+o0qKMe4rMY5Y= X-Received: by 2002:a17:903:1103:b0:236:9d66:ff24 with SMTP id d9443c01a7336-23de480adf5mr26735145ad.8.1752139097010; Thu, 10 Jul 2025 02:18:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGJGyoIrfBA9Zxl0Ughrj3uMKfz6jdSKT0NaAjnNjMskqdtkAKMLUS8x/FzIhDGTyLMPqU7g== X-Received: by 2002:a17:903:1103:b0:236:9d66:ff24 with SMTP id d9443c01a7336-23de480adf5mr26734395ad.8.1752139096442; Thu, 10 Jul 2025 02:18:16 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23de4341d51sm14837765ad.189.2025.07.10.02.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jul 2025 02:18:16 -0700 (PDT) From: Shivendra Pratap Date: Thu, 10 Jul 2025 14:45:52 +0530 Subject: [PATCH v10 10/10] power: reset: reboot-mode: Expose sysfs for registered arguments 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: <20250710-arm-psci-system_reset2-vendor-reboots-v10-10-b2d3b882be85@oss.qualcomm.com> References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@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 , Olof Johansson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Elliot Berman Cc: Stephen Boyd , 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, Andre Draszik , Alim Akhtar , linux-samsung-soc@vger.kernel.org, Wei Xu , linux-rockchip@lists.infradead.org, Baolin Wang , Sen Chu , Sean Wang , Macpaul Lin , AngeloGioacchino Del Regno , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Ferre , Alexandre Belloni , Elliot Berman , Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1752138982; l=5404; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=Gh0wKF8f8obJZBIFY+YXRq0mvEFaXxY4KjC0e6ESP0U=; b=lw/w70/5HLBy4afjvzlsoilkn9KNGxxeob32fKCnRPLyN8EQy03rSeyCWxEC8VvLFF42hMkAU +dipiHJKDdAD9k39uxR5AmQE0RPKWUW9koD6OoeU2qqjpwjX3QrfMdd X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=Ar7u3P9P c=1 sm=1 tr=0 ts=686f855a cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=YvCmAYiu2kffolCFmWcA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: Lm777GWecXA3y0UHvAT3znv-BItpkcxM X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzEwMDA3OCBTYWx0ZWRfX/R6rnISYpH1O UJq2JUq4TxyH/q+B0TOm0lkcYgZ0/jc8Ii1LO7HeiH4D0COkrNzKHtWDNwqnOl+PlvmF4KejwDx kfGqVTusQPmwBVxD7vgGNpfgBloxwagleKU7fVuSwfi5tj0mRa6tsAdXPfdB8IKLF8NX1SZt/kS 0J63rblvrbIr3nByMbW7bXBBrEdIYMLKikT42YyKfh22J74xUXhf95SKsQb8B/oCj3gOlfwNNkZ //kpYNuUchm5grIsNgKSg4V2EXOtJhkbMh4HLVDcAu9OdJwTx9lcbxo2NmBlUPjKWfw7zRF5N64 Pp8PatirHoOLR+OOx/710Anetxd23Ydf0yinK1+LvqhYfRW95X+MU+HrL5XBdqEDhXDMlhtNWVe bZGp+givLmokEJMuPzXQ4B8KfE3mSm+bU88amzQMiKU9uhsmUKhduWBhSyQlP+zboIIVazsp X-Proofpoint-GUID: Lm777GWecXA3y0UHvAT3znv-BItpkcxM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-10_01,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 phishscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507100078 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. Create the device using the node name of the driver that registers with reboot mode driver. This results in the creation of: /sys/class/reboot-mode//reboot_modes This read-only sysfs file will exposes the list of supported reboot modes arguments provided by the driver, enabling userspace to query the list of arguments. Align the clean up path to maintain backward compatibility for existing reboot-mode based drivers. Signed-off-by: Shivendra Pratap --- drivers/power/reset/reboot-mode.c | 95 ++++++++++++++++++++++++++++++++++-= ---- include/linux/reboot-mode.h | 1 + 2 files changed, 84 insertions(+), 12 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index afadd823d62d0f7e7e645746b978cc8fecfb9ac4..128192d49d895beeacb180c1a92= b44a5eddccc78 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -22,6 +22,8 @@ struct mode_info { struct list_head list; }; =20 +static struct class *rb_class; + static struct mode_info *get_reboot_mode_info(struct reboot_mode_driver *r= eboot, const char *cmd) { const char *normal =3D "normal"; @@ -70,6 +72,79 @@ static int reboot_mode_notify(struct notifier_block *thi= s, return NOTIFY_DONE; } =20 +static void release_reboot_mode_device(struct device *dev, void *res); + +static ssize_t reboot_modes_show(struct device *dev, struct device_attribu= te *attr, char *buf) +{ + struct reboot_mode_driver **devres_reboot; + struct reboot_mode_driver *reboot; + struct mode_info *info; + ssize_t size =3D 0; + + devres_reboot =3D devres_find(dev, release_reboot_mode_device, NULL, 0); + reboot =3D *devres_reboot; + list_for_each_entry(info, &reboot->head, list) { + size +=3D sprintf(buf + size, "%s,", info->mode); + } + + 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); + + list_for_each_entry_safe(info, next, &reboot->head, list) { + kfree_const(info->mode); + list_del(&info->list); + kfree(info); + } + + device_remove_file(reboot->dev, &dev_attr_reboot_modes); +} + +static int create_reboot_mode_device(struct reboot_mode_driver *reboot, + const char *dev_name) +{ + struct reboot_mode_driver **dr; + int ret =3D 0; + + if (!rb_class) { + rb_class =3D class_create("reboot-mode"); + if (IS_ERR(rb_class)) + return PTR_ERR(rb_class); + } + + reboot->reboot_dev =3D device_create(rb_class, NULL, 0, NULL, dev_name); + if (IS_ERR(reboot->reboot_dev)) + return PTR_ERR(reboot->reboot_dev); + + ret =3D device_create_file(reboot->reboot_dev, &dev_attr_reboot_modes); + if (ret) + return ret; + + dr =3D devres_alloc(release_reboot_mode_device, sizeof(*dr), GFP_KERNEL); + if (!dr) { + device_remove_file(reboot->reboot_dev, &dev_attr_reboot_modes); + return -ENOMEM; + } + + *dr =3D reboot; + devres_add(reboot->reboot_dev, dr); + + return ret; +} + /** * reboot_mode_register - register a reboot mode driver * @reboot: reboot mode driver @@ -84,6 +159,10 @@ int reboot_mode_register(struct reboot_mode_driver *reb= oot, struct device_node * size_t len =3D strlen(PREFIX); int ret; =20 + ret =3D create_reboot_mode_device(reboot, np->name ? np->name : "reboot-m= ode-dev"); + if (ret) + return ret; + INIT_LIST_HEAD(&reboot->head); =20 for_each_property_of_node(np, prop) { @@ -140,24 +219,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); - - list_for_each_entry_safe(info, next, &reboot->head, list) { - kfree_const(info->mode); - list_del(&info->list); - kfree(info); - } - + device_unregister(reboot->reboot_dev); return 0; } EXPORT_SYMBOL_GPL(reboot_mode_unregister); =20 static void devm_reboot_mode_release(struct device *dev, void *res) { - reboot_mode_unregister(*(struct reboot_mode_driver **)res); + struct reboot_mode_driver *reboot =3D *(struct reboot_mode_driver **)res; + + device_unregister(reboot->reboot_dev); } =20 /** diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h index cfe18cdc2559be249969bba6c022940a508dd188..3aab8700a5961b90b07ed4d722c= 77484213ac6c4 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -4,6 +4,7 @@ =20 struct reboot_mode_driver { struct device *dev; + struct device *reboot_dev; struct list_head head; int (*write)(struct reboot_mode_driver *reboot, unsigned int magic); int (*write_with_cookie)(struct reboot_mode_driver *reboot, --=20 2.34.1