Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind...
[pandora-kernel.git] / drivers / ata / sata_mv.c
index 71cc0d4..f3471bc 100644 (file)
@@ -686,16 +686,27 @@ static struct ata_port_operations mv5_ops = {
 };
 
 static struct ata_port_operations mv6_ops = {
-       .inherits               = &mv5_ops,
+       .inherits               = &ata_bmdma_port_ops,
+
+       .lost_interrupt         = ATA_OP_NULL,
+
+       .qc_defer               = mv_qc_defer,
+       .qc_prep                = mv_qc_prep,
+       .qc_issue               = mv_qc_issue,
+
        .dev_config             = mv6_dev_config,
-       .scr_read               = mv_scr_read,
-       .scr_write              = mv_scr_write,
 
+       .freeze                 = mv_eh_freeze,
+       .thaw                   = mv_eh_thaw,
+       .hardreset              = mv_hardreset,
+       .softreset              = mv_softreset,
        .pmp_hardreset          = mv_pmp_hardreset,
        .pmp_softreset          = mv_softreset,
-       .softreset              = mv_softreset,
        .error_handler          = mv_pmp_error_handler,
 
+       .scr_read               = mv_scr_read,
+       .scr_write              = mv_scr_write,
+
        .sff_check_status       = mv_sff_check_status,
        .sff_irq_clear          = mv_sff_irq_clear,
        .check_atapi_dma        = mv_check_atapi_dma,
@@ -703,6 +714,9 @@ static struct ata_port_operations mv6_ops = {
        .bmdma_start            = mv_bmdma_start,
        .bmdma_stop             = mv_bmdma_stop,
        .bmdma_status           = mv_bmdma_status,
+
+       .port_start             = mv_port_start,
+       .port_stop              = mv_port_stop,
 };
 
 static struct ata_port_operations mv_iie_ops = {
@@ -2248,7 +2262,7 @@ static unsigned int mv_qc_issue_fis(struct ata_queued_cmd *qc)
        }
 
        if (qc->tf.flags & ATA_TFLAG_POLLING)
-               ata_pio_queue_task(ap, qc, 0);
+               ata_sff_queue_pio_task(ap, 0);
        return 0;
 }
 
@@ -2344,7 +2358,7 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
                if (IS_GEN_II(hpriv))
                        return mv_qc_issue_fis(qc);
        }
-       return ata_sff_qc_issue(qc);
+       return ata_bmdma_qc_issue(qc);
 }
 
 static struct ata_queued_cmd *mv_get_active_qc(struct ata_port *ap)
@@ -2355,13 +2369,9 @@ static struct ata_queued_cmd *mv_get_active_qc(struct ata_port *ap)
        if (pp->pp_flags & MV_PP_FLAG_NCQ_EN)
                return NULL;
        qc = ata_qc_from_tag(ap, ap->link.active_tag);
-       if (qc) {
-               if (qc->tf.flags & ATA_TFLAG_POLLING)
-                       qc = NULL;
-               else if (!(qc->flags & ATA_QCFLAG_ACTIVE))
-                       qc = NULL;
-       }
-       return qc;
+       if (qc && !(qc->tf.flags & ATA_TFLAG_POLLING))
+               return qc;
+       return NULL;
 }
 
 static void mv_pmp_error_handler(struct ata_port *ap)
@@ -2546,9 +2556,7 @@ static void mv_unexpected_intr(struct ata_port *ap, int edma_was_enabled)
        char *when = "idle";
 
        ata_ehi_clear_desc(ehi);
-       if (ap->flags & ATA_FLAG_DISABLED) {
-               when = "disabled";
-       } else if (edma_was_enabled) {
+       if (edma_was_enabled) {
                when = "EDMA enabled";
        } else {
                struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag);
@@ -2782,10 +2790,6 @@ static void mv_port_intr(struct ata_port *ap, u32 port_cause)
        struct mv_port_priv *pp;
        int edma_was_enabled;
 
-       if (ap->flags & ATA_FLAG_DISABLED) {
-               mv_unexpected_intr(ap, 0);
-               return;
-       }
        /*
         * Grab a snapshot of the EDMA_EN flag setting,
         * so that we have a consistent view for this port,
@@ -3656,9 +3660,6 @@ static void mv_port_init(struct ata_ioports *port,  void __iomem *port_mmio)
        /* special case: control/altstatus doesn't have ATA_REG_ address */
        port->altstatus_addr = port->ctl_addr = shd_base + SHD_CTL_AST;
 
-       /* unused: */
-       port->cmd_addr = port->bmdma_addr = port->scr_addr = NULL;
-
        /* Clear any currently outstanding port interrupt conditions */
        serr = port_mmio + mv_scr_offset(SCR_ERROR);
        writelfl(readl(serr), serr);