aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pdc_adma.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-05-10 15:41:30 -0400
committerJeff Garzik <jgarzik@redhat.com>2010-05-17 22:49:02 -0400
commit3e4ec3443f70fbe144799ccf0b1c3797f78d1715 (patch)
treecfb297e42075baacbbabfb6034e3e7c9a44c73b2 /drivers/ata/pdc_adma.c
parentc7a8209f766961eea4cfc6f22d2d6e06ef63546c (diff)
libata: kill ATA_FLAG_DISABLED
ATA_FLAG_DISABLED is only used by drivers which don't use ->error_handler framework and is largely broken. Its only meaningful function is to make irq handlers skip processing if the flag is set, which is largely useless and even harmful as it makes those ports more likely to cause IRQ storms. Kill ATA_FLAG_DISABLED and makes the callers disable attached devices instead. ata_port_probe() and ata_port_disable() which manipulate the flag are also killed. This simplifies condition check in IRQ handlers. While updating IRQ handlers, remove ap NULL check as libata guarantees consecutive port allocation (unoccupied ports are initialized with dummies) and long-obsolete ATA_QCFLAG_ACTIVE check (checked by ata_qc_from_tag()). Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pdc_adma.c')
-rw-r--r--drivers/ata/pdc_adma.c66
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;