summaryrefslogtreecommitdiffstats
path: root/sys/dev/mpr/mpr_sas_lsi.c
diff options
context:
space:
mode:
authorslm <slm@FreeBSD.org>2016-05-16 18:47:53 +0000
committerslm <slm@FreeBSD.org>2016-05-16 18:47:53 +0000
commit5635d52f8eeca3a6ddbb0c44aec1dee011de9fe0 (patch)
treeb0eaeeb831aa675536a13368eac97e75d4756b70 /sys/dev/mpr/mpr_sas_lsi.c
parent0b59bb7a64049fbc914c5c7225befe1b68adacd8 (diff)
downloadFreeBSD-src-5635d52f8eeca3a6ddbb0c44aec1dee011de9fe0.zip
FreeBSD-src-5635d52f8eeca3a6ddbb0c44aec1dee011de9fe0.tar.gz
MFC r299263, r299265, r299266, r299267, r299268, r299269, r299270, r299271,
r299272, r299274, r299275 - (r299263) Update MPI headers to version 42. - (r299265) Several style changes and add copyrights for 2016. - (r299266) Add support for the Broadcom (Avago/LSI) 9305 16 and 24 port HBA's. - (r299267) No log bit in IOCStatus and endian-safe changes. Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and make a few more things endian-safe. - (r299268) Change logging level for a debug string to use MPR_LOG instead of MPR_INFO. - (r299269) Fix possible use of invalid pointer. It was possible to use an invalid pointer to get the target ID value. To fix this, initialize a local Target ID variable to an invalid value and change that variable to a valid value only if the pointer to the Target ID is not NULL. - (r299270) No need to set the MPRSAS_SHUTDOWN flag because it's never used. - (r299271) Use callout_reset_sbt() instead of callout_reset() if FreeBSD ver is >= 1000029 - (r299272) done_ccb pointer can be used if it is NULL. To prevent this, move check for done_ccb == NULL to before done_ccb is used in mprsas_stop_unit_done(). - (r299274) Disks can go missing until a reboot is done in some cases. This is due to the DevHandle not being released, which causes the Firmware to not allow that disk to be re-added. - (r299275) Bump version of mpr driver to 13.00.00.00-fbsd
Diffstat (limited to 'sys/dev/mpr/mpr_sas_lsi.c')
-rw-r--r--sys/dev/mpr/mpr_sas_lsi.c61
1 files changed, 38 insertions, 23 deletions
diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c
index b2ffe96..73e2f54 100644
--- a/sys/dev/mpr/mpr_sas_lsi.c
+++ b/sys/dev/mpr/mpr_sas_lsi.c
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2011-2015 LSI Corp.
- * Copyright (c) 2013-2015 Avago Technologies
+ * Copyright (c) 2013-2016 Avago Technologies
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/* Communications core for LSI MPT3 */
+/* Communications core for Avago Technologies (LSI) MPT3 */
/* TODO Move headers to mprvar */
#include <sys/types.h>
@@ -252,8 +252,7 @@ mprsas_fw_work(struct mpr_softc *sc, struct mpr_fw_event_work *fw_event)
data = (MPI2_EVENT_DATA_SAS_DISCOVERY *)fw_event->event_data;
if (data->ReasonCode & MPI2_EVENT_SAS_DISC_RC_STARTED)
- mpr_dprint(sc, MPR_TRACE,"SAS discovery start "
- "event\n");
+ mpr_dprint(sc, MPR_TRACE,"SAS discovery start event\n");
if (data->ReasonCode & MPI2_EVENT_SAS_DISC_RC_COMPLETED) {
mpr_dprint(sc, MPR_TRACE,"SAS discovery stop event\n");
sassc->flags &= ~MPRSAS_IN_DISCOVERY;
@@ -646,6 +645,23 @@ skip_fp_send:
}
break;
}
+ case MPI2_EVENT_ACTIVE_CABLE_EXCEPTION:
+ {
+ pMpi26EventDataActiveCableExcept_t ace_event_data;
+ ace_event_data =
+ (pMpi26EventDataActiveCableExcept_t)fw_event->event_data;
+
+ if (ace_event_data->ReasonCode ==
+ MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER) {
+ mpr_printf(sc, "Currently an active cable with "
+ "ReceptacleID %d cannot be powered and device "
+ "connected to this active cable will not be seen. "
+ "This active cable requires %d mW of power.\n",
+ ace_event_data->ReceptacleID,
+ ace_event_data->ActiveCablePowerRequirement);
+ }
+ break;
+ }
case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE:
case MPI2_EVENT_SAS_BROADCAST_PRIMITIVE:
default:
@@ -839,8 +855,8 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 linkrate){
MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET);
} else {
mpr_dprint(sc, MPR_ERROR, "Failed to allocate "
- "tm for Target Reset after SATA ID "
- "command timed out (cm %p)\n", cm);
+ "tm for Target Reset after SATA ID command "
+ "timed out (cm %p)\n", cm);
}
/*
* No need to check for more since the target is
@@ -901,9 +917,8 @@ mprsas_get_sas_address_for_sata_disk(struct mpr_softc *sc,
}
}
} while (((rc && (rc != EWOULDBLOCK)) ||
- (ioc_status &&
- (ioc_status != MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR))
- || sas_status) && (try_count < 5));
+ (ioc_status && (ioc_status != MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR))
+ || sas_status) && (try_count < 5));
if (rc == 0 && !ioc_status && !sas_status) {
mpr_dprint(sc, MPR_MAPPING, "%s: got SATA identify "
@@ -1059,8 +1074,8 @@ mprsas_ata_id_timeout(void *data)
__func__, cm, sc);
if ((callout_pending(&cm->cm_callout)) ||
(!callout_active(&cm->cm_callout))) {
- mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed "
- "out\n", __func__);
+ mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed out\n",
+ __func__);
return;
}
callout_deactivate(&cm->cm_callout);
@@ -1072,21 +1087,21 @@ mprsas_ata_id_timeout(void *data)
*/
mpr_intr_locked(sc);
if (cm->cm_state == MPR_CM_STATE_FREE) {
- mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed "
- "out\n", __func__);
+ mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed out\n",
+ __func__);
return;
}
mpr_dprint(sc, MPR_INFO, "ATA ID command timeout cm %p\n", cm);
/*
- * Send wakeup() to the sleeping thread that issued this ATA ID
- * command. wakeup() will cause msleep to return a 0 (not EWOULDBLOCK),
- * and this will keep reinit() from being called. This way, an Abort
- * Task TM can be issued so that the timed out command can be cleared.
- * The Abort Task cannot be sent from here because the driver has not
- * completed setting up targets. Instead, the command is flagged so
- * that special handling will be used to send the abort.
+ * Send wakeup() to the sleeping thread that issued this ATA ID command.
+ * wakeup() will cause msleep to return a 0 (not EWOULDBLOCK), and this
+ * will keep reinit() from being called. This way, an Abort Task TM can
+ * be issued so that the timed out command can be cleared. The Abort
+ * Task cannot be sent from here because the driver has not completed
+ * setting up targets. Instead, the command is flagged so that special
+ * handling will be used to send the abort.
*/
cm->cm_flags |= MPR_CM_FLAGS_SATA_ID_TIMEOUT;
wakeup(cm);
@@ -1257,15 +1272,15 @@ mprsas_stop_unit_done(struct cam_periph *periph, union ccb *done_ccb)
struct mprsas_softc *sassc;
char path_str[64];
+ if (done_ccb == NULL)
+ return;
+
sassc = (struct mprsas_softc *)done_ccb->ccb_h.ppriv_ptr1;
xpt_path_string(done_ccb->ccb_h.path, path_str, sizeof(path_str));
mpr_dprint(sassc->sc, MPR_INFO, "Completing stop unit for %s\n",
path_str);
- if (done_ccb == NULL)
- return;
-
/*
* Nothing more to do except free the CCB and path. If the command
* timed out, an abort reset, then target reset will be issued during
OpenPOWER on IntegriCloud