aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/isci/request.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index a46e07ac789f..b4cf998385b3 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -2399,22 +2399,19 @@ static void isci_task_save_for_upper_layer_completion(
2399 } 2399 }
2400} 2400}
2401 2401
2402static void isci_request_process_stp_response(struct sas_task *task, 2402static void isci_process_stp_response(struct sas_task *task, struct dev_to_host_fis *fis)
2403 void *response_buffer)
2404{ 2403{
2405 struct dev_to_host_fis *d2h_reg_fis = response_buffer;
2406 struct task_status_struct *ts = &task->task_status; 2404 struct task_status_struct *ts = &task->task_status;
2407 struct ata_task_resp *resp = (void *)&ts->buf[0]; 2405 struct ata_task_resp *resp = (void *)&ts->buf[0];
2408 2406
2409 resp->frame_len = le16_to_cpu(*(__le16 *)(response_buffer + 6)); 2407 resp->frame_len = sizeof(*fis);
2410 memcpy(&resp->ending_fis[0], response_buffer + 16, 24); 2408 memcpy(resp->ending_fis, fis, sizeof(*fis));
2411 ts->buf_valid_size = sizeof(*resp); 2409 ts->buf_valid_size = sizeof(*resp);
2412 2410
2413 /** 2411 /* If the device fault bit is set in the status register, then
2414 * If the device fault bit is set in the status register, then
2415 * set the sense data and return. 2412 * set the sense data and return.
2416 */ 2413 */
2417 if (d2h_reg_fis->status & ATA_DF) 2414 if (fis->status & ATA_DF)
2418 ts->stat = SAS_PROTO_RESPONSE; 2415 ts->stat = SAS_PROTO_RESPONSE;
2419 else 2416 else
2420 ts->stat = SAM_STAT_GOOD; 2417 ts->stat = SAM_STAT_GOOD;
@@ -2428,7 +2425,6 @@ static void isci_request_io_request_complete(struct isci_host *ihost,
2428{ 2425{
2429 struct sas_task *task = isci_request_access_task(request); 2426 struct sas_task *task = isci_request_access_task(request);
2430 struct ssp_response_iu *resp_iu; 2427 struct ssp_response_iu *resp_iu;
2431 void *resp_buf;
2432 unsigned long task_flags; 2428 unsigned long task_flags;
2433 struct isci_remote_device *idev = isci_lookup_device(task->dev); 2429 struct isci_remote_device *idev = isci_lookup_device(task->dev);
2434 enum service_response response = SAS_TASK_UNDELIVERED; 2430 enum service_response response = SAS_TASK_UNDELIVERED;
@@ -2565,9 +2561,7 @@ static void isci_request_io_request_complete(struct isci_host *ihost,
2565 task); 2561 task);
2566 2562
2567 if (sas_protocol_ata(task->task_proto)) { 2563 if (sas_protocol_ata(task->task_proto)) {
2568 resp_buf = &request->stp.rsp; 2564 isci_process_stp_response(task, &request->stp.rsp);
2569 isci_request_process_stp_response(task,
2570 resp_buf);
2571 } else if (SAS_PROTOCOL_SSP == task->task_proto) { 2565 } else if (SAS_PROTOCOL_SSP == task->task_proto) {
2572 2566
2573 /* crack the iu response buffer. */ 2567 /* crack the iu response buffer. */