From nobody Fri Jun 12 14:07:47 2026 Received: from smtp1.tecnico.ulisboa.pt (smtp1.tecnico.ulisboa.pt [193.136.128.21]) (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 5951F3BED43; Thu, 14 May 2026 14:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.136.128.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778770533; cv=none; b=cRfz8VqXn5kKmQGozCfnGcL58i4SvZLLeYgzGbv3ZYecGlmla7LL4wBoD7l062fSuQCwyFsxyPr+ubQsfHOwW/7hdicDDWvgwSbGZTUNHuIKtzgO5eEcSxqfwA4cMZCXSVcRUBZLxLSTJ4vg0aeP+54Z+AK+iUq3b11WhqbCus0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778770533; c=relaxed/simple; bh=iKpL2tZGcpfwQZn6rSsZghYOqthAeTURsDvaVuWlul0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Z8qXZrfOza/ZbVqFAqnIJO1L1DSrLjgN1uLkSvuEzg5hSQEmtd9lOwK3Qi0J+6JiP4oDP+785AS7nKlp41tLKoQmgBSaRyxyjNzzi0bk39/7i36yExmXWGduc8ZpyB9jZ88cPVF0wMpWfJSymMvuLn5tt7BULpR2uCpgwUL1Ub0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tecnico.ulisboa.pt; spf=pass smtp.mailfrom=tecnico.ulisboa.pt; dkim=pass (2048-bit key) header.d=tecnico.ulisboa.pt header.i=@tecnico.ulisboa.pt header.b=gE8zolpZ; arc=none smtp.client-ip=193.136.128.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tecnico.ulisboa.pt Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tecnico.ulisboa.pt Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tecnico.ulisboa.pt header.i=@tecnico.ulisboa.pt header.b="gE8zolpZ" Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.tecnico.ulisboa.pt (Postfix) with ESMTP id 23F826000222; Thu, 14 May 2026 15:47:30 +0100 (WEST) X-Virus-Scanned: by amavis-2.13.0 (20230106) (Debian) at tecnico.ulisboa.pt Received: from smtp1.tecnico.ulisboa.pt ([127.0.0.1]) by localhost (smtp1.tecnico.ulisboa.pt [127.0.0.1]) (amavis, port 10025) with LMTP id sxCi7LopkDkE; Thu, 14 May 2026 15:47:28 +0100 (WEST) Received: from mail1.tecnico.ulisboa.pt (mail1.ist.utl.pt [193.136.128.10]) by smtp1.tecnico.ulisboa.pt (Postfix) with ESMTPS id CA6DD6000874; Thu, 14 May 2026 15:47:27 +0100 (WEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tecnico.ulisboa.pt; s=mail2; t=1778770047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3nchV8R8N22csolYEW3nDc6UaflBfzUU8x9AMzJq3tI=; b=gE8zolpZ0jFP/V+8YUQmRf1aiyMqsehtQwKOFK7fjV5RZs5Iy7hyGU4FphdQ+BCgUh9UKV h+unP8ghKACIgHzSA8YlDzkn77fE5xMR7oHlyipv7AcxB8ogRuuDVwMQt4BUUbk+gseB6w V2I9pKH9SQmgnumCAZnWOBEYn2d5/399/l4P5WTHUnm9T47SvRmC7YqdOJWidqrdNVvphJ ZWn5UiqrK5Mus3HJh9jAPBCZKlSevaQv5dyFuNnSu5MVBPo1HZASCqhOjxpPqNDFOVjjBg oaipoYV3vSXDc+JIkrLu4AIA8FLBB6M+7w/31T7+Nb36RRlF9W4MpBLx/wZC7w== Received: from [192.168.1.94] (2a02-842a-00d7-bd01-2527-ff0d-f555-b6e4.rev.sfr.net [IPv6:2a02:842a:d7:bd01:2527:ff0d:f555:b6e4]) (Authenticated sender: ist187313) by mail1.tecnico.ulisboa.pt (Postfix) with ESMTPSA id 38D3636026F; Thu, 14 May 2026 15:47:27 +0100 (WEST) From: Diogo Ivo Date: Thu, 14 May 2026 16:47:19 +0200 Subject: [PATCH 1/4] firmware: psci: switch SYSTEM_OFF to sys-off handler API 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: <20260514-smaug-poweroff-v1-1-30f9a4688966@tecnico.ulisboa.pt> References: <20260514-smaug-poweroff-v1-0-30f9a4688966@tecnico.ulisboa.pt> In-Reply-To: <20260514-smaug-poweroff-v1-0-30f9a4688966@tecnico.ulisboa.pt> To: Mark Rutland , Lorenzo Pieralisi , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Jonathan Hunter Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, Diogo Ivo X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1778770045; l=1612; i=diogo.ivo@tecnico.ulisboa.pt; s=20240529; h=from:subject:message-id; bh=iKpL2tZGcpfwQZn6rSsZghYOqthAeTURsDvaVuWlul0=; b=mNBKOD3xIOPmaNUJzRwUDmwi+ef8RxjYEkH65pN2enlXmtGLq/ohk+C7tlJmJshxf6TssnUdH L9T+3cgibpBDek2qNCbgwB06mtebC9EY88A4hyJNq0xhVTznAkJ6Cna X-Developer-Key: i=diogo.ivo@tecnico.ulisboa.pt; a=ed25519; pk=BRGXhMh1q5KDlZ9y2B8SodFFY8FGupal+NMtJPwRpUQ= Replace the legacy pm_power_off hook with the generic sys-off handler infrastructure. Convert psci_sys_poweroff() to the sys-off callback prototype and register it through register_sys_off_handler() with firmware priority. This removes the direct dependency on pm_power_off and drops the now-unused include. This aligns the PSCI poweroff path with the modern system-off framework used by other firmware and platform drivers. Signed-off-by: Diogo Ivo Reviewed-by: Thierry Reding --- drivers/firmware/psci/psci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 38ca190d4a22..d6e9721d11e5 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -329,9 +328,11 @@ static struct notifier_block psci_sys_reset_nb =3D { .priority =3D 129, }; =20 -static void psci_sys_poweroff(void) +static int psci_sys_poweroff(struct sys_off_data *data) { invoke_psci_fn(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0); + + return NOTIFY_DONE; } =20 #ifdef CONFIG_HIBERNATION @@ -671,7 +672,8 @@ static void __init psci_0_2_set_functions(void) =20 register_restart_handler(&psci_sys_reset_nb); =20 - pm_power_off =3D psci_sys_poweroff; + register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_FIRMWARE, + psci_sys_poweroff, NULL); } =20 /* --=20 2.54.0 From nobody Fri Jun 12 14:07:47 2026 Received: from smtp1.tecnico.ulisboa.pt (smtp1.tecnico.ulisboa.pt [193.136.128.21]) (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 59637410D2F; Thu, 14 May 2026 14:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.136.128.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778770534; cv=none; b=GaQh2TPuC0QfbQOto4cMMH4kLFK9qR42Db5RO0+gUI4N1DMW2iPprtGmi1K4yuCPOIl0wlXWXy10/6FOaapQ3mYndiMOl84a36NtPZ5ctP7IQPFpQi6HKVBXyyc6W8AQA7ogPlERb72fobvc0KYLCNJwoI77mdR/ckLmn2iQQ/Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778770534; c=relaxed/simple; bh=JA8yV+QK8BosoCH/4FosyvERNGhrrE+s1PDY8QHwMQo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HYcwvrQUNhhm1P9tBm6C1I1liMRU5OQw4Xnmj6UF/Ts6o2aH+rtbpai3QMzwIChBBqumIqAJ/GIlwd2Lj+FvQ/y+cgeu1QpCcKSsqDL5Dp/SFrkm/W3PdWGYcLGvQfG7Nls0STZ2ag29FfHCIo9QCQsyIDmNj496vg863sf22vY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tecnico.ulisboa.pt; spf=pass smtp.mailfrom=tecnico.ulisboa.pt; dkim=pass (2048-bit key) header.d=tecnico.ulisboa.pt header.i=@tecnico.ulisboa.pt header.b=SOdhjUAR; arc=none smtp.client-ip=193.136.128.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tecnico.ulisboa.pt Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tecnico.ulisboa.pt Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tecnico.ulisboa.pt header.i=@tecnico.ulisboa.pt header.b="SOdhjUAR" Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.tecnico.ulisboa.pt (Postfix) with ESMTP id 6FE2A600025B; Thu, 14 May 2026 15:47:30 +0100 (WEST) X-Virus-Scanned: by amavis-2.13.0 (20230106) (Debian) at tecnico.ulisboa.pt Received: from smtp1.tecnico.ulisboa.pt ([127.0.0.1]) by localhost (smtp1.tecnico.ulisboa.pt [127.0.0.1]) (amavis, port 10025) with LMTP id lD8sePFOM8qE; Thu, 14 May 2026 15:47:28 +0100 (WEST) Received: from mail1.tecnico.ulisboa.pt (mail1.ist.utl.pt [IPv6:2001:690:2100:1::b3dd:b9ac]) by smtp1.tecnico.ulisboa.pt (Postfix) with ESMTPS id 6FAAE60020C2; Thu, 14 May 2026 15:47:28 +0100 (WEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tecnico.ulisboa.pt; s=mail2; t=1778770048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3NA2Gtf+fFj04PTND+0t9TktuWb6JGQ89xyKhXYc0Ko=; b=SOdhjUARqCKdZbYd3+mDEviLLdgU3eHXwCvuH3/HrD9xWUHHGowHA692kRk6UAefc6L2h8 xCPEB11f+RRaT/tVOwT0cH/iR+uen/MAC/uBVFIo+73Lj9qdtvgHmLZjcXCpeSkEKwCuPd XvnQVMT6uTU7r5GZVlb0r0DoSRei6VLwBoweMN5k899BTKbcZ3BOwNppBrTjz5Rdig5fCU e2p+bv0S2A7PePTGPnvwaapk2GJr5S7XVhGyQoVUyfJ2Z7ap2JfqEeWe58OnJaTgnzmiLL udvL3zYZ8nalY/trLk8XV0XE8IVsbTGrUrA6v8M6lPJbk7FiGzS+4JXJBY0yrw== Received: from [192.168.1.94] (2a02-842a-00d7-bd01-2527-ff0d-f555-b6e4.rev.sfr.net [IPv6:2a02:842a:d7:bd01:2527:ff0d:f555:b6e4]) (Authenticated sender: ist187313) by mail1.tecnico.ulisboa.pt (Postfix) with ESMTPSA id CFB77360275; Thu, 14 May 2026 15:47:27 +0100 (WEST) From: Diogo Ivo Date: Thu, 14 May 2026 16:47:20 +0200 Subject: [PATCH 2/4] mfd: max77620: convert poweroff support to sys-off API 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: <20260514-smaug-poweroff-v1-2-30f9a4688966@tecnico.ulisboa.pt> References: <20260514-smaug-poweroff-v1-0-30f9a4688966@tecnico.ulisboa.pt> In-Reply-To: <20260514-smaug-poweroff-v1-0-30f9a4688966@tecnico.ulisboa.pt> To: Mark Rutland , Lorenzo Pieralisi , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Jonathan Hunter Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, Diogo Ivo X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1778770045; l=2514; i=diogo.ivo@tecnico.ulisboa.pt; s=20240529; h=from:subject:message-id; bh=JA8yV+QK8BosoCH/4FosyvERNGhrrE+s1PDY8QHwMQo=; b=/6m/rVtf/FFgBTVMU3mf1D+Nq4W2412regH0ZRKIDlq+HysxVx1mFgB+mH39nKoW6Yk48uCWe WWU6XsMiq/fDeyer6NtnFNpnkWAsnJeCIq42/DXH+speBG7hh2pJ5RY X-Developer-Key: i=diogo.ivo@tecnico.ulisboa.pt; a=ed25519; pk=BRGXhMh1q5KDlZ9y2B8SodFFY8FGupal+NMtJPwRpUQ= Convert max77620_pm_power_off() to the sys-off callback prototype and register it with the sys-off API when the device tree marks the PMIC as a system power controller. This also removes the global max77620_scratch pointer by passing the chip instance through the callback data. This modernizes the driver's poweroff handling and aligns it with the kernel sys-off infrastructure. Signed-off-by: Diogo Ivo Reviewed-by: Thierry Reding --- drivers/mfd/max77620.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c index 3af2974b3023..c4f89a9681f3 100644 --- a/drivers/mfd/max77620.c +++ b/drivers/mfd/max77620.c @@ -31,11 +31,10 @@ #include #include #include +#include #include #include =20 -static struct max77620_chip *max77620_scratch; - static const struct resource gpio_resources[] =3D { DEFINE_RES_IRQ(MAX77620_IRQ_TOP_GPIO), }; @@ -484,13 +483,15 @@ static int max77620_read_es_version(struct max77620_c= hip *chip) return ret; } =20 -static void max77620_pm_power_off(void) +static int max77620_pm_power_off(struct sys_off_data *data) { - struct max77620_chip *chip =3D max77620_scratch; + struct max77620_chip *chip =3D data->cb_data; =20 regmap_update_bits(chip->rmap, MAX77620_REG_ONOFFCNFG1, MAX77620_ONOFFCNFG1_SFT_RST, MAX77620_ONOFFCNFG1_SFT_RST); + + return NOTIFY_DONE; } =20 static int max77620_probe(struct i2c_client *client) @@ -501,7 +502,6 @@ static int max77620_probe(struct i2c_client *client) struct regmap_irq_chip *chip_desc; const struct mfd_cell *mfd_cells; int n_mfd_cells; - bool pm_off; int ret; =20 chip =3D devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); @@ -573,10 +573,14 @@ static int max77620_probe(struct i2c_client *client) return ret; } =20 - pm_off =3D of_device_is_system_power_controller(client->dev.of_node); - if (pm_off && !pm_power_off) { - max77620_scratch =3D chip; - pm_power_off =3D max77620_pm_power_off; + if (of_device_is_system_power_controller(client->dev.of_node)) { + ret =3D devm_register_sys_off_handler(&client->dev, + SYS_OFF_MODE_POWER_OFF, + SYS_OFF_PRIO_DEFAULT, + max77620_pm_power_off, chip); + if (ret) + return dev_err_probe(&client->dev, ret, + "failed to register power-off handler\n"); } =20 return 0; --=20 2.54.0 From nobody Fri Jun 12 14:07:47 2026 Received: from smtp1.tecnico.ulisboa.pt (smtp1.tecnico.ulisboa.pt [193.136.128.21]) (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 5A41F4219F2; Thu, 14 May 2026 14:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.136.128.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778770533; cv=none; b=O4aO/okkFFNsv/0QAVkEei7HeqDD79lfyAwsaZYsqt/jvd4wn1Cu9cX89U7ISMoGTr7idkwXb7MFrE1j+Q06FuWbe+8m9GmfElzJISNHYwUHQS4IV7pBhAoplhIG9X23N3cJWA2hWZdM/rRO7yUoW0xiRDCo29B77GfzfYC1MBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778770533; c=relaxed/simple; bh=EMOZ9KhOtUkr6GKfd7Yj0yXxYgXnjs2s04jA5kPD/MA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vtz+IykeJ/aZVTeyDYzd/Ub9M/8mdisY+D7/F55L2K2raQ2FnDrjcWi1bRyclgXwrm2jNOq7LhKKMOsGgSGa9ffIwXHqlqZk70XtIgR57jQFD/Ja30wLxvetZexPFU7vkVYRLd92I5afII99STk/yNOoc5l+Y6OQv5diubW21R4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tecnico.ulisboa.pt; spf=pass smtp.mailfrom=tecnico.ulisboa.pt; dkim=pass (2048-bit key) header.d=tecnico.ulisboa.pt header.i=@tecnico.ulisboa.pt header.b=hDCTM9jp; arc=none smtp.client-ip=193.136.128.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tecnico.ulisboa.pt Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tecnico.ulisboa.pt Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tecnico.ulisboa.pt header.i=@tecnico.ulisboa.pt header.b="hDCTM9jp" Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.tecnico.ulisboa.pt (Postfix) with ESMTP id 0AC3560020C2; Thu, 14 May 2026 15:47:31 +0100 (WEST) X-Virus-Scanned: by amavis-2.13.0 (20230106) (Debian) at tecnico.ulisboa.pt Received: from smtp1.tecnico.ulisboa.pt ([127.0.0.1]) by localhost (smtp1.tecnico.ulisboa.pt [127.0.0.1]) (amavis, port 10025) with LMTP id ZK7wsflRmjsw; Thu, 14 May 2026 15:47:29 +0100 (WEST) Received: from mail1.tecnico.ulisboa.pt (mail1.ist.utl.pt [IPv6:2001:690:2100:1::b3dd:b9ac]) by smtp1.tecnico.ulisboa.pt (Postfix) with ESMTPS id 11DBE600022B; Thu, 14 May 2026 15:47:29 +0100 (WEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tecnico.ulisboa.pt; s=mail2; t=1778770049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gIIHohhxfreSLoAD8V86VP5969wDk4fLYdaYpGL5+hE=; b=hDCTM9jpfH6mxlb0r21LnH72Q705EDZh1yiX+WmPT/akRA2rAmHe8h3+11srOT7UDQLw4p jZkZduEWEsyOVixPaFIr+mfSKNrViyeNowmGmAvuFS6UnX2YOBCfaSiPnubmLCBT78zep8 zAGA1EWT2fMxGUm/OITeVHw7KV0cRHkZC0Cex0yzgRsVj2wgLmi+/wKFE9kNV1wJDDKww4 VsMs6GDwov4q+6z66Dtl7eKcphYA6E5mLr/GpIvBvQvhidqRfTJMiSCovROH6NZxPg7y6M /5X3J+UCi9skguR9NdxwGuIZkAXFwv6q9VtTvpsza09N/fOZbQF4Nv62vTIztg== Received: from [192.168.1.94] (2a02-842a-00d7-bd01-2527-ff0d-f555-b6e4.rev.sfr.net [IPv6:2a02:842a:d7:bd01:2527:ff0d:f555:b6e4]) (Authenticated sender: ist187313) by mail1.tecnico.ulisboa.pt (Postfix) with ESMTPSA id 74154360260; Thu, 14 May 2026 15:47:28 +0100 (WEST) From: Diogo Ivo Date: Thu, 14 May 2026 16:47:21 +0200 Subject: [PATCH 3/4] mfd: max77620: override PSCI poweroff handler on Pixel C 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: <20260514-smaug-poweroff-v1-3-30f9a4688966@tecnico.ulisboa.pt> References: <20260514-smaug-poweroff-v1-0-30f9a4688966@tecnico.ulisboa.pt> In-Reply-To: <20260514-smaug-poweroff-v1-0-30f9a4688966@tecnico.ulisboa.pt> To: Mark Rutland , Lorenzo Pieralisi , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Jonathan Hunter Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, Diogo Ivo X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1778770045; l=2174; i=diogo.ivo@tecnico.ulisboa.pt; s=20240529; h=from:subject:message-id; bh=EMOZ9KhOtUkr6GKfd7Yj0yXxYgXnjs2s04jA5kPD/MA=; b=JvvfsRUjLwodi/WBii3lHYcZxJOSU4Bt5SpfGjYqjnt23eP5enKTC44EU9YYmiXQ3+cP6SCwW e0UixKEGxEeDwXgdYZ1b+ophNehQuOJyU4OLrcNEAeLlS9bhbrjzBa6 X-Developer-Key: i=diogo.ivo@tecnico.ulisboa.pt; a=ed25519; pk=BRGXhMh1q5KDlZ9y2B8SodFFY8FGupal+NMtJPwRpUQ= On Pixel C, shutdown must be handled by the MAX77620 PMIC rather than the PSCI SYSTEM_OFF call, whose firmware implementation is: __dead2 void tegra_system_off(void) { ERROR("Tegra System Off: operation not handled.\n"); panic(); } Raise the MAX77620 sys-off handler priority above SYS_OFF_PRIO_FIRMWARE on Pixel C systems so it takes precedence over the PSCI poweroff handler. Other systems continue to use the default sys-off priority. Signed-off-by: Diogo Ivo --- drivers/mfd/max77620.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c index c4f89a9681f3..3b1f3a2f3566 100644 --- a/drivers/mfd/max77620.c +++ b/drivers/mfd/max77620.c @@ -494,6 +494,18 @@ static int max77620_pm_power_off(struct sys_off_data *= data) return NOTIFY_DONE; } =20 +static int max77620_power_off_priority(void) +{ + /* + * For Smaug we need to override the PSCI poweroff handler + * which is registered at priority SYS_OFF_PRIO_FIRMWARE. + */ + if (of_machine_is_compatible("google,smaug")) + return SYS_OFF_PRIO_FIRMWARE + 1; + + return SYS_OFF_PRIO_DEFAULT; +} + static int max77620_probe(struct i2c_client *client) { const struct i2c_device_id *id =3D i2c_client_get_device_id(client); @@ -502,6 +514,7 @@ static int max77620_probe(struct i2c_client *client) struct regmap_irq_chip *chip_desc; const struct mfd_cell *mfd_cells; int n_mfd_cells; + int priority; int ret; =20 chip =3D devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); @@ -574,10 +587,11 @@ static int max77620_probe(struct i2c_client *client) } =20 if (of_device_is_system_power_controller(client->dev.of_node)) { + priority =3D max77620_power_off_priority(); ret =3D devm_register_sys_off_handler(&client->dev, SYS_OFF_MODE_POWER_OFF, - SYS_OFF_PRIO_DEFAULT, - max77620_pm_power_off, chip); + priority, max77620_pm_power_off, + chip); if (ret) return dev_err_probe(&client->dev, ret, "failed to register power-off handler\n"); --=20 2.54.0 From nobody Fri Jun 12 14:07:47 2026 Received: from smtp1.tecnico.ulisboa.pt (smtp1.tecnico.ulisboa.pt [193.136.128.21]) (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 17A554219FF; Thu, 14 May 2026 14:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.136.128.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778770534; cv=none; b=EwVUMlghU3zUdNx38wNe8X+PalfUXlI+108IbO1iTWunFBrkGrj/XcS9zO0MWU4hjfjp1NA43ltQuqXKW1m57rxrDpzzZ7G+bhE1eEmYpJ/iHevKBgMlMlFgJfNzLkje4PvfHhk9H6pROu/7ydYNvD08n322UCX216rBQfViOxw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778770534; c=relaxed/simple; bh=8xZjmEb0d95N1+sb8980A/vPSc/pHkMH8Oys2etbVAM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b+0TstC87YVoUMmxhXxWCQEX2Jqp0aEioh4D7qNIKZrBloBJlx103x5c+3+Om12UucCytjHxbUVRZ3dgW5D++8gSx4XiAf0r+5XKykMFumhME4N2mhXhvDVSWBpM5/5IPbKX2cX34x/MO5kLAqVbF6OEnplTOz+eM8f0ePUtRhA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tecnico.ulisboa.pt; spf=pass smtp.mailfrom=tecnico.ulisboa.pt; dkim=pass (2048-bit key) header.d=tecnico.ulisboa.pt header.i=@tecnico.ulisboa.pt header.b=efsLmlWd; arc=none smtp.client-ip=193.136.128.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tecnico.ulisboa.pt Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tecnico.ulisboa.pt Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tecnico.ulisboa.pt header.i=@tecnico.ulisboa.pt header.b="efsLmlWd" Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.tecnico.ulisboa.pt (Postfix) with ESMTP id AF71760020C9; Thu, 14 May 2026 15:47:31 +0100 (WEST) X-Virus-Scanned: by amavis-2.13.0 (20230106) (Debian) at tecnico.ulisboa.pt Received: from smtp1.tecnico.ulisboa.pt ([127.0.0.1]) by localhost (smtp1.tecnico.ulisboa.pt [127.0.0.1]) (amavis, port 10025) with LMTP id OinNfQWH81a8; Thu, 14 May 2026 15:47:29 +0100 (WEST) Received: from mail1.tecnico.ulisboa.pt (mail1.ist.utl.pt [IPv6:2001:690:2100:1::b3dd:b9ac]) by smtp1.tecnico.ulisboa.pt (Postfix) with ESMTPS id A955060020D6; Thu, 14 May 2026 15:47:29 +0100 (WEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tecnico.ulisboa.pt; s=mail2; t=1778770049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zcd1JbPtrEgwdOAeh0HthnUl2Zq4Rk56InIYU9qFrKI=; b=efsLmlWdYYNiU5dA0Dot0WXBUlxQX7fnGCJX1BPRVzeCxzDCPaal+fsDSvYvjyuq8DTU2I iGciiVW/QoqWxmBIIjMujMUemOWvs6xnKrRaBe1wIn+U1LvaSuG2pzcc26ozW8tTIchpVP F4zaFcGR6NBGYEeBthuy+uJblWiVzJ5OKendEPZUS5p73YUkQHPo2iDdJtKNBX/Kk14Du3 ql62isxTd0a6jMrLpG4vi77nTIUTcI9AU7UQjpINp8cqFKejJ+uyztiF6N3zeoLq3iTDpO GY2Qkd0deq81AjpmivAQRP35pUDR4B4AyfcbBh+0m2W9BDhC2V4xz1OpqNjnig== Received: from [192.168.1.94] (2a02-842a-00d7-bd01-2527-ff0d-f555-b6e4.rev.sfr.net [IPv6:2a02:842a:d7:bd01:2527:ff0d:f555:b6e4]) (Authenticated sender: ist187313) by mail1.tecnico.ulisboa.pt (Postfix) with ESMTPSA id 16B61360249; Thu, 14 May 2026 15:47:29 +0100 (WEST) From: Diogo Ivo Date: Thu, 14 May 2026 16:47:22 +0200 Subject: [PATCH 4/4] arm64: tegra: smaug: mark MAX77620 as system power controller 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: <20260514-smaug-poweroff-v1-4-30f9a4688966@tecnico.ulisboa.pt> References: <20260514-smaug-poweroff-v1-0-30f9a4688966@tecnico.ulisboa.pt> In-Reply-To: <20260514-smaug-poweroff-v1-0-30f9a4688966@tecnico.ulisboa.pt> To: Mark Rutland , Lorenzo Pieralisi , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Jonathan Hunter Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, Diogo Ivo X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1778770045; l=857; i=diogo.ivo@tecnico.ulisboa.pt; s=20240529; h=from:subject:message-id; bh=8xZjmEb0d95N1+sb8980A/vPSc/pHkMH8Oys2etbVAM=; b=fAg7sGCuUVA0iqnWf++Tln0G9BLmwunVozYRTTAPsp51y1pPfrbVXJeU21dWwC8wa8i8qLzU1 RSAjLik/GjCBtFgrjC/UcDxwZVxEQlg6mU1osM6V+Jtt3GBIBV27s9a X-Developer-Key: i=diogo.ivo@tecnico.ulisboa.pt; a=ed25519; pk=BRGXhMh1q5KDlZ9y2B8SodFFY8FGupal+NMtJPwRpUQ= Register the MAX77620 PMIC as the system power controller on Pixel C so the driver can install its sys-off handler. This allows the PMIC poweroff sequence to override the non-working PSCI SYSTEM_OFF implementation on this platform. Signed-off-by: Diogo Ivo --- arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boo= t/dts/nvidia/tegra210-smaug.dts index f0b8c2c80aa5..1791b47f0a73 100644 --- a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts @@ -1467,6 +1467,8 @@ pmic: pmic@3c { gpio-controller; #gpio-cells =3D <2>; =20 + system-power-controller; + pinctrl-names =3D "default"; pinctrl-0 =3D <&max77620_default>; =20 --=20 2.54.0