From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FCCC33859A for ; Wed, 22 Jul 2026 09:00:49 +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=1784710853; cv=none; b=eti7I4yt7rS06dcxQu/KfnshNPkDjTZ99noUVvCQk9jC1BCJiNFpy4MB3+NjFDaYoKfnEe8EX9phSx1ltUbC/iMolmbgzwXe1/RcDEKl/DJUeRLFNragncvGi09WCItSdo7xWJ8yVCQHnl40/Piba/tV5PsGTyyOibqTszwPpDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784710853; c=relaxed/simple; bh=5pJuTCP7sU+4IEJexJigKVVU/zFhh7PKLKwPDLEVMz8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NLv398BM1KBSEmxGlOthNCLPvo2dne7TbK97UPPt2jK1iTVXHX8tDqI7Go2XHFSD2zbmltwENfNT5YOjCCI28d3yvv0cb3FoCQQOI6ruU6MuFxgwAmqFsstGAhMXqc57DK61/52byjaJd05EmGGBKHawG0wwFWs3scfxMb/fecI= 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=PrB530u3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XH5ju/tn; 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="PrB530u3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XH5ju/tn" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66M8xdGV123853 for ; Wed, 22 Jul 2026 09:00:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=PqyCT9Iq0DxPGfOdiNjUipdB Gd6ZzRa4dkeRNbbVexo=; b=PrB530u3HOg2VClclqSZ5w6KVDmDc1YlTmje/sb7 HT1OxOsb4mJ57P1AGUAjYaosaquV5lcA65OmQY0iQ0gfpzr0kktBTdFom5rCKXdZ sdy9F9+9nFWy0wAnLzyCYBvd9SHIpNK5FNw/cikpEjnhCWfrlf82dpaY1cYrKkIO VrB7TkHnagDKzZ+cs8VSY18z5DemTh1AD923r28N8bf1AU5I9Hgjctb6QTHqwku2 x2s1XV73b6u+nyePUPgsl2bLzAMlWSSsUAbIL601Gz944uZjujizErXWyJjm5aIH U3xwRds9e7+sx/5kO9d+M9/hERkXxzOqLpc4OOMEqb8vNQ== 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 4fjnu4s8ha-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 22 Jul 2026 09:00:49 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2ccafc5e82cso119515335ad.3 for ; Wed, 22 Jul 2026 02:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784710848; x=1785315648; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=PqyCT9Iq0DxPGfOdiNjUipdBGd6ZzRa4dkeRNbbVexo=; b=XH5ju/tnoxeCfznO3mINuXXlgp5VqI7Flituncg8UHJMf+EkGVxhpmhD0MHoim5EOi CD+Ey2nhPFXk7CnmJu+bUPueEyADGPleRUC4Cb9FFeQgqgkdizM2ia3CMppClgiNlCwy EuLUE3JfEZOQaCZzjPfSm9rhV35mx+/bVsczM3aOT4A+yGTOumOoqOUTRyv2KOWcd4W4 AvyW7gWQSJAcMkcZRm/H8xv4SglnpWVkRjymzpY057w4TUSb7e8in2JSsr8jfOa02KUF GP56fAH9vnCydnLFvn9hII2xYz2PNqJJcbPuhejkuYo7zarkN14kYCuA2iMkUxUaTABI c93w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784710848; x=1785315648; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=PqyCT9Iq0DxPGfOdiNjUipdBGd6ZzRa4dkeRNbbVexo=; b=aXOKUBiypx+3W7pH55P9YhRh6ZBPRLCLTSEvQgzJJxwPX92aj6EAj31tXnEy/gxu2y j/jMkjs3mTTJQI6VLSaPi7FI63iR19mOia/pNyiDfVnyuoGnkgAX3a8KQHq5rnyO/5hu TmI3xrzX2VRBgN1yBhbrIYzvWD2wm9QWBSG9bJqXFTfX30tB3naF5JrfCI3YQQBVGx1J AAXyxs5+dbZ2G4NFPAtTApRNus1XFEuPZn2k8GkoBq8R8GfDNq/RKvT2RANiNYEtkw4F N8qGi76HEVnLfiyVKDpKYxdKjY88MAO07tp4XLKbVW6aL/Go4c4cmrM3TZYyaJOFLPZ1 +79Q== X-Forwarded-Encrypted: i=1; AHgh+RoGI2MmudY3keiGlQy3QpVjLv1cvoKdrexcFk1oXGxya/utTC/mt0k2cDdLNXSFZ5RnXZP6qcvQxe+LpIY=@vger.kernel.org X-Gm-Message-State: AOJu0YzdPb5OjGMqN3MMCdZszFFyzikV0/5HDteDlbXq0FK2boBjih0K S5hjKGijssTJ93M5b8Vus/8QTbp6xJH52bV8rGedx86gv2SWmO5WWYpdXZenGyx558V1d2wZSSu qa/7uEk2C/NmjWbTkbOLcHbfPUogsMT3R+1cnMPi48eJnk/bXgORgYauy65JA3BL7NU3FPXNLMv DfgA== X-Gm-Gg: AR+sD11Cd6j1lVTVsdZ7HQSo22VVUvjC9E3HmfK6+cwfnWZbjKFu/h3BTBcMJjg2RIW elYfoDjuEECf8S5RmeLGLfOlZHK9Qg2Z0AtblUxGE2VSxopZe2fSexcCbP4haYG/0O5hsj7IaWR +y8gR+ld5Ff7t+DvuvPnqbqcevxlyYcqyHiHOBQwUL1I0yfV+1T3YtvvIWnszRj1wCLDdytZq3Z rxxpS5IeY+KsT2tIhGd8uWCoRxQPhjKhUV6ajJOo4I5jWz/XvSwlAFfzq22m3esayd5Ahj1v3F8 OqLtdPKuJs9mLgigUQE6XtLxdwJLc29unr40Av8x0+vzlrrc22hacNQYqmPY6aluAc9yFa2bHQT auPhyp4X+cMRvz7rnwBFkpzNKSd4a/+YD1w== X-Received: by 2002:a17:903:291:b0:2ca:eea:eb5c with SMTP id d9443c01a7336-2cf348acaedmr221823405ad.18.1784710848282; Wed, 22 Jul 2026 02:00:48 -0700 (PDT) X-Received: by 2002:a17:903:291:b0:2ca:eea:eb5c with SMTP id d9443c01a7336-2cf348acaedmr221822565ad.18.1784710847561; Wed, 22 Jul 2026 02:00:47 -0700 (PDT) Received: from hu-pkondeti-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3147dc1b99esm7167019eec.3.2026.07.22.02.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 02:00:47 -0700 (PDT) Date: Wed, 22 Jul 2026 14:30:35 +0530 From: Pavan Kondeti To: Shivendra Pratap Cc: Sebastian Reichel , Mark Rutland , Lorenzo Pieralisi , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Ulf Hansson , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Arnd Bergmann , Souvik Chakravarty , Andy Yan , Matthias Brugger , John Stultz , Moritz Fischer , Bartosz Golaszewski , Sudeep Holla , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , mfd@lists.linux.dev, Srinivas Kandagatla Subject: Re: [PATCH v23 07/13] power: reset: Add psci-reboot-mode driver Message-ID: <7b1dad52-b9d3-44a7-aedb-62911778f3ad@quicinc.com> References: <20260714-arm-psci-system_reset2-vendor-reboots-v23-0-e7453c548c21@oss.qualcomm.com> <20260714-arm-psci-system_reset2-vendor-reboots-v23-7-e7453c548c21@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260714-arm-psci-system_reset2-vendor-reboots-v23-7-e7453c548c21@oss.qualcomm.com> X-Proofpoint-GUID: KoiOHcQARyJk5kRg82PZV4tEalrB9fXY X-Authority-Analysis: v=2.4 cv=KLhqylFo c=1 sm=1 tr=0 ts=6a6086c1 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=jeYV839nRbxY1CX0_0kA:9 a=CjuIK1q_8ugA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIyMDA4NCBTYWx0ZWRfX9Fq1sgBXV0pe +gVi9LBMdH1b6zZEkoRIdO7Xw9CnGt0zAqGVdJbp+Q8i/8S2hlPOxoXnM/x9jwvDmN5zP/oyBFc lrxNjUkEgyKcCScxllYD0qbK8uXG3A3JYtYv1rtp7hkdHXk0gGq34OrYVWzAgdGvemBTn5KbdTZ orSBn0B1unGpAPh8RlNq4gHPftAKcAoJw9QwGYN0gVoyzG9iPwf27HAqzvES6d+FLK9nOWhB97s dmcTOGVS3u+OaoGjkxvWh9JWny22/FAjiXY9JRMcLj5cekdaJygL0PPPHrvpRELqBlVihIz/t0g K/uyu8HCuHDjSAvirLi8u8pkB2DS4CsCDtHOCfdr/L7Re7ggI2t/c82+OIEhx29bftPrDxenPYl a6t6bAw2s/6QDtb6aeUPmNRpW9QpM+qhX/sSbxMA5S850oF24cM0XKVRoZlqcTUl4SrODZn8cQz gAbP8X4pv3/wNxTwz9g== X-Proofpoint-ORIG-GUID: KoiOHcQARyJk5kRg82PZV4tEalrB9fXY X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIyMDA4NCBTYWx0ZWRfX4283YDcrjDhY TVtF/1eH8xItB9QKoY92i7OjurEYGzpQ7EFcb1l7MUtbdvn3OCsgn0W74q/xEub+9hPjimjaZ9B 0BlqiLLS28NoUQSvCIsLu4jTFUuaINg= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-22_03,2026-07-21_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607220084 On Tue, Jul 14, 2026 at 10:46:35PM +0530, Shivendra Pratap wrote: > PSCI supports different types of resets like SYSTEM_RESET, SYSTEM_RESET2 > ARCH WARM reset and SYSTEM_RESET2 vendor-specific resets. Currently > there is no common driver that handles all supported psci resets at one > place. Additionally, there is no common mechanism to issue the supported > psci resets from userspace. > > Add a psci-reboot-mode driver, and define two types of PSCI resets, > predefined-resets and vendor-specific resets. Predefined-resets are > defined by psci driver and vendor-specific resets are defined by SoC > vendors, under the psci:reboot-mode node of SoC device tree. > > Register the driver with the reboot-mode framework to interface these > resets to userspace. When userspace initiates a supported command, pass > the reset arguments to the PSCI driver to enable command-based reset. > > This change allows userspace to issue supported PSCI reset commands > using the standard reboot system calls while enabling SoC vendors to > define their specific resets for PSCI. > > Signed-off-by: Shivendra Pratap > --- > MAINTAINERS | 1 + > drivers/power/reset/Kconfig | 10 +++++ > drivers/power/reset/Makefile | 1 + > drivers/power/reset/psci-reboot-mode.c | 78 ++++++++++++++++++++++++++++++++++ > 4 files changed, 90 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index e1ed6abef62a..4910abafa170 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -21576,6 +21576,7 @@ S: Maintained > F: Documentation/devicetree/bindings/arm/psci.yaml > F: drivers/firmware/psci/ > F: drivers/mfd/psci-mfd.c > +F: drivers/power/reset/psci-reboot-mode.c > F: include/linux/psci.h > F: include/uapi/linux/psci.h > > diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig > index 124afb99febe..93e4029d9506 100644 > --- a/drivers/power/reset/Kconfig > +++ b/drivers/power/reset/Kconfig > @@ -348,6 +348,16 @@ config NVMEM_REBOOT_MODE > then the bootloader can read it and take different > action according to the mode. > > +config PSCI_REBOOT_MODE > + bool "PSCI reboot mode driver" > + depends on OF && (ARM_PSCI_FW || COMPILE_TEST) > + select REBOOT_MODE > + help > + Say y here will enable PSCI reboot mode driver. This gets > + the PSCI reboot mode arguments and passes them to psci > + driver. psci driver uses these arguments for issuing > + device reset into different boot states. > + Since we have added predefined-resets support, why are we forcing this driver to depend on OF? For example, `reboot psci-system-reset2-arch-warm-reset` gives me warm reset on non-DT systems, correct? > config POWER_MLXBF > tristate "Mellanox BlueField power handling driver" > depends on (GPIO_MLXBF2 || GPIO_MLXBF3) && ACPI > diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile > index d7ae97241a83..02948622fe3d 100644 > --- a/drivers/power/reset/Makefile > +++ b/drivers/power/reset/Makefile > @@ -40,5 +40,6 @@ obj-$(CONFIG_REBOOT_MODE) += reboot-mode.o > obj-$(CONFIG_SYSCON_REBOOT_MODE) += syscon-reboot-mode.o > obj-$(CONFIG_POWER_RESET_SC27XX) += sc27xx-poweroff.o > obj-$(CONFIG_NVMEM_REBOOT_MODE) += nvmem-reboot-mode.o > +obj-$(CONFIG_PSCI_REBOOT_MODE) += psci-reboot-mode.o > obj-$(CONFIG_POWER_MLXBF) += pwr-mlxbf.o > obj-$(CONFIG_POWER_RESET_QEMU_VIRT_CTRL) += qemu-virt-ctrl.o > diff --git a/drivers/power/reset/psci-reboot-mode.c b/drivers/power/reset/psci-reboot-mode.c > new file mode 100644 > index 000000000000..955ed68f1402 > --- /dev/null > +++ b/drivers/power/reset/psci-reboot-mode.c > @@ -0,0 +1,78 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +static const struct reboot_mode_entry psci_resets[] = { > + { > + .name = "psci-system-reset", > + .magic = { 0, PSCI_SYSTEM_RESET_COLD_RESET }, > + .count = 2, > + }, > + { > + .name = "psci-system-reset2-arch-warm-reset", > + .magic = { 0, PSCI_SYSTEM_RESET2_ARCH_WARM_RESET }, > + .count = 2, > + }, > +}; > + Thanks, Pavan