diff options
author | Andy Yan <ayan@marvell.com> | 2009-05-11 08:05:26 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-05-23 16:44:07 -0400 |
commit | 0b84b7094e87769120def1e703b8b4d037281038 (patch) | |
tree | 10ece1e9bb1653b56597b0dc4b39c4d2fe110dae /drivers | |
parent | 2b288133ab6306b1761e0a2ef943b944ead6ad69 (diff) |
[SCSI] mvsas: bug fix of dead lock
TMF task should be issued with Interrupt Disabled, or Deadlock may take place.
Clean-up unused parameters and conditonal lock.
Signed-off-by: Ying Chu <jasonchu@marvell.com>
Signed-off-by: Andy Yan <ayan@marvell.com>
Signed-off-by: Ke Wei <kewei@marvell.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/mvsas/mv_sas.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index f709319c2b6d..4279b5e8808a 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c | |||
@@ -868,8 +868,8 @@ static int mvs_task_prep_ssp(struct mvs_info *mvi, | |||
868 | 868 | ||
869 | #define DEV_IS_GONE(mvi_dev) ((!mvi_dev || (mvi_dev->dev_type == NO_DEVICE))) | 869 | #define DEV_IS_GONE(mvi_dev) ((!mvi_dev || (mvi_dev->dev_type == NO_DEVICE))) |
870 | static int mvs_task_exec(struct sas_task *task, const int num, gfp_t gfp_flags, | 870 | static int mvs_task_exec(struct sas_task *task, const int num, gfp_t gfp_flags, |
871 | struct completion *completion, int lock, | 871 | struct completion *completion,int is_tmf, |
872 | int is_tmf, struct mvs_tmf_task *tmf) | 872 | struct mvs_tmf_task *tmf) |
873 | { | 873 | { |
874 | struct domain_device *dev = task->dev; | 874 | struct domain_device *dev = task->dev; |
875 | struct mvs_info *mvi; | 875 | struct mvs_info *mvi; |
@@ -892,8 +892,7 @@ static int mvs_task_exec(struct sas_task *task, const int num, gfp_t gfp_flags, | |||
892 | 892 | ||
893 | mvi = mvs_find_dev_mvi(task->dev); | 893 | mvi = mvs_find_dev_mvi(task->dev); |
894 | 894 | ||
895 | if (lock) | 895 | spin_lock_irqsave(&mvi->lock, flags); |
896 | spin_lock_irqsave(&mvi->lock, flags); | ||
897 | do { | 896 | do { |
898 | dev = t->dev; | 897 | dev = t->dev; |
899 | mvi_dev = (struct mvs_device *)dev->lldd_dev; | 898 | mvi_dev = (struct mvs_device *)dev->lldd_dev; |
@@ -1020,15 +1019,14 @@ out_done: | |||
1020 | MVS_CHIP_DISP->start_delivery(mvi, | 1019 | MVS_CHIP_DISP->start_delivery(mvi, |
1021 | (mvi->tx_prod - 1) & (MVS_CHIP_SLOT_SZ - 1)); | 1020 | (mvi->tx_prod - 1) & (MVS_CHIP_SLOT_SZ - 1)); |
1022 | } | 1021 | } |
1023 | if (lock) | 1022 | spin_unlock_irqrestore(&mvi->lock, flags); |
1024 | spin_unlock_irqrestore(&mvi->lock, flags); | ||
1025 | return rc; | 1023 | return rc; |
1026 | } | 1024 | } |
1027 | 1025 | ||
1028 | int mvs_queue_command(struct sas_task *task, const int num, | 1026 | int mvs_queue_command(struct sas_task *task, const int num, |
1029 | gfp_t gfp_flags) | 1027 | gfp_t gfp_flags) |
1030 | { | 1028 | { |
1031 | return mvs_task_exec(task, num, gfp_flags, NULL, 1, 0, NULL); | 1029 | return mvs_task_exec(task, num, gfp_flags, NULL, 0, NULL); |
1032 | } | 1030 | } |
1033 | 1031 | ||
1034 | static void mvs_slot_free(struct mvs_info *mvi, u32 rx_desc) | 1032 | static void mvs_slot_free(struct mvs_info *mvi, u32 rx_desc) |
@@ -1448,7 +1446,7 @@ static int mvs_exec_internal_tmf_task(struct domain_device *dev, | |||
1448 | task->timer.expires = jiffies + MVS_TASK_TIMEOUT*HZ; | 1446 | task->timer.expires = jiffies + MVS_TASK_TIMEOUT*HZ; |
1449 | add_timer(&task->timer); | 1447 | add_timer(&task->timer); |
1450 | 1448 | ||
1451 | res = mvs_task_exec(task, 1, GFP_KERNEL, NULL, 0, 1, tmf); | 1449 | res = mvs_task_exec(task, 1, GFP_KERNEL, NULL, 1, tmf); |
1452 | 1450 | ||
1453 | if (res) { | 1451 | if (res) { |
1454 | del_timer(&task->timer); | 1452 | del_timer(&task->timer); |