From patchwork Wed Jun 6 15:01:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wenxiong@linux.vnet.ibm.com X-Patchwork-Id: 10450621 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 AE6B960234 for ; Wed, 6 Jun 2018 16:06:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DDF92995D for ; Wed, 6 Jun 2018 16:06:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9272629960; Wed, 6 Jun 2018 16:06:26 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 310472995D for ; Wed, 6 Jun 2018 16:06:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752096AbeFFQGZ (ORCPT ); Wed, 6 Jun 2018 12:06:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50504 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751812AbeFFQGY (ORCPT ); Wed, 6 Jun 2018 12:06:24 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w56G5sc9060326 for ; Wed, 6 Jun 2018 12:06:24 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jej1yths5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Jun 2018 12:06:24 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Jun 2018 10:06:23 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 6 Jun 2018 10:06:21 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w56G6KdI61931696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 6 Jun 2018 09:06:20 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CA096BE03E; Wed, 6 Jun 2018 10:06:20 -0600 (MDT) Received: from localhost.localdomain (unknown [9.40.195.89]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP id 6CFA7BE039; Wed, 6 Jun 2018 10:06:20 -0600 (MDT) From: wenxiong@linux.vnet.ibm.com To: linux-scsi@vger.kernel.org Cc: James.Bottomley@hansenpartnership.com, brking@linux.vnet.ibm.com, wenxiong@us.ibm.com, Wen Xiong Subject: [PATCH] ipr: Format HCAM overlay ID 0x41 Date: Wed, 6 Jun 2018 10:01:36 -0500 X-Mailer: git-send-email 1.6.0.2 X-TM-AS-GCONF: 00 x-cbid: 18060616-0012-0000-0000-0000166A28FE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009139; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000265; SDB=6.01043027; UDB=6.00534142; IPR=6.00822157; MB=3.00021491; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-06 16:06:23 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18060616-0013-0000-0000-0000532C3E54 Message-Id: <1528297296-9747-1-git-send-email-wenxiong@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-06_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806060182 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wen Xiong This patch adds formatting error overlay 0x41 to improve debug capabilities. Signed-off-by: Wen Xiong Acked-by: Brian King --- drivers/scsi/ipr.c | 25 +++++++++++++++++++++++++ drivers/scsi/ipr.h | 7 +++++++ 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 6615ad8..d51eb71 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -2413,6 +2413,28 @@ static void ipr_log_sis64_fabric_error(struct ipr_ioa_cfg *ioa_cfg, } /** + * ipr_log_sis64_service_required_error - Log a sis64 service required error. + * @ioa_cfg: ioa config struct + * @hostrcb: hostrcb struct + * + * Return value: + * none + **/ +static void ipr_log_sis64_service_required_error(struct ipr_ioa_cfg *ioa_cfg, + struct ipr_hostrcb *hostrcb) +{ + struct ipr_hostrcb_type_41_error *error; + + error = &hostrcb->hcam.u.error64.u.type_41_error; + + error->failure_reason[sizeof(error->failure_reason) - 1] = '\0'; + ipr_err("Primary Failure Reason: %s\n", error->failure_reason); + ipr_log_hex_data(ioa_cfg, error->data, + be32_to_cpu(hostrcb->hcam.length) - + (offsetof(struct ipr_hostrcb_error, u) + + offsetof(struct ipr_hostrcb_type_41_error, data))); +} +/** * ipr_log_generic_error - Log an adapter error. * @ioa_cfg: ioa config struct * @hostrcb: hostrcb struct @@ -2587,6 +2609,9 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg, case IPR_HOST_RCB_OVERLAY_ID_30: ipr_log_sis64_fabric_error(ioa_cfg, hostrcb); break; + case IPR_HOST_RCB_OVERLAY_ID_41: + ipr_log_sis64_service_required_error(ioa_cfg, hostrcb); + break; case IPR_HOST_RCB_OVERLAY_ID_1: case IPR_HOST_RCB_OVERLAY_ID_DEFAULT: default: diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 9357073..68afbbd 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h @@ -1135,6 +1135,11 @@ struct ipr_hostrcb_type_30_error { struct ipr_hostrcb64_fabric_desc desc[1]; }__attribute__((packed, aligned (4))); +struct ipr_hostrcb_type_41_error { + u8 failure_reason[64]; + __be32 data[200]; +}__attribute__((packed, aligned (4))); + struct ipr_hostrcb_error { __be32 fd_ioasc; struct ipr_res_addr fd_res_addr; @@ -1173,6 +1178,7 @@ struct ipr_hostrcb64_error { struct ipr_hostrcb_type_23_error type_23_error; struct ipr_hostrcb_type_24_error type_24_error; struct ipr_hostrcb_type_30_error type_30_error; + struct ipr_hostrcb_type_41_error type_41_error; } u; }__attribute__((packed, aligned (8))); @@ -1218,6 +1224,7 @@ struct ipr_hcam { #define IPR_HOST_RCB_OVERLAY_ID_24 0x24 #define IPR_HOST_RCB_OVERLAY_ID_26 0x26 #define IPR_HOST_RCB_OVERLAY_ID_30 0x30 +#define IPR_HOST_RCB_OVERLAY_ID_41 0x41 #define IPR_HOST_RCB_OVERLAY_ID_DEFAULT 0xFF u8 reserved1[3];