From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EBA9CCAC5AE for ; Wed, 24 Sep 2025 20:52:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9267C10E7EC; Wed, 24 Sep 2025 20:52:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="GQUxsUrr"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D83E10E7EA for ; Wed, 24 Sep 2025 20:52:22 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id EAD3D44F28; Wed, 24 Sep 2025 20:52:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26627C4CEF4; Wed, 24 Sep 2025 20:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758747141; bh=zgIesB5VznBypz3VkissfWZh/qWJnK9VZ6cGxonMczo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GQUxsUrrkU0H8zKKfk1JwOQHiDQWqxdAO3JYu//TMICRitobcgj5bxDJp4Lp6/Cqv jyUg6mF/1O2jaTSg4mp4kzHjItkiOvrqrOO1kX/P+vq/enihrkkh/Rro+WFev3uHmc 8MrbWdxs5RmZxp+6dVzSVoVHCzpwYfW2eBYAxdWdXQAUBUkrrJr8QtBKWI5dWnLfb3 q1wxB9jEHCiKpsTSlQ0bu4hfh27P2RZ1jf18EcjAHhDRQsU/Ty/YucbUNzlkrb1oGY 12jqhPg1uJ0YgOws/S+hxm41RuqCCjBP0t3fBDnN/GsbJ8h5Ptl2INZuqeLoSbFkFk dOrqxB4D+wHcQ== From: "Mario Limonciello (AMD)" To: Alex Deucher , "Rafael J . Wysocki" Cc: Samuel Zhang , amd-gfx@lists.freedesktop.org (open list:RADEON and AMDGPU DRM DRIVERS), linux-pm@vger.kernel.org (open list:HIBERNATION (aka Software Suspend, aka swsusp)), Mario Limonciello , Ionut Nechita Subject: [PATCH 3/3] drm/amd: Fix hybrid sleep Date: Wed, 24 Sep 2025 15:52:11 -0500 Message-ID: <20250924205211.1059571-4-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250924205211.1059571-1-superm1@kernel.org> References: <20250924205211.1059571-1-superm1@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" [Why] commit 530694f54dd5e ("drm/amdgpu: do not resume device in thaw for normal hibernation") optimized the flow for systems that are going into S4 where the power would be turned off. Basically the thaw() callback wouldn't resume the device if the hibernation image was successfully created since the system would be powered off. This however isn't the correct flow for a system entering into s0i3 after the hibernation image is created. Some of the amdgpu callbacks have different behavior depending upon the intended state of the suspend. [How] Use pm_hibernation_mode_is_suspend() as an input to decide whether to run resume during thaw() callback. Reported-by: Ionut Nechita Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4573 Tested-by: Ionut Nechita Fixes: 530694f54dd5e ("drm/amdgpu: do not resume device in thaw for normal hibernation") Signed-off-by: Mario Limonciello (AMD) --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 395c6be901ce..dcea66aadfa3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2665,7 +2665,7 @@ static int amdgpu_pmops_thaw(struct device *dev) struct drm_device *drm_dev = dev_get_drvdata(dev); /* do not resume device if it's normal hibernation */ - if (!pm_hibernate_is_recovering()) + if (!pm_hibernate_is_recovering() && !pm_hibernation_mode_is_suspend()) return 0; return amdgpu_device_resume(drm_dev, true); -- 2.51.0