Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCB70606A320 for ; Tue, 1 Dec 2026 14:15:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=jlQPHCT1 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 615FF10F943; Tue, 1 Dec 2026 14:15:54 +0000 (UTC) Received: from SN4PR0501CU005.outbound.protection.outlook.com (mail-southcentralusazon11011048.outbound.protection.outlook.com [40.93.194.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 28FFA10F948 for ; Tue, 1 Dec 2026 14:15:48 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aX3YHq22mm+LfgSBQLlL50/j6tP4hXqmJuNhhAx7MAfBhTQK/hTJXqUt1GcE4CUdQ670m2P297uGGaf59AK5apVmYpCDvhT4umi5KvKrnyAIaAuYr0XyyFLGLxKIHLqGkbeoYzQE5rVKk7V5P0qpSjqhW9I7G/W2FUYFWJaTzv+fLzNixRhKDqbGwd1cRv7ne4iGAEmfFg+QW0mlvie/uqldD/mdqH83+5lxpyy2T4yANKXkZXmHxb6NuF7WWcjT6Bz9vY6LZ9CE7U0piKoYsL5O41JROSDBih3VDwqELErg1Ur0hkrkYgRww8JcRzgVpR386bh97or4MigHr8cf8A== 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=hhDLBftlIRfWZqv5/cAggyK0w2L2X5uDUJ3Y2QaYKGQ=; b=SnsOG2X/gPN61b0ll8LZXptM54uguEW7p5KnF8G4/EJytxfrW300pbkUqxXwdDNOnAJ354i3bJiup+xeM85+Ibk4BeJWJY8b2MdPUkI8loOgC9R/l1nkIDi/RVcXz1D7iqbMfSWdpN1gYYMYoMg3cwWvZW+7HQwy/h9/vUWU/bIHWIfsf7zxgoSORLjQszwJSeoOnzAQIk1QDZlchiYFN+PwJi1dBzWA7abK9aaqsEbCyOhMQx9y2RMBFmOcxUBmaRp8hC55D2k5UdkBXJVEFghlebl87yvWuLF9t5iKv1llX6Ug3DhWRDYkGd8KNOV3NN/bgpo4C0sONG8MBmxnug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.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=hhDLBftlIRfWZqv5/cAggyK0w2L2X5uDUJ3Y2QaYKGQ=; b=jlQPHCT1BJONuvi0xNugKdioc6c+iqaO7v95qFr0TSx3o6cJnKkIzeFuhtPRfwRG4EVD5HdgwxwhEeNeA6yWp6/dTHP7iezsjEoCv/6Hjuwxkq329Pw7tXJzCLq9bt/8Qwh23jsrntC4+Jt/RODP1npv7lvvBqGl+WqFTzO65Pc= Received: from DS0PR17CA0015.namprd17.prod.outlook.com (2603:10b6:8:191::23) by CH3PR12MB9077.namprd12.prod.outlook.com (2603:10b6:610:1a2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Tue, 1 Dec 2026 14:15:14 +0000 Received: from DS2PEPF00006E22.namprd05.prod.outlook.com (2603:10b6:8:191:cafe::84) by DS0PR17CA0015.outlook.office365.com (2603:10b6:8:191::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Tue, 1 Dec 2026 14:15:14 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; 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 DS2PEPF00006E22.mail.protection.outlook.com (10.167.23.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 14:15:13 +0000 Received: from jz-tester2.amd.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.57; Tue, 1 Dec 2026 08:15:12 -0600 From: James Zhu To: CC: , , , , , Subject: [PATCH 1/3] drm/amdgpu: clear in_runpm when runtime suspend fails in prepare Date: Tue, 1 Dec 2026 09:14:58 -0500 Message-ID: <20261201141500.3346608-1-James.Zhu@amd.com> X-Mailer: git-send-email 2.56.1 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00006E22:EE_|CH3PR12MB9077:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b1984cd-24f7-449f-8220-08df4fb583f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700016|23010399003|1800799024|82310400026|376014|18002099003|10067099003|56012099006|260925021311599003|260925021911599003|260925022911599003|261026140227099003|261026121527099003|261028144727099003|261022075727099003|261021123027099003|261022105027099003|261021121427099003|261102123227099003|261009223027099003|11063799006; X-Microsoft-Antispam-Message-Info: rx4jznAHoV63P3rGlihPLMpmQBWIJssOe3D0zmfzkTdXRw5qlTYvMZ3kjV57AP4xZqLORmegIOoEcpYwjVRqCkV22u1ys0G92bZqGQ4EO+ON1p3BKQfqvRMoJ4/QIVCWrVJ61Ktkvam17OR7zYVnncdjj2T+SIdxekGgGWo5xWVHmBE3daYGiJhUCxJMGSNHSNyHbKel7z09FSlgVa8T85eCLG3sHS9dnaeiQyQIC4ChEl4cXG97XPf0OGmrJBlvFU7KWwyPVGZMiTgeHSzmtv+EZdh6Y4sVuMtaREqPV6NzH2qI5EOeZLdnNuKFMtyvqVmDEh3q+tQKCOLi8/IWS0lAQKRvXuRLSq9tYQ0JmwMrpxxx4U7BfhGOO23CqxspMym4oZntnW+dz0qBapxEno/9O8K6LkXYsicZyd2U2jjQZJAZlYh8WGDN8o+IZiINkPXkmnSn+aIxHu5zpbACkUT5UyCjR4KMcMA2dnDwbFXdgB+B9Xwa2WB5CJ4B97sfDlArc57H8t0pdOzqIoEp7h4iVsj5uWHIvIyb0E88R3UdQK5MLFycJL6lDaOBjQ9BAE54Aka7Swn60m1MmulOvAtxnufkAvf3itP4UwFOxZs+MsowbaQYoNeP09p+LEw4Zr+TIHneR78+KCRt48IaRlsk9js8oQKuRxdZ76veA0Dv4Z9TLTaFCFYW8XpbEyWyx/406ZxA68hVdU75csocHg== 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)(1800799024)(82310400026)(376014)(18002099003)(10067099003)(56012099006)(260925021311599003)(260925021911599003)(260925022911599003)(261026140227099003)(261026121527099003)(261028144727099003)(261022075727099003)(261021123027099003)(261022105027099003)(261021121427099003)(261102123227099003)(261009223027099003)(11063799006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FT8zuZkx8kRaTY+jBD0H8Ptb9BFLodu+EM6VZALDOxYZqhDVmdWdQxn7gaY+xjoITUhkPUOov7WN0lGJlJvCgxPC0d0Fj4GnZUKr9qiyCw9X+sX+gdyFBEIZlgtQve4BE7ltqvY3HUgc0V3Ykfpvv+HwadJ6ODux8pER8c36MX3Ra3RRnkEmKNuH1d3aQHyJib7ybpVBApZ/BmgPs19IaaTi7O2sxOyJhWVL1NwwNt166nfvQ+PZAgP867eHMITV6GRVV+Sd9gVtLQN57GbK2wt8nEH4pB2U3agu/xiETdNW8GKBT110chzGGpWIuQvZiI3eB6CjHEuy0MYCdtTycnFYI6UMWdKoF0CcM6WwxV/Ihb2JYPClpVr6Dso9wf4zoiplmhRcq5meU+uL098JnfFfzd+QL5QLJdhR0bqg73QLEPBUxy/T68QuT+CfTG5Q X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 14:15:13.0836 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b1984cd-24f7-449f-8220-08df4fb583f5 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: DS2PEPF00006E22.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9077 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "amd-gfx" X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 amdgpu_pmops_runtime_suspend() sets in_runpm and, on BOCO, mp1_state before it calls amdgpu_device_prepare(). When prepare fails it returns without undoing either, unlike the amdgpu_device_suspend() failure just below. The device stays active with in_runpm set, so later checks of in_runpm, including the ones made during system suspend and resume, take the runtime PM path. The next patch relies on in_runpm to tell a system resume from a runtime resume. Handle both failures the same way. Fixes: 5095d5418193 ("drm/amd: Evict resources during PM ops prepare() callback") Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 2a8614269984..7418c8588e18 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2917,9 +2917,8 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev) adev->mp1_state = PP_MP1_STATE_UNLOAD; ret = amdgpu_device_prepare(drm_dev); - if (ret) - return ret; - ret = amdgpu_device_suspend(drm_dev, false); + if (!ret) + ret = amdgpu_device_suspend(drm_dev, false); if (ret) { adev->in_runpm = false; if (adev->pm.rpm_mode == AMDGPU_RUNPM_BOCO) -- 2.56.1