From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11011012.outbound.protection.outlook.com [52.101.62.12]) (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 CF8B247CA88 for ; Wed, 29 Jul 2026 12:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.12 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785327967; cv=fail; b=rDi1AEk6KIlOdG9+zvMgSxLv0+fBiE6t/FRDcyO2bZvutWg+1ENrvkBAj+PZ/05Prst4/SIcbcR7Qe4XTrStfZb1Ww22LRwgIrgymbJzi97rdCC/6xFGPi3XfschEh14fPpnDitfvgEYvbH475oKPIy1AgweeK0d7zGU0+8hAcw= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785327967; c=relaxed/simple; bh=5dZxA/cUiMBKrU7EAphDyoyWijhjFnJkBBVHw78Mi7Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=phs5QWNhHl6l+eCBlTcqSo57ZidEncriMvh8bdmVHlfp0eIur6PS2XlfiWXgZnBf7fgAbN3eTDicQCUm4En6ZPQGhNtrkr9jdUw1lUgpUEV2eWOOzS8oV5Q5ivzqJbKv8HxTEth4rRFsvl8YdvszY6u331dDfwlqE5LsF+6PFo4= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=M9fb8vm2; arc=fail smtp.client-ip=52.101.62.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="M9fb8vm2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=j66Fe55CSq/0gvSHpYAoflXr926hLnXhCb3j/ac8dvxTDxiccbiH7YOX4FB7Tiab23i0Qy04Ae0zcJ4cSpfWqBNvQsd+/7fEyhfTyHm+uIL0DhY8Vbqfn/BmrXiRpk3P/H2GNsmnpNB13wMZJyOCRfOM4Ff0nigr0VuSxscWD95K+JJHuYhKUnqWRhNoQpWLGSDyXypWols+OUj4Sz78FZhXqOGObYON1T/ny46LOBSB8RzZ6iaugZo6SiYAYqcaedz9akbDHXSRPUO/xTzW/ugZNGGX89JOOtm3TIxuwIPuWFLOrlbn0AYxn3ZqCF8iAnbmk1TQcspbQdXOv5myWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/Z0rGNYfLyn2UM9LMjxnaekW8bXeIQca03QduKS1Svk=; b=HbP4b3Wvkl+O4jf2LNSl8MgcIiZfMs3bPR+HVSTHjubwurV7RdjCnpXthvbsIO6EtkKCvxE4weRV9NuanZYMcG0qc58U+5s4ELXHxHm4cIUG+tGbG9h3GpxCPnuIwcdlu3RfYOcPvfnJinlu4MYAzF4NgTaG4GPFxVJoO9JmMErR3QBW9Emnp54p1JGop7PIe2Gn+3r5NZY2Ns33T3tMMbK7fqB2tgQfVUqv04q/GRYVxk41Jc+28FmG5n9Bzn5/7IeuFdQTDo0PUk+htLYAnzfL2aenVf6ydNNcBjT/+guEmd78pZdxoshHBe5hI3JZxSv349To86AXh1TfN2MifA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/Z0rGNYfLyn2UM9LMjxnaekW8bXeIQca03QduKS1Svk=; b=M9fb8vm2TKf4jo7nFgm4xR7iiA6c4EJRD1gLuQ8UMUCUXTnoHB8WjuW6LJRTwRICA9EOSQUpUfknHvOZTUCtDRMRFJo60Ss0qk46df2OgrUVtuaWB+m/z6zU2crFjeyiZUGm0HVXIoOi5aN6SFscZJIl3T6+HEmcf8IxbqCB7IA= Received: from BN9PR03CA0740.namprd03.prod.outlook.com (2603:10b6:408:110::25) by SA3PR12MB7902.namprd12.prod.outlook.com (2603:10b6:806:305::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul 2026 12:26:01 +0000 Received: from BN1PEPF0000468E.namprd05.prod.outlook.com (2603:10b6:408:110:cafe::2c) by BN9PR03CA0740.outlook.office365.com (2603:10b6:408:110::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Wed, 29 Jul 2026 12:26:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BN1PEPF0000468E.mail.protection.outlook.com (10.167.243.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.5 via Frontend Transport; Wed, 29 Jul 2026 12:26:01 +0000 Received: from xsjarunbala50.xilinx.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 29 Jul 2026 07:25:57 -0500 From: Jay Buddhabhatti To: , CC: , , Jay Buddhabhatti Subject: [PATCH v4 0/3] firmware: xilinx: Clean up firmware and EL3 state on kexec Date: Wed, 29 Jul 2026 05:25:19 -0700 Message-ID: <20260729122522.3732875-1-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260724101948.2895263-1-jay.buddhabhatti@amd.com> References: <20260724101948.2895263-1-jay.buddhabhatti@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF0000468E:EE_|SA3PR12MB7902:EE_ X-MS-Office365-Filtering-Correlation-Id: b00a4bd9-9f78-4e3d-ed7b-08deed6c8d30 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|23010399003|376014|82310400026|1800799024|6133799003|10067099003|56012099006|11063799006|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: wA8fpYXZdR0ujVQ2N37Gt0eQU3u8SckNHzcq7Ym0jk7YyDpuyU22wrrZFku0DiBvehW5vfZCRqGMPdBN8M0BGVqQAaK173j0/nzmn1hNOOuFJrBIMj23Yq+gWwzTHgCT+vopPpA/wvjBiD8pX+r5A0hS+43hNBuR+hHgHNTM+KY61ZBwwIUVNvdvjy3PSx1F/YOim0yhWtGB2wDEOxHSDTX3MV8tuVbOPRuqeMo7uhITU89hrJbNb3B7bQlXcSeLfsMmbvltdk6XjyNCvmDDPg6MArMNRh6d01o26lmCgkX/pPnW8spGyB9ZL+F+6tJJeVD2/RdSDFeE+2AwOARP+eNfwaFne/JStad2o8R5pMidd+O+1N+ll9J+FyYjGDYSIWWQVh9DtYNe3UyFldEOXILZjc2SOn2+OCSCNdWaiY7vJHWvqiUUF1dhsiY9i8W6FOfhq9Dvo5RgeAbrwaux3Bs2rAcXPb7fNmBll1a7JajpQBW/IBAsGtHGQOBwbQXGJ0WrrWj8hGwDcDf6PpTM5UmFmUmL5u/OouCI2Z8j8f82f3dnlV62HnYZ5SNqdgAS0+K+n/VCbD+LiQJlhcjUbpNq+9ED+8E6WIClOkckuNuTwdvdVWTLTdyQc+rLH3y2HsW8c28NdCWjv1Qi2z84RR71Rc0IpSqI3l/0L+jbcpUgwvLVJ3UqDuep31OCpjV289GqS9kKF5BOysOL2TRcVA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(376014)(82310400026)(1800799024)(6133799003)(10067099003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5g3ZZa0iwVahaXUwBl1LSZBMDJwgQ8cYFvJIjrorRjF0Z5EdUajCGXy+kTAxfE8Y1XBgf2nHyHRE76+HG7I5skjVa2EUzP6VJC9lgrTq3KylFjfdIgPhuuhxUFthvLOKmBiM5eFGgvWo2gKond4Z3NcCVxlUjxivF16r1ZGXGjiw2sgtPLPiYhmEkn9HrW/nY9fE/cntW6oTIDBipIUKR80ib2Ezk66ERH3zijlnvJ6j5+b32DuE0ZKC2JymDHzSxTwaokFVATBPFr137dBJWK+SbAuvjrWU5+fscHhSuqGlrDsvmK2bIF4wNrSunjr4ER/6AuQdoH1eoh4AfXUJJPPNgE9XO6YDCnBLpfD3Ztbw3u7hSx342C/h7j278zcnLEFV8fluBSyJ2ylcj8uvoQWUJZrmZPGFuO1C/cMMt9bZjVY9oqo4emBXQvWjC+Ks X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 12:26:01.3818 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b00a4bd9-9f78-4e3d-ed7b-08deed6c8d30 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF0000468E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7902 During a kexec restart, only the kernel is reloaded while the state held in EL3 and platform firmware persists. This leaves the freshly booted kernel out of sync with secure firmware for things like the SGI number, shutdown scope, allocated peripheral devices and registered notifier callbacks, which can lead to unexpected behaviour after a kexec. Introduce a mechanism to clear the stale EL3 and platform firmware state so the reloaded kernel starts from a clean baseline: - Add TF_A_CLEAR_PM_STATE to clear EL3 PM subsystem state. - Add PM_DEV_ALL_PERIPH to release all peripheral devices in one call. - Add PM_ALL_NOTIFIERS to unregister all notifier callbacks in one call. On a graceful kexec reboot the cleanup is performed from zynqmp_firmware_shutdown(); on a crash (kdump) restart it is performed from zynqmp_firmware_probe() of the reloaded kernel. Each cleanup step is guarded by a feature check so it degrades gracefully on firmware versions that do not implement the new APIs. Changes in v4: - Modified platform check to restrict kexec cleanup to Versal and Versal Net platforms only - Used EL3 firmware instead of TF-A in descriptions and comments Changes in v3: - Corrected subject prefix Changes in v2: - Drop patch 4/4 (feature check improvements) from this series per review feedback. Those changes are sent separately as: "[PATCH 1/2] firmware: xilinx: Use TF-A feature check for TF-A-specific APIs" and "[PATCH 2/2] firmware: xilinx: Propagate actual error from feature check" Jay Buddhabhatti (3): firmware: xilinx: Add support to clear EL3 PM state firmware: xilinx: Release all peripheral devices from firmware firmware: xilinx: Clear firmware notifiers across kexec transitions drivers/firmware/xilinx/zynqmp.c | 86 +++++++++++++++++++++++++++- include/linux/firmware/xlnx-zynqmp.h | 10 +++- 2 files changed, 94 insertions(+), 2 deletions(-) -- 2.34.1