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

amdgpu: Don't print L2 status if there's nothing to print

If a 2nd fault comes in before the 1st is handled, the 1st fault will
clear out the FAULT STATUS registers before the 2nd fault is handled.
Thus we get a lot of zeroes. If status=0, just skip the L2 fault status
information, to avoid confusion of why some VM fault status prints in
dmesg are all zeroes.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Kent Russell and committed by
Alex Deucher
3c0be69b 5605a0d3

+18 -3
+4 -1
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
··· 175 175 addr, entry->client_id, 176 176 soc15_ih_clientid_name[entry->client_id]); 177 177 178 - if (!amdgpu_sriov_vf(adev)) 178 + /* Only print L2 fault status if the status register could be read and 179 + * contains useful information 180 + */ 181 + if (status != 0) 179 182 hub->vmhub_funcs->print_l2_protection_fault_status(adev, 180 183 status); 181 184
+4 -1
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
··· 144 144 dev_err(adev->dev, " in page starting at address 0x%016llx from client %d\n", 145 145 addr, entry->client_id); 146 146 147 - if (!amdgpu_sriov_vf(adev)) 147 + /* Only print L2 fault status if the status register could be read and 148 + * contains useful information 149 + */ 150 + if (status != 0) 148 151 hub->vmhub_funcs->print_l2_protection_fault_status(adev, status); 149 152 } 150 153
+4 -1
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
··· 137 137 dev_err(adev->dev, " in page starting at address 0x%016llx from client %d\n", 138 138 addr, entry->client_id); 139 139 140 - if (!amdgpu_sriov_vf(adev)) 140 + /* Only print L2 fault status if the status register could be read and 141 + * contains useful information 142 + */ 143 + if (status != 0) 141 144 hub->vmhub_funcs->print_l2_protection_fault_status(adev, status); 142 145 } 143 146
+6
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
··· 672 672 (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(9, 4, 2))) 673 673 return 0; 674 674 675 + /* Only print L2 fault status if the status register could be read and 676 + * contains useful information 677 + */ 678 + if (!status) 679 + return 0; 680 + 675 681 if (!amdgpu_sriov_vf(adev)) 676 682 WREG32_P(hub->vm_l2_pro_fault_cntl, 1, ~1); 677 683