Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1617123pxb; Mon, 11 Oct 2021 09:34:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEqEFtQna8bkcX+8R2DbeMfUDkLipI1z1f/v+cFNfFKs2Ykx5l8LH+Ty/fIKGDTgOw0TTU X-Received: by 2002:a17:906:cd11:: with SMTP id oz17mr28210018ejb.67.1633970042519; Mon, 11 Oct 2021 09:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633970042; cv=none; d=google.com; s=arc-20160816; b=xc3ntwnkyzsaX5hHqSPPcpnd6uVc1AQxlV9JkvjlUIGMLBCUT/c+sZz2GOO4tmeX/s EfcqdMiUIvOhNFidNx+ucPtnUcykzNLYnfPpioH7ENRzgzQZaDSOfNGFfJHVIm/xBLNG x9FqDHPtjZGiFY+qMQ4YEuIl0cDW1tNFnmTOYu8XmnOa1zPtcSfDmO/z9pThsEpXdQGJ QPCSCVRAJzLiVPytcwga8fselOqxuHst3iZHHEYeSiYtR/D4o2eTlIY01aoGbO4J82Vc CH8P4issBBZuWZGaoU3XD6tkhJ6MPmRjuFSgcHskfevqI+ilovap8PtI5pwTpVO6ZkRy /VSQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NEPtuCEGksaBY//2MtPhsQTWlhTpdYptAUPpo56vjNg=; b=MCWR8JO3rfuCo+YjjsrhXE+OduA3AHm3CB3tClKA2k1ZLAjJonTFDlbefK2Yb9llgU 3Xvwj8EFE/YpH0LFRcPMYDbJim1/hJP4kQAQfbsYkSQMZJpy9lsGb92V2rPlFRFtzvcC o29oq5VA+4UHGFbIbTqn6aGRcERWh/nfhrJh647ZqaSoepvqJwL8CqXI3Ewvtqx1HTZu CxEGEpCG6kn8oSo0VfsISEVWmFrOEhW6BeSOPaLSEkuFHLSuOl07sRsFkBYMm2uMHctI BKcMmpPSZYDzpdwbU1VvSXlaCiqD2UvOdxQPAT00XgeRLdI8xV1bDtLXnP1ooVntsJ+H 5plg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bf42dsyZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si12153498eje.51.2021.10.11.09.33.38; Mon, 11 Oct 2021 09:34:02 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bf42dsyZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238025AbhJKN7t (ORCPT + 99 others); Mon, 11 Oct 2021 09:59:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:49208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238192AbhJKN5c (ORCPT ); Mon, 11 Oct 2021 09:57:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2712C60555; Mon, 11 Oct 2021 13:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960450; bh=t/0bX0SbVyZbJc1kDZCfPr7Bm/ITs/34zUpEui1W42U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bf42dsyZfcTaRHZzUr4piAxF+5Rqzzl+9faDgr5pJ76Jb/QtytkRYadvug+c0/7qF z7j1wmGygsL6XudgJiKBg+0YPirVSL2ICRplK6CihpJBYFPfKlSe7sgjvrRcNc3k4z UYu3CY9LQpU7Z8Et9oDIA2KWVzshqHI6HitQiPq4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Drew Fustini , Grygorii Strashko , "H. Nikolaus Schaller" , Robert Nelson , Yongqin Liu , Matti Vaittinen , Matti Vaittinen , Tony Lindgren , Sasha Levin Subject: [PATCH 5.10 36/83] soc: ti: omap-prm: Fix external abort for am335x pruss Date: Mon, 11 Oct 2021 15:45:56 +0200 Message-Id: <20211011134509.631730661@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tony Lindgren [ Upstream commit b232537074fcaf0c2837abbb217429c097bb7598 ] 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 Fixes: effe89e40037 ("soc: ti: omap-prm: Fix occasional abort on reset deassert for dra7 iva") Reported-by: Matti Vaittinen Tested-by: Matti Vaittinen Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- 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 index fb067b5e4a97..4a782bfd753c 100644 --- a/drivers/soc/ti/omap_prm.c +++ b/drivers/soc/ti/omap_prm.c @@ -509,25 +509,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