diff mbox series

i2c: designware: Modify timing parameters for amdpsp mailbox

Message ID 20220428122651.208575-1-jsd@semihalf.com
State Accepted
Commit be18ce150a436d01c13546e4a2440e717c99d57c
Headers show
Series i2c: designware: Modify timing parameters for amdpsp mailbox | expand

Commit Message

Jan Dąbroś April 28, 2022, 12:26 p.m. UTC
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.

Signed-off-by: Jan Dabros <jsd@semihalf.com>
---
 drivers/i2c/busses/i2c-designware-amdpsp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jarkko Nikula April 28, 2022, 1:07 p.m. UTC | #1
On 4/28/22 15:26, Jan Dabros wrote:
> 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.
> 
> Signed-off-by: Jan Dabros <jsd@semihalf.com>
> ---
>   drivers/i2c/busses/i2c-designware-amdpsp.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c
> index 9b37f2b95abc..b624356c945f 100644
> --- a/drivers/i2c/busses/i2c-designware-amdpsp.c
> +++ b/drivers/i2c/busses/i2c-designware-amdpsp.c
> @@ -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?

Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Jan Dąbroś May 16, 2022, 1:34 p.m. UTC | #2
śr., 4 maj 2022 o 21:55 Wolfram Sang <wsa@kernel.org> napisał(a):
>
> On Thu, Apr 28, 2022 at 02:26:51PM +0200, Jan Dabros wrote:
> > 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.
> >
> > Signed-off-by: Jan Dabros <jsd@semihalf.com>
>
> 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
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-designware-amdpsp.c b/drivers/i2c/busses/i2c-designware-amdpsp.c
index 9b37f2b95abc..b624356c945f 100644
--- a/drivers/i2c/busses/i2c-designware-amdpsp.c
+++ b/drivers/i2c/busses/i2c-designware-amdpsp.c
@@ -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