Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
[pandora-kernel.git] / drivers / ata / libata-core.c
index d4e52e2..76c3c15 100644 (file)
@@ -4139,6 +4139,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
         */
        { "PIONEER DVD-RW  DVRTD08",    "1.00", ATA_HORKAGE_NOSETXFER },
        { "PIONEER DVD-RW  DVR-212D",   "1.28", ATA_HORKAGE_NOSETXFER },
+       { "PIONEER DVD-RW  DVR-216D",   "1.08", ATA_HORKAGE_NOSETXFER },
 
        /* End Marker */
        { }
@@ -4210,7 +4211,7 @@ static int glob_match (const char *text, const char *pattern)
                return 0;  /* End of both strings: match */
        return 1;  /* No match */
 }
+
 static unsigned long ata_dev_blacklisted(const struct ata_device *dev)
 {
        unsigned char model_num[ATA_ID_PROD_LEN + 1];
@@ -5340,7 +5341,7 @@ int ata_host_suspend(struct ata_host *host, pm_message_t mesg)
  *
  *     Resume @host.  Actual operation is performed by EH.  This
  *     function requests EH to perform PM operations and returns.
- *     Note that all resume operations are performed parallely.
+ *     Note that all resume operations are performed parallelly.
  *
  *     LOCKING:
  *     Kernel thread context (may sleep).
@@ -5479,8 +5480,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
        ap = kzalloc(sizeof(*ap), GFP_KERNEL);
        if (!ap)
                return NULL;
-       
-       ap->pflags |= ATA_PFLAG_INITIALIZING;
+
+       ap->pflags |= ATA_PFLAG_INITIALIZING | ATA_PFLAG_FROZEN;
        ap->lock = &host->lock;
        ap->print_id = -1;
        ap->host = host;
@@ -5887,21 +5888,9 @@ void ata_host_init(struct ata_host *host, struct device *dev,
        host->ops = ops;
 }
 
-
-static void async_port_probe(void *data, async_cookie_t cookie)
+int ata_port_probe(struct ata_port *ap)
 {
-       int rc;
-       struct ata_port *ap = data;
-
-       /*
-        * If we're not allowed to scan this host in parallel,
-        * we need to wait until all previous scans have completed
-        * before going further.
-        * Jeff Garzik says this is only within a controller, so we
-        * don't need to wait for port 0, only for later ports.
-        */
-       if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0)
-               async_synchronize_cookie(cookie);
+       int rc = 0;
 
        /* probe */
        if (ap->ops->error_handler) {
@@ -5927,23 +5916,33 @@ static void async_port_probe(void *data, async_cookie_t cookie)
                DPRINTK("ata%u: bus probe begin\n", ap->print_id);
                rc = ata_bus_probe(ap);
                DPRINTK("ata%u: bus probe end\n", ap->print_id);
-
-               if (rc) {
-                       /* FIXME: do something useful here?
-                        * Current libata behavior will
-                        * tear down everything when
-                        * the module is removed
-                        * or the h/w is unplugged.
-                        */
-               }
        }
+       return rc;
+}
+
+
+static void async_port_probe(void *data, async_cookie_t cookie)
+{
+       struct ata_port *ap = data;
+
+       /*
+        * If we're not allowed to scan this host in parallel,
+        * we need to wait until all previous scans have completed
+        * before going further.
+        * Jeff Garzik says this is only within a controller, so we
+        * don't need to wait for port 0, only for later ports.
+        */
+       if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0)
+               async_synchronize_cookie(cookie);
+
+       (void)ata_port_probe(ap);
 
        /* in order to keep device order, we need to synchronize at this point */
        async_synchronize_cookie(cookie);
 
        ata_scsi_scan_host(ap, 1);
-
 }
+
 /**
  *     ata_host_register - register initialized ATA host
  *     @host: ATA host to register
@@ -5983,7 +5982,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
        for (i = 0; i < host->n_ports; i++)
                host->ports[i]->print_id = ata_print_id++;
 
-       
+
        /* Create associated sysfs transport objects  */
        for (i = 0; i < host->n_ports; i++) {
                rc = ata_tport_add(host->dev,host->ports[i]);
@@ -6471,7 +6470,7 @@ static int __init ata_init(void)
                ata_sff_exit();
                rc = -ENOMEM;
                goto err_out;
-       }               
+       }
 
        printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n");
        return 0;