Skip to contentSkip to conversation

i2c: designware: Modify timing parameters for amdpsp mailbox

PATCH Applied Jan Dabros 3 participants 5 messages Apr 28, 2022 – May 16, 2022

Subsystems (3)
lore
Share & tools
lore

Jan Dabros

author
#0 lore raw

PATCH 1/1 i2c: designware: Modify timing parameters for amdpsp mailbox

Adjust retry period and timeout values for x86-PSP mailbox based on the typical I2C traffic generated by PSP. In order to limit the possibility of timeouts, x86 should reduce the interval between retries as well as increase overall time after which it gives up.

---
 drivers/i2c/busses/i2c-designware-amdpsp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-designware-amdpsp.c +2 -2
index 9b37f2b95abc..b624356c945f 100644
@@ -16,8 +16,8 @@
 #define PSP_CMD_TIMEOUT_US	(500 * USEC_PER_MSEC)
 
 #define PSP_I2C_REQ_BUS_CMD		0x64
-#define PSP_I2C_REQ_RETRY_CNT		10
-#define PSP_I2C_REQ_RETRY_DELAY_US	(50 * USEC_PER_MSEC)
+#define PSP_I2C_REQ_RETRY_CNT		400
+#define PSP_I2C_REQ_RETRY_DELAY_US	(25 * USEC_PER_MSEC)
 #define PSP_I2C_REQ_STS_OK		0x0
 #define PSP_I2C_REQ_STS_BUS_BUSY	0x1
 #define PSP_I2C_REQ_STS_INV_PARAM	0x3
Signature · 1 line
2.36.0.rc2.479.g8af0fa9b8e-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · Jan Dabros

Adjust retry period and timeout values for x86-PSP mailbox based on the typical I2C traffic generated by PSP. In order to limit the possibility of timeouts, x86 should reduce the interval between retries as well as increase overall time after which it gives up.

---
  drivers/i2c/busses/i2c-designware-amdpsp.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-designware-amdpsp.c +0 -0
index 9b37f2b95abc..b624356c945f 100644

drivers/i2c/busses/i2c-designware-amdpsp.c line 23

Quoted 10 lines
drivers/i2c/busses/i2c-designware-amdpsp.c +2 -2
@@ -16,8 +16,8 @@
  #define PSP_CMD_TIMEOUT_US	(500 * USEC_PER_MSEC)
 
  #define PSP_I2C_REQ_BUS_CMD		0x64
-#define PSP_I2C_REQ_RETRY_CNT		10
-#define PSP_I2C_REQ_RETRY_DELAY_US	(50 * USEC_PER_MSEC)
+#define PSP_I2C_REQ_RETRY_CNT		400
+#define PSP_I2C_REQ_RETRY_DELAY_US	(25 * USEC_PER_MSEC)
  #define PSP_I2C_REQ_STS_OK		0x0
  #define PSP_I2C_REQ_STS_BUS_BUSY	0x1
  #define PSP_I2C_REQ_STS_INV_PARAM	0x3

Out of curiosity, can it be up to 400 * 25 ms = 10 s?

#2 lore raw

czw., 28 kwi 2022 o 15:07 Jarkko Nikula
<[email protected]> napisał(a):

Quoted 19 lines · Jan Dabros
Quoted 17 lines

Adjust retry period and timeout values for x86-PSP mailbox based on the typical I2C traffic generated by PSP. In order to limit the possibility of timeouts, x86 should reduce the interval between retries as well as increase overall time after which it gives up.

---
  drivers/i2c/busses/i2c-designware-amdpsp.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-designware-amdpsp.c +0 -0
index 9b37f2b95abc..b624356c945f 100644
@@ -16,8 +16,8 @@
  #define PSP_CMD_TIMEOUT_US  (500 * USEC_PER_MSEC)
 
Quoted 10 lines

drivers/i2c/busses/i2c-designware-amdpsp.c line 23

Quoted 8 lines
drivers/i2c/busses/i2c-designware-amdpsp.c +2 -2
  #define PSP_I2C_REQ_BUS_CMD         0x64
-#define PSP_I2C_REQ_RETRY_CNT                10
-#define PSP_I2C_REQ_RETRY_DELAY_US   (50 * USEC_PER_MSEC)
+#define PSP_I2C_REQ_RETRY_CNT                400
+#define PSP_I2C_REQ_RETRY_DELAY_US   (25 * USEC_PER_MSEC)
  #define PSP_I2C_REQ_STS_OK          0x0
  #define PSP_I2C_REQ_STS_BUS_BUSY    0x1
  #define PSP_I2C_REQ_STS_INV_PARAM   0x3

Out of curiosity, can it be up to 400 * 25 ms = 10 s?

Right, worst case x86 is trying to take arbitration of the bus for 10s. But this is very unlikely (margin of safety).

Quoted 1 line

Thanks!

Best Regards,
Jan

Applied
#3 lore raw
In reply to Jan Dabros
Quoted 6 lines · Jan Dabros

Adjust retry period and timeout values for x86-PSP mailbox based on the typical I2C traffic generated by PSP. In order to limit the possibility of timeouts, x86 should reduce the interval between retries as well as increase overall time after which it gives up.

Applied to for-next, thanks! Let me know if you think this is a bugfix and should be in for-current.

#4 lore raw

śr., 4 maj 2022 o 21:55 Wolfram Sang <[email protected]> napisał(a):

Quoted 11 lines · Jan Dabros
Quoted 6 lines

Adjust retry period and timeout values for x86-PSP mailbox based on the typical I2C traffic generated by PSP. In order to limit the possibility of timeouts, x86 should reduce the interval between retries as well as increase overall time after which it gives up.

Applied to for-next, thanks! Let me know if you think this is a bugfix and should be in for-current.

Sorry for the late response! I believe this is not necessary to include this patch in for-current. Thanks.

Best Regards,
Jan