From patchwork Sun Mar 29 01:33:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 14934 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2T1ZLOo025198 for ; Sun, 29 Mar 2009 01:35:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752739AbZC2Bez (ORCPT ); Sat, 28 Mar 2009 21:34:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752435AbZC2Bez (ORCPT ); Sat, 28 Mar 2009 21:34:55 -0400 Received: from hera.kernel.org ([140.211.167.34]:43371 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751857AbZC2Bey (ORCPT ); Sat, 28 Mar 2009 21:34:54 -0400 Received: from [192.168.101.5] (adsl-75-61-233-214.dsl.pltn13.sbcglobal.net [75.61.233.214]) (authenticated bits=0) by hera.kernel.org (8.14.2/8.13.8) with ESMTP id n2T1XPWX016116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 29 Mar 2009 01:33:51 GMT Message-ID: <49CECFCF.8060403@kernel.org> Date: Sat, 28 Mar 2009 18:33:03 -0700 From: Yinghai Lu User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Prakash Punnoor , Jesse Barnes CC: Matthew Wilcox , Andrew Morton , Ingo Molnar , "Eric W. Biederman" , Robert Hancock , david@lang.hm, linux-kernel , linux-pci@vger.kernel.org Subject: Re: [PATCH] pci: don't enable too much HT MSI mapping -v5 -resend References: <200903281431.36572.prakash@punnoor.de> <86802c440903281352v1a12a5a2kbda5a039d72aa26f@mail.gmail.com> <200903282316.55142.prakash@punnoor.de> In-Reply-To: <200903282316.55142.prakash@punnoor.de> X-Virus-Scanned: ClamAV 0.93.3/9177/Sat Mar 28 10:23:56 2009 on hera.kernel.org X-Virus-Status: Clean Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org please try follwing patch over pci/linux-next Thanks YH [PATCH] pci: don't enable too much HT MSI mapping -v6 Impact: fix bug Prakash reported that his c51-mcp51 system ondie sound card doesn't work MSI but if he hack out the HT-MSI on mcp51, the MSI will work well with sound card. this patch rework the nv_msi_ht_cap_quirk() and will only try to avoid to enable ht_msi on device following that root dev, and don't touch that root dev v6: only do that trick with end_device on the chain. Reported-by: Prakash Punnoor Signed-off-by: Yinghai Lu --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index faf02dd..52714f2 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2206,6 +2206,33 @@ static int __devinit host_bridge_with_leaf(struct pci_dev *host_bridge) return found; } +#define PCI_HT_CAP_SLAVE_CTRL0 4 /* link control */ +#define PCI_HT_CAP_SLAVE_CTRL1 8 /* link control to */ + +static int __devinit is_end_of_ht_chain(struct pci_dev *dev) +{ + int pos, ctrl_off; + int end = 0; + u16 flags, ctrl; + + pos = pci_find_ht_capability(dev, HT_CAPTYPE_SLAVE); + + if (!pos) + goto out; + + pci_read_config_word(dev, pos + PCI_CAP_FLAGS, &flags); + + ctrl_off = ((flags >> 10) & 1) ? + PCI_HT_CAP_SLAVE_CTRL0 : PCI_HT_CAP_SLAVE_CTRL1; + pci_read_config_word(dev, pos + ctrl_off, &ctrl); + + if (ctrl & (1 << 6)) + end = 1; + +out: + return end; +} + static void __devinit nv_ht_enable_msi_mapping(struct pci_dev *dev) { struct pci_dev *host_bridge; @@ -2230,8 +2257,9 @@ static void __devinit nv_ht_enable_msi_mapping(struct pci_dev *dev) if (!found) return; - /* don't enable host_bridge with leaf directly here */ - if (host_bridge == dev && host_bridge_with_leaf(host_bridge)) + /* don't enable end_device/host_bridge with leaf directly here */ + if (host_bridge == dev && is_end_of_ht_chain(host_bridge) && + host_bridge_with_leaf(host_bridge)) goto out; /* root did that ! */