diff options
Diffstat (limited to 'drivers/ata/pdc_adma.c')
-rw-r--r-- | drivers/ata/pdc_adma.c | 66 |
1 files changed, 30 insertions, 36 deletions
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c index 5904cfdb8dbe..ed18d8b42c52 100644 --- a/drivers/ata/pdc_adma.c +++ b/drivers/ata/pdc_adma.c | |||
@@ -442,8 +442,6 @@ static inline unsigned int adma_intr_pkt(struct ata_host *host) | |||
442 | continue; | 442 | continue; |
443 | handled = 1; | 443 | handled = 1; |
444 | adma_enter_reg_mode(ap); | 444 | adma_enter_reg_mode(ap); |
445 | if (ap->flags & ATA_FLAG_DISABLED) | ||
446 | continue; | ||
447 | pp = ap->private_data; | 445 | pp = ap->private_data; |
448 | if (!pp || pp->state != adma_state_pkt) | 446 | if (!pp || pp->state != adma_state_pkt) |
449 | continue; | 447 | continue; |
@@ -484,42 +482,38 @@ static inline unsigned int adma_intr_mmio(struct ata_host *host) | |||
484 | unsigned int handled = 0, port_no; | 482 | unsigned int handled = 0, port_no; |
485 | 483 | ||
486 | for (port_no = 0; port_no < host->n_ports; ++port_no) { | 484 | for (port_no = 0; port_no < host->n_ports; ++port_no) { |
487 | struct ata_port *ap; | 485 | struct ata_port *ap = host->ports[port_no]; |
488 | ap = host->ports[port_no]; | 486 | struct adma_port_priv *pp = ap->private_data; |
489 | if (ap && (!(ap->flags & ATA_FLAG_DISABLED))) { | 487 | struct ata_queued_cmd *qc; |
490 | struct ata_queued_cmd *qc; | 488 | |
491 | struct adma_port_priv *pp = ap->private_data; | 489 | if (!pp || pp->state != adma_state_mmio) |
492 | if (!pp || pp->state != adma_state_mmio) | 490 | continue; |
491 | qc = ata_qc_from_tag(ap, ap->link.active_tag); | ||
492 | if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) { | ||
493 | |||
494 | /* check main status, clearing INTRQ */ | ||
495 | u8 status = ata_sff_check_status(ap); | ||
496 | if ((status & ATA_BUSY)) | ||
493 | continue; | 497 | continue; |
494 | qc = ata_qc_from_tag(ap, ap->link.active_tag); | 498 | DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", |
495 | if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) { | 499 | ap->print_id, qc->tf.protocol, status); |
496 | 500 | ||
497 | /* check main status, clearing INTRQ */ | 501 | /* complete taskfile transaction */ |
498 | u8 status = ata_sff_check_status(ap); | 502 | pp->state = adma_state_idle; |
499 | if ((status & ATA_BUSY)) | 503 | qc->err_mask |= ac_err_mask(status); |
500 | continue; | 504 | if (!qc->err_mask) |
501 | DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", | 505 | ata_qc_complete(qc); |
502 | ap->print_id, qc->tf.protocol, status); | 506 | else { |
503 | 507 | struct ata_eh_info *ehi = &ap->link.eh_info; | |
504 | /* complete taskfile transaction */ | 508 | ata_ehi_clear_desc(ehi); |
505 | pp->state = adma_state_idle; | 509 | ata_ehi_push_desc(ehi, "status 0x%02X", status); |
506 | qc->err_mask |= ac_err_mask(status); | 510 | |
507 | if (!qc->err_mask) | 511 | if (qc->err_mask == AC_ERR_DEV) |
508 | ata_qc_complete(qc); | 512 | ata_port_abort(ap); |
509 | else { | 513 | else |
510 | struct ata_eh_info *ehi = | 514 | ata_port_freeze(ap); |
511 | &ap->link.eh_info; | ||
512 | ata_ehi_clear_desc(ehi); | ||
513 | ata_ehi_push_desc(ehi, | ||
514 | "status 0x%02X", status); | ||
515 | |||
516 | if (qc->err_mask == AC_ERR_DEV) | ||
517 | ata_port_abort(ap); | ||
518 | else | ||
519 | ata_port_freeze(ap); | ||
520 | } | ||
521 | handled = 1; | ||
522 | } | 515 | } |
516 | handled = 1; | ||
523 | } | 517 | } |
524 | } | 518 | } |
525 | return handled; | 519 | return handled; |