From patchwork Thu Jan 19 15:49:07 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: 9526261 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 A977360459 for ; Thu, 19 Jan 2017 15:50:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AA2C28435 for ; Thu, 19 Jan 2017 15:50:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D3FD284A7; Thu, 19 Jan 2017 15:50:08 +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=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 4B4192845F for ; Thu, 19 Jan 2017 15:50:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753487AbdASPuG (ORCPT ); Thu, 19 Jan 2017 10:50:06 -0500 Received: from mail-ua0-f176.google.com ([209.85.217.176]:35335 "EHLO mail-ua0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753705AbdASPuD (ORCPT ); Thu, 19 Jan 2017 10:50:03 -0500 Received: by mail-ua0-f176.google.com with SMTP id y9so37226194uae.2 for ; Thu, 19 Jan 2017 07:50:03 -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=EZbWqpqCZve7XP7RdQZkuduiSjyB0U4SxWW9PuSUrfs=; b=KtK48WZjU/FVmaWqJxkPbdBZ2/HAGO0x0ci1SXvE6T0aeg7pQf9qkOsOzz+gzLZNK/ v6jt9iOgBFYles0l44UcI+zAxYU1FVCisEEk9WGx9qech7adpnXz1Oxmx8NHNg1rZY/d MF4iNajS+dp/PqBotbDsyFD2TcXA7wd3vz8j0= 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=EZbWqpqCZve7XP7RdQZkuduiSjyB0U4SxWW9PuSUrfs=; b=V8jqf22iV3o9UKk2rNQ2J0rGbjIB9uxyzb+zWYQfFDbtY4CCL4yy17IckwSH+G9elb PI9i+ri/HDYKFy8TEVjQu1Y8sxSYoYTa5bNnT8c4iEy8/i2apFKPihc4LLoz2EaVPysg CA//jFs3VJD+zT2xPDdI5mL4XPnh43mOkQPqe6SAb8plqDNgLTpW0T8kjgxap30hMw5z AXXcwUAQqLNfiif4ys010hfR/2UlVmkdOT2veTvvBAFn8rs2+r82QCLtgH8jkPgnnlHI /tcdHJ/uV/1wQdMmUM3Ppc0ThM5xwnpRMGQneLxK4c5UY2NHnebbo4+RYBbzxTg6PPDo GHdg== X-Gm-Message-State: AIkVDXJDLBOO+WWGhnjuCV0T7k6Zd97K/9vHjfUgIxCyBLt7/+IkzNwOpEgOqa/r/l+UKmOK X-Received: by 10.200.42.182 with SMTP id b51mr7929175qta.101.1484840997305; Thu, 19 Jan 2017 07:49:57 -0800 (PST) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id t7sm2659815qtb.11.2017.01.19.07.49.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jan 2017 07:49:57 -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 1/4] mpt3sas: Added print to notify cable running at a degraded speed. Date: Thu, 19 Jan 2017 21:19:07 +0530 Message-Id: <1484840950-13656-2-git-send-email-chaitra.basappa@broadcom.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1484840950-13656-1-git-send-email-chaitra.basappa@broadcom.com> References: <1484840950-13656-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 Suganath Prabu Reviewed-by: Johannes Thumshirn --- drivers/scsi/mpt3sas/mpi/mpi2_ioc.h | 2 ++ drivers/scsi/mpt3sas/mpt3sas_scsih.c | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 5 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..5ffbfb1 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) { + switch (ActiveCableEventData->ReasonCode) { + case MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER: pr_info(MPT3SAS_FMT "Currently an active cable with ReceptacleID %d", 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"); + pr_info(" this active cable will not be seen. This"); + pr_info(" cable requires %d mW of power", 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 */