Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188200
b: refs/heads/master
c: 5db5b02
h: refs/heads/master
v: v3
  • Loading branch information
Shane Huang authored and Jeff Garzik committed Mar 17, 2010
1 parent 85d5683 commit c9e61e5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9deb343189b3cf45e84dd08480f330575ffe2004
refs/heads/master: 5db5b0215af94a36d4bf10900ff9707b6d5c1610
23 changes: 17 additions & 6 deletions trunk/drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,7 @@ static void ahci_port_intr(struct ata_port *ap)
struct ahci_port_priv *pp = ap->private_data;
struct ahci_host_priv *hpriv = ap->host->private_data;
int resetting = !!(ap->pflags & ATA_PFLAG_RESETTING);
u32 status, qc_active;
u32 status, qc_active = 0;
int rc;

status = readl(port_mmio + PORT_IRQ_STAT);
Expand Down Expand Up @@ -2336,11 +2336,22 @@ static void ahci_port_intr(struct ata_port *ap)
}
}

/* pp->active_link is valid iff any command is in flight */
if (ap->qc_active && pp->active_link->sactive)
qc_active = readl(port_mmio + PORT_SCR_ACT);
else
qc_active = readl(port_mmio + PORT_CMD_ISSUE);
/* pp->active_link is not reliable once FBS is enabled, both
* PORT_SCR_ACT and PORT_CMD_ISSUE should be checked because
* NCQ and non-NCQ commands may be in flight at the same time.
*/
if (pp->fbs_enabled) {
if (ap->qc_active) {
qc_active = readl(port_mmio + PORT_SCR_ACT);
qc_active |= readl(port_mmio + PORT_CMD_ISSUE);
}
} else {
/* pp->active_link is valid iff any command is in flight */
if (ap->qc_active && pp->active_link->sactive)
qc_active = readl(port_mmio + PORT_SCR_ACT);
else
qc_active = readl(port_mmio + PORT_CMD_ISSUE);
}

rc = ata_qc_complete_multiple(ap, qc_active);

Expand Down

0 comments on commit c9e61e5

Please sign in to comment.