aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2005-06-23 03:10:26 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 12:45:34 -0400
commit4452ea509e29df2f019bed2f7a1e0f5eea092b26 (patch)
treeaecda6901c8126fdeabf823381f05f12f77d69a6 /drivers/scsi
parent152becd26e0563aefdbc4fd1fe491928efe92d1f (diff)
[PATCH] dpt_i2o: fix waitqueue abuse
The driver plays with waitqueue internals and fails to compile after Ben's "aio: make wait_queue ->task ->private" patch. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/dpt_i2o.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 9cc0015b717d..a699c30b2662 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -1126,11 +1126,11 @@ static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout)
1126 struct adpt_i2o_post_wait_data *p1, *p2; 1126 struct adpt_i2o_post_wait_data *p1, *p2;
1127 struct adpt_i2o_post_wait_data *wait_data = 1127 struct adpt_i2o_post_wait_data *wait_data =
1128 kmalloc(sizeof(struct adpt_i2o_post_wait_data),GFP_KERNEL); 1128 kmalloc(sizeof(struct adpt_i2o_post_wait_data),GFP_KERNEL);
1129 adpt_wait_queue_t wait; 1129 DECLARE_WAITQUEUE(wait, current);
1130 1130
1131 if(!wait_data){ 1131 if (!wait_data)
1132 return -ENOMEM; 1132 return -ENOMEM;
1133 } 1133
1134 /* 1134 /*
1135 * The spin locking is needed to keep anyone from playing 1135 * The spin locking is needed to keep anyone from playing
1136 * with the queue pointers and id while we do the same 1136 * with the queue pointers and id while we do the same
@@ -1148,12 +1148,7 @@ static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout)
1148 wait_data->wq = &adpt_wq_i2o_post; 1148 wait_data->wq = &adpt_wq_i2o_post;
1149 wait_data->status = -ETIMEDOUT; 1149 wait_data->status = -ETIMEDOUT;
1150 1150
1151 // this code is taken from kernel/sched.c:interruptible_sleep_on_timeout 1151 add_wait_queue(&adpt_wq_i2o_post, &wait);
1152 wait.task = current;
1153 init_waitqueue_entry(&wait, current);
1154 spin_lock_irqsave(&adpt_wq_i2o_post.lock, flags);
1155 __add_wait_queue(&adpt_wq_i2o_post, &wait);
1156 spin_unlock(&adpt_wq_i2o_post.lock);
1157 1152
1158 msg[2] |= 0x80000000 | ((u32)wait_data->id); 1153 msg[2] |= 0x80000000 | ((u32)wait_data->id);
1159 timeout *= HZ; 1154 timeout *= HZ;
@@ -1175,9 +1170,7 @@ static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout)
1175 if(pHba->host) 1170 if(pHba->host)
1176 spin_lock_irq(pHba->host->host_lock); 1171 spin_lock_irq(pHba->host->host_lock);
1177 } 1172 }
1178 spin_lock_irq(&adpt_wq_i2o_post.lock); 1173 remove_wait_queue(&adpt_wq_i2o_post, &wait);
1179 __remove_wait_queue(&adpt_wq_i2o_post, &wait);
1180 spin_unlock_irqrestore(&adpt_wq_i2o_post.lock, flags);
1181 1174
1182 if(status == -ETIMEDOUT){ 1175 if(status == -ETIMEDOUT){
1183 printk(KERN_INFO"dpti%d: POST WAIT TIMEOUT\n",pHba->unit); 1176 printk(KERN_INFO"dpti%d: POST WAIT TIMEOUT\n",pHba->unit);