|
81 | 81 | #define EPSILON 1
|
82 | 82 |
|
83 | 83 | #define smnPCIE_ESM_CTRL 0x193D0
|
84 |
| -#define smnPCIE_LC_LINK_WIDTH_CNTL 0x1ab40288 |
| 84 | +#define smnPCIE_LC_LINK_WIDTH_CNTL 0x1a340288 |
85 | 85 | #define PCIE_LC_LINK_WIDTH_CNTL__LC_LINK_WIDTH_RD_MASK 0x00000070L
|
86 | 86 | #define PCIE_LC_LINK_WIDTH_CNTL__LC_LINK_WIDTH_RD__SHIFT 0x4
|
| 87 | +#define MAX_LINK_WIDTH 6 |
87 | 88 |
|
88 | 89 | static const struct cmn2asic_msg_mapping smu_v13_0_6_message_map[SMU_MSG_MAX_COUNT] = {
|
89 | 90 | MSG_MAP(TestMessage, PPSMC_MSG_TestMessage, 0),
|
@@ -1969,6 +1970,7 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
|
1969 | 1970 | struct amdgpu_device *adev = smu->adev;
|
1970 | 1971 | int ret = 0, inst0, xcc0;
|
1971 | 1972 | MetricsTable_t *metrics;
|
| 1973 | + u16 link_width_level; |
1972 | 1974 |
|
1973 | 1975 | inst0 = adev->sdma.instance[0].aid_id;
|
1974 | 1976 | xcc0 = GET_INST(GC, 0);
|
@@ -2019,8 +2021,12 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
|
2019 | 2021 | gpu_metrics->throttle_status = 0;
|
2020 | 2022 |
|
2021 | 2023 | if (!(adev->flags & AMD_IS_APU)) {
|
| 2024 | + link_width_level = smu_v13_0_6_get_current_pcie_link_width_level(smu); |
| 2025 | + if (link_width_level > MAX_LINK_WIDTH) |
| 2026 | + link_width_level = 0; |
| 2027 | + |
2022 | 2028 | gpu_metrics->pcie_link_width =
|
2023 |
| - smu_v13_0_6_get_current_pcie_link_width_level(smu); |
| 2029 | + DECODE_LANE_WIDTH(link_width_level); |
2024 | 2030 | gpu_metrics->pcie_link_speed =
|
2025 | 2031 | smu_v13_0_6_get_current_pcie_link_speed(smu);
|
2026 | 2032 | }
|
|
0 commit comments