Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[pandora-kernel.git] / drivers / ata / libata-core.c
index 25d8d3f..e900c5e 100644 (file)
@@ -93,6 +93,10 @@ static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ;
 module_param(ata_probe_timeout, int, 0444);
 MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)");
 
+int noacpi;
+module_param(noacpi, int, 0444);
+MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set");
+
 MODULE_AUTHOR("Jeff Garzik");
 MODULE_DESCRIPTION("Library module for ATA devices");
 MODULE_LICENSE("GPL");
@@ -1410,7 +1414,16 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
        }
 
        tf.protocol = ATA_PROT_PIO;
-       tf.flags |= ATA_TFLAG_POLLING; /* for polling presence detection */
+
+       /* Some devices choke if TF registers contain garbage.  Make
+        * sure those are properly initialized.
+        */
+       tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
+
+       /* Device presence detection is unreliable on some
+        * controllers.  Always poll IDENTIFY if available.
+        */
+       tf.flags |= ATA_TFLAG_POLLING;
 
        err_mask = ata_exec_internal(dev, &tf, NULL, DMA_FROM_DEVICE,
                                     id, sizeof(id[0]) * ATA_ID_WORDS);
@@ -1555,6 +1568,16 @@ int ata_dev_configure(struct ata_device *dev)
                ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER, host %u, dev %u\n",
                               __FUNCTION__, ap->id, dev->devno);
 
+       /* set _SDD */
+       rc = ata_acpi_push_id(ap, dev->devno);
+       if (rc) {
+               ata_dev_printk(dev, KERN_WARNING, "failed to set _SDD(%d)\n",
+                       rc);
+       }
+
+       /* retrieve and execute the ATA task file of _GTF */
+       ata_acpi_exec_tfs(ap);
+
        /* print device capabilities */
        if (ata_msg_probe(ap))
                ata_dev_printk(dev, KERN_DEBUG,