diff options
Diffstat (limited to 'drivers/scsi/isci/task.c')
-rw-r--r-- | drivers/scsi/isci/task.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c index 89b01eef44b1..3a1fc55a7557 100644 --- a/drivers/scsi/isci/task.c +++ b/drivers/scsi/isci/task.c | |||
@@ -257,7 +257,7 @@ static struct isci_request *isci_task_request_build(struct isci_host *ihost, | |||
257 | return NULL; | 257 | return NULL; |
258 | 258 | ||
259 | /* let the core do it's construct. */ | 259 | /* let the core do it's construct. */ |
260 | status = scic_task_request_construct(&ihost->sci, idev, tag, | 260 | status = scic_task_request_construct(ihost, idev, tag, |
261 | ireq); | 261 | ireq); |
262 | 262 | ||
263 | if (status != SCI_SUCCESS) { | 263 | if (status != SCI_SUCCESS) { |
@@ -332,7 +332,7 @@ int isci_task_execute_tmf(struct isci_host *ihost, | |||
332 | spin_lock_irqsave(&ihost->scic_lock, flags); | 332 | spin_lock_irqsave(&ihost->scic_lock, flags); |
333 | 333 | ||
334 | /* start the TMF io. */ | 334 | /* start the TMF io. */ |
335 | status = scic_controller_start_task(&ihost->sci, idev, ireq); | 335 | status = scic_controller_start_task(ihost, idev, ireq); |
336 | 336 | ||
337 | if (status != SCI_TASK_SUCCESS) { | 337 | if (status != SCI_TASK_SUCCESS) { |
338 | dev_warn(&ihost->pdev->dev, | 338 | dev_warn(&ihost->pdev->dev, |
@@ -364,7 +364,7 @@ int isci_task_execute_tmf(struct isci_host *ihost, | |||
364 | if (tmf->cb_state_func != NULL) | 364 | if (tmf->cb_state_func != NULL) |
365 | tmf->cb_state_func(isci_tmf_timed_out, tmf, tmf->cb_data); | 365 | tmf->cb_state_func(isci_tmf_timed_out, tmf, tmf->cb_data); |
366 | 366 | ||
367 | scic_controller_terminate_request(&ihost->sci, | 367 | scic_controller_terminate_request(ihost, |
368 | idev, | 368 | idev, |
369 | ireq); | 369 | ireq); |
370 | 370 | ||
@@ -514,15 +514,14 @@ static void isci_request_cleanup_completed_loiterer( | |||
514 | * request, and wait for it to complete. This function must only be called | 514 | * request, and wait for it to complete. This function must only be called |
515 | * from a thread that can wait. Note that the request is terminated and | 515 | * from a thread that can wait. Note that the request is terminated and |
516 | * completed (back to the host, if started there). | 516 | * completed (back to the host, if started there). |
517 | * @isci_host: This SCU. | 517 | * @ihost: This SCU. |
518 | * @idev: The target. | 518 | * @idev: The target. |
519 | * @isci_request: The I/O request to be terminated. | 519 | * @isci_request: The I/O request to be terminated. |
520 | * | 520 | * |
521 | */ | 521 | */ |
522 | static void isci_terminate_request_core( | 522 | static void isci_terminate_request_core(struct isci_host *ihost, |
523 | struct isci_host *isci_host, | 523 | struct isci_remote_device *idev, |
524 | struct isci_remote_device *idev, | 524 | struct isci_request *isci_request) |
525 | struct isci_request *isci_request) | ||
526 | { | 525 | { |
527 | enum sci_status status = SCI_SUCCESS; | 526 | enum sci_status status = SCI_SUCCESS; |
528 | bool was_terminated = false; | 527 | bool was_terminated = false; |
@@ -533,11 +532,11 @@ static void isci_terminate_request_core( | |||
533 | struct completion *io_request_completion; | 532 | struct completion *io_request_completion; |
534 | struct sas_task *task; | 533 | struct sas_task *task; |
535 | 534 | ||
536 | dev_dbg(&isci_host->pdev->dev, | 535 | dev_dbg(&ihost->pdev->dev, |
537 | "%s: device = %p; request = %p\n", | 536 | "%s: device = %p; request = %p\n", |
538 | __func__, idev, isci_request); | 537 | __func__, idev, isci_request); |
539 | 538 | ||
540 | spin_lock_irqsave(&isci_host->scic_lock, flags); | 539 | spin_lock_irqsave(&ihost->scic_lock, flags); |
541 | 540 | ||
542 | io_request_completion = isci_request->io_request_completion; | 541 | io_request_completion = isci_request->io_request_completion; |
543 | 542 | ||
@@ -557,12 +556,11 @@ static void isci_terminate_request_core( | |||
557 | if (!test_bit(IREQ_TERMINATED, &isci_request->flags)) { | 556 | if (!test_bit(IREQ_TERMINATED, &isci_request->flags)) { |
558 | was_terminated = true; | 557 | was_terminated = true; |
559 | needs_cleanup_handling = true; | 558 | needs_cleanup_handling = true; |
560 | status = scic_controller_terminate_request( | 559 | status = scic_controller_terminate_request(ihost, |
561 | &isci_host->sci, | 560 | idev, |
562 | idev, | 561 | isci_request); |
563 | isci_request); | ||
564 | } | 562 | } |
565 | spin_unlock_irqrestore(&isci_host->scic_lock, flags); | 563 | spin_unlock_irqrestore(&ihost->scic_lock, flags); |
566 | 564 | ||
567 | /* | 565 | /* |
568 | * The only time the request to terminate will | 566 | * The only time the request to terminate will |
@@ -570,7 +568,7 @@ static void isci_terminate_request_core( | |||
570 | * being aborted. | 568 | * being aborted. |
571 | */ | 569 | */ |
572 | if (status != SCI_SUCCESS) { | 570 | if (status != SCI_SUCCESS) { |
573 | dev_err(&isci_host->pdev->dev, | 571 | dev_err(&ihost->pdev->dev, |
574 | "%s: scic_controller_terminate_request" | 572 | "%s: scic_controller_terminate_request" |
575 | " returned = 0x%x\n", | 573 | " returned = 0x%x\n", |
576 | __func__, status); | 574 | __func__, status); |
@@ -579,7 +577,7 @@ static void isci_terminate_request_core( | |||
579 | 577 | ||
580 | } else { | 578 | } else { |
581 | if (was_terminated) { | 579 | if (was_terminated) { |
582 | dev_dbg(&isci_host->pdev->dev, | 580 | dev_dbg(&ihost->pdev->dev, |
583 | "%s: before completion wait (%p/%p)\n", | 581 | "%s: before completion wait (%p/%p)\n", |
584 | __func__, isci_request, io_request_completion); | 582 | __func__, isci_request, io_request_completion); |
585 | 583 | ||
@@ -593,7 +591,7 @@ static void isci_terminate_request_core( | |||
593 | if (!termination_completed) { | 591 | if (!termination_completed) { |
594 | 592 | ||
595 | /* The request to terminate has timed out. */ | 593 | /* The request to terminate has timed out. */ |
596 | spin_lock_irqsave(&isci_host->scic_lock, | 594 | spin_lock_irqsave(&ihost->scic_lock, |
597 | flags); | 595 | flags); |
598 | 596 | ||
599 | /* Check for state changes. */ | 597 | /* Check for state changes. */ |
@@ -623,12 +621,12 @@ static void isci_terminate_request_core( | |||
623 | } else | 621 | } else |
624 | termination_completed = 1; | 622 | termination_completed = 1; |
625 | 623 | ||
626 | spin_unlock_irqrestore(&isci_host->scic_lock, | 624 | spin_unlock_irqrestore(&ihost->scic_lock, |
627 | flags); | 625 | flags); |
628 | 626 | ||
629 | if (!termination_completed) { | 627 | if (!termination_completed) { |
630 | 628 | ||
631 | dev_err(&isci_host->pdev->dev, | 629 | dev_err(&ihost->pdev->dev, |
632 | "%s: *** Timeout waiting for " | 630 | "%s: *** Timeout waiting for " |
633 | "termination(%p/%p)\n", | 631 | "termination(%p/%p)\n", |
634 | __func__, io_request_completion, | 632 | __func__, io_request_completion, |
@@ -642,7 +640,7 @@ static void isci_terminate_request_core( | |||
642 | } | 640 | } |
643 | } | 641 | } |
644 | if (termination_completed) | 642 | if (termination_completed) |
645 | dev_dbg(&isci_host->pdev->dev, | 643 | dev_dbg(&ihost->pdev->dev, |
646 | "%s: after completion wait (%p/%p)\n", | 644 | "%s: after completion wait (%p/%p)\n", |
647 | __func__, isci_request, io_request_completion); | 645 | __func__, isci_request, io_request_completion); |
648 | } | 646 | } |
@@ -678,7 +676,7 @@ static void isci_terminate_request_core( | |||
678 | } | 676 | } |
679 | if (needs_cleanup_handling) | 677 | if (needs_cleanup_handling) |
680 | isci_request_cleanup_completed_loiterer( | 678 | isci_request_cleanup_completed_loiterer( |
681 | isci_host, idev, isci_request, task); | 679 | ihost, idev, isci_request, task); |
682 | } | 680 | } |
683 | } | 681 | } |
684 | 682 | ||
@@ -1253,7 +1251,7 @@ isci_task_request_complete(struct isci_host *ihost, | |||
1253 | /* PRINT_TMF( ((struct isci_tmf *)request->task)); */ | 1251 | /* PRINT_TMF( ((struct isci_tmf *)request->task)); */ |
1254 | tmf_complete = tmf->complete; | 1252 | tmf_complete = tmf->complete; |
1255 | 1253 | ||
1256 | scic_controller_complete_io(&ihost->sci, ireq->target_device, ireq); | 1254 | scic_controller_complete_io(ihost, ireq->target_device, ireq); |
1257 | /* set the 'terminated' flag handle to make sure it cannot be terminated | 1255 | /* set the 'terminated' flag handle to make sure it cannot be terminated |
1258 | * or completed again. | 1256 | * or completed again. |
1259 | */ | 1257 | */ |