Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tero Kristo and committed by
Santosh Shilimkar
c5117a78 3e99cb21

+12
+12
drivers/soc/ti/omap_prm.c
··· 152 152 writel_relaxed(v, reset->prm->base + reset->prm->data->rstctrl); 153 153 spin_unlock_irqrestore(&reset->lock, flags); 154 154 155 + if (!has_rstst) 156 + return 0; 157 + 158 + /* wait for the status to be set */ 159 + ret = readl_relaxed_poll_timeout(reset->prm->base + 160 + reset->prm->data->rstst, 161 + v, v & BIT(st_bit), 1, 162 + OMAP_RESET_MAX_WAIT); 163 + if (ret) 164 + pr_err("%s: timedout waiting for %s:%lu\n", __func__, 165 + reset->prm->data->name, id); 166 + 155 167 return 0; 156 168 } 157 169