From owner-p4-projects@FreeBSD.ORG Sat Aug 22 17:35:32 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A0BA41065691; Sat, 22 Aug 2009 17:35:32 +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 63491106568F for ; Sat, 22 Aug 2009 17:35:32 +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 52AB98FC08 for ; Sat, 22 Aug 2009 17:35:32 +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 n7MHZWVE015045 for ; Sat, 22 Aug 2009 17:35:32 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n7MHZW1F015043 for perforce@freebsd.org; Sat, 22 Aug 2009 17:35:32 GMT (envelope-from mav@freebsd.org) Date: Sat, 22 Aug 2009 17:35:32 GMT Message-Id: <200908221735.n7MHZW1F015043@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 Cc: Subject: PERFORCE change 167617 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2009 17:35:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=167617 Change 167617 by mav@mav_mavbook on 2009/08/22 17:34:58 Reduce reset time. Improve logging. Affected files ... .. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#49 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#49 (text+ko) ==== @@ -1599,7 +1599,7 @@ AHCI_P_IX_DP | AHCI_P_IX_UF | AHCI_P_IX_SDB | AHCI_P_IX_DS | AHCI_P_IX_PS | AHCI_P_IX_DHR)); if (bootverbose) - device_printf(dev, "AHCI reset done: devices=%08x\n", ch->devices); + device_printf(dev, "AHCI reset done: device found\n"); /* Tell the XPT about the event */ xpt_async(AC_BUS_RESET, ch->path, NULL); } @@ -1666,6 +1666,13 @@ ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) && ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) break; + if ((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_OFFLINE) { + if (bootverbose) { + device_printf(ch->dev, "SATA offline status=%08x\n", + status); + } + return (0); + } DELAY(1000); } if (timeout >= 100) { @@ -1709,11 +1716,11 @@ ATA_OUTL(ch->r_mem, AHCI_P_SCTL, ATA_SC_DET_RESET | val | ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER); - DELAY(50000); + DELAY(5000); ATA_OUTL(ch->r_mem, AHCI_P_SCTL, ATA_SC_DET_IDLE | val | ((ch->pm_level > 0) ? 0 : (ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER))); - DELAY(50000); + DELAY(5000); return (ahci_sata_connect(ch)); }