summaryrefslogtreecommitdiffstats
path: root/drivers/soc/ti
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2019-10-09 08:55:37 -0700
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>2019-10-09 08:55:37 -0700
commitc5117a78dd88e5b673897baec0a6eed9ee599e02 (patch)
tree5394adada8c217fa31367a481627990c7a1e149a /drivers/soc/ti
parent3e99cb214f03b8206aad80644809aea947910372 (diff)
downloadlinux-c5117a78dd88e5b673897baec0a6eed9ee599e02.tar.bz2
soc: ti: omap-prm: poll for reset complete during de-assert
Poll for reset completion status during de-assertion of reset, otherwise the IP in question might be accessed before it has left reset properly. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Diffstat (limited to 'drivers/soc/ti')
-rw-r--r--drivers/soc/ti/omap_prm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c
index d171e96e4ef1..a3ffb19e402f 100644
--- a/drivers/soc/ti/omap_prm.c
+++ b/drivers/soc/ti/omap_prm.c
@@ -152,6 +152,18 @@ static int omap_reset_deassert(struct reset_controller_dev *rcdev,
writel_relaxed(v, reset->prm->base + reset->prm->data->rstctrl);
spin_unlock_irqrestore(&reset->lock, flags);
+ if (!has_rstst)
+ return 0;
+
+ /* wait for the status to be set */
+ ret = readl_relaxed_poll_timeout(reset->prm->base +
+ reset->prm->data->rstst,
+ v, v & BIT(st_bit), 1,
+ OMAP_RESET_MAX_WAIT);
+ if (ret)
+ pr_err("%s: timedout waiting for %s:%lu\n", __func__,
+ reset->prm->data->name, id);
+
return 0;
}