提交 c2cd76ff 编写于 作者: J Jeff Garzik

[libata ahci] tone down ATAPI errors

ATA devices don't generate many errors, so the preferred method is to
printk() when they occur.

ATAPI devices generate tons of exceptions during the normal course
of operation, so this change skips logging the most common class of
errors.
上级 75b1f2f8
...@@ -558,13 +558,15 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc) ...@@ -558,13 +558,15 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
pp->cmd_slot[0].opts |= cpu_to_le32(n_elem << 16); pp->cmd_slot[0].opts |= cpu_to_le32(n_elem << 16);
} }
static void ahci_intr_error(struct ata_port *ap, u32 irq_stat) static void ahci_restart_port(struct ata_port *ap, u32 irq_stat)
{ {
void __iomem *mmio = ap->host_set->mmio_base; void __iomem *mmio = ap->host_set->mmio_base;
void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no); void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
u32 tmp; u32 tmp;
int work; int work;
if ((ap->device[0].class != ATA_DEV_ATAPI) ||
((irq_stat & PORT_IRQ_TF_ERR) == 0))
printk(KERN_WARNING "ata%u: port reset, " printk(KERN_WARNING "ata%u: port reset, "
"p_is %x is %x pis %x cmd %x tf %x ss %x se %x\n", "p_is %x is %x pis %x cmd %x tf %x ss %x se %x\n",
ap->id, ap->id,
...@@ -632,7 +634,7 @@ static void ahci_eng_timeout(struct ata_port *ap) ...@@ -632,7 +634,7 @@ static void ahci_eng_timeout(struct ata_port *ap)
printk(KERN_ERR "ata%u: BUG: timeout without command\n", printk(KERN_ERR "ata%u: BUG: timeout without command\n",
ap->id); ap->id);
} else { } else {
ahci_intr_error(ap, readl(port_mmio + PORT_IRQ_STAT)); ahci_restart_port(ap, readl(port_mmio + PORT_IRQ_STAT));
/* hack alert! We cannot use the supplied completion /* hack alert! We cannot use the supplied completion
* function from inside the ->eh_strategy_handler() thread. * function from inside the ->eh_strategy_handler() thread.
...@@ -677,7 +679,7 @@ static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc) ...@@ -677,7 +679,7 @@ static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc)
err_mask = AC_ERR_HOST_BUS; err_mask = AC_ERR_HOST_BUS;
/* command processing has stopped due to error; restart */ /* command processing has stopped due to error; restart */
ahci_intr_error(ap, status); ahci_restart_port(ap, status);
if (qc) if (qc)
ata_qc_complete(qc, err_mask); ata_qc_complete(qc, err_mask);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册