diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index afdef545fbed39df0936a8a166cb3ea44aa66ae3..b78125207b677b7358b914b6f7ad3769e7e11372 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c @@ -102,6 +102,12 @@ static int smu_hw_init(void *handle) return ret; } + ret = smu_check_fw_status(smu); + if (ret) { + pr_err("SMC firmware status is not correct\n"); + return ret; + } + mutex_lock(&smu->mutex); /* TODO */ diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h index ab1deb52932c5a465ec91721119d497620b6a10d..923a923d0050847c55d59b220959f6d2fd2174fe 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h @@ -36,12 +36,15 @@ struct smu_funcs { int (*init_microcode)(struct smu_context *smu); int (*load_microcode)(struct smu_context *smu); + int (*check_fw_status)(struct smu_context *smu); }; #define smu_init_microcode(smu) \ ((smu)->funcs->init_microcode ? (smu)->funcs->init_microcode((smu)) : 0) #define smu_load_microcode(smu) \ ((smu)->funcs->load_microcode ? (smu)->funcs->load_microcode((smu)) : 0) +#define smu_check_fw_status(smu) \ + ((smu)->funcs->check_fw_status ? (smu)->funcs->check_fw_status((smu)) : 0) extern const struct amd_ip_funcs smu_ip_funcs; diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index c50c8cb233b03e18429bba7f98e30ff1a9eae29d..a4fdc54ea5e26da0d86bc4502545b202aa9a2db5 100644 --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c @@ -24,6 +24,7 @@ #include #include "amdgpu.h" #include "amdgpu_smu.h" +#include "smu_v11_0.h" static int smu_v11_0_init_microcode(struct smu_context *smu) { @@ -37,9 +38,15 @@ static int smu_v11_0_load_microcode(struct smu_context *smu) return 0; } +static int smu_v11_0_check_fw_status(struct smu_context *smu) +{ + return 0; +} + static const struct smu_funcs smu_v11_0_funcs = { .init_microcode = smu_v11_0_init_microcode, .load_microcode = smu_v11_0_load_microcode, + .check_fw_status = smu_v11_0_check_fw_status, }; void smu_v11_0_set_smu_funcs(struct smu_context *smu)