From mboxrd@z Thu Jan 1 00:00:00 1970 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 A791C3090FB for ; Wed, 26 Nov 2025 17:43:22 +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=1764179004; cv=none; b=Vq31oIa5J4OClE5YleZariPffU+HVod8nlKPLM89jnmSRMO9oQvlHHOgNImHcckXKLJ5R1PQ4bNEYfDC+FkxY1iiFxLs7+nqsB3/RRI5xrDd42oiog5XJ34WC7/sa4/19ehu0vO6DqW7mSODu6ILMCdb6mqEw9j9WktarxlkQj0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764179004; c=relaxed/simple; bh=Dbd+U+20t5jh3oo5fqXo2LWhcFGP1dtMaiMN1N4Ea2s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=B9UWV5winf/QtaX3/vvsTvU2S50KPo3gdJB8WpuS6IdpXZKSpD7kmnHvFb+cTIxNHxYP1Db+hPtZ5KSi5evSXKHYDee+dffNIb6RXTnrj28Yw4oeD6ozUy0BX61K/jdz7a2z5ECEtkPMwGXoYjFfrQsaY5GVwsqhflb+J+Csa4w= 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=cT7W2fXq; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=EHl+qfC5; 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="cT7W2fXq"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="EHl+qfC5" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AQGCxmh2855082 for ; Wed, 26 Nov 2025 17:43:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= /4C1ziBJx+mjYUbjAmhSYYfbHlaOdGG35KslyrE3v6A=; b=cT7W2fXqRsVUJVhr soy3LpKx4+EudPDBbmHgPxQC658fh1GhRt3sz0AtOpj5oAlo2lsw/IvKlUlmMLvq 9jpZi1PA4ZSz+vkCu7/euX6E9XelQAyIr1Qlmi5sbXlJTIAsPom3kppk35kT6D3o 3JgSjtVyPxVE2bo9+QtsviFVMUc4FoWuvCz1BKFp0V/AiJERp+JR91wgboEHUTcz jthMGHIxQwe1BrkYD3b3W/9k3+7Yo839uA7u0IuA2VuEQ76xW2Jipsmyxo799EWY XFvjAoNOV3q8jymyoQAFrdRW8HkmiHMA6Xyow/IPuP95CwPfm3YJ306ePs/+NyQB RKkwnQ== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ap4vh88mw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 26 Nov 2025 17:43:21 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-7b9090d9f2eso14531844b3a.0 for ; Wed, 26 Nov 2025 09:43:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1764179001; x=1764783801; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/4C1ziBJx+mjYUbjAmhSYYfbHlaOdGG35KslyrE3v6A=; b=EHl+qfC5aXz3Q2q1jWQOr2bKLMiHt4sD5B6Qq3J3pt+5eCBdXuhz8XU0ENb7wgMsff /l4HFhU/26spOGfAlokZzWMjFdUHyjqlQ2xy3eLwbwY9hLGACvbFQoSlmf5k1MlCCM9+ Es0Khzh0XToW7B242Ukhd5wEEAjvhPgoQQmdYJXHTYvLoOwP4K+RD4dAwCJKx89vlLCH NI5kQXYNUXHMUvhR8aAaGVZx/BYOGlt6cYFzq4CIy9yZpAIugs8MYahDzWVqgj4Dp8IJ FHCj+oidKIL8p6vnj1rnvCeZUxQPAfkV9JSFsLRCK4dec9icpBqFWjjWJrUegv5Z8X0t k3Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764179001; x=1764783801; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/4C1ziBJx+mjYUbjAmhSYYfbHlaOdGG35KslyrE3v6A=; b=XxIFoxbbpHAR1S6aosB9UEWsjrx5gFgOASqKJqrbydtcqTQgO+7iv5oeOQZjpxvhgU kz1Dn8l7mG7GBLkm3v3ml0C1EdvqbgG+rpO1OKL9wkWmoHv/6eUqo2w/NIAR29L834A/ Gv8LhG5ASYhNXFGFI1oquEl2ZkGK7VZMyxWp7fAiMj+4NCiX9joRjKYN7aZW+NmvoLfR T9Y447mCrG9UelAssXsET7aVmKFCQYX4684UyknueHgybp2wH8/YtxfdHPE4oACRttML AIOhSzSz63m5+gZJ/6XCuHsIgVLWVelTGBiPk4JApilnAnzjugRfOY+N1B5Q3jZy43qX j8wA== X-Forwarded-Encrypted: i=1; AJvYcCULJu+YOdrTUfEX3kWmPLUQwLqQyu/hINkC8GN6+l7QQzXZqsYOYkZS+xVrVQX0KN73/ET95HxuRL0S61U=@vger.kernel.org X-Gm-Message-State: AOJu0Yy77UWuYXVPzqQvfg5fkre4oybhVt0JvUJTP2dti1TxuR8XQRfE tZi/nVpPgGAYXwgQPonsSFwY1jbzokxjLLXL7CMT0RfYb7bZixs7REiH2/UwwyoAbxam2dcfogU 7zwxGbm8tDOhlo6r+zuCHgaTEP0rJVO2gCqYrUjsTl6PfMNmnEkPmYSW8UYSDzjxRVRU= X-Gm-Gg: ASbGncs2drd/SZ9MNjmHrMfNRwmavTsr3tnDXwBGMOgJdJ3S/ZYIBDxPduJGqv+2p3C R0dZpGLcPgwMMeLIgTEkaGun+PKO/WhzHK76VsLL3yvvLIgWB5wRMmlh64jLaDKsuMJpAyBdidb qLkKPxAoHz5d/UVFeZuopPEwOzVOMHfvPYrwQAtGLi/FTHF1e2yEEvhX8qwAlq+tx8z27EyOBWm /mkeJ1LRCdEUR+ydPaf807+udrBtP22hbS++4kY0Y+ByXHPZxA6IMNujGur23ljftptZDvDaI1l bseZWcrdWitE115+5PJgB4q65Uki5iicr9Br4dRqNqhnU9RsMn5KWSsVa24u0D0rkk31H9czSJz 34Gr7RPAoS9Qfmpkb85sLcSbNq8rc306gDZXWAJqbdoQ= X-Received: by 2002:a05:6a00:2e28:b0:7b2:2d85:ae53 with SMTP id d2e1a72fcca58-7c58c999ebfmr24059796b3a.8.1764179000421; Wed, 26 Nov 2025 09:43:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFE9auC0BPVxJ4KxcFP48LwF0xTVOASw2feRr55RR8ZX+bZHEyVlBeSIXXDN1cl0ZFO26GaMg== X-Received: by 2002:a05:6a00:2e28:b0:7b2:2d85:ae53 with SMTP id d2e1a72fcca58-7c58c999ebfmr24059760b3a.8.1764178999869; Wed, 26 Nov 2025 09:43:19 -0800 (PST) Received: from [10.216.6.208] ([202.46.23.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7c3ed471022sm22183967b3a.21.2025.11.26.09.43.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Nov 2025 09:43:19 -0800 (PST) Message-ID: Date: Wed, 26 Nov 2025 23:13:05 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v17 07/12] firmware: psci: Implement vendor-specific resets as reboot-mode Content-Language: en-US To: Lorenzo Pieralisi Cc: Bartosz Golaszewski , Bjorn Andersson , Sebastian Reichel , Rob Herring , Sudeep Holla , Souvik Chakravarty , Krzysztof Kozlowski , Conor Dooley , Andy Yan , Mark Rutland , Arnd Bergmann , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org, Vinod Koul , Catalin Marinas , Will Deacon , Florian Fainelli , Moritz Fischer , John Stultz , Matthias Brugger , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Stephen Boyd , Andre Draszik , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Elliot Berman , Xin Liu , Srinivas Kandagatla , Umang Chheda , Nirmesh Kumar Singh References: <20251109-arm-psci-system_reset2-vendor-reboots-v17-0-46e085bca4cc@oss.qualcomm.com> <20251109-arm-psci-system_reset2-vendor-reboots-v17-7-46e085bca4cc@oss.qualcomm.com> <80e68e44-a8e0-464a-056e-9f087ad40d51@oss.qualcomm.com> <1da024e7-efb1-3a1c-cc13-0ae5212ed8bd@oss.qualcomm.com> <682b1a0c-644f-2aff-1860-cbf9a53bc62b@oss.qualcomm.com> From: Shivendra Pratap In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTI2MDE0NCBTYWx0ZWRfXx0v60ppXFMDH wM7DU51ae98P4tEtMFKKCQjhE7m5WxvXARB7i4t9T0QcUf81zDsk5p74Ro0+b6d9nz9qPG4bTTe gJBeeoka7Gr0hYJx6+8dxLYBPRMGKuyn0Nr2B24Gc2r7RtG0FelqRWLFTWmKgLkEmtf4vdnuVFn LbxHzuiYPMJ4Bd4BmrDzKCQMZx61WEgF8rX1jK9VjhgTQ90yjO9rR75jD+OLV7BpZjZ8quElDLX AeY8q4SGz3P/eLqiABdSrVZ5WySdxeUnzzj2aT/BxVRVq5o3prnRcFHdP6Edh+fqsp4YiSCkn0b AlHHzqITYqxCGNbVYFF5aHpb5uXhumm8gBGM0SC9MSr45QJuvvCVZ7M+eZfUbJLpFIICX8Sv1WZ nggtLDe4d1SJ6ru59Al+vVfPUlfCng== X-Proofpoint-ORIG-GUID: SIF57JxeQMMQNSFMU4Og6PhVKx60Stkq X-Proofpoint-GUID: SIF57JxeQMMQNSFMU4Og6PhVKx60Stkq X-Authority-Analysis: v=2.4 cv=Lt6fC3dc c=1 sm=1 tr=0 ts=69273c39 cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=j4ogTh8yFefVWWEFDRgCtg==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=aq4WiCt_VBwjG6PfwrMA:9 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-25_02,2025-11-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 priorityscore=1501 suspectscore=0 adultscore=0 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511260144 On 11/26/2025 10:48 PM, Lorenzo Pieralisi wrote: > On Wed, Nov 19, 2025 at 05:32:42PM +0530, Shivendra Pratap wrote: >> >> >> On 11/19/2025 3:07 PM, Lorenzo Pieralisi wrote: >>> On Tue, Nov 18, 2025 at 11:11:33PM +0530, Shivendra Pratap wrote: >>> >>> [...] >>> >>>>> Yes this could be a potential way forward but that's decoupled from the >>>>> options below. If we take this route PSCI maintainers should be added >>>>> as maintainers for this reboot mode driver. >>>> >>>> you mean the new psci_reset driver? yes. Maintainer would be PSCI maintainer, >>>> if we create a new psci_reset reboot mode driver. >>> >>> Yes. >>> >>>>>> - struct with pre-built psci reset_types - (warm, soft, cold). Currently >>>>>> only two modes supported, anything other than warm/soft defaults to cold. >>>>>> - vendor resets to be added as per vendor choice, inside psci device tree(SOC specific). >>>>>> - psci_reset registers with reboot-mode for registering vendor resets. Here, we >>>>>> have a problem, the pre-built psci reset_types - (warm, soft, cold) cannot be added via >>>>>> reboot-mode framework. >>>>> >>>>> Why ? >>>> >>>> If we want the new psci_reset to take the reboot-mode framework route, is it ok to >>>> add default modes (warm, cold) in the device tree? >>>> If not, then the design of reboot-mode framework(power:reset:reboot-mode.c) needs to be >>>> further changed to equip this new feature. >>> >>> Well, yes, all it needs to do is allowing prepopulated reboot modes on top >>> of which DT based ones are added. >> >> The mode-cold , adds a third variable to reboot-modes as the first parameter for >> invoke_psci_fn is different for cold vs warm/vendor. >> >> cold reset call : invoke_psci_fn(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); >> vendor/warm reset call: invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), vendor, cookiee, 0); >> >> Each mode will have 3 argument - like: >> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ >> MODE , cold reset, reset_type, cookie >> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - >> COLD , 1 , 0 , 0 >> WARM , 0 , 0 , 0 >> vendor1, 0 ,0x80000000 , 1 >> vendor2, 0 ,0x80000010 , 0 >> >> So reboot-mode framework will now define and support upto three 32 bit arguments for each mode? > > The cookie value is unused for SYSTEM_WARM_RESET, you can encode there whether > it is a cold (SYSTEM_RESET) or warm (SYSTEM_RESET2 - SYSTEM_WARM_RESET) architectural > reset when the magic value(aka reset_type) == 0x0 ? sure that should work. if reset_type is 0, cookie to decide warm vs cold. > > The reboot mode parameters do not necessarily need to map to PSCI function > calls parameters - provided we define that explicitly. got it. Sorry for out of inline question - So the psci_sys_reset() may be looking like below after the changes suggested? Is this on track? if( panic_in_progress() || !psci_reset_cmd.valid) { if ((reboot_mode == REBOOT_WARM || reboot_mode == REBOOT_SOFT) && psci_system_reset2_supported) { /* * reset_type[31] = 0 (architectural) * reset_type[30:0] = 0 (SYSTEM_WARM_RESET) * cookie = 0 (ignored by the implementation) */ invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), 0, 0, 0); } else { invoke_psci_fn(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); } } else { invoke_psci_fn(, , , 0); } ------ where psci_reset_cmd is defined like below? struct psci_sysreset { u32 system_reset; // this will be set as PSCI_FN_NATIVE(1_1, SYSTEM_RESET2) or PSCI_0_2_FN_SYSTEM_RESET. u32 reset_type; u32 cookie; bool valid; }; static struct psci_sysreset psci_reset_cmd; -- thanks, Shivendra