From owner-svn-src-head@FreeBSD.ORG Fri Oct 14 03:24:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 030B91065672; Fri, 14 Oct 2011 03:24:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E70318FC13; Fri, 14 Oct 2011 03:24:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9E3OZHr044527; Fri, 14 Oct 2011 03:24:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9E3OZUo044525; Fri, 14 Oct 2011 03:24:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201110140324.p9E3OZUo044525@svn.freebsd.org> From: Adrian Chadd Date: Fri, 14 Oct 2011 03:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226355 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 14 Oct 2011 03:24:36 -0000 Author: adrian Date: Fri Oct 14 03:24:35 2011 New Revision: 226355 URL: http://svn.freebsd.org/changeset/base/226355 Log: ath_pci PCI setup fixes. * Break out the PCI setup override code into a new function. * Re-apply the PCI overrides on powersave resume. The retry timeout register isn't currently being saved/resumed by the PCI driver/bus code. Modified: head/sys/dev/ath/if_ath_pci.c Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Fri Oct 14 00:34:45 2011 (r226354) +++ head/sys/dev/ath/if_ath_pci.c Fri Oct 14 03:24:35 2011 (r226355) @@ -74,6 +74,16 @@ struct ath_pci_softc { #define BS_BAR 0x10 #define PCIR_RETRY_TIMEOUT 0x41 +static void +ath_pci_setup(device_t dev) +{ + /* + * Disable retry timeout to keep PCI Tx retries from + * interfering with C3 CPU state. + */ + pci_write_config(dev, PCIR_RETRY_TIMEOUT, 0, 1); +} + static int ath_pci_probe(device_t dev) { @@ -103,10 +113,9 @@ ath_pci_attach(device_t dev) pci_enable_busmaster(dev); /* - * Disable retry timeout to keep PCI Tx retries from - * interfering with C3 CPU state. + * Setup other PCI bus configuration parameters. */ - pci_write_config(dev, PCIR_RETRY_TIMEOUT, 0, 1); + ath_pci_setup(dev); /* * Setup memory-mapping of PCI registers. @@ -228,6 +237,11 @@ ath_pci_resume(device_t dev) { struct ath_pci_softc *psc = device_get_softc(dev); + /* + * Suspend/resume resets the PCI configuration space. + */ + ath_pci_setup(dev); + ath_resume(&psc->sc_sc); return (0);