summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Russell <kent.russell@amd.com>2024-09-10 09:32:13 -0400
committerAlex Deucher <alexander.deucher@amd.com>2024-09-18 16:14:27 -0400
commit2ed186df27f078eb75c52d09e04aa7b0f9920f57 (patch)
tree8cf41ab973430016b8f107a34fc52ebc635311e4
parentc77a46bebe99e70600e636a3a1f285637c479f46 (diff)
downloadlinux-2ed186df27f078eb75c52d09e04aa7b0f9920f57.tar.gz
linux-2ed186df27f078eb75c52d09e04aa7b0f9920f57.tar.bz2
linux-2ed186df27f078eb75c52d09e04aa7b0f9920f57.zip
drm/amdgpu: Retry i2c transfer once if it fails on SMU13.0.6
During init, there can be some collisions on the i2c bus that result in the EEPROM read failing. This has been mitigated in the PMFW to a degree, but there is still a small chance that the bus will be busy. When the read fails during RAS init, that disables page retirement altogether, which is obviously not ideal. To try to avoid that situation, set the eeprom_read function to retry once if the first read fails, specifically for smu_v13_0_6. Signed-off-by: Kent Russell <kent.russell@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index 9974c9f8135e..55ed6247eb61 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -2107,8 +2107,12 @@ static int smu_v13_0_6_i2c_xfer(struct i2c_adapter *i2c_adap,
}
mutex_lock(&adev->pm.mutex);
r = smu_v13_0_6_request_i2c_xfer(smu, req);
- if (r)
- goto fail;
+ if (r) {
+ /* Retry once, in case of an i2c collision */
+ r = smu_v13_0_6_request_i2c_xfer(smu, req);
+ if (r)
+ goto fail;
+ }
for (c = i = 0; i < num_msgs; i++) {
if (!(msg[i].flags & I2C_M_RD)) {