From owner-svn-src-stable@FreeBSD.ORG Mon Mar 9 08:18:40 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB94B1065679; Mon, 9 Mar 2009 08:18:40 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE1DA8FC1E; Mon, 9 Mar 2009 08:18:40 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n298IeFx014686; Mon, 9 Mar 2009 08:18:40 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n298Ie9S014684; Mon, 9 Mar 2009 08:18:40 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903090818.n298Ie9S014684@svn.freebsd.org> From: Robert Noland Date: Mon, 9 Mar 2009 08:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189568 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2009 08:18:41 -0000 Author: rnoland Date: Mon Mar 9 08:18:40 2009 New Revision: 189568 URL: http://svn.freebsd.org/changeset/base/189568 Log: Merge r189285 Disable INTx when enabling MSI/MSIX This addresses interrupt storms that were noticed after enabling MSI in drm. I think this is due to a loose interpretation of the PCI 2.3 spec, which states that a function using MSI is prohibitted from using INTx. It appears that some vendors interpretted that to mean that they should handle it in hardware, while others felt it was the drivers responsibility. This fix will also likely resolve interrupt storm related issues with devices other than drm. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/pci/pci.c stable/7/sys/dev/pci/pcireg.h Modified: stable/7/sys/dev/pci/pci.c ============================================================================== --- stable/7/sys/dev/pci/pci.c Mon Mar 9 08:17:46 2009 (r189567) +++ stable/7/sys/dev/pci/pci.c Mon Mar 9 08:18:40 2009 (r189568) @@ -2845,6 +2845,8 @@ pci_setup_intr(device_t dev, device_t ch } mte->mte_handlers++; } + /* Disable INTx if we are using MSI/MSIX */ + pci_set_command_bit(dev, child, PCIM_CMD_INTxDIS); bad: if (error) { (void)bus_generic_teardown_intr(dev, child, irq, @@ -2899,6 +2901,8 @@ pci_teardown_intr(device_t dev, device_t if (mte->mte_handlers == 0) pci_mask_msix(child, rid - 1); } + /* Restore INTx capability for MSI/MSIX */ + pci_clear_command_bit(dev, child, PCIM_CMD_INTxDIS); } error = bus_generic_teardown_intr(dev, child, irq, cookie); if (device_get_parent(child) == dev && rid > 0) Modified: stable/7/sys/dev/pci/pcireg.h ============================================================================== --- stable/7/sys/dev/pci/pcireg.h Mon Mar 9 08:17:46 2009 (r189567) +++ stable/7/sys/dev/pci/pcireg.h Mon Mar 9 08:18:40 2009 (r189568) @@ -60,6 +60,7 @@ #define PCIM_CMD_PERRESPEN 0x0040 #define PCIM_CMD_SERRESPEN 0x0100 #define PCIM_CMD_BACKTOBACK 0x0200 +#define PCIM_CMD_INTxDIS 0x0400 #define PCIR_STATUS 0x06 #define PCIM_STATUS_CAPPRESENT 0x0010 #define PCIM_STATUS_66CAPABLE 0x0020