From owner-p4-projects@FreeBSD.ORG Wed Jan 20 20:21:12 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D4A6F1065676; Wed, 20 Jan 2010 20:21:12 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99333106566B for ; Wed, 20 Jan 2010 20:21:12 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6E0258FC12 for ; Wed, 20 Jan 2010 20:21:12 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o0KKLCPS008057 for ; Wed, 20 Jan 2010 20:21:12 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o0KKLCjh008055 for perforce@freebsd.org; Wed, 20 Jan 2010 20:21:12 GMT (envelope-from mav@freebsd.org) Date: Wed, 20 Jan 2010 20:21:12 GMT Message-Id: <201001202021.o0KKLCjh008055@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 173430 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2010 20:21:13 -0000 http://p4web.freebsd.org/chv.cgi?CH=173430 Change 173430 by mav@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;