aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/dpt_i2o.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-11-07 04:01:20 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:53:59 -0500
commita9a3047dd8ae43ff24caae5ec733a93df129568e (patch)
treec69433a7a4a5f43ecb440e173284026b0d42d9fe /drivers/scsi/dpt_i2o.c
parent6521018d4bf9522b4de47254ea15e8c1be1ec00f (diff)
[PATCH] drivers/scsi: fix-up schedule_timeout() usage
Use schedule_timeout_uninterruptible() instead of set_current_state()/schedule_timeout() to reduce kernel size. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r--drivers/scsi/dpt_i2o.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 7235f94f1191..46d5571ec55a 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -1218,8 +1218,7 @@ static s32 adpt_i2o_post_this(adpt_hba* pHba, u32* data, int len)
1218 printk(KERN_WARNING"dpti%d: Timeout waiting for message frame!\n", pHba->unit); 1218 printk(KERN_WARNING"dpti%d: Timeout waiting for message frame!\n", pHba->unit);
1219 return -ETIMEDOUT; 1219 return -ETIMEDOUT;
1220 } 1220 }
1221 set_current_state(TASK_UNINTERRUPTIBLE); 1221 schedule_timeout_uninterruptible(1);
1222 schedule_timeout(1);
1223 } while(m == EMPTY_QUEUE); 1222 } while(m == EMPTY_QUEUE);
1224 1223
1225 msg = pHba->msg_addr_virt + m; 1224 msg = pHba->msg_addr_virt + m;
@@ -1294,8 +1293,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1294 printk(KERN_WARNING"Timeout waiting for message!\n"); 1293 printk(KERN_WARNING"Timeout waiting for message!\n");
1295 return -ETIMEDOUT; 1294 return -ETIMEDOUT;
1296 } 1295 }
1297 set_current_state(TASK_UNINTERRUPTIBLE); 1296 schedule_timeout_uninterruptible(1);
1298 schedule_timeout(1);
1299 } while (m == EMPTY_QUEUE); 1297 } while (m == EMPTY_QUEUE);
1300 1298
1301 status = (u8*)kmalloc(4, GFP_KERNEL|ADDR32); 1299 status = (u8*)kmalloc(4, GFP_KERNEL|ADDR32);
@@ -1327,8 +1325,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1327 return -ETIMEDOUT; 1325 return -ETIMEDOUT;
1328 } 1326 }
1329 rmb(); 1327 rmb();
1330 set_current_state(TASK_UNINTERRUPTIBLE); 1328 schedule_timeout_uninterruptible(1);
1331 schedule_timeout(1);
1332 } 1329 }
1333 1330
1334 if(*status == 0x01 /*I2O_EXEC_IOP_RESET_IN_PROGRESS*/) { 1331 if(*status == 0x01 /*I2O_EXEC_IOP_RESET_IN_PROGRESS*/) {
@@ -1345,8 +1342,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1345 printk(KERN_ERR "%s:Timeout waiting for IOP Reset.\n",pHba->name); 1342 printk(KERN_ERR "%s:Timeout waiting for IOP Reset.\n",pHba->name);
1346 return -ETIMEDOUT; 1343 return -ETIMEDOUT;
1347 } 1344 }
1348 set_current_state(TASK_UNINTERRUPTIBLE); 1345 schedule_timeout_uninterruptible(1);
1349 schedule_timeout(1);
1350 } while (m == EMPTY_QUEUE); 1346 } while (m == EMPTY_QUEUE);
1351 // Flush the offset 1347 // Flush the offset
1352 adpt_send_nop(pHba, m); 1348 adpt_send_nop(pHba, m);
@@ -1917,11 +1913,8 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
1917 return -ENXIO; 1913 return -ENXIO;
1918 } 1914 }
1919 1915
1920 while((volatile u32) pHba->state & DPTI_STATE_RESET ) { 1916 while((volatile u32) pHba->state & DPTI_STATE_RESET )
1921 set_task_state(current,TASK_UNINTERRUPTIBLE); 1917 schedule_timeout_uninterruptible(2);
1922 schedule_timeout(2);
1923
1924 }
1925 1918
1926 switch (cmd) { 1919 switch (cmd) {
1927 // TODO: handle 3 cases 1920 // TODO: handle 3 cases
@@ -2635,8 +2628,7 @@ static s32 adpt_send_nop(adpt_hba*pHba,u32 m)
2635 printk(KERN_ERR "%s: Timeout waiting for message frame!\n",pHba->name); 2628 printk(KERN_ERR "%s: Timeout waiting for message frame!\n",pHba->name);
2636 return 2; 2629 return 2;
2637 } 2630 }
2638 set_current_state(TASK_UNINTERRUPTIBLE); 2631 schedule_timeout_uninterruptible(1);
2639 schedule_timeout(1);
2640 } 2632 }
2641 msg = (u32 __iomem *)(pHba->msg_addr_virt + m); 2633 msg = (u32 __iomem *)(pHba->msg_addr_virt + m);
2642 writel( THREE_WORD_MSG_SIZE | SGL_OFFSET_0,&msg[0]); 2634 writel( THREE_WORD_MSG_SIZE | SGL_OFFSET_0,&msg[0]);
@@ -2670,8 +2662,7 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
2670 printk(KERN_WARNING"%s: Timeout waiting for message frame\n",pHba->name); 2662 printk(KERN_WARNING"%s: Timeout waiting for message frame\n",pHba->name);
2671 return -ETIMEDOUT; 2663 return -ETIMEDOUT;
2672 } 2664 }
2673 set_current_state(TASK_UNINTERRUPTIBLE); 2665 schedule_timeout_uninterruptible(1);
2674 schedule_timeout(1);
2675 } while(m == EMPTY_QUEUE); 2666 } while(m == EMPTY_QUEUE);
2676 2667
2677 msg=(u32 __iomem *)(pHba->msg_addr_virt+m); 2668 msg=(u32 __iomem *)(pHba->msg_addr_virt+m);
@@ -2709,8 +2700,7 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
2709 printk(KERN_WARNING"%s: Timeout Initializing\n",pHba->name); 2700 printk(KERN_WARNING"%s: Timeout Initializing\n",pHba->name);
2710 return -ETIMEDOUT; 2701 return -ETIMEDOUT;
2711 } 2702 }
2712 set_current_state(TASK_UNINTERRUPTIBLE); 2703 schedule_timeout_uninterruptible(1);
2713 schedule_timeout(1);
2714 } while (1); 2704 } while (1);
2715 2705
2716 // If the command was successful, fill the fifo with our reply 2706 // If the command was successful, fill the fifo with our reply
@@ -2788,8 +2778,7 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba)
2788 pHba->name); 2778 pHba->name);
2789 return -ETIMEDOUT; 2779 return -ETIMEDOUT;
2790 } 2780 }
2791 set_current_state(TASK_UNINTERRUPTIBLE); 2781 schedule_timeout_uninterruptible(1);
2792 schedule_timeout(1);
2793 } while(m==EMPTY_QUEUE); 2782 } while(m==EMPTY_QUEUE);
2794 2783
2795 2784
@@ -2816,8 +2805,7 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba)
2816 return -ETIMEDOUT; 2805 return -ETIMEDOUT;
2817 } 2806 }
2818 rmb(); 2807 rmb();
2819 set_current_state(TASK_UNINTERRUPTIBLE); 2808 schedule_timeout_uninterruptible(1);
2820 schedule_timeout(1);
2821 } 2809 }
2822 2810
2823 // Set up our number of outbound and inbound messages 2811 // Set up our number of outbound and inbound messages