linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: designware: Modify timing parameters for amdpsp mailbox
@ 2022-04-28 12:26 Jan Dabros
  2022-04-28 13:07 ` Jarkko Nikula
  2022-05-04 19:55 ` Wolfram Sang
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Dabros @ 2022-04-28 12:26 UTC (permalink / raw)
  To: linux-kernel, linux-i2c, jarkko.nikula, andriy.shevchenko
  Cc: mika.westerberg, rrangel, Nimesh.Easow, upstream, 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.

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
-- 
2.36.0.rc2.479.g8af0fa9b8e-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: designware: Modify timing parameters for amdpsp mailbox
  2022-04-28 12:26 [PATCH] i2c: designware: Modify timing parameters for amdpsp mailbox Jan Dabros
@ 2022-04-28 13:07 ` Jarkko Nikula
  2022-04-28 13:42   ` Jan Dąbroś
  2022-05-04 19:55 ` Wolfram Sang
  1 sibling, 1 reply; 5+ messages in thread
From: Jarkko Nikula @ 2022-04-28 13:07 UTC (permalink / raw)
  To: Jan Dabros, linux-kernel, linux-i2c, andriy.shevchenko
  Cc: mika.westerberg, rrangel, Nimesh.Easow, upstream

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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: designware: Modify timing parameters for amdpsp mailbox
  2022-04-28 13:07 ` Jarkko Nikula
@ 2022-04-28 13:42   ` Jan Dąbroś
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Dąbroś @ 2022-04-28 13:42 UTC (permalink / raw)
  To: Jarkko Nikula
  Cc: Linux Kernel Mailing List, linux-i2c, Andy Shevchenko,
	Mika Westerberg, Raul E Rangel, Easow, Nimesh, upstream

czw., 28 kwi 2022 o 15:07 Jarkko Nikula
<jarkko.nikula@linux.intel.com> napisał(a):
>
> 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?

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

> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

Thanks!

Best Regards,
Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: designware: Modify timing parameters for amdpsp mailbox
  2022-04-28 12:26 [PATCH] i2c: designware: Modify timing parameters for amdpsp mailbox Jan Dabros
  2022-04-28 13:07 ` Jarkko Nikula
@ 2022-05-04 19:55 ` Wolfram Sang
  2022-05-16 13:34   ` Jan Dąbroś
  1 sibling, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2022-05-04 19:55 UTC (permalink / raw)
  To: Jan Dabros
  Cc: linux-kernel, linux-i2c, jarkko.nikula, andriy.shevchenko,
	mika.westerberg, rrangel, Nimesh.Easow, upstream

[-- Attachment #1: Type: text/plain, Size: 494 bytes --]

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.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: designware: Modify timing parameters for amdpsp mailbox
  2022-05-04 19:55 ` Wolfram Sang
@ 2022-05-16 13:34   ` Jan Dąbroś
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Dąbroś @ 2022-05-16 13:34 UTC (permalink / raw)
  To: Wolfram Sang, Jan Dabros, Linux Kernel Mailing List, linux-i2c,
	Jarkko Nikula, Andy Shevchenko, Mika Westerberg, Raul E Rangel,
	Easow, Nimesh, upstream

ś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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-16 13:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 12:26 [PATCH] i2c: designware: Modify timing parameters for amdpsp mailbox Jan Dabros
2022-04-28 13:07 ` Jarkko Nikula
2022-04-28 13:42   ` Jan Dąbroś
2022-05-04 19:55 ` Wolfram Sang
2022-05-16 13:34   ` Jan Dąbroś

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).