From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 431E8C47082 for ; Thu, 3 Jun 2021 12:58:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0CD32613E7 for ; Thu, 3 Jun 2021 12:58:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CD32613E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TDFVgJZrDKVyCEtyh+iHwnKRmqW+AfCXMUKo0x4hSRs=; b=At3KorpNGyeslM ocHL4OxuMgNb4glethwRdk/lVpanjFJ79wxaIXt0um0JrOmK6hR6azhUi56OTQLDpfrDAeQ/uhvih eyn8MPNGHjx6Nw1GF1XsCvewjVSYZHiDTNGjlp6UBDCfiWnmSLol61vSJiWTvc2nJqqvJ3WTwMfjC WcgCteEMxnKJmzgzb3rVbaP8jR4mfstZtpo1XSmRX7UTS1mMsbbDBO5RvzO6WEy/yKyjorBUTP8Vq 5hzTEidOmBQMnJj3b5r+TZdC4wXWjZDi5067PdQCYLpYrSddFR88XiSp21yFfzbbvMiGp4Je2d3Kj djTmLLJP9rQGtBRHBwIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lomt4-008mkw-8b; Thu, 03 Jun 2021 12:55:50 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lomsj-008mcG-Rk for linux-arm-kernel@lists.infradead.org; Thu, 03 Jun 2021 12:55:33 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id B4B73601FA; Thu, 3 Jun 2021 12:55:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622724929; bh=hlQCQeLNM6wv4+bzH7qwvgaV08CGpC6v6Cmi/Lm7hM8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZC2DyaiRxHa+G/2hbGWT1les204ug+pukd5PXtVAwnttb0Gpzwe0e2fvt15f2sm2H JkPO1exrqmJpWNDJvLn2+4rZZnIampHwSc5wEGLoAkx8KJ1IH5Qt/VZ8IauXVu31BP ssqNquMQYGI0ZFzlnGhP0x/OSJbraki1ZvtRFnT0UyGdJliuqkA3LofbwpMXsxAKUM ep72bbR12pCtwkzmAu4kgGkGY5CjitZu2XgxuWV98m8zopYyXdQhXh+pog4byXUcT4 xiov/uwRKAQxtNXQchzNDZLD/mQ04GJ3y1vBVRayrP3L5iMd7BjY/7yi6su4C3JIYj MvQYsHsn7mhdw== Received: by pali.im (Postfix) id 575941229; Thu, 3 Jun 2021 14:55:25 +0200 (CEST) Date: Thu, 3 Jun 2021 14:55:25 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Chris Packham Cc: "jason@lakedaemon.net" , Joshua Scott , "gregory.clement@bootlin.com" , "andrew@lunn.ch" , "sebastian.hesselbarth@gmail.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] ARM: mvebu: Enable MBUS error propagation Message-ID: <20210603125525.nkswvixbabkgq5or@pali> References: <20191124093529.32399-1-chris.packham@alliedtelesis.co.nz> <8736cqb63d.fsf@FE-laptop> <0285a09b2b1b7ae2ccc268a37e4357c95d270ac9.camel@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0285a09b2b1b7ae2ccc268a37e4357c95d270ac9.camel@alliedtelesis.co.nz> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_055529_989703_B1925930 X-CRM114-Status: GOOD ( 39.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wednesday 08 January 2020 19:42:12 Chris Packham wrote: > Hi Gregory, > > On Wed, 2020-01-08 at 11:22 +0100, Gregory CLEMENT wrote: > > Hello Chris, > > > > > U-boot disables MBUS error propagation for Armada-385. The effect of > > > this on the kernel is that any access to a mapped but inaccessible > > > address causes the system to hang. > > > > > > By enabling MBUS error propagation the kernel can raise a Bus Error and > > > panic to restart the system. > > > > Unless I miss it, it seems that nobody comment this patch: sorry for the > > delay. > > > > Thanks for the response. > > > > > > > Signed-off-by: Chris Packham > > > --- > > > > > > Notes: > > > We've encountered an issue where rogue accesses to PCI-e space cause an > > > Armada-385 system to lockup. We've found that enabling MBUS error > > > propagation lets us get a bus error which at least gives us a panic to > > > help identify what was accessed. > > > > > > U-boot clears the IO Err Prop Enable Bit[1] but so far no-one seems to > > > know why. > > > > > > I wasn't sure where to put this code. There is similar code for kirwood > > > in the equivalent dt_init function. On Armada-XP the register is part of > > > the Core Coherency Fabric block (for A385 it's documented as part of the > > > CCF block). > > > > What about adding a new set of register to the mvebu mbus driver? > > > > After more testing we found that some previously "good" boards started > throwing up panics with this change. I think that this might require > handling some of the PCI-e interrupts (for correctable errors) via the > EDAC subsystem. > > We're still working with Marvell to track down exactly why this is > happening on our system. Hello Chris! Have you somehow solved this issue? Or do you have some contacts in Marvell for A385 PCIe subsystem? > > In this case it will be called even earlier allowing to see bus error > > earlier. > > > > In any case, you should separate the device tree change from the code > > change and at least provide 2 patches. > > Agreed. If/when something solid eventuates we'll do it as a proper > series. > > > > > Gregory > > > > > > > > -- > > > [1] - https://gitlab.denx.de/u-boot/u-boot/blob/master/arch/arm/mach-mvebu/cpu.c#L489 > > > > > > arch/arm/boot/dts/armada-38x.dtsi | 5 +++++ > > > arch/arm/mach-mvebu/board-v7.c | 27 +++++++++++++++++++++++++++ > > > 2 files changed, 32 insertions(+) > > > > > > diff --git a/arch/arm/boot/dts/armada-38x.dtsi b/arch/arm/boot/dts/armada-38x.dtsi > > > index 3f4bb44d85f0..3214c67433eb 100644 > > > --- a/arch/arm/boot/dts/armada-38x.dtsi > > > +++ b/arch/arm/boot/dts/armada-38x.dtsi > > > @@ -386,6 +386,11 @@ > > > <0x20250 0x8>; > > > }; > > > > > > + ioerrc: io-err-control@20200 { > > > + compatible = "marvell,io-err-control"; > > > + reg = <0x20200 0x4>; > > > + }; > > > + > > > mpic: interrupt-controller@20a00 { > > > compatible = "marvell,mpic"; > > > reg = <0x20a00 0x2d0>, <0x21070 0x58>; > > > diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c > > > index d2df5ef9382b..fb7718386ef9 100644 > > > --- a/arch/arm/mach-mvebu/board-v7.c > > > +++ b/arch/arm/mach-mvebu/board-v7.c > > > @@ -138,10 +138,36 @@ static void __init i2c_quirk(void) > > > } > > > } > > > > > > +#define MBUS_ERR_PROP_EN BIT(8) > > > + > > > +/* > > > + * U-boot disables MBUS error propagation. Re-enable it so we > > > + * can handle them as Bus Errors. > > > + */ > > > +static void __init enable_mbus_error_propagation(void) > > > +{ > > > + struct device_node *np = > > > + of_find_compatible_node(NULL, NULL, "marvell,io-err-control"); > > > + > > > + if (np) { > > > + void __iomem *reg; > > > + > > > + reg = of_iomap(np, 0); > > > + if (reg) { > > > + u32 val; > > > + > > > + val = readl_relaxed(reg); > > > + writel_relaxed(val | MBUS_ERR_PROP_EN, reg); > > > + } > > > + of_node_put(np); > > > + } > > > +} > > > + > > > static void __init mvebu_dt_init(void) > > > { > > > if (of_machine_is_compatible("marvell,armadaxp")) > > > i2c_quirk(); > > > + enable_mbus_error_propagation(); > > > } > > > > > > static void __init armada_370_xp_dt_fixup(void) > > > @@ -191,6 +217,7 @@ DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)") > > > .l2c_aux_val = 0, > > > .l2c_aux_mask = ~0, > > > .init_irq = mvebu_init_irq, > > > + .init_machine = mvebu_dt_init, > > > .restart = mvebu_restart, > > > .dt_compat = armada_38x_dt_compat, > > > MACHINE_END > > > -- > > > 2.24.0 > > > > > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel