From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 589192FCE0E for ; Thu, 10 Jul 2025 20:20:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752178814; cv=none; b=HqLChfohbPECsfx2BU6ivBulECl4h6jx3Eeg3r3NG7FpRi1GNQRuPpI1MfvuZY+srzzYRFeyJA/zFbz/WIAUuH39FDkaXhVctv43W1B8qW3cp+zSnb+Mo3ZiPGQSc31maaq46KHuM5NRvfjWZAeQ3llXT7EsrhSydyDgstxDaBs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752178814; c=relaxed/simple; bh=EFpUUux5IGFLjI8F9dyw5URIdRYoHLpUtpWMUT+bYN8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QKa3hOiubxSin6WH0w9JMM6g568QwZwWUpEtmUfryylADUW8RhIq4AryzSli2c5RtNdAveLOxbsVW/zmaKWwoOhxW8Frgzjvhq/XZ+ju7ObL8md6dnNmGnQIyJTA44j5WE4L5p73q2TVkaZb8NN0pFcGn9LZd9wRrzORbTZgYG0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=PtWsIt+m; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="PtWsIt+m" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-74b52bf417cso1045869b3a.0 for ; Thu, 10 Jul 2025 13:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1752178811; x=1752783611; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=fDA1snVpr4c+NFAM0uEmirZxMpXwZuvq35CUMbMBbtw=; b=PtWsIt+mkTOqqG26WG96b1qMA6jeH38ZRWXxG2M2exGEWi7aiHa+NBNu5N7pbQwL7f i7MAHSljI1W7Rt+gPgcOpbijdCk2o9E0naKrQ/qgc4vwAu5asr1nd0Zt06Nl7tyh/uRv GCGA/+55IMTYGVftSlUSTtrVTyGvDeoTHzoAo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752178811; x=1752783611; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fDA1snVpr4c+NFAM0uEmirZxMpXwZuvq35CUMbMBbtw=; b=WRDhZPLXjIyyxxjH8gwQaNsyad99EtxZItdZfGdilW+vIMe06jJMkXI9wyAJ96UvWf zm9W/AApbGG0T2mmFBa21TlIqurrkGczkWouWLvF9VS8LnYtDMqy4yFDHtcLUatFuLFG E1cv3Fb7qd8yYd5ZqrN3Uo+Bf1LYX+iI0R5joSJr4vh/EWs7VALsBdbg0d0PdP9gwsSO EQXGLd/X0vdLXZdkIda4hfNelnmrll7EO+YbQhxK2/dNqt37twcPqSwI+gxNdz8W3DTd kVvugE7F7fdD3fCaMnBj4bc2lfB90pKZoGqX7A+44FsItCRKvIvChZfSqvGDdQ1jQZn7 YMbg== X-Forwarded-Encrypted: i=1; AJvYcCX8llFZ0D+X739z96Mn67c6s+6DaVCOZz/6GFny954Md3uIX64kYtUEztUEBFJeFqY3hfhCPxeGy5dMXEM=@vger.kernel.org X-Gm-Message-State: AOJu0YzbiYOjykU8hhQyPCC3Tsj4iYhymGcLEa0jn/to048lZ4W6zLCg E4owV9xI+OtWhfGFsrAbx85AvHIJv7VSgwhLkXawEZIYamUeysLU8aunzjFWE4A1Qg== X-Gm-Gg: ASbGncs0KPbiflMualrskrVh2PLPpN9lRP9X9bikrrj0rB+43f3EdtsDxDfhtzgtSVW lO0PTEh3ol7wIyiMh4S2BRyAoTAO+a16PMbaiWiRPP9VjDqOux9MZFygGB2wcNIq8y+rwvyk6LO nNeIyASsxuSqvlwLhuX/TpzY9cSRSZaOPnAiPtrX2TSKJUClX86mm1Y0okqkPXcgsNNfGewExCu GJwTJ7HfvmbeCK+MBUskWcSWBnadBbjoGQsKmtUWImaCV+c8d5sXWhDT5q2VbYd2sMWH2972yGZ Zx2pS8zj/L3DRMU+NyqQU3EWqJzxUmRP2Z2iilULSxoXwuHw49Rh6EtO3K1OmufoU3WabGGvGoK tQgGBPrOlssR87pTzeuW6FAVCSg== X-Google-Smtp-Source: AGHT+IFL7AIbBKtnmbpYy0bxdMeh4A8w6D5qedofW87hyUDv74Ybf7PLb906ZmUsinFv9/MPjCLj0w== X-Received: by 2002:a05:6a21:a81:b0:21f:a883:d1dd with SMTP id adf61e73a8af0-2311e93bfbfmr940590637.14.1752178811479; Thu, 10 Jul 2025 13:20:11 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b3bbe72f8a9sm2946867a12.74.2025.07.10.13.20.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Jul 2025 13:20:10 -0700 (PDT) Message-ID: <34dde6a1-bb75-45ed-a20d-057e3f32f592@broadcom.com> Date: Thu, 10 Jul 2025 13:20:06 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v10 00/10] Implement vendor resets for PSCI SYSTEM_RESET2 To: Shivendra Pratap , 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 , 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 , Srinivas Kandagatla , Elliot Berman , Konrad Dybcio References: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> Content-Language: en-US From: Florian Fainelli Autocrypt: addr=florian.fainelli@broadcom.com; keydata= xsBNBFPAG8ABCAC3EO02urEwipgbUNJ1r6oI2Vr/+uE389lSEShN2PmL3MVnzhViSAtrYxeT M0Txqn1tOWoIc4QUl6Ggqf5KP6FoRkCrgMMTnUAINsINYXK+3OLe7HjP10h2jDRX4Ajs4Ghs JrZOBru6rH0YrgAhr6O5gG7NE1jhly+EsOa2MpwOiXO4DE/YKZGuVe6Bh87WqmILs9KvnNrQ PcycQnYKTVpqE95d4M824M5cuRB6D1GrYovCsjA9uxo22kPdOoQRAu5gBBn3AdtALFyQj9DQ KQuc39/i/Kt6XLZ/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dThd6SLhreCN7Uh IR/5NXGqotAZao2xlDpJLuOMQtoH9WVNuuxQQZHVd8if+yp6yRJ5DAmIUt5CCPcAEQEAAcLB gQQYAQIBKwUCU8AbwgUbDAAAAMBdIAQZAQgABgUCU8AbwQAKCRCTYAaomC8PVQ0VCACWk3n+ obFABEp5Rg6Qvspi9kWXcwCcfZV41OIYWhXMoc57ssjCand5noZi8bKg0bxw4qsg+9cNgZ3P N/DFWcNKcAT3Z2/4fTnJqdJS//YcEhlr8uGs+ZWFcqAPbteFCM4dGDRruo69IrHfyyQGx16s CcFlrN8vD066RKevFepb/ml7eYEdN5SRALyEdQMKeCSf3mectdoECEqdF/MWpfWIYQ1hEfdm C2Kztm+h3Nkt9ZQLqc3wsPJZmbD9T0c9Rphfypgw/SfTf2/CHoYVkKqwUIzI59itl5Lze+R5 wDByhWHx2Ud2R7SudmT9XK1e0x7W7a5z11Q6vrzuED5nQvkhAAoJEIExtcQpvGagugcIAJd5 EYe6KM6Y6RvI6TvHp+QgbU5dxvjqSiSvam0Ms3QrLidCtantcGT2Wz/2PlbZqkoJxMQc40rb fXa4xQSvJYj0GWpadrDJUvUu3LEsunDCxdWrmbmwGRKqZraV2oG7YEddmDqOe0Xm/NxeSobc MIlnaE6V0U8f5zNHB7Y46yJjjYT/Ds1TJo3pvwevDWPvv6rdBeV07D9s43frUS6xYd1uFxHC 7dZYWJjZmyUf5evr1W1gCgwLXG0PEi9n3qmz1lelQ8lSocmvxBKtMbX/OKhAfuP/iIwnTsww 95A2SaPiQZA51NywV8OFgsN0ITl2PlZ4Tp9hHERDe6nQCsNI/Us= In-Reply-To: <20250710-arm-psci-system_reset2-vendor-reboots-v10-0-b2d3b882be85@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/10/25 02:15, Shivendra Pratap wrote: > The PSCI SYSTEM_RESET2 call allows vendor firmware to define > additional reset types which could be mapped to the reboot > argument. > > User-space should be able to reboot a device into different > operational boot-states supported by underlying bootloader and > firmware. Generally, some HW registers need to be written, based > on which the bootloader and firmware decide the next boot state > of device, after the reset. For example, a requirement on > Qualcomm platforms may state that reboot with "bootloader" > command, should reboot the device into bootloader flashing mode > and reboot with “edl” command, should reboot the device into an > 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 defines a > vendor-specific reset in SYSTEM_RESET2 spec, which enables the > firmware to take care of underlying setting for any such > supported vendor-specific reboot. Qualcomm firmwares are > beginning to support and expose PSCI SYSTEM_RESET2 > vendor-specific reset types to simplify driver requirements from > Linux. With such support added in the firmware, we now need a > Linux interface which can make use of the firmware calls for PSCI > vendor-specific resets. This will align such reboot requirement > across platforms and vendors. > > The current psci driver supports two types of resets – > SYSTEM_RESET2 Arch warm-reset and SYSTEM_RESET cold-reset. The > patchset introduces the PSCI SYSTEM_RESET2 vendor-specific reset > into the reset path of the psci driver and aligns it to work with > reboot system call - LINUX_REBOOT_CMD_RESTART2, when used along > with a supported string-based command in “*arg”. > > The patchset uses reboot-mode based commands, to define the > supported vendor reset-types commands in psci device tree node > and registers these commands with the reboot-mode framework. > > The PSCI vendor-specific reset takes two arguments, being, > reset_type and cookie as defined by the spec. As the > vendor-specific reset needs two arguments reset_type and cookie > to be passes to the firmware, enhance the reboot-mode framework > to support two arguments (magic and cookie), for each reboot-mode > command, where cookie will be optional. > > Along this line, the patchset also extends the reboot-mode > framework to add a non-device-based registration function which > will allow drivers to register using DT node, while keeping > backward compatibility for existing users of reboot-mode. This > will enable psci driver to register for reboot-mode and implement > a write_with_cookie function which will save the > magic(reset_type) and cookie and then use it in psci reset path > to make a vendor-specific reset call into the firmware. In > addition, the patchset will expose a sysfs entry interface within > reboot-mode which can be used by userspace to view the supported > reboot-mode commands. > > The list of vendor-specific reset commands remains open due to > divergent requirements across vendors, but this can be > streamlined and standardized through dedicated device tree > bindings. > > Currently three drivers register with reboot-mode framework - > syscon-reboot-mode, nvmem-reboot-mode and qcom-pon. Consolidated > list of commands currently added across various vendor DTs: > mode-loader > mode-normal > mode-bootloader > mode-charge > mode-fastboot > mode-reboot-ab-update > mode-recovery > mode-rescue > mode-shutdown-thermal > mode-shutdown-thermal-battery > > Detailed list of commands being used by syscon-reboot-mode: > arm64/boot/dts/exynos/exynosautov9.dtsi: > mode-bootloader = ; > mode-fastboot = ; > mode-recovery = ; > > arm64/boot/dts/exynos/google/gs101.dtsi: > mode-bootloader = <0xfc>; > mode-charge = <0x0a>; > mode-fastboot = <0xfa>; > mode-reboot-ab-update = <0x52>; > mode-recovery = <0xff>; > mode-rescue = <0xf9>; > mode-shutdown-thermal = <0x51>; > mode-shutdown-thermal-battery = <0x51>; > > arm64/boot/dts/hisilicon/hi3660-hikey960.dts: > mode-normal = <0x77665501>; > mode-bootloader = <0x77665500>; > mode-recovery = <0x77665502>; > > arm64/boot/dts/hisilicon/hi6220-hikey.dts: > mode-normal = <0x77665501>; > mode-bootloader = <0x77665500>; > mode-recovery = <0x77665502>; > > arm64/boot/dts/rockchip/px30.dtsi: > mode-bootloader = ; > mode-fastboot = ; > mode-loader = ; > mode-normal = ; > mode-recovery = ; > > arm64/boot/dts/rockchip/rk3308.dtsi: > mode-bootloader = ; > mode-loader = ; > mode-normal = ; > mode-recovery = ; > mode-fastboot = ; > > arm64/boot/dts/rockchip/rk3566-lckfb-tspi.dts: > mode-normal = ; > mode-loader = ; > mode-recovery = ; > mode-bootloader = ; > > Detailed list of commands being used by nvmem-reboot-mode: > arm64/boot/dts/qcom/pmXXXX.dtsi:(multiple qcom DTs) > mode-recovery = <0x01>; > mode-bootloader = <0x02>; > > Previous discussions around SYSTEM_RESET2: > - https://lore.kernel.org/lkml/20230724223057.1208122-2-quic_eberman@quicinc.com/T/ > - https://lore.kernel.org/all/4a679542-b48d-7e11-f33a-63535a5c68cb@quicinc.com/ > > Signed-off-by: Elliot Berman > Signed-off-by: Shivendra Pratap Humm, something changed compared to the last version that I tested from Elliot which worked ok. With this patch applied and the following Device Tree snippet: psci { method = "smc"; compatible = "arm,psci-0.2", "arm,psci"; cpu_on = <0xc4000003>; cpu_suspend = <0xc4000001>; cpu_off = <0x84000002>; reset-types { mode-powercycle = <0x01>; }; }; I get the following invoking "reboot powercycle": # reboot powercycle [ 21.403188] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 is not a phandle reference [ 21.412032] Mem abort info:extended_property): /rdb/waketimer@841a840:interrupts-extended: cell 0 is not a phandle reference [ 21.414840] ESR = 0x0000000086000004operty): /rdb/waketimer@841a840:interrupts-extended: cell 2 is not a phandle reference [ 21.418601] EC = 0x21: IABT (current EL), IL = 32 bitsparent: cell 0 is not a phandle reference [ 21.423927] SET = 0, FnV = 0: /rdb/xhci_v2@8d00000:phys: cell 0 is not a phandle reference [ 21.426988] EA = 0, S1PTW = 0 /rdb/sata@8b0a000/sata-port@0:phys: cell 0 is not a phandle reference [ 21.430138] FSC = 0x04: level 0 translation fault:phys: cell 0 is not a phandle reference [ 21.435054] user pgtable: 4k pages, 48-bit VAs, pgdp=000000010112c000 a phandle reference [ 21.441508] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000handle reference [ 21.448318] Internal error: Oops: 0000000086000004 [#1] SMPcell 0 is not a phandle reference [ 21.453990] Modules linked in: bdc udc_core/thermal-zones/cpu-thermal:thermal-sensors: cell 0 is not a phandle reference [ 21.458188] CPU: 0 UID: 0 PID: 1566 Comm: reboot Not tainted 6.16.0-rc5-next-20250710-gdd78270edd5a #2 NONE 4) [ 21.468032] Hardware name: BCX972160DV (DT)ases property name must include only lowercase and '-' [ 21.472221] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)only lowercase and '-' [ 21.479193] pc : 0x0s_paths): /aliases:pcie0: aliases property is not a valid node (/pcie@8b10000) [ 21.481388] lr : reboot_mode_notify+0x64/0x80es property name must include only lowercase and '-' [ 21.485760] sp : ffff80008344bbe0iases: aliases property name must include only lowercase and '-' [ 21.489079] x29: ffff80008344bbe0 x28: ffff0000c3bb3d00 x27: ffff800080ab58e8ly lowercase and '-' [ 21.496228] x26: 0000000000000000 x25: ffff0000c3bb3d00 x24: ffff800082cf9bc8ly lowercase and '-' [ 21.503376] x23: ffff80008344bcb8 x22: 0000000000000001 x21: ffff0000c31b87b0 [ 21.510524] x20: 00000000fffffffc x19: ffff0000c31b8780 x18: 0000000000000000 [ 21.517673] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 [ 21.524821] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 [ 21.531969] x11: 0000000000000000 x10: 00007fffc02bb958 x9 : 0000000000000010 [ 21.539118] x8 : 0101010101010101 x7 : 0000000000000000 x6 : 000080c38080ffff [ 21.546266] x5 : ffff0000c3000000 x4 : 0000808000800000 x3 : 0000000000000000 [ 21.553415] x2 : 0000000000000000 x1 : 0000000000000001 x0 : ffff0000c31b8780 [ 21.560565] Call trace: [ 21.563014] 0x0 (P) [ 21.565205] notifier_call_chain+0x70/0x120 [ 21.569401] blocking_notifier_call_chain+0x4c/0x78 [ 21.574288] kernel_restart+0x30/0xc8 [ 21.577957] __do_sys_reboot+0x1c8/0x268 [ 21.581886] __arm64_sys_reboot+0x28/0x38 [ 21.585902] invoke_syscall+0x4c/0x118 [ 21.589660] el0_svc_common.constprop.0+0x44/0xe8 [ 21.594373] do_el0_svc+0x20/0x30 [ 21.597694] el0_svc+0x18/0x58 [ 21.600758] el0t_64_sync_handler+0x98/0xe0 [ 21.604947] el0t_64_sync+0x154/0x158 [ 21.608625] Code: ???????? ???????? ???????? ???????? (????????) [ 21.614730] ---[ end trace 0000000000000000 ]--- Segmentation fault # -- Florian