Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp199049pxb; Thu, 30 Sep 2021 04:21:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp2tOUWGuMrqazMBJDtXSVl3THslpPq11vNSv8uXkuiSnP73CfF81rzORrz9IhlJJ4m9+F X-Received: by 2002:aa7:c2d3:: with SMTP id m19mr6470658edp.267.1633000914194; Thu, 30 Sep 2021 04:21:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633000914; cv=none; d=google.com; s=arc-20160816; b=G/CeFncKu75kPbgobtFpfHkHAPF430llQ4YKwfCMpjcNkAx0K+xr4GoIQvaDSKr7tc y7syv3ZcNAL+ba97JX+M/4/96t+waznANP4eFkvQeIhYSqndOdAhdf4l/NQee5nRTvH7 OWBOSRaqz8r3vh2UD5zbwcBGt32b+pyx7VKhC2TO52dcluqnOlukgOQOHX0bbCHnpNg/ iRMMFEGz3KdEYum9vJA5Bo8/5bI2XPf0t4pagUzN4c9uaqDkQEAfMjBj1MDKbR16/Pph hytl99bQOSRuDpbpfRoOOOUjMpWx3ReCaU2g1ipyx5gjz8rJIVihurRHDzz+VHNDknXI vnoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=CuBe7VTii+ARJV5/n/7vopDodxCqVzGoRsKXxt3uaw4=; b=GX8WVpgpucop4RII9c7k91h42C+HuB3GaXl198fnzilQnBsw5CrGjKSuVTZqijoqU2 H0iRJU37HijJY3qOjhtgT3n6gd/p+HNLtuU4PKxB6T6hMjepToV2Qk1/uaAHrKwez8K4 NMnU2nz9OSN06i/7ojnCfgz/58nfdN/M3X8QdvhvqKiloy6XENNuWXnZKaLQqmMDXJqX WIo4g1DGxbpJwfStCkrEkh1E106CRhJXCDuK8FgB/sLKGnaJrMHBYk1Eiak5QaOOIU/6 rwiE/HFvjLnricldF6mW4b+JlDgIAz4wUuwsG71SUHaG38GFCal0oOCyRJxFnvjnKG1m aUQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="JAcRjj/i"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si2901573edq.383.2021.09.30.04.21.24; Thu, 30 Sep 2021 04:21:54 -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=@gmail.com header.s=20210112 header.b="JAcRjj/i"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350379AbhI3LVk (ORCPT + 99 others); Thu, 30 Sep 2021 07:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350339AbhI3LVj (ORCPT ); Thu, 30 Sep 2021 07:21:39 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7BA5C06176A; Thu, 30 Sep 2021 04:19:56 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id y26so23773025lfa.11; Thu, 30 Sep 2021 04:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:content-language:to:cc :references:from:subject:in-reply-to:content-transfer-encoding; bh=CuBe7VTii+ARJV5/n/7vopDodxCqVzGoRsKXxt3uaw4=; b=JAcRjj/iUrMxuV1LGjqfn9OGQIFIFvABmlDHzLB9Fnk+IxuJlcnF/uyWjuS7nOT31g Ig62W6rHb7jNdnnxa8MIkxrQ78YdxSyQ2b+3BxaVX9/1FQ12vqBgN6k+tIFjXBPDuUc0 ZrkBqPGOa0BZ46Wcz1n4hPO4I0JtNG4IA2HGQ75DKTclBVwgan/pXpWy3sLSQSkVid91 S+noo9Pms40YVwK48q6S0bn6ZfZYURP0jggNvxdX83mhUGd6g05H+MDnn5lkP5+hVcGw 3Srq8j64v4cvUVhIEt40eMP6MvcZIAx9HQxvGLjabd9OVU0UK0M5KI/kXmFEH1fBq2Rt Q8mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=CuBe7VTii+ARJV5/n/7vopDodxCqVzGoRsKXxt3uaw4=; b=iu4n7rHG/1/UsdVXAmqONjhFMwFvBbAsSo0Hqd6NoM0V32J2mLR34pTjsIDw9TR0Dq h01x6qiqmVRUBK5n1AGL0o0ShFEJ1HnN/fB4NZYuBQd/bNlqke+kYy9YMFc73150eK5Y n+FlO1iJf3yPTzF2bYVgEGae6tBc4uTPiZCNaEiMS/aDBoQXiIOEN1llEwjbsVDMy/8J 0nIVxmHywk7o1yI5HXJLcVzG9d9+noqZedNVsJjvHYPwmvYj14zNcozZQ7d6hrPvxFC0 fQs+0w3quYszxTF1bzu5336qGs9IgA18eix1GiiPxWuKet0aXUpj/L4/h/86iMOgQXqA VsDw== X-Gm-Message-State: AOAM533WLCi7L74OpdlzVXXhNERCQjPsIBKCWb5+dgpadoPJH+nFZqqJ D66Iqmh7HSlqPkJu9xREIVw= X-Received: by 2002:a2e:8617:: with SMTP id a23mr5443721lji.199.1633000794938; Thu, 30 Sep 2021 04:19:54 -0700 (PDT) Received: from [172.16.185.20] ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id s22sm310824ljg.15.2021.09.30.04.19.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Sep 2021 04:19:54 -0700 (PDT) Message-ID: Date: Thu, 30 Sep 2021 14:19:53 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Content-Language: en-US To: Tony Lindgren , 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 References: <20210930080100.56820-1-tony@atomide.com> From: Matti Vaittinen Subject: Re: [PATCH] soc: ti: omap-prm: Fix external abort for am335x pruss In-Reply-To: <20210930080100.56820-1-tony@atomide.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Tony! This was _much_ appreciated :) On 9/30/21 11:01, Tony Lindgren wrote: > 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") Tested-by: Matti Vaittinen > 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); If I was writing this I might drop the __func__. AFAIR dyndbg allows enabling the functipn names to be printed by +f. This is just a 'nit' though - I am happy if this fix gets in no matter how this print eventually looks like. I just thought I mention this as the __func__ catched my eye. > > /* 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); Same here (although that would be unrelated change as the print exists prior this patch). I tested this patch on v5.15-rc3 using my BBB Rev C - it seems to fix the boot issue on my board! Thanks a bunch! Best Regards --Matti Vaittinen