aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/isci/host.c')
-rw-r--r--drivers/scsi/isci/host.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index b334fdc1726a..609dafd661d1 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -1044,7 +1044,7 @@ static enum sci_status sci_controller_start(struct isci_host *ihost,
1044 return SCI_SUCCESS; 1044 return SCI_SUCCESS;
1045} 1045}
1046 1046
1047void isci_host_scan_start(struct Scsi_Host *shost) 1047void isci_host_start(struct Scsi_Host *shost)
1048{ 1048{
1049 struct isci_host *ihost = SHOST_TO_SAS_HA(shost)->lldd_ha; 1049 struct isci_host *ihost = SHOST_TO_SAS_HA(shost)->lldd_ha;
1050 unsigned long tmo = sci_controller_get_suggested_start_timeout(ihost); 1050 unsigned long tmo = sci_controller_get_suggested_start_timeout(ihost);
@@ -1079,7 +1079,6 @@ static void sci_controller_completion_handler(struct isci_host *ihost)
1079 1079
1080void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_task *task) 1080void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_task *task)
1081{ 1081{
1082 task->lldd_task = NULL;
1083 if (!test_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags) && 1082 if (!test_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags) &&
1084 !(task->task_state_flags & SAS_TASK_STATE_ABORTED)) { 1083 !(task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
1085 if (test_bit(IREQ_COMPLETE_IN_TARGET, &ireq->flags)) { 1084 if (test_bit(IREQ_COMPLETE_IN_TARGET, &ireq->flags)) {
@@ -1087,16 +1086,19 @@ void ireq_done(struct isci_host *ihost, struct isci_request *ireq, struct sas_ta
1087 dev_dbg(&ihost->pdev->dev, 1086 dev_dbg(&ihost->pdev->dev,
1088 "%s: Normal - ireq/task = %p/%p\n", 1087 "%s: Normal - ireq/task = %p/%p\n",
1089 __func__, ireq, task); 1088 __func__, ireq, task);
1090 1089 task->lldd_task = NULL;
1091 task->task_done(task); 1090 task->task_done(task);
1092 } else { 1091 } else {
1093 dev_dbg(&ihost->pdev->dev, 1092 dev_dbg(&ihost->pdev->dev,
1094 "%s: Error - ireq/task = %p/%p\n", 1093 "%s: Error - ireq/task = %p/%p\n",
1095 __func__, ireq, task); 1094 __func__, ireq, task);
1096 1095 if (sas_protocol_ata(task->task_proto))
1096 task->lldd_task = NULL;
1097 sas_task_abort(task); 1097 sas_task_abort(task);
1098 } 1098 }
1099 } 1099 } else
1100 task->lldd_task = NULL;
1101
1100 if (test_and_clear_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags)) 1102 if (test_and_clear_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags))
1101 wake_up_all(&ihost->eventq); 1103 wake_up_all(&ihost->eventq);
1102 1104
@@ -1120,10 +1122,16 @@ void isci_host_completion_routine(unsigned long data)
1120 sci_controller_completion_handler(ihost); 1122 sci_controller_completion_handler(ihost);
1121 spin_unlock_irq(&ihost->scic_lock); 1123 spin_unlock_irq(&ihost->scic_lock);
1122 1124
1123 /* the coalesence timeout doubles at each encoding step, so 1125 /*
1126 * we subtract SCI_MAX_PORTS to account for the number of dummy TCs
1127 * issued for hardware issue workaround
1128 */
1129 active = isci_tci_active(ihost) - SCI_MAX_PORTS;
1130
1131 /*
1132 * the coalesence timeout doubles at each encoding step, so
1124 * update it based on the ilog2 value of the outstanding requests 1133 * update it based on the ilog2 value of the outstanding requests
1125 */ 1134 */
1126 active = isci_tci_active(ihost);
1127 writel(SMU_ICC_GEN_VAL(NUMBER, active) | 1135 writel(SMU_ICC_GEN_VAL(NUMBER, active) |
1128 SMU_ICC_GEN_VAL(TIMER, ISCI_COALESCE_BASE + ilog2(active)), 1136 SMU_ICC_GEN_VAL(TIMER, ISCI_COALESCE_BASE + ilog2(active)),
1129 &ihost->smu_registers->interrupt_coalesce_control); 1137 &ihost->smu_registers->interrupt_coalesce_control);
@@ -1973,7 +1981,7 @@ static void sci_controller_afe_initialization(struct isci_host *ihost)
1973 } 1981 }
1974 1982
1975 for (phy_id = 0; phy_id < SCI_MAX_PHYS; phy_id++) { 1983 for (phy_id = 0; phy_id < SCI_MAX_PHYS; phy_id++) {
1976 struct scu_afe_transceiver *xcvr = &afe->scu_afe_xcvr[phy_id]; 1984 struct scu_afe_transceiver __iomem *xcvr = &afe->scu_afe_xcvr[phy_id];
1977 const struct sci_phy_oem_params *oem_phy = &oem->phys[phy_id]; 1985 const struct sci_phy_oem_params *oem_phy = &oem->phys[phy_id];
1978 int cable_length_long = 1986 int cable_length_long =
1979 is_long_cable(phy_id, cable_selection_mask); 1987 is_long_cable(phy_id, cable_selection_mask);