diff options
author | Tejun Heo <tj@kernel.org> | 2010-05-10 15:41:30 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2010-05-17 22:49:02 -0400 |
commit | 3e4ec3443f70fbe144799ccf0b1c3797f78d1715 (patch) | |
tree | cfb297e42075baacbbabfb6034e3e7c9a44c73b2 /drivers/ata/sata_mv.c | |
parent | c7a8209f766961eea4cfc6f22d2d6e06ef63546c (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/sata_mv.c')
-rw-r--r-- | drivers/ata/sata_mv.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index bd486462951c..318862e8a8a9 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -2355,13 +2355,9 @@ static struct ata_queued_cmd *mv_get_active_qc(struct ata_port *ap) | |||
2355 | if (pp->pp_flags & MV_PP_FLAG_NCQ_EN) | 2355 | if (pp->pp_flags & MV_PP_FLAG_NCQ_EN) |
2356 | return NULL; | 2356 | return NULL; |
2357 | qc = ata_qc_from_tag(ap, ap->link.active_tag); | 2357 | qc = ata_qc_from_tag(ap, ap->link.active_tag); |
2358 | if (qc) { | 2358 | if (qc && !(qc->tf.flags & ATA_TFLAG_POLLING)) |
2359 | if (qc->tf.flags & ATA_TFLAG_POLLING) | 2359 | return qc; |
2360 | qc = NULL; | 2360 | return NULL; |
2361 | else if (!(qc->flags & ATA_QCFLAG_ACTIVE)) | ||
2362 | qc = NULL; | ||
2363 | } | ||
2364 | return qc; | ||
2365 | } | 2361 | } |
2366 | 2362 | ||
2367 | static void mv_pmp_error_handler(struct ata_port *ap) | 2363 | static void mv_pmp_error_handler(struct ata_port *ap) |
@@ -2546,9 +2542,7 @@ static void mv_unexpected_intr(struct ata_port *ap, int edma_was_enabled) | |||
2546 | char *when = "idle"; | 2542 | char *when = "idle"; |
2547 | 2543 | ||
2548 | ata_ehi_clear_desc(ehi); | 2544 | ata_ehi_clear_desc(ehi); |
2549 | if (ap->flags & ATA_FLAG_DISABLED) { | 2545 | if (edma_was_enabled) { |
2550 | when = "disabled"; | ||
2551 | } else if (edma_was_enabled) { | ||
2552 | when = "EDMA enabled"; | 2546 | when = "EDMA enabled"; |
2553 | } else { | 2547 | } else { |
2554 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag); | 2548 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag); |
@@ -2782,10 +2776,6 @@ static void mv_port_intr(struct ata_port *ap, u32 port_cause) | |||
2782 | struct mv_port_priv *pp; | 2776 | struct mv_port_priv *pp; |
2783 | int edma_was_enabled; | 2777 | int edma_was_enabled; |
2784 | 2778 | ||
2785 | if (ap->flags & ATA_FLAG_DISABLED) { | ||
2786 | mv_unexpected_intr(ap, 0); | ||
2787 | return; | ||
2788 | } | ||
2789 | /* | 2779 | /* |
2790 | * Grab a snapshot of the EDMA_EN flag setting, | 2780 | * Grab a snapshot of the EDMA_EN flag setting, |
2791 | * so that we have a consistent view for this port, | 2781 | * so that we have a consistent view for this port, |