[PATCH] sata_sil24: put port into known state before softresetting
authorTejun Heo <htejun@gmail.com>
Tue, 11 Apr 2006 13:32:19 +0000 (22:32 +0900)
committerJeff Garzik <jeff@garzik.org>
Tue, 11 Apr 2006 17:31:36 +0000 (13:31 -0400)
Make sure the controller has no pending commands and ready for command
before issuing SRST.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/scsi/sata_sil24.c

index 8199527966ebf578f04a473608b9fd5b1e9c09ea..bfbd630a889ca5d6c72f8699a17be636a6b64e7b 100644 (file)
@@ -474,6 +474,12 @@ static int sil24_softreset(struct ata_port *ap, unsigned int *class)
        irq_enable = readl(port + PORT_IRQ_ENABLE_SET);
        writel(irq_enable, port + PORT_IRQ_ENABLE_CLR);
 
+       /* put the port into known state */
+       if (sil24_init_port(ap)) {
+               reason ="port not ready";
+               goto err;
+       }
+
        /*
         * XXX: Not sure whether the following sleep is needed or not.
         * The original driver had it.  So....