Tune AHCI verbose messages to make log more readable.
This commit is contained in:
parent
2322d4bae1
commit
f7385ac83d
@ -486,11 +486,13 @@ ata_ahci_issue_cmd(device_t dev, u_int16_t flags, int timeout)
|
||||
ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IS + offset,
|
||||
ATA_INL(ctlr->r_res2, ATA_AHCI_P_IS + offset));
|
||||
|
||||
if (bootverbose)
|
||||
device_printf(dev, "ahci_issue_cmd time=%dms cnt=%dms status=%08x\n",
|
||||
timeout, count, status);
|
||||
if (timeout && (count >= timeout))
|
||||
if (timeout && (count >= timeout)) {
|
||||
if (bootverbose) {
|
||||
device_printf(dev, "ahci_issue_cmd timeout: %d of %dms, status=%08x\n",
|
||||
count, timeout, status);
|
||||
}
|
||||
return EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -635,7 +637,7 @@ ata_ahci_wait_ready(device_t dev, int t)
|
||||
(ATA_S_BUSY | ATA_S_DRQ)) {
|
||||
DELAY(1000);
|
||||
if (timeout++ > t) {
|
||||
device_printf(dev, "port is not ready\n");
|
||||
device_printf(dev, "port is not ready (timeout %dms)\n", t);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -653,6 +655,9 @@ ata_ahci_softreset(device_t dev, int port)
|
||||
struct ata_ahci_cmd_tab *ctp =
|
||||
(struct ata_ahci_cmd_tab *)(ch->dma.work + ATA_AHCI_CT_OFFSET);
|
||||
|
||||
if (bootverbose)
|
||||
device_printf(dev, "software reset port %d...\n", port);
|
||||
|
||||
/* kick controller into sane state */
|
||||
ata_ahci_stop(dev);
|
||||
ata_ahci_clo(dev);
|
||||
@ -665,9 +670,10 @@ ata_ahci_softreset(device_t dev, int port)
|
||||
//ctp->cfis[7] = ATA_D_LBA | ATA_D_IBM;
|
||||
ctp->cfis[15] = (ATA_A_4BIT | ATA_A_RESET);
|
||||
|
||||
if (ata_ahci_issue_cmd(dev, ATA_AHCI_CMD_RESET | ATA_AHCI_CMD_CLR_BUSY,100))
|
||||
device_printf(dev, "setting SRST failed ??\n");
|
||||
//return -1;
|
||||
if (ata_ahci_issue_cmd(dev, ATA_AHCI_CMD_RESET | ATA_AHCI_CMD_CLR_BUSY,100)) {
|
||||
device_printf(dev, "software reset set timeout\n");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
ata_udelay(50);
|
||||
|
||||
@ -680,8 +686,10 @@ ata_ahci_softreset(device_t dev, int port)
|
||||
if (ata_ahci_issue_cmd(dev, 0, 0))
|
||||
return -1;
|
||||
|
||||
if (ata_ahci_wait_ready(dev, 1000))
|
||||
if (ata_ahci_wait_ready(dev, 1000)) {
|
||||
device_printf(dev, "software reset clear timeout\n");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset);
|
||||
}
|
||||
@ -695,6 +703,9 @@ ata_ahci_reset(device_t dev)
|
||||
u_int32_t signature;
|
||||
int offset = ch->unit << 7;
|
||||
|
||||
if (bootverbose)
|
||||
device_printf(dev, "AHCI reset...\n");
|
||||
|
||||
/* Disable port interrupts */
|
||||
ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0);
|
||||
|
||||
@ -718,7 +729,7 @@ ata_ahci_reset(device_t dev)
|
||||
|
||||
if (!ata_sata_phy_reset(dev)) {
|
||||
if (bootverbose)
|
||||
device_printf(dev, "phy reset found no device\n");
|
||||
device_printf(dev, "AHCI reset done: phy reset found no device\n");
|
||||
ch->devices = 0;
|
||||
|
||||
/* enable wanted port interrupts */
|
||||
@ -767,11 +778,11 @@ ata_ahci_reset(device_t dev)
|
||||
break;
|
||||
default: /* SOS XXX */
|
||||
if (bootverbose)
|
||||
device_printf(dev, "No signature, asuming disk device\n");
|
||||
device_printf(dev, "Unknown signature, asuming disk device\n");
|
||||
ch->devices = ATA_ATA_MASTER;
|
||||
}
|
||||
if (bootverbose)
|
||||
device_printf(dev, "ahci_reset devices=%08x\n", ch->devices);
|
||||
device_printf(dev, "AHCI reset done: devices=%08x\n", ch->devices);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user