Commit f15a1daf authored by Tejun Heo's avatar Tejun Heo

[PATCH] libata: use ATA printk helpers

Use ATA printk helpers.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
parent 61440db6
......@@ -655,8 +655,7 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class)
fail_restart:
ahci_start_engine(ap);
fail:
printk(KERN_ERR "ata%u: softreset failed (%s)\n",
ap->id, reason);
ata_port_printk(ap, KERN_ERR, "softreset failed (%s)\n", reason);
return rc;
}
......@@ -798,9 +797,8 @@ static void ahci_restart_port(struct ata_port *ap, u32 irq_stat)
if ((ap->device[0].class != ATA_DEV_ATAPI) ||
((irq_stat & PORT_IRQ_TF_ERR) == 0))
printk(KERN_WARNING "ata%u: port reset, "
ata_port_printk(ap, KERN_WARNING, "port reset, "
"p_is %x is %x pis %x cmd %x tf %x ss %x se %x\n",
ap->id,
irq_stat,
readl(mmio + HOST_IRQ_STAT),
readl(port_mmio + PORT_IRQ_STAT),
......@@ -840,7 +838,7 @@ static void ahci_eng_timeout(struct ata_port *ap)
struct ata_queued_cmd *qc;
unsigned long flags;
printk(KERN_WARNING "ata%u: handling error/timeout\n", ap->id);
ata_port_printk(ap, KERN_WARNING, "handling error/timeout\n");
spin_lock_irqsave(&host_set->lock, flags);
......
......@@ -484,7 +484,7 @@ static int piix_pata_probe_reset(struct ata_port *ap, unsigned int *classes)
struct pci_dev *pdev = to_pci_dev(ap->host_set->dev);
if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->hard_port_no])) {
printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
ata_port_printk(ap, KERN_INFO, "port disabled. ignoring.\n");
return 0;
}
......@@ -565,7 +565,7 @@ static unsigned int piix_sata_probe (struct ata_port *ap)
static int piix_sata_probe_reset(struct ata_port *ap, unsigned int *classes)
{
if (!piix_sata_probe(ap)) {
printk(KERN_INFO "ata%u: SATA port has no device.\n", ap->id);
ata_port_printk(ap, KERN_INFO, "SATA port has no device.\n");
return 0;
}
......
This diff is collapsed.
......@@ -167,8 +167,9 @@ static void ata_qc_timeout(struct ata_queued_cmd *qc)
/* ack bmdma irq events */
ap->ops->irq_clear(ap);
printk(KERN_ERR "ata%u: command 0x%x timeout, stat 0x%x host_stat 0x%x\n",
ap->id, qc->tf.command, drv_stat, host_stat);
ata_dev_printk(qc->dev, KERN_ERR, "command 0x%x timeout, "
"stat 0x%x host_stat 0x%x\n",
qc->tf.command, drv_stat, host_stat);
/* complete taskfile transaction */
qc->err_mask |= ac_err_mask(drv_stat);
......
......@@ -1261,8 +1261,8 @@ static void ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd,
if (cmd->sc_data_direction == DMA_FROM_DEVICE ||
cmd->sc_data_direction == DMA_TO_DEVICE) {
if (unlikely(cmd->request_bufflen < 1)) {
printk(KERN_WARNING "ata%u(%u): WARNING: zero len r/w req\n",
dev->ap->id, dev->devno);
ata_dev_printk(dev, KERN_WARNING,
"WARNING: zero len r/w req\n");
goto err_did;
}
......@@ -2200,8 +2200,9 @@ ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev)
if (!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) {
if (unlikely(dev->class == ATA_DEV_ATAPI)) {
printk(KERN_WARNING "ata%u(%u): WARNING: ATAPI is %s, device ignored.\n",
ap->id, dev->devno, atapi_enabled ? "not supported with this driver" : "disabled");
ata_dev_printk(dev, KERN_WARNING,
"WARNING: ATAPI is %s, device ignored.\n",
atapi_enabled ? "not supported with this driver" : "disabled");
return NULL;
}
}
......
......@@ -680,7 +680,7 @@ static void mv_stop_dma(struct ata_port *ap)
}
if (EDMA_EN & reg) {
printk(KERN_ERR "ata%u: Unable to stop eDMA\n", ap->id);
ata_port_printk(ap, KERN_ERR, "Unable to stop eDMA\n");
/* FIXME: Consider doing a reset here to recover */
}
}
......@@ -1964,8 +1964,8 @@ comreset_retry:
ata_port_probe(ap);
} else {
sata_scr_read(ap, SCR_STATUS, &sstatus);
printk(KERN_INFO "ata%u: no device found (phy stat %08x)\n",
ap->id, sstatus);
ata_port_printk(ap, KERN_INFO,
"no device found (phy stat %08x)\n", sstatus);
ata_port_disable(ap);
return;
}
......@@ -2023,7 +2023,7 @@ static void mv_eng_timeout(struct ata_port *ap)
{
struct ata_queued_cmd *qc;
printk(KERN_ERR "ata%u: Entering mv_eng_timeout\n",ap->id);
ata_port_printk(ap, KERN_ERR, "Entering mv_eng_timeout\n");
DPRINTK("All regs @ start of eng_timeout\n");
mv_dump_all_regs(ap->host_set->mmio_base, ap->port_no,
to_pci_dev(ap->host_set->dev));
......
......@@ -435,7 +435,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
switch (qc->tf.protocol) {
case ATA_PROT_DMA:
case ATA_PROT_NODATA:
printk(KERN_ERR "ata%u: command timeout\n", ap->id);
ata_port_printk(ap, KERN_ERR, "command timeout\n");
drv_stat = ata_wait_idle(ap);
qc->err_mask |= __ac_err_mask(drv_stat);
break;
......@@ -443,8 +443,9 @@ static void pdc_eng_timeout(struct ata_port *ap)
default:
drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n",
ap->id, qc->tf.command, drv_stat);
ata_port_printk(ap, KERN_ERR,
"unknown timeout, cmd 0x%x stat 0x%x\n",
qc->tf.command, drv_stat);
qc->err_mask |= ac_err_mask(drv_stat);
break;
......
......@@ -360,16 +360,16 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev)
if (slow_down ||
((ap->flags & SIL_FLAG_MOD15WRITE) &&
(quirks & SIL_QUIRK_MOD15WRITE))) {
printk(KERN_INFO "ata%u(%u): applying Seagate errata fix (mod15write workaround)\n",
ap->id, dev->devno);
ata_dev_printk(dev, KERN_INFO, "applying Seagate errata fix "
"(mod15write workaround)\n");
dev->max_sectors = 15;
return;
}
/* limit to udma5 */
if (quirks & SIL_QUIRK_UDMA5MAX) {
printk(KERN_INFO "ata%u(%u): applying Maxtor errata fix %s\n",
ap->id, dev->devno, model_num);
ata_dev_printk(dev, KERN_INFO,
"applying Maxtor errata fix %s\n", model_num);
dev->udma_mask &= ATA_UDMA5;
return;
}
......
......@@ -516,7 +516,7 @@ static int sil24_softreset(struct ata_port *ap, unsigned int *class)
return 0;
err:
printk(KERN_ERR "ata%u: softreset failed (%s)\n", ap->id, reason);
ata_port_printk(ap, KERN_ERR, "softreset failed (%s)\n", reason);
return -EIO;
}
......@@ -561,7 +561,7 @@ static int sil24_hardreset(struct ata_port *ap, unsigned int *class)
return 0;
err:
printk(KERN_ERR "ata%u: hardreset failed (%s)\n", ap->id, reason);
ata_port_printk(ap, KERN_ERR, "hardreset failed (%s)\n", reason);
return -EIO;
}
......@@ -721,7 +721,7 @@ static void sil24_eng_timeout(struct ata_port *ap)
qc = ata_qc_from_tag(ap, ap->active_tag);
printk(KERN_ERR "ata%u: command timeout\n", ap->id);
ata_port_printk(ap, KERN_ERR, "command timeout\n");
qc->err_mask |= AC_ERR_TIMEOUT;
ata_eh_qc_complete(qc);
......
......@@ -868,15 +868,16 @@ static void pdc_eng_timeout(struct ata_port *ap)
switch (qc->tf.protocol) {
case ATA_PROT_DMA:
case ATA_PROT_NODATA:
printk(KERN_ERR "ata%u: command timeout\n", ap->id);
ata_port_printk(ap, KERN_ERR, "command timeout\n");
qc->err_mask |= __ac_err_mask(ata_wait_idle(ap));
break;
default:
drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n",
ap->id, qc->tf.command, drv_stat);
ata_port_printk(ap, KERN_ERR,
"unknown timeout, cmd 0x%x stat 0x%x\n",
qc->tf.command, drv_stat);
qc->err_mask |= ac_err_mask(drv_stat);
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment