--- zzzz-none-000/linux-3.10.107/drivers/scsi/bfa/bfad_im.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/scsi/bfa/bfad_im.c 2021-02-04 17:41:59.000000000 +0000 @@ -73,9 +73,14 @@ break; - case BFI_IOIM_STS_ABORTED: case BFI_IOIM_STS_TIMEDOUT: + host_status = DID_TIME_OUT; + cmnd->result = ScsiResult(host_status, 0); + break; case BFI_IOIM_STS_PATHTOV: + host_status = DID_TRANSPORT_DISRUPTED; + cmnd->result = ScsiResult(host_status, 0); + break; default: host_status = DID_ERROR; cmnd->result = ScsiResult(host_status, 0); @@ -206,7 +211,7 @@ spin_lock_irqsave(&bfad->bfad_lock, flags); hal_io = (struct bfa_ioim_s *) cmnd->host_scribble; if (!hal_io) { - /* IO has been completed, retrun success */ + /* IO has been completed, return success */ rc = SUCCESS; goto out; } @@ -771,11 +776,7 @@ static int bfad_im_slave_configure(struct scsi_device *sdev) { - if (sdev->tagged_supported) - scsi_activate_tcq(sdev, bfa_lun_queue_depth); - else - scsi_deactivate_tcq(sdev, bfa_lun_queue_depth); - + scsi_change_queue_depth(sdev, bfa_lun_queue_depth); return 0; } @@ -848,6 +849,8 @@ if (bfad_im_scsi_vport_transport_template) fc_release_transport(bfad_im_scsi_vport_transport_template); + + idr_destroy(&bfad_im_port_index); } void @@ -863,14 +866,8 @@ if (bfa_lun_queue_depth > tmp_sdev->queue_depth) { if (tmp_sdev->id != sdev->id) continue; - if (tmp_sdev->ordered_tags) - scsi_adjust_queue_depth(tmp_sdev, - MSG_ORDERED_TAG, - tmp_sdev->queue_depth + 1); - else - scsi_adjust_queue_depth(tmp_sdev, - MSG_SIMPLE_TAG, - tmp_sdev->queue_depth + 1); + scsi_change_queue_depth(tmp_sdev, + tmp_sdev->queue_depth + 1); itnim->last_ramp_up_time = jiffies; } @@ -944,13 +941,15 @@ bfad_im_slave_alloc(struct scsi_device *sdev) { struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); - struct bfad_itnim_data_s *itnim_data = - (struct bfad_itnim_data_s *) rport->dd_data; - struct bfa_s *bfa = itnim_data->itnim->bfa_itnim->bfa; + struct bfad_itnim_data_s *itnim_data; + struct bfa_s *bfa; if (!rport || fc_remote_port_chkready(rport)) return -ENXIO; + itnim_data = (struct bfad_itnim_data_s *) rport->dd_data; + bfa = itnim_data->itnim->bfa_itnim->bfa; + if (bfa_get_lun_mask_status(bfa) == BFA_LUNMASK_ENABLED) { /* * We should not mask LUN 0 - since this will translate @@ -1035,7 +1034,7 @@ /* For fibre channel services type 0x20 */ fc_host_supported_fc4s(host)[7] = 1; - strncpy(symname, bfad->bfa_fcs.fabric.bport.port_cfg.sym_name.symname, + strlcpy(symname, bfad->bfa_fcs.fabric.bport.port_cfg.sym_name.symname, BFA_SYMNAME_MAXLEN); sprintf(fc_host_symbolic_name(host), "%s", symname);