Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Apr 2015 04:56:25 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r281288 - head/sys/dev/wpi
Message-ID:  <201504090456.t394uPIC062318@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <s3erios@gmail.com>

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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504090456.t394uPIC062318>