From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 45F1213D891 for ; Wed, 24 Sep 2025 20:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758747142; cv=none; b=Nad/f6bx28qoUYw7p9HN6QgSi0Ftk3j7cxS+902M79tPIxD1qt1QrXbLBew6U1M9oMVm+GaBr0r0by3PTmGQFHiACt6Vd5EbKUn9EYbmFoQyt2FpMfhWv01fmfmohqkPsdPQbWAUr3hSY7cFLd7iLTttSsfk+wtYaNnAH+PaD3s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758747142; c=relaxed/simple; bh=zgIesB5VznBypz3VkissfWZh/qWJnK9VZ6cGxonMczo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gnCcpNqaGEYqggi16edZTUBaaHy5hTgpR8vGFaUVFXhIwoathgX7wHLfMQY18pmsPQV0eEMvwUX3YnL4IDx+Ts+Uc8sDAvZ74XOa+lkdjT6EJHkkcs3iCfwLPZqdYe/8AoB7J+M/xPc6ruAZWodgnsFBONRv6hqd/CgfmO2aHEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GQUxsUrr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GQUxsUrr" 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> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit [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