Skip to content

Commit

Permalink
mailbox: imx: Clear the right interrupts at shutdown
Browse files Browse the repository at this point in the history
Make sure to only clear enabled interrupts keeping count
of the connection type.

Suggested-by: Oleksij Rempel <[email protected]>
Signed-off-by: Daniel Baluta <[email protected]>
Signed-off-by: Richard Zhu <[email protected]>
Reviewed-by: Dong Aisheng <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
  • Loading branch information
dbaluta authored and JassiBrar committed Dec 1, 2019
1 parent bf159d1 commit 5f0af07
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions drivers/mailbox/imx-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,19 @@ static void imx_mu_shutdown(struct mbox_chan *chan)
return;
}

imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_TIEn(cp->idx) |
IMX_MU_xCR_RIEn(cp->idx) | IMX_MU_xCR_GIEn(cp->idx));
switch (cp->type) {
case IMX_MU_TYPE_TX:
imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_TIEn(cp->idx));
break;
case IMX_MU_TYPE_RX:
imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_RIEn(cp->idx));
break;
case IMX_MU_TYPE_RXDB:
imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_GIEn(cp->idx));
break;
default:
break;
}

free_irq(priv->irq, chan);
}
Expand Down

0 comments on commit 5f0af07

Please sign in to comment.