All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Populate subsystem vendor and device IDs for PCI-Bridges
@ 2009-10-06 15:45 Gabe Black
  2009-10-14  1:45 ` Andrew Morton
  2009-11-04 17:42 ` Jesse Barnes
  0 siblings, 2 replies; 3+ messages in thread
From: Gabe Black @ 2009-10-06 15:45 UTC (permalink / raw)
  To: jbarnes; +Cc: shawn.bohrer, mike.hoogendyk, linux-pci, linux-kernel, Gabe Black

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 <gabe.black@ni.com>
---
 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 */
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Populate subsystem vendor and device IDs for PCI-Bridges
  2009-10-06 15:45 [PATCH] Populate subsystem vendor and device IDs for PCI-Bridges Gabe Black
@ 2009-10-14  1:45 ` Andrew Morton
  2009-11-04 17:42 ` Jesse Barnes
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2009-10-14  1:45 UTC (permalink / raw)
  To: Gabe Black; +Cc: jbarnes, shawn.bohrer, mike.hoogendyk, linux-pci, linux-kernel

On Tue, 6 Oct 2009 10:45:19 -0500 Gabe Black <gabe.black@ni.com> 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 <gabe.black@ni.com>
> ---
>  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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Populate subsystem vendor and device IDs for PCI-Bridges
  2009-10-06 15:45 [PATCH] Populate subsystem vendor and device IDs for PCI-Bridges Gabe Black
  2009-10-14  1:45 ` Andrew Morton
@ 2009-11-04 17:42 ` Jesse Barnes
  1 sibling, 0 replies; 3+ messages in thread
From: Jesse Barnes @ 2009-11-04 17:42 UTC (permalink / raw)
  To: Gabe Black
  Cc: shawn.bohrer, mike.hoogendyk, linux-pci, linux-kernel, Gabe Black

On Tue, 6 Oct 2009 10:45:19 -0500
Gabe Black <gabe.black@ni.com> 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 <gabe.black@ni.com>

Applied to my linux-next branch, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-04 17:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-06 15:45 [PATCH] Populate subsystem vendor and device IDs for PCI-Bridges Gabe Black
2009-10-14  1:45 ` Andrew Morton
2009-11-04 17:42 ` Jesse Barnes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.