Print this page
Code review comments
@@ -213,11 +213,10 @@
.issue_cmd_in_poll_mode = issue_cmd_in_poll_mode_ppc,
.enable_intr = enable_intr_ppc,
.disable_intr = disable_intr_ppc,
.intr_ack = intr_ack_ppc,
.init_adapter = mrsas_init_adapter_ppc
-/* .reset_adapter = mrsas_reset_adapter_ppc */
};
static struct mrsas_function_template mrsas_function_template_fusion = {
.read_fw_status_reg = tbolt_read_fw_status_reg,
@@ -301,11 +300,10 @@
#ifdef __sparc
ddi_quiesce_not_needed
#else /* __sparc */
mrsas_quiesce /* quiesce */
#endif /* __sparc */
-
};
static struct modldrv modldrv = {
&mod_driverops, /* module type - driver */
MRSAS_VERSION,
@@ -323,11 +321,11 @@
DDI_STRUCTURE_LE_ACC,
DDI_STRICTORDER_ACC,
DDI_DEFAULT_ACC
};
-
+/* Use the LSI Fast Path for the 2208 (tbolt) commands. */
unsigned int enable_fp = 1;
/*
* ************************************************************************** *
@@ -511,12 +509,10 @@
"mr_sas%d: Bad soft state", instance_no);
ddi_soft_state_free(mrsas_state, instance_no);
return (DDI_FAILURE);
}
- bzero(instance, sizeof (struct mrsas_instance));
-
instance->unroll.softs = 1;
/* Setup the PCI configuration space handles */
if (pci_config_setup(dip, &instance->pci_handle) !=
DDI_SUCCESS) {
@@ -525,20 +521,11 @@
instance_no);
ddi_soft_state_free(mrsas_state, instance_no);
return (DDI_FAILURE);
}
- if (instance->pci_handle == NULL) {
- cmn_err(CE_WARN,
- "mr_sas%d: pci config setup failed ",
- instance_no);
- ddi_soft_state_free(mrsas_state, instance_no);
- return (DDI_FAILURE);
- }
-
-
if (ddi_dev_nregs(dip, &nregs) != DDI_SUCCESS) {
cmn_err(CE_WARN,
"mr_sas: failed to get registers.");
pci_config_teardown(&instance->pci_handle);
@@ -652,15 +639,10 @@
!= DDI_SUCCESS) {
cmn_err(CE_WARN,
"mr_sas: couldn't map control registers");
goto fail_attach;
}
- if (instance->regmap_handle == NULL) {
- cmn_err(CE_WARN,
- "mr_sas: couldn't map control registers");
- goto fail_attach;
- }
instance->unroll.regs = 1;
/*
* Disable Interrupt Now.
@@ -1243,11 +1225,11 @@
cmn_err(CE_WARN, "mrsas_detach: "
"failed to abort prevous AEN command");
instance->unroll.aenPend = 0;
con_log(CL_ANN1, (CE_CONT, "aen cmd aborted, done."));
- /* This means the controller is fully initialzed and running */
+ /* This means the controller is fully initialized and running */
/* Shutdown should be a last command to controller. */
/* shutdown_controller(); */
}
@@ -1472,11 +1454,11 @@
KM_SLEEP);
if (ioctl == NULL) {
/* Failed to allocate memory for ioctl */
con_log(CL_ANN, (CE_WARN, "mr_sas_ioctl: "
"failed to allocate memory for ioctl"));
- return (ENXIO);
+ return (ENOMEM);
}
switch ((uint_t)cmd) {
case MRSAS_IOCTL_FIRMWARE:
if (ddi_copyin((void *)arg, ioctl,
@@ -2546,11 +2528,10 @@
{
mlist_t *head = &instance->cmd_pool_list;
struct mrsas_cmd *cmd = NULL;
mutex_enter(&instance->cmd_pool_mtx);
- ASSERT(mutex_owned(&instance->cmd_pool_mtx));
if (!mlist_empty(head)) {
cmd = mlist_entry(head->next, struct mrsas_cmd, list);
mlist_del_init(head->next);
}
@@ -2570,11 +2551,10 @@
{
mlist_t *head = &instance->app_cmd_pool_list;
struct mrsas_cmd *cmd = NULL;
mutex_enter(&instance->app_cmd_pool_mtx);
- ASSERT(mutex_owned(&instance->app_cmd_pool_mtx));
if (!mlist_empty(head)) {
cmd = mlist_entry(head->next, struct mrsas_cmd, list);
mlist_del_init(head->next);
}
@@ -2593,11 +2573,10 @@
*/
static void
return_mfi_pkt(struct mrsas_instance *instance, struct mrsas_cmd *cmd)
{
mutex_enter(&instance->cmd_pool_mtx);
- ASSERT(mutex_owned(&instance->cmd_pool_mtx));
/* use mlist_add_tail for debug assistance */
mlist_add_tail(&cmd->list, &instance->cmd_pool_list);
mutex_exit(&instance->cmd_pool_mtx);
}
@@ -2604,11 +2583,10 @@
static void
return_mfi_app_pkt(struct mrsas_instance *instance, struct mrsas_cmd *cmd)
{
mutex_enter(&instance->app_cmd_pool_mtx);
- ASSERT(mutex_owned(&instance->app_cmd_pool_mtx));
mlist_add(&cmd->list, &instance->app_cmd_pool_list);
mutex_exit(&instance->app_cmd_pool_mtx);
}
@@ -2617,11 +2595,10 @@
{
struct scsi_pkt *pkt;
struct mrsas_header *hdr;
con_log(CL_DLEVEL2, (CE_NOTE, "push_pending_pkt(): Called\n"));
mutex_enter(&instance->cmd_pend_mtx);
- ASSERT(mutex_owned(&instance->cmd_pend_mtx));
mlist_del_init(&cmd->list);
mlist_add_tail(&cmd->list, &instance->cmd_pend_list);
if (cmd->sync_cmd == MRSAS_TRUE) {
hdr = (struct mrsas_header *)&cmd->frame->hdr;
if (hdr) {
@@ -2676,11 +2653,10 @@
unsigned int flag = 1;
struct scsi_pkt *pkt;
int saved_level;
int cmd_count = 0;
-
saved_level = debug_level_g;
debug_level_g = CL_ANN1;
cmn_err(CE_NOTE, "mrsas_print_pending_cmds(): Called\n");
@@ -3682,11 +3658,11 @@
goto fail_fw_init;
}
if (mrsas_common_check(instance, cmd) != DDI_SUCCESS)
goto fail_fw_init;
- /* return_mfi_pkt(instance, cmd); */ /* XXX KEBE ASKS, inherit? */
+ return_mfi_pkt(instance, cmd);
if (ctio_enable &&
(instance->func_ptr->read_fw_status_reg(instance) & 0x04000000)) {
con_log(CL_ANN, (CE_NOTE, "mr_sas: IEEE SGL's supported"));
instance->flag_ieee = 1;
@@ -4882,15 +4858,10 @@
con_log(CL_ANN, (CE_WARN, "Failed : ddi_dma_mem_alloc"));
return (-1);
}
- if (obj->dma_handle == NULL) {
- /* XXX KEBE ASKS --> fm_service_impact()? */
- con_log(CL_ANN, (CE_WARN, "Failed : ddi_dma_mem_alloc"));
- return (-1);
- }
if (ddi_dma_addr_bind_handle(obj->dma_handle, NULL, obj->buffer,
obj->size, DDI_DMA_RDWR | DDI_DMA_STREAMING, DDI_DMA_SLEEP,
NULL, &obj->dma_cookie[0], &cookie_cnt) != DDI_SUCCESS) {
@@ -4899,19 +4870,11 @@
con_log(CL_ANN, (CE_WARN, "Failed : ddi_dma_addr_bind_handle"));
return (-1);
}
- if (obj->acc_handle == NULL) {
- /* XXX KEBE ASKS --> fm_service_impact()? */
- ddi_dma_mem_free(&obj->acc_handle);
- ddi_dma_free_handle(&obj->dma_handle);
- con_log(CL_ANN, (CE_WARN, "Failed : ddi_dma_addr_bind_handle"));
- return (-1);
- }
-
if (mrsas_check_dma_handle(obj->dma_handle) != DDI_SUCCESS) {
ddi_fm_service_impact(instance->dip, DDI_SERVICE_LOST);
return (-1);
}
@@ -6845,11 +6808,10 @@
"ISSUED CMD TO FW : called : cmd : %p, instance: %p"
"(NO PKT)\n", gethrtime(), (void *)cmd, (void *)instance));
}
mutex_enter(&instance->reg_write_mtx);
- ASSERT(mutex_owned(&instance->reg_write_mtx));
/* Issue the command to the FW */
WR_IB_QPORT((cmd->frame_phys_addr) |
(((cmd->frame_count - 1) << 1) | 1), instance);
mutex_exit(&instance->reg_write_mtx);
@@ -6886,11 +6848,10 @@
}
cmd->cmd_status = ENODATA;
mutex_enter(&instance->reg_write_mtx);
- ASSERT(mutex_owned(&instance->reg_write_mtx));
/* Issue the command to the FW */
WR_IB_QPORT((cmd->frame_phys_addr) |
(((cmd->frame_count - 1) << 1) | 1), instance);
mutex_exit(&instance->reg_write_mtx);