Skip to content

Commit 81a9d3b

Browse files
Ranjani VaidyanathanJassiBrar
authored andcommitted
mailbox: imx: enlarge timeout while reading/writing messages to SCFW
Mailbox driver needs to wait and read all the words in response to a SCFW API call, else the protocol gets messed up and results in kernel hang. When the responses are longer than 3 words its possible that SCFW will take some time to fill up the rest of the words in the MU, a timeout of 100us is arbritrary and too short. While waiting for Linux to consume the first 3 words of the response SCFW can be busy doing other stuff and hence Linux needs to wait for the rest of the words. Similar restriction applies when writing messages that are longer than 3 words. This patch increases the timeout to 5secs while waiting for response or writing long messages to SCFW. Signed-off-by: Ranjani Vaidyanathan <[email protected]> Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent 8219efd commit 81a9d3b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/mailbox/imx-mailbox.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static int imx_mu_specific_tx(struct imx_mu_priv *priv, struct imx_mu_con_priv *
218218
ret = readl_poll_timeout(priv->base + priv->dcfg->xSR[IMX_MU_TSR],
219219
xsr,
220220
xsr & IMX_MU_xSR_TEn(priv->dcfg->type, i % num_tr),
221-
0, 100);
221+
0, 5 * USEC_PER_SEC);
222222
if (ret) {
223223
dev_err(priv->dev, "Send data index: %d timeout\n", i);
224224
return ret;
@@ -263,7 +263,8 @@ static int imx_mu_specific_rx(struct imx_mu_priv *priv, struct imx_mu_con_priv *
263263

264264
for (i = 1; i < size; i++) {
265265
ret = readl_poll_timeout(priv->base + priv->dcfg->xSR[IMX_MU_RSR], xsr,
266-
xsr & IMX_MU_xSR_RFn(priv->dcfg->type, i % 4), 0, 100);
266+
xsr & IMX_MU_xSR_RFn(priv->dcfg->type, i % 4), 0,
267+
5 * USEC_PER_SEC);
267268
if (ret) {
268269
dev_err(priv->dev, "timeout read idx %d\n", i);
269270
return ret;

0 commit comments

Comments
 (0)