From patchwork Tue Mar 28 21:34:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 9650527 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 783A8601D7 for ; Tue, 28 Mar 2017 21:36:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E49D283C9 for ; Tue, 28 Mar 2017 21:36:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 626BB28405; Tue, 28 Mar 2017 21:36:13 +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 0B549283C9 for ; Tue, 28 Mar 2017 21:36:13 +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=lPj15GQj+mirhnPM05DM7MnsAp5CAOBk1DBTavcS1vM=; b=hUQiwpYx72VZcuy3tUmS4IYnvv fvKNo25AW2mT12yQ6JEfyBP8DdYvm9IGLM0gyYTY4OMz2lEqWighOkGyvrqNC19rAlFi1i0uwNZGS C0mB3uuieTf/+K9a6C2AeyDayaMhQQXz0vF2ngtmPz2esodSxYM8IF8Yyu9fI67WXSEBVtxt5EDlx m0v2TuXmH0Gd2INwHbhv0hWiOFwWVcScJuTqpBnVj+36JQtzRBI8HepnP5l4+/dISrNsVXfh48wVE sFHWeUDr+7TyjL0MdQjGsJ1YO1Fxhz1qzQ+kNnF0ML9AgQEIXE3y1ZmbEBP4svwdJISA6aV535SfZ TyWSR/OA==; 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 1csymi-0004Xj-7x; Tue, 28 Mar 2017 21:36:12 +0000 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1csymE-0003oR-3k for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2017 21:35:44 +0000 Received: by mail-qk0-x241.google.com with SMTP id r142so10551228qke.3 for ; Tue, 28 Mar 2017 14:35:24 -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=DYTEUu8Gv8OH3HgS9/sYsC9X+yur8zLUNHmoyN7t7U8=; b=k44QCxCN+ShREJAGXiY+NhEGdjow/vKYuC2Opvgc0rmO6cGS1zLddj6yiocaJFMF3l WKLOdBLUSe4uE6WZ23AAxzAm6yLmDScc3CQHzDZaVYlvB7mcR0x0o5xWr/y2jQU0QvQu ZxU3DdIxCmxg8FCuKyBvg5P5ZaeYKC5Ce+jWpmEqEyDVC49LNf+ATKHP8sjV1Ex+Hdwl Ddxi/lXnK5nUrvoQaWIeCG8O6QXQOGu4HxS9C/CH74l3OeBV+yiWWMoCX3jyYQDmhOXz N6REX4JJbsOJ4UQ52ASnco/FCweGgQcLOkZYUpb8DzTw1r+A/zoLvi3tNGc19V9CbNC3 plOQ== 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=DYTEUu8Gv8OH3HgS9/sYsC9X+yur8zLUNHmoyN7t7U8=; b=fl/s/IOjl1/DnurxOuIwEr3SbkMUOdh6mBsQav8ZhY8HIul7Fk518f0Xct3vR0jWN4 cZuzx3y6iyw+bTJcCyv6gy+QFJYX5i2s2AdJoTFjPA8JE5NOofk71urCXOxjyEGASkWe nb2BvEPZxW8ToxdztpDfH+eYehM2kABkCn2xsZfhCRR9zUUoLGXKl4agDH44jOW72asn 0PgLFIUn8GGQDIQsID0JN8U+4ya9b7G2X5rCgQMmVk0uybOqz9bsK9C4WIx/p98yN7/I reNQHhiy1WHq8nEZPq5mTvh1ZlyNPi7chD8Mp72bTBS6th8RMioUSnlcfkF94ve/PSVN 7gRA== X-Gm-Message-State: AFeK/H0gXZ+yGchwZS/50CPwFXJ4Kcpg6QV7wvB4Jp6uH5f4Eq+WHDZK1+gKSZ0VJq5DDQ== X-Received: by 10.55.91.66 with SMTP id p63mr27095793qkb.319.1490736923437; Tue, 28 Mar 2017 14:35:23 -0700 (PDT) Received: from stb-bld-02.irv.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id a26sm3540762qtb.28.2017.03.28.14.35.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Mar 2017 14:35:22 -0700 (PDT) From: Doug Berger To: mark.rutland@arm.com Subject: [PATCH v2 7/8] bus: brcmstb_gisb: add notifier handling Date: Tue, 28 Mar 2017 14:34:30 -0700 Message-Id: <20170328213431.10904-8-opendmb@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170328213431.10904-1-opendmb@gmail.com> References: <20170328213431.10904-1-opendmb@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170328_143542_468853_DC390D78 X-CRM114-Status: GOOD ( 13.83 ) 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: wangkefeng.wang@huawei.com, catalin.marinas@arm.com, linus.walleij@linaro.org, will.deacon@arm.com, mingo@kernel.org, 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, suzuki.poulose@arm.com, robh+dt@kernel.org, gregory.0xf0@gmail.com, sandeepa.s.prabhu@gmail.com, 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 Check for GISB arbitration errors through a chained notifier when a process dies or a kernel panic occurs. This allows a meaningful diagnostic message to occur along with other diagnostic information. Notably writes to a bad GISB address on an ARM64 architecture kernel cause unrecoverable SError aborts and this allows the cause of the abort to be seen. Signed-off-by: Doug Berger --- drivers/bus/brcmstb_gisb.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c index 500b6bb5c739..774729002b8c 100644 --- a/drivers/bus/brcmstb_gisb.c +++ b/drivers/bus/brcmstb_gisb.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #ifdef CONFIG_ARM #include @@ -290,6 +292,25 @@ static irqreturn_t brcmstb_gisb_tea_handler(int irq, void *dev_id) return IRQ_HANDLED; } +/* + * Dump out gisb errors on die or panic. + */ +static int dump_gisb_error(struct notifier_block *self, unsigned long v, + void *p) +{ + struct brcmstb_gisb_arb_device *gdev; + + /* iterate over each GISB arb registered handlers */ + list_for_each_entry(gdev, &brcmstb_gisb_arb_device_list, next) + brcmstb_gisb_arb_decode_addr(gdev, "async abort"); + + return 0; +} + +static struct notifier_block gisb_error_notifier = { + .notifier_call = dump_gisb_error, +}; + static DEVICE_ATTR(gisb_arb_timeout, S_IWUSR | S_IRUGO, gisb_arb_get_timeout, gisb_arb_set_timeout); @@ -408,6 +429,12 @@ static int __init brcmstb_gisb_arb_probe(struct platform_device *pdev) board_be_handler = brcmstb_bus_error_handler; #endif + if (list_is_singular(&brcmstb_gisb_arb_device_list)) { + register_die_notifier(&gisb_error_notifier); + atomic_notifier_chain_register(&panic_notifier_list, + &gisb_error_notifier); + } + dev_info(&pdev->dev, "registered mem: %p, irqs: %d, %d\n", gdev->base, timeout_irq, tea_irq);