Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2118115ybl; Thu, 9 Jan 2020 07:12:19 -0800 (PST) X-Google-Smtp-Source: APXvYqw9rlz7gM1uizS7tBb8l80dj0b6J8pdWGXL1XQvVk7s6+sVcRV4PRYdNfT72DV0VIRzS2nZ X-Received: by 2002:a9d:c42:: with SMTP id 60mr8568998otr.182.1578582739554; Thu, 09 Jan 2020 07:12:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578582739; cv=none; d=google.com; s=arc-20160816; b=lqqX4391UIu32VlPlpZ+is5SDsuF2Prw9RKAqDeNDN7rhaOwU4Zc8s4EdQuSGpD6KP D8UcFuL6WNmd1SVXAXdnv+EuKZhnD9DgyWCvCMfRGvY8inNLMOORHfSRTCI/rM992b9b gB8i+5sAfhYh5KLmJy+A+AYRAe9XkeFgXEWTUiobX8i0rwrvOvBa9mTpw7bqWT3ne5BO Ic8uDbpwYA6urvsw6zlxvJz7iVb5HOSxhJxlTX4YElXncqVLQXtNgUx0WsHsPUnuGNeU Pbp3RRHssMGCqGdlOLYfsZNU8Q1RcSWFolpDg58bQQ+FXuWGes3DpxAC6Lf86JKAl7B7 jHpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/uOed+eugaR2xu9CXwkgolYr0/NXG57GP2X+ZCFs/48=; b=xvfd9Hi8YudpISh4ei1TKJRZxDlsBS1WXWZM5UCKtLu7aLtXrjZ5c89hZZDsIfGU5Z UMMGlcI+JXQGsO29TSUdFfDpXehM9G5FbLpTMc5NS6DXB+LlTl+ZwgVApMXYJJTuEVhp AkJYBG0+Nu5KGbfw15fFYjsokNsiq9Xs2OgcykuTMuUlAeUI4vWnIq/3dHilC7cIcJt1 Ihf/AMRU+TzIyhRGr5vleiYVhJgsPZZMupqK0XLHRMQbU0XRaIlOATb4KGvC86uLyHBH NyJvsBJi6HEZ5DIOSfLqsj8OjrIvjHyeC/AgvMJWTygAz0mJptVFU8mwFymii7Bt0ebr UF2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si3865706oie.146.2020.01.09.07.12.07; Thu, 09 Jan 2020 07:12:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731016AbgAIMeQ (ORCPT + 99 others); Thu, 9 Jan 2020 07:34:16 -0500 Received: from mx2.suse.de ([195.135.220.15]:38028 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730970AbgAIMeL (ORCPT ); Thu, 9 Jan 2020 07:34:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 11D76B220F; Thu, 9 Jan 2020 12:34:06 +0000 (UTC) From: Thomas Bogendoerfer To: Paul Burton Cc: Ralf Baechle , James Hogan , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/14] MIPS: SGI-IP27: Use structs for decoding error status registers Date: Thu, 9 Jan 2020 13:33:46 +0100 Message-Id: <20200109123353.5656-10-tbogendoerfer@suse.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200109123353.5656-1-tbogendoerfer@suse.de> References: <20200109123353.5656-1-tbogendoerfer@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert printing of error status registers to use structs, which are defines for IP27 and IP35. Signed-off-by: Thomas Bogendoerfer --- arch/mips/sgi-ip27/ip27-berr.c | 38 ++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/arch/mips/sgi-ip27/ip27-berr.c b/arch/mips/sgi-ip27/ip27-berr.c index 65635f765645..5a38ae6bdfa9 100644 --- a/arch/mips/sgi-ip27/ip27-berr.c +++ b/arch/mips/sgi-ip27/ip27-berr.c @@ -30,29 +30,31 @@ static void dump_hub_information(unsigned long errst0, unsigned long errst1) { "WERR", "Uncached Partial Write", "PWERR", "Write Timeout", NULL, NULL, NULL, NULL } }; - int wrb = errst1 & PI_ERR_ST1_WRBRRB_MASK; + union pi_err_stat0 st0; + union pi_err_stat1 st1; - if (!(errst0 & PI_ERR_ST0_VALID_MASK)) { - printk("Hub does not contain valid error information\n"); + st0.pi_stat0_word = errst0; + st1.pi_stat1_word = errst1; + + if (!st0.pi_stat0_fmt.s0_valid) { + pr_info("Hub does not contain valid error information\n"); return; } - - printk("Hub has valid error information:\n"); - if (errst0 & PI_ERR_ST0_OVERRUN_MASK) - printk("Overrun is set. Error stack may contain additional " + pr_info("Hub has valid error information:\n"); + if (st0.pi_stat0_fmt.s0_ovr_run) + pr_info("Overrun is set. Error stack may contain additional " "information.\n"); - printk("Hub error address is %08lx\n", - (errst0 & PI_ERR_ST0_ADDR_MASK) >> (PI_ERR_ST0_ADDR_SHFT - 3)); - printk("Incoming message command 0x%lx\n", - (errst0 & PI_ERR_ST0_CMD_MASK) >> PI_ERR_ST0_CMD_SHFT); - printk("Supplemental field of incoming message is 0x%lx\n", - (errst0 & PI_ERR_ST0_SUPPL_MASK) >> PI_ERR_ST0_SUPPL_SHFT); - printk("T5 Rn (for RRB only) is 0x%lx\n", - (errst0 & PI_ERR_ST0_REQNUM_MASK) >> PI_ERR_ST0_REQNUM_SHFT); - printk("Error type is %s\n", err_type[wrb] - [(errst0 & PI_ERR_ST0_TYPE_MASK) >> PI_ERR_ST0_TYPE_SHFT] - ? : "invalid"); + pr_info("Hub error address is %08lx\n", + (unsigned long)st0.pi_stat0_fmt.s0_addr); + pr_info("Incoming message command 0x%lx\n", + (unsigned long)st0.pi_stat0_fmt.s0_cmd); + pr_info("Supplemental field of incoming message is 0x%lx\n", + (unsigned long)st0.pi_stat0_fmt.s0_supl); + pr_info("T5 Rn (for RRB only) is 0x%lx\n", + (unsigned long)st0.pi_stat0_fmt.s0_t5_req); + pr_info("Error type is %s\n", err_type[st1.pi_stat1_fmt.s1_rw_rb] + [st0.pi_stat0_fmt.s0_err_type] ? : "invalid"); } int ip27_be_handler(struct pt_regs *regs, int is_fixup) -- 2.24.1