drm/amd/pm: Notify node unload during driver unload
Subsystems (3)
PATCH 1/1 drm/amd/pm: Notify node unload during driver unload
Notify node unload on smu_v15_0_8 during driver unload
Signed-off-by Asad Kamal <[email protected]>
Reviewed-by Lijo Lazar <[email protected]>
--- .../pm/swsmu/inc/pmfw_if/smu_v15_0_8_ppsmc.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h | 1 + .../drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c | 60 +++++++++++++++++++ .../drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.h | 2 + drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 26 ++++++++ drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 2 + 7 files changed, 95 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v15_0_8_ppsmc.h +2 -1
@@ -85,7 +85,8 @@#define PPSMC_MSG_SetSoftMaxFclk 0x34/* NPM limit setter; NPM reads are served from the SystemMetricsTable. */ #define PPSMC_MSG_SetNpmLimit 0x40 -#define PPSMC_Message_Count 0x41 +#define PPSMC_MSG_PrepareNodeForUnload 0x41 +#define PPSMC_Message_Count 0x42/* PSMC Reset Types for driver msg argument */ #define PPSMC_RESET_TYPE_DRIVER_MODE_1_RESET 0x1
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +2 -1
@@ -306,7 +306,8 @@__SMU_DUMMY_MAP (SetSoftMaxGl2clk), \__SMU_DUMMY_MAP (SetSoftMinGl2clk), \__SMU_DUMMY_MAP (GetSystemMetricsVersion), \ -__SMU_DUMMY_MAP (SetNpmLimit), +__SMU_DUMMY_MAP (SetNpmLimit), \ +__SMU_DUMMY_MAP (PrepareNodeForUnload), #undef __SMU_DUMMY_MAP#define __SMU_DUMMY_MAP (type) SMU_MSG_##type
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h +1 -0
@@ -89,6 +89,7 @@ struct smu_15_0_dpm_context {uint32_t workload_policy_mask;uint32_t dcef_min_ds_clk;uint64_t caps; +bool node_unload;uint32_t board_volt; };
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c +60 -0
95 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.h +2 -0
@@ -33,6 +33,8 @@#define SMU_15_0_8_MAX_MID 2#define SMU_15_0_8_MAX_HBM_STACKS 12#define SMU_15_0_8_CAP_NPM 1 +#define SMU_15_0_8_CAP_NODE_UNLOAD 2 +#define SMU_15_0_8_NODE_UNLOAD_MIN_FW_VERSION 0x027d0c00u/* 2.125.12.0 */ extern void smu_v15_0_8_set_ppt_funcs (struct smu_context *smu); typedef struct {
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +26 -0
@@ -27,6 +27,32 @@#include "smu_cmn.h" #include "soc15_common.h" +#include "amdgpu_xgmi.h" + +struct smu_context *smu_get_primary_dev (struct smu_context *smu) +{ +struct amdgpu_device *adev = smu->adev; +struct amdgpu_hive_info *hive; +struct amdgpu_device *peer; + +if (adev->gmc.xgmi.physical_node_id ==0 ) +return smu; + + hive =amdgpu_get_xgmi_hive (adev); +if (!hive) +return NULL ; + +list_for_each_entry (peer, &hive->device_list, gmc.xgmi.head) { +if (peer->gmc.xgmi.physical_node_id ==0 ) { +amdgpu_put_xgmi_hive (hive); +return peer->powerplay.pp_handle; + } + } + +amdgpu_put_xgmi_hive (hive); +return NULL ; +} +/* * DO NOT use these for err/warn/info/debug messages. * Use dev_err, dev_warn, dev_info and dev_dbg instead.
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +2 -0
@@ -249,6 +249,8 @@ int smu_cmn_dpm_pcie_gen_idx(int gen);int smu_cmn_dpm_pcie_width_idx (int width);int smu_cmn_check_fw_version (struct smu_context *smu); +struct smu_context *smu_get_primary_dev (struct smu_context *smu); +int smu_cmn_get_pptable_from_firmware (struct smu_context *smu,void **table,uint32_t *size,uint32_t pptable_id);
Signature · 1 line
2.46.0