drm/amdgpu: Retry i2c transfer once if it fails on SMU13.0.6
Subsystems (3)
PATCH 1/1 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.
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +6 -2
@@ -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) { +/* Rrtry 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 )) {
Signature · 1 line
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Fixed the typo locally.
Quoted 26 lines
-----Original Message-----
From: Russell, Kent <[email protected]>
Sent: Wednesday, September 11, 2024 2:06 PM
To: [email protected]
Cc: Russell, Kent <[email protected]>
Subject: [PATCH] drm/amdgpu: Retry i2c transfer once if it fails on SMU13.0.6During 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_readfunction to retry once if the first read fails, specifically forsmu_v13_0_6.Signed-off-by Kent Russell <[email protected]>--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +0
-0
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c static int smu_v13_0_6_i2c_xfer(struct i2c_adapter · line 2112
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +2
-2@@ -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) { +/* Rrtry once, in case of an i2c collision */
Rrtry->Retry
Quoted 9 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +4
-0+ 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)) {--
2.34.1
Lazar, Lijo
Reviewed-byQuoted 22 lines · Kent
[AMD Official Use Only - AMD Internal Distribution Only]
[AMD Official Use Only - AMD Internal Distribution Only]
Fixed the typo locally.
Quoted 16 lines
-----Original Message-----
From: Russell, Kent <[email protected]>
Sent: Wednesday, September 11, 2024 2:06 PM
To: [email protected]
Cc: Russell, Kent <[email protected]>
Subject: [PATCH] drm/amdgpu: Retry i2c transfer once if it fails on SMU13.0.6During 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_readfunction to retry once if the first read fails, specifically forsmu_v13_0_6.Signed-off-by Kent Russell <[email protected]>
Thanks,
Lijo
Quoted 29 lines
Quoted 10 lines
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +0
-0drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c static int smu_v13_0_6_i2c_xfer(struct i2c_adapter · line 2112
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +2
-2@@ -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) { +/* Rrtry once, in case of an i2c collision */
Rrtry->RetryQuoted 9 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +4
-0+ 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)) {--
2.34.1