Re: beaglebone black boot failure Linux v5.15.rc1

Tony Lindgren
2021-09-21T07:47:41Z

* Matti Vaittinen <mazziesaccount@gmail.com> [210920 08:23]:
> Finally, adding the udelay(100); (as Tony suggested) at the end of the
> omap_reset_deassert() did make the oops go away even when pruss_tm was
> enabled. I don't know what would be a proper fix though.

The following patch works for me on bbb with the following test script:

#!/bin/sh

module="4a326000.target-module"
driver="/sys/bus/platform/drivers/ti-sysc"

while true; do
echo ${module} > ${driver}/bind
echo ${module} > ${driver}/unbind
done

It also allows leaving out the udelay for dra7 iva reset. Care to try
this and see if it helps?

Regards,

Tony

8< -----------------
diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c
--- a/drivers/soc/ti/omap_prm.c
+++ b/drivers/soc/ti/omap_prm.c
@@ -825,26 +825,29 @@ 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)
- goto exit;
-
- /* wait for the status to be set */
- ret = readl_relaxed_poll_timeout_atomic(reset->prm->base +
+ if (has_rstst) {
+ /* wait for the status to be set */
+ ret = readl_relaxed_poll_timeout_atomic(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);
-
-exit:
- if (reset->clkdm) {
- /* At least dra7 iva needs a delay before clkdm idle */
- if (has_rstst)
- udelay(1);
- pdata->clkdm_allow_idle(reset->clkdm);
+ if (ret)
+ pr_err("%s: timedout waiting for %s:%lu\n", __func__,
+ reset->prm->data->name, id);
+ } else {
+ /* wait for the reset bit to cleaar */
+ ret = readl_relaxed_poll_timeout_atomic(reset->prm->base +
+ reset->prm->data->rstctrl,
+ v, !(v & BIT(id)), 1,
+ OMAP_RESET_MAX_WAIT);
+ if (ret)
+ pr_err("%s: timedout waiting for %s:%lu\n", __func__,
+ reset->prm->data->name, id);
}

+ if (reset->clkdm)
+ pdata->clkdm_allow_idle(reset->clkdm);
+
return ret;
}

--
2.33.0