aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChaitra P B <chaitra.basappa@broadcom.com>2016-05-06 04:59:27 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2016-05-11 16:11:26 -0400
commita470a51cd6481373cdf2b5934b1b9f7853688de9 (patch)
tree0f97d6dd6b4f815229817d8bd98fef9558d75097
parent4fe6bc97efebdc5083aa749850928fad1740a60d (diff)
mpt3sas: Handle active cable exception event
In-order to handle this 'MPI2_EVENT_ACTIVE_CABLE_EXCEPTION' event, driver need to follow below steps, 1. Unmask the 'MPI2_EVENT_ACTIVE_CABLE_EXCEPTION' event, so that FW can notify this event to host driver. 2. After receiving this event, add this event to AEN event queue, for notifying this event to applications. 3. Then Print below message in kernel logs if the event data's reason code is zero, "Currently an active cable with ReceptacleID <ID_Value> cannot be powered and devices connected to this active cable will not be seen. This active cable requires <PowerValue_in_mW> of power" This event is only for Intruder/Cutlass HBAs. Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_base.c5
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_scsih.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 93d7c28f8162..b7f4e664f5f3 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -655,6 +655,9 @@ _base_display_event_data(struct MPT3SAS_ADAPTER *ioc,
655 case MPI2_EVENT_TEMP_THRESHOLD: 655 case MPI2_EVENT_TEMP_THRESHOLD:
656 desc = "Temperature Threshold"; 656 desc = "Temperature Threshold";
657 break; 657 break;
658 case MPI2_EVENT_ACTIVE_CABLE_EXCEPTION:
659 desc = "Active cable exception";
660 break;
658 } 661 }
659 662
660 if (!desc) 663 if (!desc)
@@ -5424,6 +5427,8 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc)
5424 _base_unmask_events(ioc, MPI2_EVENT_IR_OPERATION_STATUS); 5427 _base_unmask_events(ioc, MPI2_EVENT_IR_OPERATION_STATUS);
5425 _base_unmask_events(ioc, MPI2_EVENT_LOG_ENTRY_ADDED); 5428 _base_unmask_events(ioc, MPI2_EVENT_LOG_ENTRY_ADDED);
5426 _base_unmask_events(ioc, MPI2_EVENT_TEMP_THRESHOLD); 5429 _base_unmask_events(ioc, MPI2_EVENT_TEMP_THRESHOLD);
5430 if (ioc->hba_mpi_version_belonged == MPI26_VERSION)
5431 _base_unmask_events(ioc, MPI2_EVENT_ACTIVE_CABLE_EXCEPTION);
5427 5432
5428 r = _base_make_ioc_operational(ioc, CAN_SLEEP); 5433 r = _base_make_ioc_operational(ioc, CAN_SLEEP);
5429 if (r) 5434 if (r)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index f2139e5604a3..4f2500b24c59 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -7848,6 +7848,7 @@ mpt3sas_scsih_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index,
7848 Mpi2EventNotificationReply_t *mpi_reply; 7848 Mpi2EventNotificationReply_t *mpi_reply;
7849 u16 event; 7849 u16 event;
7850 u16 sz; 7850 u16 sz;
7851 Mpi26EventDataActiveCableExcept_t *ActiveCableEventData;
7851 7852
7852 /* events turned off due to host reset or driver unloading */ 7853 /* events turned off due to host reset or driver unloading */
7853 if (ioc->remove_host || ioc->pci_error_recovery) 7854 if (ioc->remove_host || ioc->pci_error_recovery)
@@ -7960,6 +7961,18 @@ mpt3sas_scsih_event_callback(struct MPT3SAS_ADAPTER *ioc, u8 msix_index,
7960 (Mpi2EventDataTemperature_t *) 7961 (Mpi2EventDataTemperature_t *)
7961 mpi_reply->EventData); 7962 mpi_reply->EventData);
7962 break; 7963 break;
7964 case MPI2_EVENT_ACTIVE_CABLE_EXCEPTION:
7965 ActiveCableEventData =
7966 (Mpi26EventDataActiveCableExcept_t *) mpi_reply->EventData;
7967 if (ActiveCableEventData->ReasonCode ==
7968 MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER)
7969 pr_info(MPT3SAS_FMT "Currently an active cable with ReceptacleID %d",
7970 ioc->name, ActiveCableEventData->ReceptacleID);
7971 pr_info("cannot be powered and devices connected to this active cable");
7972 pr_info("will not be seen. This active cable");
7973 pr_info("requires %d mW of power",
7974 ActiveCableEventData->ActiveCablePowerRequirement);
7975 break;
7963 7976
7964 default: /* ignore the rest */ 7977 default: /* ignore the rest */
7965 return 1; 7978 return 1;