aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pm8001/pm8001_sas.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2012-06-22 02:36:30 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 03:58:54 -0400
commitf0bf750c2d25c3a2131ececbff63c7878e0e3765 (patch)
treeba967c5d28945e76bee78feb24ade328d5b0b3a6 /drivers/scsi/pm8001/pm8001_sas.c
parenta494fd5bd98bb35d5a9a274fecb768e14ebf499c (diff)
[SCSI] libsas: trim sas_task of slow path infrastructure
The timer and the completion are only used for slow path tasks (smp, and lldd tmfs), yet we incur the allocation space and cpu setup time for every fast path task. Cc: Xiangliang Yu <yuxiangl@marvell.com> Acked-by: Jack Wang <jack_wang@usish.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/pm8001/pm8001_sas.c')
-rw-r--r--drivers/scsi/pm8001/pm8001_sas.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index fdbba57a74ae..b961112395d5 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -650,9 +650,9 @@ int pm8001_dev_found(struct domain_device *dev)
650 650
651static void pm8001_task_done(struct sas_task *task) 651static void pm8001_task_done(struct sas_task *task)
652{ 652{
653 if (!del_timer(&task->timer)) 653 if (!del_timer(&task->slow_task->timer))
654 return; 654 return;
655 complete(&task->completion); 655 complete(&task->slow_task->completion);
656} 656}
657 657
658static void pm8001_tmf_timedout(unsigned long data) 658static void pm8001_tmf_timedout(unsigned long data)
@@ -660,7 +660,7 @@ static void pm8001_tmf_timedout(unsigned long data)
660 struct sas_task *task = (struct sas_task *)data; 660 struct sas_task *task = (struct sas_task *)data;
661 661
662 task->task_state_flags |= SAS_TASK_STATE_ABORTED; 662 task->task_state_flags |= SAS_TASK_STATE_ABORTED;
663 complete(&task->completion); 663 complete(&task->slow_task->completion);
664} 664}
665 665
666#define PM8001_TASK_TIMEOUT 20 666#define PM8001_TASK_TIMEOUT 20
@@ -683,7 +683,7 @@ static int pm8001_exec_internal_tmf_task(struct domain_device *dev,
683 struct pm8001_hba_info *pm8001_ha = pm8001_find_ha_by_dev(dev); 683 struct pm8001_hba_info *pm8001_ha = pm8001_find_ha_by_dev(dev);
684 684
685 for (retry = 0; retry < 3; retry++) { 685 for (retry = 0; retry < 3; retry++) {
686 task = sas_alloc_task(GFP_KERNEL); 686 task = sas_alloc_slow_task(GFP_KERNEL);
687 if (!task) 687 if (!task)
688 return -ENOMEM; 688 return -ENOMEM;
689 689
@@ -691,21 +691,21 @@ static int pm8001_exec_internal_tmf_task(struct domain_device *dev,
691 task->task_proto = dev->tproto; 691 task->task_proto = dev->tproto;
692 memcpy(&task->ssp_task, parameter, para_len); 692 memcpy(&task->ssp_task, parameter, para_len);
693 task->task_done = pm8001_task_done; 693 task->task_done = pm8001_task_done;
694 task->timer.data = (unsigned long)task; 694 task->slow_task->timer.data = (unsigned long)task;
695 task->timer.function = pm8001_tmf_timedout; 695 task->slow_task->timer.function = pm8001_tmf_timedout;
696 task->timer.expires = jiffies + PM8001_TASK_TIMEOUT*HZ; 696 task->slow_task->timer.expires = jiffies + PM8001_TASK_TIMEOUT*HZ;
697 add_timer(&task->timer); 697 add_timer(&task->slow_task->timer);
698 698
699 res = pm8001_task_exec(task, 1, GFP_KERNEL, 1, tmf); 699 res = pm8001_task_exec(task, 1, GFP_KERNEL, 1, tmf);
700 700
701 if (res) { 701 if (res) {
702 del_timer(&task->timer); 702 del_timer(&task->slow_task->timer);
703 PM8001_FAIL_DBG(pm8001_ha, 703 PM8001_FAIL_DBG(pm8001_ha,
704 pm8001_printk("Executing internal task " 704 pm8001_printk("Executing internal task "
705 "failed\n")); 705 "failed\n"));
706 goto ex_err; 706 goto ex_err;
707 } 707 }
708 wait_for_completion(&task->completion); 708 wait_for_completion(&task->slow_task->completion);
709 res = -TMF_RESP_FUNC_FAILED; 709 res = -TMF_RESP_FUNC_FAILED;
710 /* Even TMF timed out, return direct. */ 710 /* Even TMF timed out, return direct. */
711 if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) { 711 if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) {
@@ -765,17 +765,17 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha,
765 struct sas_task *task = NULL; 765 struct sas_task *task = NULL;
766 766
767 for (retry = 0; retry < 3; retry++) { 767 for (retry = 0; retry < 3; retry++) {
768 task = sas_alloc_task(GFP_KERNEL); 768 task = sas_alloc_slow_task(GFP_KERNEL);
769 if (!task) 769 if (!task)
770 return -ENOMEM; 770 return -ENOMEM;
771 771
772 task->dev = dev; 772 task->dev = dev;
773 task->task_proto = dev->tproto; 773 task->task_proto = dev->tproto;
774 task->task_done = pm8001_task_done; 774 task->task_done = pm8001_task_done;
775 task->timer.data = (unsigned long)task; 775 task->slow_task->timer.data = (unsigned long)task;
776 task->timer.function = pm8001_tmf_timedout; 776 task->slow_task->timer.function = pm8001_tmf_timedout;
777 task->timer.expires = jiffies + PM8001_TASK_TIMEOUT * HZ; 777 task->slow_task->timer.expires = jiffies + PM8001_TASK_TIMEOUT * HZ;
778 add_timer(&task->timer); 778 add_timer(&task->slow_task->timer);
779 779
780 res = pm8001_tag_alloc(pm8001_ha, &ccb_tag); 780 res = pm8001_tag_alloc(pm8001_ha, &ccb_tag);
781 if (res) 781 if (res)
@@ -789,13 +789,13 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha,
789 pm8001_dev, flag, task_tag, ccb_tag); 789 pm8001_dev, flag, task_tag, ccb_tag);
790 790
791 if (res) { 791 if (res) {
792 del_timer(&task->timer); 792 del_timer(&task->slow_task->timer);
793 PM8001_FAIL_DBG(pm8001_ha, 793 PM8001_FAIL_DBG(pm8001_ha,
794 pm8001_printk("Executing internal task " 794 pm8001_printk("Executing internal task "
795 "failed\n")); 795 "failed\n"));
796 goto ex_err; 796 goto ex_err;
797 } 797 }
798 wait_for_completion(&task->completion); 798 wait_for_completion(&task->slow_task->completion);
799 res = TMF_RESP_FUNC_FAILED; 799 res = TMF_RESP_FUNC_FAILED;
800 /* Even TMF timed out, return direct. */ 800 /* Even TMF timed out, return direct. */
801 if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) { 801 if ((task->task_state_flags & SAS_TASK_STATE_ABORTED)) {