]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
libata-core: Allow translation setting to fail
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Wed, 8 Aug 2007 13:28:49 +0000 (14:28 +0100)
committerJeff Garzik <jeff@garzik.org>
Fri, 31 Aug 2007 07:37:55 +0000 (03:37 -0400)
On some early drives (pre ATA1) this feature is not supported. If it
fails then we know the drive geometry is the hardware geometry and the
one we tried to set anyway so just carry on.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-core.c

index 2ad4dda6d4a780e13e1814296ead50ed1dd0774f..9cf46bf8c8d2c4e3c1511fe2a2c66efd5eb3642e 100644 (file)
@@ -3985,6 +3985,11 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,
        tf.device |= (heads - 1) & 0x0f; /* max head = num. of heads - 1 */
 
        err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
+       /* A clean abort indicates an original or just out of spec drive
+          and we should continue as we issue the setup based on the
+          drive reported working geometry */
+       if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED))
+               err_mask = 0;
 
        DPRINTK("EXIT, err_mask=%x\n", err_mask);
        return err_mask;