From owner-svn-src-all@freebsd.org Thu Mar 1 03:05:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89BF2F3C565; Thu, 1 Mar 2018 03:05:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CC2D751C5; Thu, 1 Mar 2018 03:05:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3792D22998; Thu, 1 Mar 2018 03:05:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21351F1050289; Thu, 1 Mar 2018 03:05:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21351rQ050288; Thu, 1 Mar 2018 03:05:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010305.w21351rQ050288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 03:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330140 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 03:05:01 -0000 Author: eadler Date: Thu Mar 1 03:05:00 2018 New Revision: 330140 URL: https://svnweb.freebsd.org/changeset/base/330140 Log: MFC r314073: [iwm] Remove OpenBSD-specific comment. Beautify pci cfg space accesses. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 02:31:28 2018 (r330139) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 03:05:00 2018 (r330140) @@ -3091,11 +3091,6 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, if (--ring->queued < IWM_TX_RING_LOMARK) { sc->qfullmsk &= ~(1 << ring->qid); if (sc->qfullmsk == 0) { - /* - * Well, we're in interrupt context, but then again - * I guess net80211 does all sorts of stunts in - * interrupt context, so maybe this is no biggie. - */ iwm_start(sc); } } @@ -5598,6 +5593,9 @@ iwm_dev_check(device_t dev) } } +/* PCI registers */ +#define PCI_CFG_RETRY_TIMEOUT 0x041 + static int iwm_pci_attach(device_t dev) { @@ -5607,9 +5605,9 @@ iwm_pci_attach(device_t dev) sc = device_get_softc(dev); - /* Clear device-specific "PCI retry timeout" register (41h). */ - reg = pci_read_config(dev, 0x40, sizeof(reg)); - pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); + /* We disable the RETRY_TIMEOUT register (0x41) to keep + * PCI Tx retries from interfering with C3 CPU state */ + pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); /* Enable bus-mastering and hardware bug workaround. */ pci_enable_busmaster(dev); @@ -6071,11 +6069,12 @@ iwm_resume(device_t dev) { struct iwm_softc *sc = device_get_softc(dev); int do_reinit = 0; - uint16_t reg; - /* Clear device-specific "PCI retry timeout" register (41h). */ - reg = pci_read_config(dev, 0x40, sizeof(reg)); - pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); + /* + * We disable the RETRY_TIMEOUT register (0x41) to keep + * PCI Tx retries from interfering with C3 CPU state. + */ + pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); iwm_init_task(device_get_softc(dev)); IWM_LOCK(sc);