Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754566AbYJBQD6 (ORCPT ); Thu, 2 Oct 2008 12:03:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753541AbYJBQDs (ORCPT ); Thu, 2 Oct 2008 12:03:48 -0400 Received: from outbound-mail-117.bluehost.com ([69.89.22.17]:57854 "HELO outbound-mail-117.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752558AbYJBQDs (ORCPT ); Thu, 2 Oct 2008 12:03:48 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=virtuousgeek.org; h=Received:From:To:Subject:Date:User-Agent:Cc:References:In-Reply-To:MIME-Version:Content-Disposition:Content-Type:Content-Transfer-Encoding:Message-Id:X-Identified-User; b=lZO3xJVs3k9m52rkWxaZ/D1EHPjfawJEKD3GbHAMSMrDIaoHaHsOw2BbrdO1FI9T8RDHMsLWX1Mz3RyIUQT7stRR3M7dAJoC9fdQ240/pLLzLl7e+9rtFEsr/ipAIUj+; From: Jesse Barnes To: "Zhao, Yu" Subject: Re: [PATCH 3/6 v3] PCI: support ARI capability Date: Thu, 2 Oct 2008 09:03:15 -0700 User-Agent: KMail/1.9.10 Cc: "linux-pci@vger.kernel.org" , Randy Dunlap , Grant Grundler , Alex Chiang , Matthew Wilcox , Roland Dreier , Greg KH , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810020903.16385.jbarnes@virtuousgeek.org> X-Identified-User: {642:box128.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 75.111.27.49 authed with jbarnes@virtuousgeek.org} Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2286 Lines: 69 On Saturday, September 27, 2008 1:28 am Zhao, Yu wrote: > Add Alternative Routing-ID Interpretation (ARI) support. > > Cc: Jesse Barnes > Cc: Randy Dunlap > Cc: Grant Grundler > Cc: Alex Chiang > Cc: Matthew Wilcox > Cc: Roland Dreier > Cc: Greg KH > Signed-off-by: Yu Zhao > > --- > drivers/pci/pci.c | 31 +++++++++++++++++++++++++++++++ > drivers/pci/pci.h | 12 ++++++++++++ > drivers/pci/probe.c | 3 +++ > include/linux/pci.h | 1 + > include/linux/pci_regs.h | 14 ++++++++++++++ > 5 files changed, 61 insertions(+), 0 deletions(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index 400d3b3..fe9efc4 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -1260,6 +1260,37 @@ void pci_pm_init(struct pci_dev *dev) > } > } > > +/** > + * pci_ari_init - turn on ARI forwarding if it's supported > + * @dev: the PCI device > + */ > +void pci_ari_init(struct pci_dev *dev) > +{ > + int pos; > + u32 cap; > + u16 ctrl; > + > + if (!dev->is_pcie || (dev->pcie_type != PCI_EXP_TYPE_ROOT_PORT && > + dev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM)) > + return; > + > + pos = pci_find_capability(dev, PCI_CAP_ID_EXP); > + if (!pos) > + return; > + > + pci_read_config_dword(dev, pos + PCI_EXP_DEVCAP2, &cap); > + > + if (!(cap & PCI_EXP_DEVCAP2_ARI)) > + return; > + > + pci_read_config_word(dev, pos + PCI_EXP_DEVCTL2, &ctrl); > + ctrl |= PCI_EXP_DEVCTL2_ARI; > + pci_write_config_word(dev, pos + PCI_EXP_DEVCTL2, ctrl); > + > + dev->ari_enabled = 1; > + dev_info(&dev->dev, "ARI forwarding enabled.\n"); > +} > + Maybe we should be consistent with the other APIs and call it pci_enable_ari (like we do for wake & msi). Looks pretty good otherwise. Jesse -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/