From patchwork Mon Jan 23 09:56: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: 9531991 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 AA8B660434 for ; Mon, 23 Jan 2017 09:57:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BC3527E3E for ; Mon, 23 Jan 2017 09:57:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DE8727D0C; Mon, 23 Jan 2017 09:57:11 +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 34E7527D0C for ; Mon, 23 Jan 2017 09:57:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750898AbdAWJ46 (ORCPT ); Mon, 23 Jan 2017 04:56:58 -0500 Received: from mail-qt0-f182.google.com ([209.85.216.182]:34509 "EHLO mail-qt0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbdAWJ45 (ORCPT ); Mon, 23 Jan 2017 04:56:57 -0500 Received: by mail-qt0-f182.google.com with SMTP id l7so115058822qtd.1 for ; Mon, 23 Jan 2017 01:56:57 -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=wjbZv0fk+7lr+VVKif291rvIE0TiWVKTI1RZ4eboiO4=; b=WCkVW0XXVOynFgzassJ/5Q+Tc3jJaETRow9kvBT3dvDPgxVDX1++oOn3KUi9tG3BAq H5UgOgw/rpsOU9rswyx4K0FKlTQZbS38mHfxwZgb63y8fnLDXVWu/7fycq/CuRduc1He YYBGi4tVuK7KcnNZJWlgQLEfIbF1BW7OVa+Ig= 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=wjbZv0fk+7lr+VVKif291rvIE0TiWVKTI1RZ4eboiO4=; b=NM0FUdepzGiKf4r1kVb2b4F8Yo3nOORODIzCH5Xa7EGLaMLbUd63l1uboDgmbIE9DL Lj3BV+zPExXXWZ1ZpzbjL5UBea7Bsc3LGNeRV6ds6fmJU6oorkADYvWDGz7qm3YebH8K zx1wj4qGLF4izxFKsccNvTQT3CxFLoMbDtD5aqUMT6aggTbhqQ+4PbiuEPBMbvyIhe+x Fh9pA/VCaBHgz+f+TqgmhX0Mlflo9flyoR+DhH4akdiGJgCLIdZakP16El/5CK0IOtox dMOa2w2S5l9TSKEY6bm6DXmwSYnbzpR90XnVqccNhhuzcrSyDAi96ZqdwmL0MWMhjLkP W0vw== X-Gm-Message-State: AIkVDXJAKhUB30p0b80xjasOinMXnDo7bDkwgkMe7jTiDno2NBmWnihX6rBzTT2Hj1cAniAz X-Received: by 10.55.73.211 with SMTP id w202mr22900190qka.321.1485165416012; Mon, 23 Jan 2017 01:56:56 -0800 (PST) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id d20sm12763330qtb.17.2017.01.23.01.56.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jan 2017 01:56:55 -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 v3 1/4] mpt3sas: Added print to notify cable running at a degraded speed. Date: Mon, 23 Jan 2017 15:26:07 +0530 Message-Id: <1485165370-43401-2-git-send-email-chaitra.basappa@broadcom.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1485165370-43401-1-git-send-email-chaitra.basappa@broadcom.com> References: <1485165370-43401-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 | 25 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 8 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..2c6a689 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -8028,15 +8028,24 @@ 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", - 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", - ActiveCableEventData->ActiveCablePowerRequirement); + switch (ActiveCableEventData->ReasonCode) { + case MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER: + pr_notice(MPT3SAS_FMT "Receptacle ID %d: This active cable" + " requires %d mW of power\n", ioc->name, + ActiveCableEventData->ReceptacleID, + ActiveCableEventData->ActiveCablePowerRequirement); + pr_notice(MPT3SAS_FMT "Receptacle ID %d: Devices connected" + " to this active cable will not be seen\n", + ioc->name, ActiveCableEventData->ReceptacleID); + break; + + case MPI26_EVENT_ACTIVE_CABLE_DEGRADED: + pr_notice(MPT3SAS_FMT "ReceptacleID %d: This cable", + ioc->name, ActiveCableEventData->ReceptacleID); + pr_notice(" is not running at an optimal speed(12 Gb/s)\n"); + break; } + break; default: /* ignore the rest */