Skip to content

Commit b232537

Browse files
committed
soc: ti: omap-prm: Fix external abort for am335x pruss
Starting with v5.15-rc1, we may now see some am335x beaglebone black device produce the following error on pruss probe: Unhandled fault: external abort on non-linefetch (0x1008) at 0xe0326000 This has started with the enabling of pruss for am335x in the dts files. Turns out the is caused by the PRM reset handling not waiting for the reset bit to clear. To fix the issue, let's always wait for the reset bit to clear, even if there is a separate reset status register. We attempted to fix a similar issue for dra7 iva with a udelay() in commit effe89e ("soc: ti: omap-prm: Fix occasional abort on reset deassert for dra7 iva"). There is no longer a need for the udelay() for dra7 iva reset either with the check added for reset bit clearing. Cc: Drew Fustini <[email protected]> Cc: Grygorii Strashko <[email protected]> Cc: "H. Nikolaus Schaller" <[email protected]> Cc: Robert Nelson <[email protected]> Cc: Yongqin Liu <[email protected]> Fixes: effe89e ("soc: ti: omap-prm: Fix occasional abort on reset deassert for dra7 iva") Reported-by: Matti Vaittinen <[email protected]> Tested-by: Matti Vaittinen <[email protected]> Signed-off-by: Tony Lindgren <[email protected]>
1 parent 6880fa6 commit b232537

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

drivers/soc/ti/omap_prm.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -825,25 +825,28 @@ static int omap_reset_deassert(struct reset_controller_dev *rcdev,
825825
writel_relaxed(v, reset->prm->base + reset->prm->data->rstctrl);
826826
spin_unlock_irqrestore(&reset->lock, flags);
827827

828-
if (!has_rstst)
829-
goto exit;
828+
/* wait for the reset bit to clear */
829+
ret = readl_relaxed_poll_timeout_atomic(reset->prm->base +
830+
reset->prm->data->rstctrl,
831+
v, !(v & BIT(id)), 1,
832+
OMAP_RESET_MAX_WAIT);
833+
if (ret)
834+
pr_err("%s: timedout waiting for %s:%lu\n", __func__,
835+
reset->prm->data->name, id);
830836

831837
/* wait for the status to be set */
832-
ret = readl_relaxed_poll_timeout_atomic(reset->prm->base +
838+
if (has_rstst) {
839+
ret = readl_relaxed_poll_timeout_atomic(reset->prm->base +
833840
reset->prm->data->rstst,
834841
v, v & BIT(st_bit), 1,
835842
OMAP_RESET_MAX_WAIT);
836-
if (ret)
837-
pr_err("%s: timedout waiting for %s:%lu\n", __func__,
838-
reset->prm->data->name, id);
843+
if (ret)
844+
pr_err("%s: timedout waiting for %s:%lu\n", __func__,
845+
reset->prm->data->name, id);
846+
}
839847

840-
exit:
841-
if (reset->clkdm) {
842-
/* At least dra7 iva needs a delay before clkdm idle */
843-
if (has_rstst)
844-
udelay(1);
848+
if (reset->clkdm)
845849
pdata->clkdm_allow_idle(reset->clkdm);
846-
}
847850

848851
return ret;
849852
}

0 commit comments

Comments
 (0)