[PATCH] libata: revalidate after transfer mode configuration
authorTejun Heo <htejun@gmail.com>
Sun, 5 Mar 2006 08:55:58 +0000 (17:55 +0900)
committerJeff Garzik <jeff@garzik.org>
Sun, 5 Mar 2006 16:09:42 +0000 (11:09 -0500)
Revalidate device after transfer mode configuration.  This also makes
dev->id up-to-date.

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

index 5d0adfa4610a3ca09ae3801ba160f57056b0f9d7..5dbcf0cf4a1062d620fa79dc15b5e06b0f29c0ff 100644 (file)
@@ -1625,6 +1625,12 @@ static void ata_dev_set_mode(struct ata_port *ap, struct ata_device *dev)
        idx = ofs + dev->xfer_shift;
        WARN_ON(idx >= ARRAY_SIZE(xfer_mode_str));
 
        idx = ofs + dev->xfer_shift;
        WARN_ON(idx >= ARRAY_SIZE(xfer_mode_str));
 
+       if (ata_dev_revalidate(ap, dev, 0)) {
+               printk(KERN_ERR "ata%u: failed to revalidate after set "
+                      "xfermode, disabled\n", ap->id);
+               ata_port_disable(ap);
+       }
+
        DPRINTK("idx=%d xfer_shift=%u, xfer_mode=0x%x, base=0x%x, offset=%d\n",
                idx, dev->xfer_shift, (int)dev->xfer_mode, (int)base, ofs);
 
        DPRINTK("idx=%d xfer_shift=%u, xfer_mode=0x%x, base=0x%x, offset=%d\n",
                idx, dev->xfer_shift, (int)dev->xfer_mode, (int)base, ofs);