Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2498988pxb; Tue, 21 Sep 2021 00:49:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuV13cZ/bM/vEu93YeJDK8D1pn/1I/QGktTU4akOUc+IYNAZ96p/UejuTfEbuQqYgFd3hc X-Received: by 2002:a17:906:368e:: with SMTP id a14mr32860184ejc.60.1632210568420; Tue, 21 Sep 2021 00:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632210568; cv=none; d=google.com; s=arc-20160816; b=UHadA079Iz/lC+eXQIkytjsG6DC/tpol0jfv3UsuqoOHj8b7s20JK31yi2Bm2BwMsJ grbhBcBlHmI+2fg1KNRqGoR8ygmwDg4kPK5ugRutgwRRqzCcX1GdrvFDN3FCXbE7rXU+ 3fTnXKB93D8d7wCU0UIjzP69RM60Zx0pGngGRRvL70Dkh9DmlEgxiWB66eN9UPDuCWTy 6iTOlvJ/pQ+4i2GPfo6e938c9hDaPLLHEIUra4v2RvMVpvJC0wysSKAi76iZVik69E6T UzGAFID6WheTnljRlk3Qu7hmb4F6IhFxValR+U/Z/PYfB/5bi4B80Xb066WPDab5GwVH So0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lDXTNt0wKhpOcLKzRe7gUi+C2Hu5e0RlmJqP1AG9Sq8=; b=piiRD27mDOAWv5JI+mguqmQ4pUfRx2UA9r78oMDLar0VooxzUrG+nLnsC4UY9xk85B kX2Kraxw+Mq8pMxr1FdS0+I4jWJrt/DFHALdIUWKtglFx/mSouplpIsRLLWcO/D+hcMx MWNMzwEbd61VQzCM2juMlMSTAHaWBK7Wris8ZhHYiJZnNQLxx8ebBPebYVcHQw7dK7/l SVs5oRUzXSmmUXP1BLfGt+XGyQXQFPiAvqIBcvUFHx+QVHYZkVvdKgbFZgKg3L5AVu++ wdCstcphxZLVz6HffjFJbDaNefCM6OQWwxkdB4agXnBHdbqXZ8vkXvu5yM6IoDhR+a4v Ek1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yy2si7043958ejb.325.2021.09.21.00.49.03; Tue, 21 Sep 2021 00:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230271AbhIUHtI (ORCPT + 99 others); Tue, 21 Sep 2021 03:49:08 -0400 Received: from muru.com ([72.249.23.125]:35266 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230172AbhIUHtG (ORCPT ); Tue, 21 Sep 2021 03:49:06 -0400 Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 8CB4580A8; Tue, 21 Sep 2021 07:48:05 +0000 (UTC) Date: Tue, 21 Sep 2021 10:47:36 +0300 From: Tony Lindgren To: Matti Vaittinen Cc: Grygorii Strashko , "Vaittinen, Matti" , "linux-omap@vger.kernel.org" , Suman Anna , Paul Barker , Peter Ujfalusi , =?utf-8?Q?Beno=C3=AEt?= Cousson , "linux-kernel@vger.kernel.org" Subject: Re: beaglebone black boot failure Linux v5.15.rc1 Message-ID: References: <120a0ca4-28c7-5a7b-f1ab-2015c8817bda@fi.rohmeurope.com> <0679a5bb-88d1-077d-6107-d5f88ef60dbf@fi.rohmeurope.com> <8f3963ca-ff09-b876-ae9e-433add242de2@ti.com> <331ab81e-cd42-7e9b-617a-fde4c773c07a@ti.com> <615b6fec-6c62-4a97-6d0c-d2e5a5d1ccb2@fi.rohmeurope.com> <36785ccf-57b4-eaf1-cfc0-b024857f7694@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36785ccf-57b4-eaf1-cfc0-b024857f7694@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Matti Vaittinen [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