From patchwork Fri Mar 24 14:46:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 9643027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 798B660327 for ; Fri, 24 Mar 2017 14:51:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BDF9205FD for ; Fri, 24 Mar 2017 14:51:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6026422701; Fri, 24 Mar 2017 14:51:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EABE2205FD for ; Fri, 24 Mar 2017 14:51:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=12dMDpJtRayBMppywvwJIxuquStRk5Co6YVBi+oQRvw=; b=L/VWxds2tevD25iNv8g4mVUcN3 /Fx9gaM/6rZILu+GcMgZguTX0GV1x7ADgUpuam1q0W6vfLkgMXOf2/OqOaUniWcbYOUz5CPQ7dii7 XurY5vd0VlORfgF+EtQ3Vy0o4o5T4F2VkBHc3yW5TJXctzO1hnm246FIUVIVSwm6xEHpjkTinTlx8 7e6XnXCSs0vl+mQ9qHa3Sr5DPXXmVf+QrN2BUn5cZzlCRAksYl3JzeJ/7JBGAbdXPHNE0w0ImF+cP MjWFWXGPfTbOsZqFPgPmYPik0d0nnt4UZSpzowtlvUC8aZl9ZLqp7syLfI1nNLaSPzGIlZZNyxdJt kjQ1NeiQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1crQYy-0006KR-Jd; Fri, 24 Mar 2017 14:51:36 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1crQYO-00066u-QY for linux-arm-kernel@bombadil.infradead.org; Fri, 24 Mar 2017 14:51:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IDfIuRajFSnT/x2ofLmKEFP7yqbo2zCRmRmqK4K5/sA=; b=v4QiCR33kn/IdwE5qlW+64F3h SHuknQI1FkxMBAiO27zW7Q1kPxVVa9BoZX7A0i605GhLTKOYTZdYLxgRJOw5BYxbN1zJu7c+wE+MH +JwxjrVI0n6pGCrJd04W0feE7jHubaKqqBV3N3DED3/O8imdpHkNEO2EWn+FgV9/Jr1gj/Y2QO6/T Rs1pWq9AWf5zP7pD0RdN+asP4dp2R7oGKKE5EWlm/QyBn7vLCpnRlhu7FW/msk+t96rgcW8WbH5BS zMDkentGEufYneYUMrhCa0HAITka63UzMhgc5NMp25yhotywPNtprDu/td+jJ1PLExqt/l5G4LDoi BatXOBX/g==; Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1crQW8-00026X-8v for linux-arm-kernel@lists.infradead.org; Fri, 24 Mar 2017 14:48:42 +0000 Received: by mail-wm0-x242.google.com with SMTP id x124so1008050wmf.3 for ; Fri, 24 Mar 2017 07:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IDfIuRajFSnT/x2ofLmKEFP7yqbo2zCRmRmqK4K5/sA=; b=grQuQ4KDQoMuViJVuJ7sVhEBkFcEWdR2+2Qz2fGStVe2nYRZ2lijXY7IXp+/lN8gb0 XQ/W8p1LnkyV0IYOxYGq9x2W70fjTsWv4FsXOZIA+Q+IX6m+LzFAjAanm2Qv7HJTW6K9 a4uBYGDUI8fHZlR6UwKGlKN7Sfc92wWHzY0GS+SCaCEszTttUgrvYwGlsRGN7pG58XaY w8CDAt+MuxMh6k10XBc7Ic1ROknKsDdM6zc5Oro1HNen0j5nff4w+MMiOOPvXrh0nwRb POiRcOEpmiJ2QKPmFD/YUh11DfXRSkrS/BcNmaWWdie2JV4Nfl1In7uM8HcMLpAyxUZo RVjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IDfIuRajFSnT/x2ofLmKEFP7yqbo2zCRmRmqK4K5/sA=; b=tiFoCdBtroaFdlryt43GnvKSNMt15HNFpnWcpQ+9OJYbcIvyreVYZzAzMAWNF2ICXZ sVm3xfShIV/cwI85QFQr3Mc8QH2w0SV4kbYP/hit3akUkTmEH4qy7MxHfGBqfmPUAFcW ZRX93zO6GuKP3n/ArR2cchXX71JHHuvQNzlTQULqFuJzO2pt5s4bOo7B+Y5gmg9VfF3F NdCED+sYeJgKAI/wx3qX8ST2Ebz40dVUTfbfg4FM93khT3DE006Zi7DcWUIu7PRAioTn hsLWP3U1GO8efagAFP1rG/wUwts/T+tCZ98nyRso/l0m1IjwljuvJ/LYxKE1WOFTdR8y Mytg== X-Gm-Message-State: AFeK/H1S5SXrxVwuaTJHAqvi6FJoMGtB7xpvIaoaEXMlt5lCqTqm45MvNLknQb6acKNy+g== X-Received: by 10.28.169.199 with SMTP id s190mr3393016wme.2.1490366898961; Fri, 24 Mar 2017 07:48:18 -0700 (PDT) Received: from stb-bld-02.irv.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id k32sm3154947wre.18.2017.03.24.07.48.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 07:48:18 -0700 (PDT) From: Doug Berger To: catalin.marinas@arm.com Subject: [PATCH 8/9] bus: brcmstb_gisb: add ARM64 SError support Date: Fri, 24 Mar 2017 07:46:31 -0700 Message-Id: <20170324144632.5896-9-opendmb@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170324144632.5896-1-opendmb@gmail.com> References: <20170324144632.5896-1-opendmb@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170324_144840_439618_ABBB6EFB X-CRM114-Status: GOOD ( 12.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, wangkefeng.wang@huawei.com, linus.walleij@linaro.org, will.deacon@arm.com, mingo@kernel.org, panand@redhat.com, f.fainelli@gmail.com, jonathanh@nvidia.com, bgolaszewski@baylibre.com, bcm-kernel-feedback-list@broadcom.com, shijie.huang@arm.com, opendmb@gmail.com, treding@nvidia.com, devicetree@vger.kernel.org, vladimir.murzin@arm.com, cmetcalf@mellanox.com, suzuki.poulose@arm.com, andre.przywara@arm.com, robh+dt@kernel.org, gregory.0xf0@gmail.com, sandeepa.s.prabhu@gmail.com, horms+renesas@verge.net.au, linux-arm-kernel@lists.infradead.org, mirza.krak@gmail.com, linux-kernel@vger.kernel.org, james.morse@arm.com, olof@lixom.net, computersforpeace@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Asynchronous external aborts (e.g. for buffered writes) trigger SError aborts on the arm64 architecture. This commit hooks the SError abort handling to check for GISB arbitration errors. Signed-off-by: Doug Berger --- drivers/bus/brcmstb_gisb.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c index bf26b4017a2c..52b5d96081eb 100644 --- a/drivers/bus/brcmstb_gisb.c +++ b/drivers/bus/brcmstb_gisb.c @@ -252,6 +252,28 @@ static int brcmstb_bus_error_handler(unsigned long addr, unsigned int fsr, /* Always report unhandled exception */ return 1; } + +#ifdef CONFIG_ARM64 +static int (*serror_chain)(unsigned long addr, unsigned int esr, + struct pt_regs *regs); +static int do_brahma_b53_serror(unsigned long addr, unsigned int esr, + struct pt_regs *regs) +{ + struct brcmstb_gisb_arb_device *gdev; + + if (((esr & (3 << 22)) == 0) && ((esr & 3) == 2)) { + /* iterate over each GISB arb registered handlers */ + list_for_each_entry(gdev, &brcmstb_gisb_arb_device_list, next) + brcmstb_gisb_arb_decode_addr(gdev, "bus error"); + } + + if (serror_chain) + return serror_chain(addr, esr, regs); + + /* Always report unhandled exception */ + return 1; +} +#endif #endif /* CONFIG_ARM || CONFIG_ARM64 */ #ifdef CONFIG_MIPS @@ -403,6 +425,8 @@ static int __init brcmstb_gisb_arb_probe(struct platform_device *pdev) #ifdef CONFIG_ARM64 hook_fault_code(16, brcmstb_bus_error_handler, SIGBUS, 0, "synchronous external abort"); + if (list_is_singular(&brcmstb_gisb_arb_device_list)) + serror_chain = hook_serror_handler(do_brahma_b53_serror); #endif #ifdef CONFIG_MIPS board_be_handler = brcmstb_bus_error_handler;