From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 04:56:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA9FF4CE; Thu, 9 Apr 2015 04:56:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C693A18C; Thu, 9 Apr 2015 04:56:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t394uPSL062319; Thu, 9 Apr 2015 04:56:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t394uPIC062318; Thu, 9 Apr 2015 04:56:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201504090456.t394uPIC062318@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 9 Apr 2015 04:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281288 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2015 04:56:26 -0000 Author: adrian Date: Thu Apr 9 04:56:24 2015 New Revision: 281288 URL: https://svnweb.freebsd.org/changeset/base/281288 Log: Do not access peripheral before clock stabilization. Tested: * Intel 3945ABG NIC, STA mode PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Thu Apr 9 04:51:39 2015 (r281287) +++ head/sys/dev/wpi/if_wpi.c Thu Apr 9 04:56:24 2015 (r281288) @@ -4905,10 +4905,6 @@ wpi_apm_init(struct wpi_softc *sc) /* Set FH wait threshold to max (HW bug under stress workaround). */ WPI_SETBITS(sc, WPI_DBG_HPET_MEM, 0xffff0000); - /* Cleanup. */ - wpi_prph_write(sc, WPI_APMG_CLK_DIS, 0x00000400); - wpi_prph_clrbits(sc, WPI_APMG_PS, 0x00000E00); - /* Retrieve PCIe Active State Power Management (ASPM). */ reg = pci_read_config(sc->sc_dev, sc->sc_cap_off + 0x10, 1); /* Workaround for HW instability in PCIe L0->L0s->L1 transition. */ @@ -4925,6 +4921,10 @@ wpi_apm_init(struct wpi_softc *sc) if ((error = wpi_nic_lock(sc)) != 0) return error; + /* Cleanup. */ + wpi_prph_write(sc, WPI_APMG_CLK_DIS, 0x00000400); + wpi_prph_clrbits(sc, WPI_APMG_PS, 0x00000200); + /* Enable DMA and BSM (Bootstrap State Machine). */ wpi_prph_write(sc, WPI_APMG_CLK_EN, WPI_APMG_CLK_CTRL_DMA_CLK_RQT | WPI_APMG_CLK_CTRL_BSM_CLK_RQT);