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

drm/amdgpu: Re-enable FRU check for most models v5

There is at least 1 VG20 DID that does not have an FRU, and trying to read
that will cause a hang. For now, explicitly support reading the FRU for
Arcturus and for the WKS VG20 DIDs, and skip for everything else.
This re-enables serial number reporting for server cards

v2: Add ASIC check
v3: Don't default to true for pre-VG20
v4: Use DID instead of parsing the VBIOS
v5: Sqaush in overflow warning fix

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

authored by

Kent Russell and committed by
Alex Deucher
1ea2b260 3adf175e

+13 -3
+13 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c
··· 20 20 * OTHER DEALINGS IN THE SOFTWARE. 21 21 * 22 22 */ 23 + #include <linux/pci.h> 24 + 23 25 #include "amdgpu.h" 24 26 #include "amdgpu_i2c.h" 25 27 #include "smu_v11_0_i2c.h" ··· 33 31 34 32 bool is_fru_eeprom_supported(struct amdgpu_device *adev) 35 33 { 36 - /* TODO: Resolve supported ASIC type */ 37 - 34 + /* TODO: Gaming SKUs don't have the FRU EEPROM. 35 + * Use this hack to address hangs on modprobe on gaming SKUs 36 + * until a proper solution can be implemented by only supporting 37 + * it on Arcturus, and the explicit chip IDs for VG20 Server cards 38 + */ 39 + if ((adev->asic_type == CHIP_ARCTURUS) || 40 + (adev->asic_type == CHIP_VEGA20 && adev->pdev->device == 0x66a0) || 41 + (adev->asic_type == CHIP_VEGA20 && adev->pdev->device == 0x66a1) || 42 + (adev->asic_type == CHIP_VEGA20 && adev->pdev->device == 0x66a4)) 43 + return true; 38 44 return false; 39 45 } 40 46 ··· 85 75 86 76 int amdgpu_fru_get_product_info(struct amdgpu_device *adev) 87 77 { 88 - unsigned char buff[32]; 78 + unsigned char buff[34]; 89 79 int addrptr = 0, size = 0; 90 80 91 81 if (!is_fru_eeprom_supported(adev))