aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_sil24.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-03-10 21:44:08 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-11 19:29:42 -0500
commit8645984c357a0262a29b8a28353a576645e2c707 (patch)
treea97b41a4c84a295dc075106226d053fd04a40c07 /drivers/scsi/sata_sil24.c
parent10d996ad1990ec2338c463042db6d5ef4f347187 (diff)
[PATCH] sata_sil24: lengthen softreset timeout
sil24 softreset timeout was > 100ms (100 loops with msleep(1)), which turned out to be too short for some devices (ASI ARAID99 2000). This patch converts sil24 softreset waiting loop to use proper timeout condition and lengthen the timeout to ATA_TMOUT_BOOT secs and check interval to 100ms. Chisato Yamauchi discovered the problem and supplied initial patch. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Chisato Yamauchi <cyamauch@plamo.linet.gr.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/sata_sil24.c')
-rw-r--r--drivers/scsi/sata_sil24.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index fa1a5ac60639..9a53a5ed38c5 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -435,8 +435,8 @@ static int sil24_softreset(struct ata_port *ap, int verbose,
435 struct sil24_port_priv *pp = ap->private_data; 435 struct sil24_port_priv *pp = ap->private_data;
436 struct sil24_prb *prb = &pp->cmd_block[0].ata.prb; 436 struct sil24_prb *prb = &pp->cmd_block[0].ata.prb;
437 dma_addr_t paddr = pp->cmd_block_dma; 437 dma_addr_t paddr = pp->cmd_block_dma;
438 unsigned long timeout = jiffies + ATA_TMOUT_BOOT * HZ;
438 u32 irq_enable, irq_stat; 439 u32 irq_enable, irq_stat;
439 int cnt;
440 440
441 DPRINTK("ENTER\n"); 441 DPRINTK("ENTER\n");
442 442
@@ -461,7 +461,7 @@ static int sil24_softreset(struct ata_port *ap, int verbose,
461 461
462 writel((u32)paddr, port + PORT_CMD_ACTIVATE); 462 writel((u32)paddr, port + PORT_CMD_ACTIVATE);
463 463
464 for (cnt = 0; cnt < 100; cnt++) { 464 do {
465 irq_stat = readl(port + PORT_IRQ_STAT); 465 irq_stat = readl(port + PORT_IRQ_STAT);
466 writel(irq_stat, port + PORT_IRQ_STAT); /* clear irq */ 466 writel(irq_stat, port + PORT_IRQ_STAT); /* clear irq */
467 467
@@ -469,8 +469,8 @@ static int sil24_softreset(struct ata_port *ap, int verbose,
469 if (irq_stat & (PORT_IRQ_COMPLETE | PORT_IRQ_ERROR)) 469 if (irq_stat & (PORT_IRQ_COMPLETE | PORT_IRQ_ERROR))
470 break; 470 break;
471 471
472 msleep(1); 472 msleep(100);
473 } 473 } while (time_before(jiffies, timeout));
474 474
475 /* restore IRQs */ 475 /* restore IRQs */
476 writel(irq_enable, port + PORT_IRQ_ENABLE_SET); 476 writel(irq_enable, port + PORT_IRQ_ENABLE_SET);