diff options
-rw-r--r-- | drivers/scsi/mvsas.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/drivers/scsi/mvsas.c b/drivers/scsi/mvsas.c index ebfe1649443a..f4f7b0af3027 100644 --- a/drivers/scsi/mvsas.c +++ b/drivers/scsi/mvsas.c | |||
@@ -2159,42 +2159,59 @@ out_done: | |||
2159 | 2159 | ||
2160 | static int mvs_task_abort(struct sas_task *task) | 2160 | static int mvs_task_abort(struct sas_task *task) |
2161 | { | 2161 | { |
2162 | int rc = 1; | 2162 | int rc; |
2163 | unsigned long flags; | 2163 | unsigned long flags; |
2164 | struct mvs_info *mvi = task->dev->port->ha->lldd_ha; | 2164 | struct mvs_info *mvi = task->dev->port->ha->lldd_ha; |
2165 | struct pci_dev *pdev = mvi->pdev; | 2165 | struct pci_dev *pdev = mvi->pdev; |
2166 | int tag; | ||
2166 | 2167 | ||
2167 | spin_lock_irqsave(&task->task_state_lock, flags); | 2168 | spin_lock_irqsave(&task->task_state_lock, flags); |
2168 | if (task->task_state_flags & SAS_TASK_STATE_DONE) { | 2169 | if (task->task_state_flags & SAS_TASK_STATE_DONE) { |
2169 | rc = TMF_RESP_FUNC_COMPLETE; | 2170 | rc = TMF_RESP_FUNC_COMPLETE; |
2171 | spin_unlock_irqrestore(&task->task_state_lock, flags); | ||
2170 | goto out_done; | 2172 | goto out_done; |
2171 | } | 2173 | } |
2172 | spin_unlock_irqrestore(&task->task_state_lock, flags); | 2174 | spin_unlock_irqrestore(&task->task_state_lock, flags); |
2173 | 2175 | ||
2174 | /*FIXME*/ | ||
2175 | rc = TMF_RESP_FUNC_COMPLETE; | ||
2176 | |||
2177 | switch (task->task_proto) { | 2176 | switch (task->task_proto) { |
2178 | case SAS_PROTOCOL_SMP: | 2177 | case SAS_PROTOCOL_SMP: |
2179 | dev_printk(KERN_DEBUG, &pdev->dev, "SMP Abort! "); | 2178 | dev_printk(KERN_DEBUG, &pdev->dev, "SMP Abort! \n"); |
2180 | break; | 2179 | break; |
2181 | case SAS_PROTOCOL_SSP: | 2180 | case SAS_PROTOCOL_SSP: |
2182 | dev_printk(KERN_DEBUG, &pdev->dev, "SSP Abort! "); | 2181 | dev_printk(KERN_DEBUG, &pdev->dev, "SSP Abort! \n"); |
2183 | break; | 2182 | break; |
2184 | case SAS_PROTOCOL_SATA: | 2183 | case SAS_PROTOCOL_SATA: |
2185 | case SAS_PROTOCOL_STP: | 2184 | case SAS_PROTOCOL_STP: |
2186 | case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP:{ | 2185 | case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP:{ |
2187 | dev_printk(KERN_DEBUG, &pdev->dev, "STP Abort! " | 2186 | dev_printk(KERN_DEBUG, &pdev->dev, "STP Abort! \n"); |
2188 | "Dump D2H FIS: \n"); | 2187 | #if _MV_DUMP |
2188 | dev_printk(KERN_DEBUG, &pdev->dev, "Dump D2H FIS: \n"); | ||
2189 | mvs_hexdump(sizeof(struct host_to_dev_fis), | 2189 | mvs_hexdump(sizeof(struct host_to_dev_fis), |
2190 | (void *)&task->ata_task.fis, 0); | 2190 | (void *)&task->ata_task.fis, 0); |
2191 | dev_printk(KERN_DEBUG, &pdev->dev, "Dump ATAPI Cmd : \n"); | 2191 | dev_printk(KERN_DEBUG, &pdev->dev, "Dump ATAPI Cmd : \n"); |
2192 | mvs_hexdump(16, task->ata_task.atapi_packet, 0); | 2192 | mvs_hexdump(16, task->ata_task.atapi_packet, 0); |
2193 | #endif | ||
2194 | spin_lock_irqsave(&task->task_state_lock, flags); | ||
2195 | if (task->task_state_flags & SAS_TASK_NEED_DEV_RESET) { | ||
2196 | /* TODO */ | ||
2197 | ; | ||
2198 | } | ||
2199 | spin_unlock_irqrestore(&task->task_state_lock, flags); | ||
2193 | break; | 2200 | break; |
2194 | } | 2201 | } |
2195 | default: | 2202 | default: |
2196 | break; | 2203 | break; |
2197 | } | 2204 | } |
2205 | |||
2206 | if (mvs_find_tag(mvi, task, &tag)) { | ||
2207 | spin_lock_irqsave(&mvi->lock, flags); | ||
2208 | mvs_slot_task_free(mvi, task, &mvi->slot_info[tag], tag); | ||
2209 | spin_unlock_irqrestore(&mvi->lock, flags); | ||
2210 | } | ||
2211 | if (!mvs_task_exec(task, 1, GFP_ATOMIC)) | ||
2212 | rc = TMF_RESP_FUNC_COMPLETE; | ||
2213 | else | ||
2214 | rc = TMF_RESP_FUNC_FAILED; | ||
2198 | out_done: | 2215 | out_done: |
2199 | return rc; | 2216 | return rc; |
2200 | } | 2217 | } |