[PATCH 01/10] mpt3sas: Processing of Cable Exception events

From: Sreekanth Reddy
Date: Tue Oct 10 2017 - 09:12:12 EST


Earlier Active Cable Exception event with reason code
"Cable Degraded (0x02))" was added only for Active Cable,
Now this event is extended to Passive cable too.
So re-arranged display message accordingly.

Also added Cable Exception Event even for SAS3008 & SAS3108 HBAs
(i.e. MPI 2.5 spec supporting HBAs) earlier this event was
enabled only for MPI 2.6 spec supporting HBA devices.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@xxxxxxxxxxxx>
---
drivers/scsi/mpt3sas/mpt3sas_base.c | 5 ++---
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 20 +++++++++++---------
2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 8799990..844e29c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -655,7 +655,7 @@ _base_display_event_data(struct MPT3SAS_ADAPTER *ioc,
desc = "Temperature Threshold";
break;
case MPI2_EVENT_ACTIVE_CABLE_EXCEPTION:
- desc = "Active cable exception";
+ desc = "Cable Event";
break;
}

@@ -5517,8 +5517,7 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc)
_base_unmask_events(ioc, MPI2_EVENT_IR_OPERATION_STATUS);
_base_unmask_events(ioc, MPI2_EVENT_LOG_ENTRY_ADDED);
_base_unmask_events(ioc, MPI2_EVENT_TEMP_THRESHOLD);
- if (ioc->hba_mpi_version_belonged == MPI26_VERSION)
- _base_unmask_events(ioc, MPI2_EVENT_ACTIVE_CABLE_EXCEPTION);
+ _base_unmask_events(ioc, MPI2_EVENT_ACTIVE_CABLE_EXCEPTION);

r = _base_make_ioc_operational(ioc);
if (r)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 22998cb..9594166 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -8056,19 +8056,21 @@ mpt3sas_scsih_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index,
(Mpi26EventDataActiveCableExcept_t *) mpi_reply->EventData;
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,
+ pr_notice(MPT3SAS_FMT
+ "Currently an active cable with ReceptacleID %d\n",
+ ioc->name, ActiveCableEventData->ReceptacleID);
+ pr_notice("cannot be powered and devices connected\n");
+ pr_notice("to this active cable will not be seen\n");
+ pr_notice("This active cable require %d mW of power\n",
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");
+ pr_notice(MPT3SAS_FMT
+ "Currently a cable with ReceptacleID %d\n",
+ ioc->name, ActiveCableEventData->ReceptacleID);
+ pr_notice(
+ "is not running at optimal speed(12 Gb/s rate)\n");
break;
}

--
2.4.3