All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] firmware: ti_sci: Fix TISCI mailbox receive timeout handling
@ 2019-04-24 19:20 Andreas Dannenberg
  2019-04-25  3:10 ` Lokesh Vutla
  2019-05-03 18:19 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Dannenberg @ 2019-04-24 19:20 UTC (permalink / raw)
  To: u-boot

An earlier commit converted the TISCI receive timeouts to be specified
in ms rather than us however it failed to take this change into account
when passing the actual timeout to be used when invoking the mailbox
receive API. This leads to the actual timeout to be 1,000 times shorter
than expected and as a result certain TISCI operations would fail.

Fix the issue by converting the timeout declared in ms to us on the fly
as expected by the respective API.

Fixes: fd6b40b1ba20 ("firmware: ti_sci: Add support for NAVSS resource management")
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
---

Found this issue through bisecting the u-boot tree while maintaining my
yet-to-be-submitted-upstream system firmware loader series current, which
would cause SYSFW PM init to time out and the AM654x board to constantly
reset. The TI "ti-u-boot-2019.01" tree has this change already built-in
(it appears like when "firmware: ti_sci: Add support for NAVSS resource
management" was originally submitted upstream this change was missed).

Regards, Andreas


 drivers/firmware/ti_sci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index d47d22fff3..d72dd73f3b 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -158,7 +158,7 @@ static inline int ti_sci_get_response(struct ti_sci_info *info,
 	int ret;
 
 	/* Receive the response */
-	ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_ms);
+	ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_ms * 1000);
 	if (ret) {
 		dev_err(info->dev, "%s: Message receive failed. ret = %d\n",
 			__func__, ret);
-- 
2.17.1

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

* [U-Boot] [PATCH] firmware: ti_sci: Fix TISCI mailbox receive timeout handling
  2019-04-24 19:20 [U-Boot] [PATCH] firmware: ti_sci: Fix TISCI mailbox receive timeout handling Andreas Dannenberg
@ 2019-04-25  3:10 ` Lokesh Vutla
  2019-05-03 18:19 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Lokesh Vutla @ 2019-04-25  3:10 UTC (permalink / raw)
  To: u-boot



On 25/04/19 12:50 AM, Andreas Dannenberg wrote:
> An earlier commit converted the TISCI receive timeouts to be specified
> in ms rather than us however it failed to take this change into account
> when passing the actual timeout to be used when invoking the mailbox
> receive API. This leads to the actual timeout to be 1,000 times shorter
> than expected and as a result certain TISCI operations would fail.
> 
> Fix the issue by converting the timeout declared in ms to us on the fly
> as expected by the respective API.
> 
> Fixes: fd6b40b1ba20 ("firmware: ti_sci: Add support for NAVSS resource management")
> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>

Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>

Thanks and regards,
Lokesh

> ---
> 
> Found this issue through bisecting the u-boot tree while maintaining my
> yet-to-be-submitted-upstream system firmware loader series current, which
> would cause SYSFW PM init to time out and the AM654x board to constantly
> reset. The TI "ti-u-boot-2019.01" tree has this change already built-in
> (it appears like when "firmware: ti_sci: Add support for NAVSS resource
> management" was originally submitted upstream this change was missed).
> 
> Regards, Andreas
> 
> 
>  drivers/firmware/ti_sci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
> index d47d22fff3..d72dd73f3b 100644
> --- a/drivers/firmware/ti_sci.c
> +++ b/drivers/firmware/ti_sci.c
> @@ -158,7 +158,7 @@ static inline int ti_sci_get_response(struct ti_sci_info *info,
>  	int ret;
>  
>  	/* Receive the response */
> -	ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_ms);
> +	ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_ms * 1000);
>  	if (ret) {
>  		dev_err(info->dev, "%s: Message receive failed. ret = %d\n",
>  			__func__, ret);
> 

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

* [U-Boot] [PATCH] firmware: ti_sci: Fix TISCI mailbox receive timeout handling
  2019-04-24 19:20 [U-Boot] [PATCH] firmware: ti_sci: Fix TISCI mailbox receive timeout handling Andreas Dannenberg
  2019-04-25  3:10 ` Lokesh Vutla
@ 2019-05-03 18:19 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2019-05-03 18:19 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 24, 2019 at 02:20:08PM -0500, Andreas Dannenberg wrote:

> An earlier commit converted the TISCI receive timeouts to be specified
> in ms rather than us however it failed to take this change into account
> when passing the actual timeout to be used when invoking the mailbox
> receive API. This leads to the actual timeout to be 1,000 times shorter
> than expected and as a result certain TISCI operations would fail.
> 
> Fix the issue by converting the timeout declared in ms to us on the fly
> as expected by the respective API.
> 
> Fixes: fd6b40b1ba20 ("firmware: ti_sci: Add support for NAVSS resource management")
> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190503/84d69bbd/attachment.sig>

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

end of thread, other threads:[~2019-05-03 18:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 19:20 [U-Boot] [PATCH] firmware: ti_sci: Fix TISCI mailbox receive timeout handling Andreas Dannenberg
2019-04-25  3:10 ` Lokesh Vutla
2019-05-03 18:19 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.