PERFORCE change 173430 for review
Alexander Motin
mav at FreeBSD.org
Wed Jan 20 20:21:13 UTC 2010
http://p4web.freebsd.org/chv.cgi?CH=173430
Change 173430 by mav at mav_mavtest on 2010/01/20 20:20:12
- Increase device ready timeout.
- Print more info on soft-reset timeout.
- Remove some useless messages.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#96 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#96 (text+ko) ====
@@ -85,7 +85,7 @@
static void ahci_stop_fr(device_t dev);
static int ahci_sata_connect(struct ahci_channel *ch);
-static int ahci_sata_phy_reset(device_t dev, int quick);
+static int ahci_sata_phy_reset(device_t dev);
static void ahci_issue_read_log(device_t dev);
static void ahci_process_read_log(device_t dev, union ccb *ccb);
@@ -1508,6 +1508,13 @@
if (timeout && (count >= timeout)) {
device_printf(ch->dev,
"Poll timeout on slot %d\n", slot->slot);
+ device_printf(dev, "is %08x cs %08x ss %08x "
+ "rs %08x tfd %02x serr %08x\n",
+ ATA_INL(ch->r_mem, AHCI_P_IS),
+ ATA_INL(ch->r_mem, AHCI_P_CI),
+ ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots,
+ ATA_INL(ch->r_mem, AHCI_P_TFD),
+ ATA_INL(ch->r_mem, AHCI_P_SERR));
et = AHCI_ERR_TIMEOUT;
}
if (et != AHCI_ERR_NONE) {
@@ -1932,7 +1939,7 @@
(ATA_S_BUSY | ATA_S_DRQ)) {
DELAY(1000);
if (timeout++ > t) {
- device_printf(dev, "port is not ready (timeout %dms) "
+ device_printf(dev, "device is not ready (timeout %dms) "
"tfd = %08x\n", t, val);
return (EBUSY);
}
@@ -1984,7 +1991,7 @@
/* Disable port interrupts */
ATA_OUTL(ch->r_mem, AHCI_P_IE, 0);
/* Reset and reconnect PHY, */
- if (!ahci_sata_phy_reset(dev, 0)) {
+ if (!ahci_sata_phy_reset(dev)) {
if (bootverbose)
device_printf(dev,
"AHCI reset done: phy reset found no device\n");
@@ -1996,10 +2003,8 @@
return;
}
/* Wait for clearing busy status. */
- if (ahci_wait_ready(dev, 10000)) {
- device_printf(dev, "device ready timeout\n");
+ if (ahci_wait_ready(dev, 15000))
ahci_clo(dev);
- }
ahci_start(dev);
ch->devices = 1;
/* Enable wanted port interrupts */
@@ -2104,20 +2109,12 @@
}
static int
-ahci_sata_phy_reset(device_t dev, int quick)
+ahci_sata_phy_reset(device_t dev)
{
struct ahci_channel *ch = device_get_softc(dev);
int sata_rev;
uint32_t val;
- if (quick) {
- val = ATA_INL(ch->r_mem, AHCI_P_SCTL);
- if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE)
- return (ahci_sata_connect(ch));
- }
-
- if (bootverbose)
- device_printf(dev, "hardware reset ...\n");
sata_rev = ch->user[ch->pm_present ? 15 : 0].revision;
if (sata_rev == 1)
val = ATA_SC_SPD_SPEED_GEN1;
More information about the p4-projects
mailing list