aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_nv.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-05-10 15:41:39 -0400
committerJeff Garzik <jgarzik@redhat.com>2010-05-19 13:36:46 -0400
commitfe06e5f9b7c61dc567edace3f4909672067f7d7e (patch)
treeb2242169e8e3b32c63925ed9901fff9d49c26192 /drivers/ata/sata_nv.c
parentc429137a67b82788d24682153bb9c96501a9ef34 (diff)
libata-sff: separate out BMDMA EH
Some of error handling logic in ata_sff_error_handler() and all of ata_sff_post_internal_cmd() are for BMDMA. Create ata_bmdma_error_handler() and ata_bmdma_post_internal_cmd() and move BMDMA part into those. While at it, change DMA protocol check to ata_is_dma(), fix post_internal_cmd to call ap->ops->bmdma_stop instead of directly calling ata_bmdma_stop() and open code hardreset selection so that ata_std_error_handler() doesn't have to know about sff hardreset. As these two functions are BMDMA specific, there's no reason to check for bmdma_addr before calling bmdma methods if the protocol of the failed command is DMA. sata_mv and pata_mpc52xx now don't need to set .post_internal_cmd to ATA_OP_NULL and pata_icside and sata_qstor don't need to set it to their bmdma_stop routines. ata_sff_post_internal_cmd() becomes noop and is removed. This fixes p3 described in clean-up-BMDMA-initialization patch. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/sata_nv.c')
-rw-r--r--drivers/ata/sata_nv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index a007b20c199..64e99824d8c 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -1131,7 +1131,7 @@ static void nv_adma_post_internal_cmd(struct ata_queued_cmd *qc)
1131 struct nv_adma_port_priv *pp = qc->ap->private_data; 1131 struct nv_adma_port_priv *pp = qc->ap->private_data;
1132 1132
1133 if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) 1133 if (pp->flags & NV_ADMA_PORT_REGISTER_MODE)
1134 ata_sff_post_internal_cmd(qc); 1134 ata_bmdma_post_internal_cmd(qc);
1135} 1135}
1136 1136
1137static int nv_adma_port_start(struct ata_port *ap) 1137static int nv_adma_port_start(struct ata_port *ap)
@@ -1739,7 +1739,7 @@ static void nv_adma_error_handler(struct ata_port *ap)
1739 readw(mmio + NV_ADMA_CTL); /* flush posted write */ 1739 readw(mmio + NV_ADMA_CTL); /* flush posted write */
1740 } 1740 }
1741 1741
1742 ata_sff_error_handler(ap); 1742 ata_bmdma_error_handler(ap);
1743} 1743}
1744 1744
1745static void nv_swncq_qc_to_dq(struct ata_port *ap, struct ata_queued_cmd *qc) 1745static void nv_swncq_qc_to_dq(struct ata_port *ap, struct ata_queued_cmd *qc)
@@ -1865,7 +1865,7 @@ static void nv_swncq_error_handler(struct ata_port *ap)
1865 ehc->i.action |= ATA_EH_RESET; 1865 ehc->i.action |= ATA_EH_RESET;
1866 } 1866 }
1867 1867
1868 ata_sff_error_handler(ap); 1868 ata_bmdma_error_handler(ap);
1869} 1869}
1870 1870
1871#ifdef CONFIG_PM 1871#ifdef CONFIG_PM