Merge branch 'master' into upstream
[pandora-kernel.git] / drivers / scsi / libata-core.c
index 3f1aa77..df483ad 100644 (file)
@@ -981,8 +981,10 @@ void ata_qc_complete_internal(struct ata_queued_cmd *qc)
  *
  *     LOCKING:
  *     None.  Should be called with kernel context, might sleep.
+ *
+ *     RETURNS:
+ *     Zero on success, AC_ERR_* mask on failure
  */
-
 unsigned ata_exec_internal(struct ata_device *dev,
                           struct ata_taskfile *tf, const u8 *cdb,
                           int dma_dir, void *buf, unsigned int buflen)
@@ -3287,6 +3289,7 @@ void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
        qc->n_elem = 1;
        qc->orig_n_elem = 1;
        qc->buf_virt = buf;
+       qc->nbytes = buflen;
 
        sg = qc->__sg;
        sg_init_one(sg, buf, buflen);
@@ -3493,7 +3496,7 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words)
 
 /**
  *     ata_mmio_data_xfer - Transfer data by MMIO
- *     @dev: device for this I/O
+ *     @adev: device for this I/O
  *     @buf: data buffer
  *     @buflen: buffer length
  *     @write_data: read/write
@@ -4987,6 +4990,7 @@ int ata_device_resume(struct ata_device *dev)
        if (ap->flags & ATA_FLAG_SUSPENDED) {
                struct ata_device *failed_dev;
 
+               ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
                ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000);
 
                ap->flags &= ~ATA_FLAG_SUSPENDED;
@@ -5193,6 +5197,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
 
        INIT_WORK(&ap->port_task, NULL, NULL);
        INIT_WORK(&ap->hotplug_task, ata_scsi_hotplug, ap);
+       INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan, ap);
        INIT_LIST_HEAD(&ap->eh_done_q);
        init_waitqueue_head(&ap->eh_wait_q);
 
@@ -5292,6 +5297,7 @@ int ata_device_add(const struct ata_probe_ent *ent)
        unsigned int count = 0, i;
        struct device *dev = ent->dev;
        struct ata_host_set *host_set;
+       int rc;
 
        DPRINTK("ENTER\n");
        /* alloc a container for our list of ATA ports (buses) */
@@ -5343,9 +5349,13 @@ int ata_device_add(const struct ata_probe_ent *ent)
                goto err_free_ret;
 
        /* obtain irq, that is shared between channels */
-       if (request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags,
-                       DRV_NAME, host_set))
+       rc = request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags,
+                        DRV_NAME, host_set);
+       if (rc) {
+               dev_printk(KERN_ERR, dev, "irq %lu request failed: %d\n",
+                          ent->irq, rc);
                goto err_out;
+       }
 
        /* perform each probe synchronously */
        DPRINTK("probe begin\n");
@@ -5612,8 +5622,12 @@ void ata_pci_remove_one (struct pci_dev *pdev)
 {
        struct device *dev = pci_dev_to_dev(pdev);
        struct ata_host_set *host_set = dev_get_drvdata(dev);
+       struct ata_host_set *host_set2 = host_set->next;
 
        ata_host_set_remove(host_set);
+       if (host_set2)
+               ata_host_set_remove(host_set2);
+
        pci_release_regions(pdev);
        pci_disable_device(pdev);
        dev_set_drvdata(dev, NULL);