Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp71578pxb; Thu, 30 Sep 2021 01:06:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcscLCKolC1gWRF7pS5AbZIHH5WiaF70fE599S1lCFMR5giikRRaR6zHndvTscFG9I/1OH X-Received: by 2002:a63:bf07:: with SMTP id v7mr3752582pgf.333.1632989178731; Thu, 30 Sep 2021 01:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632989178; cv=none; d=google.com; s=arc-20160816; b=fCN40j22EmaKakbQl9Xh4V7IajC57zXqsM4UMs2hwjqQoysa04dinq9zm5ZwI6U2hy a4o8O+TWMQODjJYOAai5as3aG8NTdopSwpjFutHVxeaEMnaMfg/6kfPm859V4cEEPsQQ U/Hrj+adRoW3xwJcpfQfudgXXFc7C7fEchD+xsSq70zo0vo4rSSFucPwkJL/DFqWTID1 pee9UiftzpiI0lgFHuthsAh5ydWCorSh9l5CGONi1FdJhWoB6MY7tlLyC8j3suSg9m/3 up4E3L/Q68AtkUwtKgek9hzshrjJmkJ8k3fFQV0iBD3VMsVwFk8OaYZd+x9kI4y/umwV kOVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Jf6glwX6FtB1WV68IqrKme6GcgqrcBA41EESDR94RH0=; b=MJTu9E+EdqA/jbO+uyu9Ko7TD40fZob+XQ3EDgs3s1hLM6v645QwiB98OWFaqMHGWu phU/Gv9c+qOp8HMt+0BmN0Dv8hL0QtKyc2shRfUu/vmXm6TigALrTz9Uj+9TJwFiGOPV cLSQT6xy5cg/Js8rz3GHpKMYYMwAUqy8Eamq6O6IKAB7FxIhXFxXfns/VxzhCR7HwizD c/pnYHfc8R/TC/iCgKgoBtnkQiKE6Hxs9cunIJ30OHMiVi7hG9GhG4JgwISoardUqQaB KNCejJESZB71LXfXnxZNRBVreHc2XbsPkGfs/yqPX9mrEG1EG/JKD/cyha/KlBXNz5YE ChtA== 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 x8si2986393plo.61.2021.09.30.01.05.40; Thu, 30 Sep 2021 01:06:18 -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 S1348933AbhI3IDY (ORCPT + 99 others); Thu, 30 Sep 2021 04:03:24 -0400 Received: from muru.com ([72.249.23.125]:39032 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348885AbhI3ICz (ORCPT ); Thu, 30 Sep 2021 04:02:55 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 3EC918050; Thu, 30 Sep 2021 08:01:32 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dave Gerlach , Faiz Abbas , Santosh Shilimkar , Suman Anna , Tero Kristo , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Drew Fustini , Grygorii Strashko , "H. Nikolaus Schaller" , Robert Nelson , Yongqin Liu , Matti Vaittinen Subject: [PATCH] soc: ti: omap-prm: Fix external abort for am335x pruss Date: Thu, 30 Sep 2021 11:01:00 +0300 Message-Id: <20210930080100.56820-1-tony@atomide.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 effe89e40037 ("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 Cc: Grygorii Strashko Cc: "H. Nikolaus Schaller" Cc: Robert Nelson Cc: Yongqin Liu Reported-by: Matti Vaittinen Fixes: effe89e40037 ("soc: ti: omap-prm: Fix occasional abort on reset deassert for dra7 iva") Signed-off-by: Tony Lindgren --- drivers/soc/ti/omap_prm.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) 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,25 +825,28 @@ 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 reset bit to clear */ + 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); /* wait for the status to be set */ - ret = readl_relaxed_poll_timeout_atomic(reset->prm->base + + if (has_rstst) { + 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); + 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); + if (reset->clkdm) pdata->clkdm_allow_idle(reset->clkdm); - } return ret; } -- 2.33.0