Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: do not resume device in thaw for normal hibernation

For normal hibernation, GPU do not need to be resumed in thaw since it is
not involved in writing the hibernation image. Skip resume in this case
can reduce the hibernation time.

On VM with 8 * 192GB VRAM dGPUs, 98% VRAM usage and 1.7TB system memory,
this can save 50 minutes.

Signed-off-by: Samuel Zhang <guoqing.zhang@amd.com>
Tested-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Link: https://lore.kernel.org/r/20250710062313.3226149-6-guoqing.zhang@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

authored by

Samuel Zhang and committed by
Mario Limonciello
530694f5 c2aaddbd

+17
+17
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 2541 2541 if (amdgpu_ras_intr_triggered()) 2542 2542 return; 2543 2543 2544 + /* device maybe not resumed here, return immediately in this case */ 2545 + if (adev->in_s4 && adev->in_suspend) 2546 + return; 2547 + 2544 2548 /* if we are running in a VM, make sure the device 2545 2549 * torn down properly on reboot/shutdown. 2546 2550 * unfortunately we can't detect certain ··· 2560 2556 { 2561 2557 struct drm_device *drm_dev = dev_get_drvdata(dev); 2562 2558 struct amdgpu_device *adev = drm_to_adev(drm_dev); 2559 + 2560 + /* device maybe not resumed here, return immediately in this case */ 2561 + if (adev->in_s4 && adev->in_suspend) 2562 + return 0; 2563 2563 2564 2564 /* Return a positive number here so 2565 2565 * DPM_FLAG_SMART_SUSPEND works properly ··· 2664 2656 { 2665 2657 struct drm_device *drm_dev = dev_get_drvdata(dev); 2666 2658 2659 + /* do not resume device if it's normal hibernation */ 2660 + if (!pm_hibernate_is_recovering()) 2661 + return 0; 2662 + 2667 2663 return amdgpu_device_resume(drm_dev, true); 2668 2664 } 2669 2665 2670 2666 static int amdgpu_pmops_poweroff(struct device *dev) 2671 2667 { 2672 2668 struct drm_device *drm_dev = dev_get_drvdata(dev); 2669 + struct amdgpu_device *adev = drm_to_adev(drm_dev); 2670 + 2671 + /* device maybe not resumed here, return immediately in this case */ 2672 + if (adev->in_s4 && adev->in_suspend) 2673 + return 0; 2673 2674 2674 2675 return amdgpu_device_suspend(drm_dev, true); 2675 2676 }