From patchwork Mon Mar 22 08:52:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clemens Ladisch X-Patchwork-Id: 87382 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2M8qOe7024332 for ; Mon, 22 Mar 2010 08:52:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751578Ab0CVIwX (ORCPT ); Mon, 22 Mar 2010 04:52:23 -0400 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:55245 "EHLO out2.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507Ab0CVIwW (ORCPT ); Mon, 22 Mar 2010 04:52:22 -0400 Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id AD335E8F14; Mon, 22 Mar 2010 04:52:21 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 22 Mar 2010 04:52:21 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:content-type:content-transfer-encoding; s=smtpout; bh=6vzLrbVb/0yb3oGXUCsXx1Vgg8A=; b=No38+Vl86VBeVVdLD+eyCDC50cYkEU1de2mmHslvFcTPFUx/qrUaEXeT4Ke0tiQEWiu666YCar0T2TYQOUqZN9Vrx4+YOVND0TXroqTXvj5QnSIT/Mj+N4LzdHqztKafmkInzXYeZDp41/CVBrmstTIkQfMJxu8JQhMwJfGHEwo= X-Sasl-enc: He39VkulevC6/nOrTZRU2px9hFmtnWhZOF+bAiBJyy/5 1269247941 Received: from [10.1.2.38] (srv004.schk01.int.dmc-one.com [85.232.8.141]) by mail.messagingengine.com (Postfix) with ESMTPSA id 9870A4B5974; Mon, 22 Mar 2010 04:52:20 -0400 (EDT) Message-ID: <4BA72FC0.6060002@ladisch.de> Date: Mon, 22 Mar 2010 09:52:16 +0100 From: Clemens Ladisch User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Jesse Barnes , Alex Deucher CC: linux-pci@vger.kernel.org, dri-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] PCI quirks: RS780/RS880: work around missing MSI initialization Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 22 Mar 2010 08:52:24 +0000 (UTC) --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2479,6 +2479,39 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AT DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375, quirk_msi_intx_disable_bug); +/* + * MSI does not work with the AMD RS780/RS880 internal graphics and HDMI audio + * devices unless the BIOS has initialized the nb_cntl.strap_msi_enable bit. + */ +static void __init rs780_int_gfx_disable_msi(struct pci_dev *int_gfx_bridge) +{ + u32 nb_cntl; + + if (!int_gfx_bridge->subordinate) + return; + + pci_bus_write_config_dword(int_gfx_bridge->bus, PCI_DEVFN(0, 0), + 0x60, 0); + pci_bus_read_config_dword(int_gfx_bridge->bus, PCI_DEVFN(0, 0), + 0x64, &nb_cntl); + + if (!(nb_cntl & BIT(10))) { + dev_warn(&int_gfx_bridge->dev, + FW_WARN "RS780: MSI for internal graphics disabled\n"); + int_gfx_bridge->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI; + } +} + +#define PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX 0x9602 + +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX, + rs780_int_gfx_disable_msi); +/* wrong vendor ID on M4A785TD motherboard: */ +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK, + PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX, + rs780_int_gfx_disable_msi); + #endif /* CONFIG_PCI_MSI */ #ifdef CONFIG_PCI_IOV --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c @@ -116,13 +116,7 @@ int radeon_irq_kms_init(struct radeon_de } /* enable msi */ rdev->msi_enabled = 0; - /* MSIs don't seem to work on my rs780; - * not sure about rs880 or other rs780s. - * Needs more investigation. - */ - if ((rdev->family >= CHIP_RV380) && - (rdev->family != CHIP_RS780) && - (rdev->family != CHIP_RS880)) { + if (rdev->family >= CHIP_RV380) { int ret = pci_enable_msi(rdev->pdev); if (!ret) { rdev->msi_enabled = 1;