From patchwork Sat Oct 29 11:12:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 688739 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t5dLv5xdtz9t0q for ; Sat, 29 Oct 2016 22:14:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Mn/jllrs; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c0RZW-00071x-SO; Sat, 29 Oct 2016 11:13:10 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c0RZS-0006zK-Hg for linux-arm-kernel@lists.infradead.org; Sat, 29 Oct 2016 11:13:07 +0000 Received: by mail-lf0-x244.google.com with SMTP id x79so4939119lff.2 for ; Sat, 29 Oct 2016 04:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TK+CA4LwVvlgGEo1+bLTica8edi0zV89qrZlL8FgsCc=; b=Mn/jllrs53ywiRjXKy1lzTQ59tb6hpOMcKk+bHYLJfcRLsSKkhrHSmbMIZlWEkRleA JfiP0IicVo/hgR41t7MJ9hIgtrKkyKmT0WwSIoqLRB5Pi7xnNwqEiSvY27/bDIkgl0YF 7oxqhQZZCW/JfsmKSQovnqfQEhDmgCldUnJRxQFqS4vhPAYJg0dgkEpwrJ5btNa4/CeY +F1H+O+F4bGxxZxfhLgFrpX+c5v/hPGbFPZwJWGNtRLMV226xFz3vs2pwc2xi7asSZQ4 rGiINmlyqwgDUeOAMeCpF6C6++FoeHolzjFtItUWzmJbPvw0Qc28wVG6ufCg3fHO2qXM IacQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TK+CA4LwVvlgGEo1+bLTica8edi0zV89qrZlL8FgsCc=; b=fuaW8JW3YMRp6gxhJQH08LEJKWAPdXF/J8gQw6ByAEtMKKe7+HF2RHqsA7xUUGwbDy xEu1hnbJ6qgEU+dn2Y5IbPsx19k6p/MI9wSagW5VMJ7R5CZlkBT0pTd4IpqC/J0WaeiL IIcPyy9FXczeK0Xe5CJL1MFhK8T9rC05pT9mTRCeP8X2j/RNRl99gUoOfRzzinLEk0/D /jMq7XTkXqV8yBHhYHs+w+VG9oLMKfb8aYego4OThbgpO6mxzgNrpe8CcyPnN0f3ch4M G9iMu2AAs57DObpRKrfnxLq8N9nEjVAI3US2m5HBqAVwFohoaITBQkGUkpleNggMi0x+ 6zKA== X-Gm-Message-State: ABUngvcIr1YV/fyeNKZ+sTVBDtH6PZuxqJzYM/mc1sKKGZKyBTUP/7K8VZ8rxPc5UohUuw== X-Received: by 10.25.19.106 with SMTP id j103mr11401563lfi.68.1477739563694; Sat, 29 Oct 2016 04:12:43 -0700 (PDT) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id 18sm2750941ljj.49.2016.10.29.04.12.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Oct 2016 04:12:42 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Florian Fainelli , linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: BCM5301X: Add back handler ignoring external imprecise aborts Date: Sat, 29 Oct 2016 13:12:29 +0200 Message-Id: <20161029111229.26875-1-zajec5@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161029_041306_918030_20FB2200 X-CRM114-Status: GOOD ( 14.05 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:244 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Scott Branden , Arnd Bergmann , Jon Mason , Hauke Mehrtens , linux-pci@vger.kernel.org, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , bcm-kernel-feedback-list@broadcom.com, Ray Jui , Bjorn Helgaas , Lucas Stach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Rafał Miłecki Since early BCM5301X days we got abort handler that was removed by commit 937b12306ea79 ("ARM: BCM5301X: remove workaround imprecise abort fault handler"). It assumed we need to deal only with pending aborts left by the bootloader. Unfortunately this isn't true for BCM5301X. When probing PCI config space (device enumeration) it is expected to have master aborts on the PCI bus. Most bridges don't forward (or they allow disabling it) these errors onto the AXI/AMBA bus but not the Northstar (BCM5301X) one. iProc PCIe controller on Northstar seems to be some older one, without a control register for errors forwarding. It means we need to workaround this at platform level. All newer platforms are not affected by this issue. Signed-off-by: Rafał Miłecki --- arch/arm/mach-bcm/bcm_5301x.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm/mach-bcm/bcm_5301x.c b/arch/arm/mach-bcm/bcm_5301x.c index c8830a2..fe067f6 100644 --- a/arch/arm/mach-bcm/bcm_5301x.c +++ b/arch/arm/mach-bcm/bcm_5301x.c @@ -9,14 +9,42 @@ #include #include +#include +#include + +#define FSR_EXTERNAL (1 << 12) +#define FSR_READ (0 << 10) +#define FSR_IMPRECISE 0x0406 static const char *const bcm5301x_dt_compat[] __initconst = { "brcm,bcm4708", NULL, }; +static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr, + struct pt_regs *regs) +{ + /* + * We want to ignore aborts forwarded from the PCIe bus that are + * expected and shouldn't really be passed by the PCIe controller. + * The biggest disadvantage is the same FSR code may be reported when + * reading non-existing APB register and we shouldn't ignore that. + */ + if (fsr == (FSR_EXTERNAL | FSR_READ | FSR_IMPRECISE)) + return 0; + + return 1; +} + +static void __init bcm5301x_init_early(void) +{ + hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR, + "imprecise external abort"); +} + DT_MACHINE_START(BCM5301X, "BCM5301X") .l2c_aux_val = 0, .l2c_aux_mask = ~0, .dt_compat = bcm5301x_dt_compat, + .init_early = bcm5301x_init_early, MACHINE_END