Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755634AbZJNBqI (ORCPT ); Tue, 13 Oct 2009 21:46:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753599AbZJNBqH (ORCPT ); Tue, 13 Oct 2009 21:46:07 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:51174 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753118AbZJNBqG (ORCPT ); Tue, 13 Oct 2009 21:46:06 -0400 Date: Tue, 13 Oct 2009 18:45:11 -0700 From: Andrew Morton To: Gabe Black Cc: jbarnes@virtuousgeek.org, shawn.bohrer@ni.com, mike.hoogendyk@ni.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Populate subsystem vendor and device IDs for PCI-Bridges Message-Id: <20091013184511.c9b67d06.akpm@linux-foundation.org> In-Reply-To: <1254843919-13809-1-git-send-email-gabe.black@ni.com> References: <1254843919-13809-1-git-send-email-gabe.black@ni.com> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2300 Lines: 59 On Tue, 6 Oct 2009 10:45:19 -0500 Gabe Black wrote: > Change to populate the subsystem vendor and subsytem device IDs for > PCI-PCI bridges that implement the PCI Subsystem Vendor ID capability. > Previously bridges left subsystem vendor IDs unpopulated. > > Signed-off-by: Gabe Black > --- > drivers/pci/probe.c | 6 ++++++ > include/linux/pci_regs.h | 5 +++++ > 2 files changed, 11 insertions(+), 0 deletions(-) > > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > index 8105e32..6d90246 100644 > --- a/drivers/pci/probe.c > +++ b/drivers/pci/probe.c > @@ -731,6 +731,7 @@ int pci_setup_device(struct pci_dev *dev) > u32 class; > u8 hdr_type; > struct pci_slot *slot; > + int pos = 0; > > if (pci_read_config_byte(dev, PCI_HEADER_TYPE, &hdr_type)) > return -EIO; > @@ -822,6 +823,11 @@ int pci_setup_device(struct pci_dev *dev) > dev->transparent = ((dev->class & 0xff) == 1); > pci_read_bases(dev, 2, PCI_ROM_ADDRESS1); > set_pcie_hotplug_bridge(dev); > + pos = pci_find_capability(dev, PCI_CAP_ID_SSVID); > + if (pos) { > + pci_read_config_word(dev, pos + PCI_SSVID_VENDOR_ID, &dev->subsystem_vendor); > + pci_read_config_word(dev, pos + PCI_SSVID_DEVICE_ID, &dev->subsystem_device); > + } > break; > > case PCI_HEADER_TYPE_CARDBUS: /* CardBus bridge header */ > diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h > index dd0bed4..d3b0cfb 100644 > --- a/include/linux/pci_regs.h > +++ b/include/linux/pci_regs.h > @@ -365,6 +365,11 @@ > #define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ > #define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ > > +/* PCI Bridge Subsystem ID registers */ > + > +#define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */ > +#define PCI_SSVID_DEVICE_ID 6 /* PCI-Bridge subsystem device id register */ > + > /* PCI Express capability registers */ > > #define PCI_EXP_FLAGS 2 /* Capabilities register */ What is the reason for making this change? -- 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/