libata/pdc_adma: make SFF EH handle non-bmdma SFF drivers and standardize pdc_adma ops
authorTejun Heo <htejun@gmail.com>
Tue, 25 Mar 2008 12:34:39 +0000 (21:34 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 17 Apr 2008 19:44:20 +0000 (15:44 -0400)
pdc_adma has interface similar to SFF but has its own DMA interface.
It currently implements noop bmdma ops to avoid crashing
ata_bmdma_error_handler() which BTW actually is EH for SFF drivers.

This patch makes ata_bmdma_error_handler() dereference bmdma ops iff
bmdma_addr is initialized as done in ata_bmdma_post_internal_cmd.
This change allows pdc_adma to standardize ops and use SFF
error_handler and post_internal_cmd.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Mark Lord <liml@rtr.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-sff.c
drivers/ata/pdc_adma.c

index c601dcef2925f625a486acde9b8210f89ffb6c7d..5208ca21f634cf520e6365727086c70d43c47619 100644 (file)
@@ -2014,7 +2014,8 @@ void ata_bmdma_error_handler(struct ata_port *ap)
 
        ap->hsm_task_state = HSM_ST_IDLE;
 
-       if (qc && (qc->tf.protocol == ATA_PROT_DMA ||
+       if (ap->ioaddr.bmdma_addr &&
+           qc && (qc->tf.protocol == ATA_PROT_DMA ||
                   qc->tf.protocol == ATAPI_PROT_DMA)) {
                u8 host_stat;
 
index 5ed065d0ab4cb9d76f37d350f707704eed85a29d..577a0e556f7a6da98c219201136b7a1ba829bc36 100644 (file)
@@ -136,8 +136,6 @@ static void adma_port_stop(struct ata_port *ap);
 static void adma_qc_prep(struct ata_queued_cmd *qc);
 static unsigned int adma_qc_issue(struct ata_queued_cmd *qc);
 static int adma_check_atapi_dma(struct ata_queued_cmd *qc);
-static void adma_bmdma_stop(struct ata_queued_cmd *qc);
-static u8 adma_bmdma_status(struct ata_port *ap);
 static void adma_freeze(struct ata_port *ap);
 static void adma_thaw(struct ata_port *ap);
 static int adma_prereset(struct ata_link *link, unsigned long deadline);
@@ -158,8 +156,6 @@ static struct ata_port_operations adma_ata_ops = {
        .exec_command           = ata_exec_command,
        .data_xfer              = ata_data_xfer,
        .check_atapi_dma        = adma_check_atapi_dma,
-       .bmdma_stop             = adma_bmdma_stop,
-       .bmdma_status           = adma_bmdma_status,
        .qc_prep                = adma_qc_prep,
        .qc_issue               = adma_qc_issue,
        .irq_on                 = ata_irq_on,
@@ -168,6 +164,8 @@ static struct ata_port_operations adma_ata_ops = {
        .thaw                   = adma_thaw,
        .prereset               = adma_prereset,
        .softreset              = ata_std_softreset,
+       .error_handler          = ata_bmdma_error_handler,
+       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
 
        .port_start             = adma_port_start,
        .port_stop              = adma_port_stop,
@@ -204,16 +202,6 @@ static int adma_check_atapi_dma(struct ata_queued_cmd *qc)
        return 1;       /* ATAPI DMA not yet supported */
 }
 
-static void adma_bmdma_stop(struct ata_queued_cmd *qc)
-{
-       /* nothing */
-}
-
-static u8 adma_bmdma_status(struct ata_port *ap)
-{
-       return 0;
-}
-
 static void adma_reset_engine(struct ata_port *ap)
 {
        void __iomem *chan = ADMA_PORT_REGS(ap);