From 4e99b08b5bd38d4e29c346e0873590f0c16ecb10 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 11 Jul 2018 14:08:55 -0500 Subject: [PATCH 4/4] drm/amdgpu/pp/smu7: pin/kmap smu buffers in start_smu Move the allocation into start_smu so we have a valid buffer after resume from suspend. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105760 Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c index e192c90eaa57..147fdddd07df 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c @@ -387,6 +387,10 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr) return 0; } + result = smu7_alloc_buffers(hwmgr); + if (result) + return result; + if (smu_data->soft_regs_start) cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, smu_data->soft_regs_start + smum_get_offsetof(hwmgr, @@ -622,7 +626,6 @@ void smu7_free_buffers(struct pp_hwmgr *hwmgr) int smu7_init(struct pp_hwmgr *hwmgr) { struct smu7_smumgr *smu_data; - int r; /* Allocate memory for backend private data */ smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend); @@ -636,9 +639,7 @@ int smu7_init(struct pp_hwmgr *hwmgr) hwmgr->avfs_supported = true; } - r = smu7_alloc_buffers(hwmgr); - - return r; + return 0; } -- 2.13.6