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

drm/amdgpu: fix amdgpu pmu to use hwc->config instead of hwc->conf

hwc->conf was designated specifically for AMD APU IOMMU purposes. This
could cause problems in performance and/or function since APU IOMMU
implementation is elsewhere. Also hwc->conf and hwc->config are
different members of an anonymous union so hwc->conf aliases as
hw->last_tag.

Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Jonathan Kim and committed by
Alex Deucher
46d1da73 416611d9

+8 -7
+8 -7
drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c
··· 52 52 return -ENOENT; 53 53 54 54 /* update the hw_perf_event struct with config data */ 55 - hwc->conf = event->attr.config; 55 + hwc->config = event->attr.config; 56 56 57 57 return 0; 58 58 } ··· 74 74 switch (pe->pmu_perf_type) { 75 75 case PERF_TYPE_AMDGPU_DF: 76 76 if (!(flags & PERF_EF_RELOAD)) 77 - pe->adev->df.funcs->pmc_start(pe->adev, hwc->conf, 1); 77 + pe->adev->df.funcs->pmc_start(pe->adev, hwc->config, 1); 78 78 79 - pe->adev->df.funcs->pmc_start(pe->adev, hwc->conf, 0); 79 + pe->adev->df.funcs->pmc_start(pe->adev, hwc->config, 0); 80 80 break; 81 81 default: 82 82 break; ··· 101 101 102 102 switch (pe->pmu_perf_type) { 103 103 case PERF_TYPE_AMDGPU_DF: 104 - pe->adev->df.funcs->pmc_get_count(pe->adev, hwc->conf, 104 + pe->adev->df.funcs->pmc_get_count(pe->adev, hwc->config, 105 105 &count); 106 106 break; 107 107 default: ··· 126 126 127 127 switch (pe->pmu_perf_type) { 128 128 case PERF_TYPE_AMDGPU_DF: 129 - pe->adev->df.funcs->pmc_stop(pe->adev, hwc->conf, 0); 129 + pe->adev->df.funcs->pmc_stop(pe->adev, hwc->config, 0); 130 130 break; 131 131 default: 132 132 break; ··· 156 156 157 157 switch (pe->pmu_perf_type) { 158 158 case PERF_TYPE_AMDGPU_DF: 159 - retval = pe->adev->df.funcs->pmc_start(pe->adev, hwc->conf, 1); 159 + retval = pe->adev->df.funcs->pmc_start(pe->adev, 160 + hwc->config, 1); 160 161 break; 161 162 default: 162 163 return 0; ··· 185 184 186 185 switch (pe->pmu_perf_type) { 187 186 case PERF_TYPE_AMDGPU_DF: 188 - pe->adev->df.funcs->pmc_stop(pe->adev, hwc->conf, 1); 187 + pe->adev->df.funcs->pmc_stop(pe->adev, hwc->config, 1); 189 188 break; 190 189 default: 191 190 break;