diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-15 14:03:47 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-15 14:03:47 -0500 |
commit | 9f68a24853dd37d18f2cfa979cf4e131f5a10e8f (patch) | |
tree | 0e6c81b47ff6f4e2e3a5149873d9d3c176d9e292 /drivers/scsi | |
parent | c6e6e666cbfe40f0d7fb1a293ff6332973acac37 (diff) |
[libata ahci] command completion fixes, improved debug msgs
- Fix a regression in command completion, which prevented
the restart of the DMA engine after the device throws
an error.
- Pack more hardware info into the port-reset error message.
- Promote "welcome to our timeout" message from debug msg
to normal printk.
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ahci.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index c710a7def7a7..894e7113e0b3 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c | |||
@@ -565,6 +565,17 @@ static void ahci_intr_error(struct ata_port *ap, u32 irq_stat) | |||
565 | u32 tmp; | 565 | u32 tmp; |
566 | int work; | 566 | int work; |
567 | 567 | ||
568 | printk(KERN_WARNING "ata%u: port reset, " | ||
569 | "p_is %x is %x pis %x cmd %x tf %x ss %x se %x\n", | ||
570 | ap->id, | ||
571 | irq_stat, | ||
572 | readl(mmio + HOST_IRQ_STAT), | ||
573 | readl(port_mmio + PORT_IRQ_STAT), | ||
574 | readl(port_mmio + PORT_CMD), | ||
575 | readl(port_mmio + PORT_TFDATA), | ||
576 | readl(port_mmio + PORT_SCR_STAT), | ||
577 | readl(port_mmio + PORT_SCR_ERR)); | ||
578 | |||
568 | /* stop DMA */ | 579 | /* stop DMA */ |
569 | tmp = readl(port_mmio + PORT_CMD); | 580 | tmp = readl(port_mmio + PORT_CMD); |
570 | tmp &= ~PORT_CMD_START; | 581 | tmp &= ~PORT_CMD_START; |
@@ -602,13 +613,6 @@ static void ahci_intr_error(struct ata_port *ap, u32 irq_stat) | |||
602 | tmp |= PORT_CMD_START; | 613 | tmp |= PORT_CMD_START; |
603 | writel(tmp, port_mmio + PORT_CMD); | 614 | writel(tmp, port_mmio + PORT_CMD); |
604 | readl(port_mmio + PORT_CMD); /* flush */ | 615 | readl(port_mmio + PORT_CMD); /* flush */ |
605 | |||
606 | printk(KERN_WARNING "ata%u: error occurred, port reset (%s%s%s%s)\n", | ||
607 | ap->id, | ||
608 | irq_stat & PORT_IRQ_TF_ERR ? "taskf " : "", | ||
609 | irq_stat & PORT_IRQ_HBUS_ERR ? "hbus " : "", | ||
610 | irq_stat & PORT_IRQ_HBUS_DATA_ERR ? "hbus_data " : "", | ||
611 | irq_stat & PORT_IRQ_IF_ERR ? "if " : ""); | ||
612 | } | 616 | } |
613 | 617 | ||
614 | static void ahci_eng_timeout(struct ata_port *ap) | 618 | static void ahci_eng_timeout(struct ata_port *ap) |
@@ -619,7 +623,7 @@ static void ahci_eng_timeout(struct ata_port *ap) | |||
619 | struct ata_queued_cmd *qc; | 623 | struct ata_queued_cmd *qc; |
620 | unsigned long flags; | 624 | unsigned long flags; |
621 | 625 | ||
622 | DPRINTK("ENTER\n"); | 626 | printk(KERN_WARNING "ata%u: handling error/timeout\n", ap->id); |
623 | 627 | ||
624 | spin_lock_irqsave(&host_set->lock, flags); | 628 | spin_lock_irqsave(&host_set->lock, flags); |
625 | 629 | ||
@@ -672,8 +676,9 @@ static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc) | |||
672 | else | 676 | else |
673 | err_mask = AC_ERR_HOST_BUS; | 677 | err_mask = AC_ERR_HOST_BUS; |
674 | 678 | ||
675 | if (err_mask != AC_ERR_DEV) | 679 | /* command processing has stopped due to error; restart */ |
676 | ahci_intr_error(ap, status); | 680 | ahci_intr_error(ap, status); |
681 | |||
677 | if (qc) | 682 | if (qc) |
678 | ata_qc_complete(qc, err_mask); | 683 | ata_qc_complete(qc, err_mask); |
679 | } | 684 | } |