From patchwork Fri Jan 20 14:42:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitra P B X-Patchwork-Id: 9528665 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 5868760459 for ; Fri, 20 Jan 2017 14:42:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ABEB2868D for ; Fri, 20 Jan 2017 14:42:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E9382868F; Fri, 20 Jan 2017 14:42:47 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable 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 02AAA2868D for ; Fri, 20 Jan 2017 14:42:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752191AbdATOmj (ORCPT ); Fri, 20 Jan 2017 09:42:39 -0500 Received: from mail-yb0-f173.google.com ([209.85.213.173]:34440 "EHLO mail-yb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752507AbdATOmh (ORCPT ); Fri, 20 Jan 2017 09:42:37 -0500 Received: by mail-yb0-f173.google.com with SMTP id j82so56381962ybg.1 for ; Fri, 20 Jan 2017 06:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J8B7wCYOnoIyrPauPdROhiRP3mnCXg/5KmKDmKtQAc0=; b=Q7XMkD6t++gLKjGagirwQVsZMQh52UT62YRgA1LX/Y4dZzDBv14WPWp89FCgynVSjp 8sT6OC4OPtVYkfs/XJ3dkUhXOLIiTsz92UeAPZ7VGXlFQ9EHLDE81m/JSMlkmjG5U/WN dS+1VTb7jJgrGpUGyzBCnfnNGK4Z98leGkU0Q= 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=J8B7wCYOnoIyrPauPdROhiRP3mnCXg/5KmKDmKtQAc0=; b=D3pd1eL7YAPwrB/h3ELFLZxmZIT6d1kTurB2OhkDGiDsNduodLNLf3hvF6xqmP9zsN iPiim8xdjEvU3HNCZv5U/Ci4A5y78bnMWMX1niX4ZmgdDIimJGkRTKVMLK9aDmRbVPHw uS3X5W/107C0njNwZl74uDZ0A7DXDwhjJHwhp+65tU+OxGRkDPPYhUrPo/AhoyK+wFah ardPy0OvFnWkkmkiadJHAXXN7iPKfcnETlOBKhJG04Qjdr4HnvSq7K3khv/mTKVkH5TG 8SutXd0JdLNk/3Fu1pKJhHVYT1RBF2OEJ2AdQEebyX3yK6mmV8ak6Skvc+rFeP02yrBV i/bQ== X-Gm-Message-State: AIkVDXKBm8CqQ4JQVhsyAdgWmi/n4WANYxcX5/F8Lr3otQ6qPBHS4aPGDzc4kUXJ5mQMBFvQ X-Received: by 10.237.41.99 with SMTP id s90mr12845867qtd.4.1484923356332; Fri, 20 Jan 2017 06:42:36 -0800 (PST) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id x62sm6059032qkg.31.2017.01.20.06.42.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Jan 2017 06:42:35 -0800 (PST) From: Chaitra P B To: JBottomley@Parallels.com, jejb@kernel.org, hch@infradead.org Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, Sathya.Prakash@broadcom.com, kashyap.desai@broadcom.com, krishnaraddi.mankani@broadcom.com, linux-kernel@vger.kernel.org, suganath-prabu.subramani@broadcom.com, chaitra.basappa@broadcom.com, sreekanth.reddy@broadcom.com Subject: [PATCH v2 1/4] mpt3sas: Added print to notify cable running at a degraded speed. Date: Fri, 20 Jan 2017 20:12:10 +0530 Message-Id: <1484923333-8509-2-git-send-email-chaitra.basappa@broadcom.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1484923333-8509-1-git-send-email-chaitra.basappa@broadcom.com> References: <1484923333-8509-1-git-send-email-chaitra.basappa@broadcom.com> 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 Driver processes the event MPI26_EVENT_ACTIVE_CABLE_DEGRADED when a cable is present and is running at a degraded speed (below the SAS3 12 Gb/s rate). Prints added to inform the user that the cable is not running at optimal speed. Signed-off-by: Chaitra P B Signed-off-by: Suganath Prabu S Reviewed-by: Johannes Thumshirn --- drivers/scsi/mpt3sas/mpi/mpi2_ioc.h | 2 ++ drivers/scsi/mpt3sas/mpt3sas_scsih.c | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h index 8bae305..af4be40 100644 --- a/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h +++ b/drivers/scsi/mpt3sas/mpi/mpi2_ioc.h @@ -624,6 +624,8 @@ typedef struct _MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT { /* defines for ReasonCode field */ #define MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER (0x00) +#define MPI26_EVENT_ACTIVE_CABLE_PRESENT (0x01) +#define MPI26_EVENT_ACTIVE_CABLE_DEGRADED (0x02) /*Hard Reset Received Event data */ diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 75f3fce..0f71f4a 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -8028,15 +8028,23 @@ mpt3sas_scsih_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index, case MPI2_EVENT_ACTIVE_CABLE_EXCEPTION: ActiveCableEventData = (Mpi26EventDataActiveCableExcept_t *) mpi_reply->EventData; - if (ActiveCableEventData->ReasonCode == - MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER) { - pr_info(MPT3SAS_FMT "Currently an active cable with ReceptacleID %d", + switch (ActiveCableEventData->ReasonCode) { + case MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER: + pr_info(MPT3SAS_FMT "Currently an active cable with ReceptacleID %d\n", ioc->name, ActiveCableEventData->ReceptacleID); - pr_info("cannot be powered and devices connected to this active cable"); - pr_info("will not be seen. This active cable"); - pr_info("requires %d mW of power", + pr_info(" cannot be powered and devices connected to\n"); + pr_info(" this active cable will not be seen. This\n"); + pr_info(" cable requires %d mW of power\n", ActiveCableEventData->ActiveCablePowerRequirement); + break; + + case MPI26_EVENT_ACTIVE_CABLE_DEGRADED: + pr_info(MPT3SAS_FMT "Currently a cable with ReceptacleID %d", + ioc->name, ActiveCableEventData->ReceptacleID); + pr_info(" is not running at optimal speed(12 Gb/s)\n"); + break; } + break; default: /* ignore the rest */