public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BK PATCH] More PCI fixes for 2.6.7
@ 2004-07-02 21:38 Greg KH
  2004-07-02 21:39 ` [PATCH] " Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-07-02 21:38 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel

Hi,

Here are some more small PCI patches for 2.6.7.  They have some more pci
id fixes, pci express #defines for drivers to use, and some more ppc64
pci hotplug driver bugfixes.

Please pull from:
	bk://kernel.bkbits.net/gregkh/linux/pci-2.6

thanks,

greg k-h

p.s. I'll send these as patches in response to this email to lkml for
those who want to see them.


 drivers/pci/hotplug/rpaphp.h     |    4 +--
 drivers/pci/hotplug/rpaphp_pci.c |   15 ++++++++++---
 drivers/pci/pci.ids              |    1 
 drivers/pci/probe.c              |    5 ++--
 include/linux/pci.h              |   45 +++++++++++++++++++++++++++++++++++++++
 include/linux/pci_ids.h          |    3 ++
 6 files changed, 66 insertions(+), 7 deletions(-)
-----

<buytenh:wantstofly.org>:
  o PCI: New PCI vendor/device ID for Radisys ENP-2611 board

Linas Vepstas:
  o PCI Hotplug: RPAPHP structure size/performance
  o PCI Hotplug: rpaphp null pointer deref

Linda Xie:
  o PCI: export pci_scan_child_bus for the pci hotplug drivers to use

Roland Dreier:
  o PCI: Add some PCI Express constants to pci.h


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

* [PATCH] More PCI fixes for 2.6.7
  2004-07-02 21:38 [BK PATCH] More PCI fixes for 2.6.7 Greg KH
@ 2004-07-02 21:39 ` Greg KH
  2004-07-02 21:39   ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-07-02 21:39 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1785, 2004/07/02 13:26:39-07:00, lxiep@us.ibm.com

[PATCH] PCI: export pci_scan_child_bus for the pci hotplug drivers to use

Signed-off-by: Linda Xie lxie@us.ibm.com
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/probe.c |    5 +++--
 include/linux/pci.h |    1 +
 2 files changed, 4 insertions(+), 2 deletions(-)


diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c	2004-07-02 14:25:00 -07:00
+++ b/drivers/pci/probe.c	2004-07-02 14:25:01 -07:00
@@ -326,7 +326,7 @@
 	return child;
 }
 
-static unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus);
+unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus);
 
 /*
  * If it's a bridge, configure it and scan the bus behind it.
@@ -694,7 +694,7 @@
 	return nr;
 }
 
-static unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
+unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
 {
 	unsigned int devfn, pass, max = bus->secondary;
 	struct pci_dev *dev;
@@ -801,4 +801,5 @@
 EXPORT_SYMBOL(pci_scan_slot);
 EXPORT_SYMBOL(pci_scan_bridge);
 EXPORT_SYMBOL(pci_scan_single_device);
+EXPORT_SYMBOL_GPL(pci_scan_child_bus);
 #endif
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	2004-07-02 14:25:00 -07:00
+++ b/include/linux/pci.h	2004-07-02 14:25:00 -07:00
@@ -659,6 +659,7 @@
 }
 int pci_scan_slot(struct pci_bus *bus, int devfn);
 struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn);
+unsigned int pci_scan_child_bus(struct pci_bus *bus);
 void pci_bus_add_devices(struct pci_bus *bus);
 void pci_name_device(struct pci_dev *dev);
 char *pci_class_name(u32 class);


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

* Re: [PATCH] More PCI fixes for 2.6.7
  2004-07-02 21:39     ` Greg KH
@ 2004-07-02 21:39       ` Greg KH
  2004-07-02 21:39         ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-07-02 21:39 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1788, 2004/07/02 13:35:57-07:00, linas@austin.ibm.com

[PATCH] PCI Hotplug: RPAPHP structure size/performance

Please review and apply the following patch if you find it agreeable.

This patch does not make any functional changes, but does improve
both performance and memory usage by rearranging structure elements.

The need for these changes became appearent during a code review of
the disassembly involving this structure. The memory footprint of this
structure is made smaller by grouping the byte fields next to each other.
The access of the list_head can be simplified by making it the first element
of the structure, thus avoiding a needless add-immediate without negatively
impacting any of the other accesses.

Signed-off-by: Linas Vepstas <linas@linas.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/hotplug/rpaphp.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
--- a/drivers/pci/hotplug/rpaphp.h	2004-07-02 14:24:19 -07:00
+++ b/drivers/pci/hotplug/rpaphp.h	2004-07-02 14:24:19 -07:00
@@ -85,6 +85,7 @@
  * struct slot - slot information for each *physical* slot
  */
 struct slot {
+	struct list_head rpaphp_slot_list;
 	int state;
 	u32 index;
 	u32 type;
@@ -92,6 +93,7 @@
 	char *name;
 	char *location;
 	u8 removable;
+	u8 dev_type;		/* VIO or PCI */
 	struct device_node *dn;	/* slot's device_node in OFDT */
 				/* dn has phb info */
 	struct pci_dev *bridge;	/* slot's pci_dev in pci_devices */
@@ -99,9 +101,7 @@
 		struct list_head pci_funcs; /* pci_devs in PCI slot */ 
 		struct vio_dev *vio_dev; /* vio_dev in VIO slot */
 	} dev;
-	u8 dev_type;		/* VIO or PCI */
 	struct hotplug_slot *hotplug_slot;
-	struct list_head rpaphp_slot_list;
 };
 
 extern struct hotplug_slot_ops rpaphp_hotplug_slot_ops;


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

* Re: [PATCH] More PCI fixes for 2.6.7
  2004-07-02 21:39   ` Greg KH
@ 2004-07-02 21:39     ` Greg KH
  2004-07-02 21:39       ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-07-02 21:39 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1787, 2004/07/02 13:33:23-07:00, linas@austin.ibm.com

[PATCH] PCI Hotplug: rpaphp null pointer deref

This patch fixes a null-pointer dereference when hot-plug operations
are performed on a machine that has virtual-io devices in it.
Virtual i/o devices to not have pci bridges associated with them.
It also corrects an ordering problem during hotplug remove.

This patch was previously reviewed/tested by Linda Xie, the current
rpaphp maintainer.

Signed-off-by: Linas Vepstas <linas@linas.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/hotplug/rpaphp_pci.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)


diff -Nru a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
--- a/drivers/pci/hotplug/rpaphp_pci.c	2004-07-02 14:24:33 -07:00
+++ b/drivers/pci/hotplug/rpaphp_pci.c	2004-07-02 14:24:33 -07:00
@@ -378,8 +378,8 @@
 	
 		func = list_entry(ln, struct rpaphp_pci_func, sibling);
 		if (func->pci_dev) {
-			rpaphp_eeh_remove_bus_device(func->pci_dev);
 			pci_remove_bus_device(func->pci_dev); 
+			rpaphp_eeh_remove_bus_device(func->pci_dev);
 		}
 		kfree(func);
 	}
@@ -513,9 +513,18 @@
 		struct list_head *ln;
 
 		slot = list_entry(tmp, struct slot, rpaphp_slot_list);
+		if (slot->bridge == NULL) {
+			if (slot->dev_type == PCI_DEV) {
+				printk(KERN_WARNING "PCI slot missing bridge %s %s \n", 
+				                    slot->name, slot->location);
+			}
+			continue;
+		}
+
 		bus = slot->bridge->subordinate;
-		if (!bus)
-			return NULL; /* shouldn't be here */
+		if (!bus) {
+			continue;  /* should never happen? */
+		}
 		for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
                                 struct pci_dev *pdev = pci_dev_b(ln);
 				if (pdev == dev)


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

* Re: [PATCH] More PCI fixes for 2.6.7
  2004-07-02 21:39       ` Greg KH
@ 2004-07-02 21:39         ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2004-07-02 21:39 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1789, 2004/07/02 13:53:00-07:00, buytenh@wantstofly.org

[PATCH] PCI: New PCI vendor/device ID for Radisys ENP-2611 board

Included is a patch for linux to add a PCI vendor/device ID for the
Radisys ENP-2611 board.  The ENP-2611 is a 64bit/66MHz PCI board which
hosts an Intel IXP2400 network processor, has three GigE interfaces,
runs linux and generally kicks ass.

(see http://www.radisys.com/oem_products/ds-page.cfm?productdatasheetsid=1147)


Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/pci.ids     |    1 +
 include/linux/pci_ids.h |    3 +++
 2 files changed, 4 insertions(+)


diff -Nru a/drivers/pci/pci.ids b/drivers/pci/pci.ids
--- a/drivers/pci/pci.ids	2004-07-02 14:24:06 -07:00
+++ b/drivers/pci/pci.ids	2004-07-02 14:24:06 -07:00
@@ -5535,6 +5535,7 @@
 132d  Integrated Silicon Solution, Inc.
 1330  MMC Networks
 1331  Radisys Corp.
+	0030  ENP-2611
 	8200  82600 Host Bridge
 	8201  82600 IDE
 	8202  82600 USB
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h	2004-07-02 14:24:06 -07:00
+++ b/include/linux/pci_ids.h	2004-07-02 14:24:06 -07:00
@@ -1711,6 +1711,9 @@
 #define PCI_DEVICE_ID_SIIG_2S1P_20x_650	0x2061
 #define PCI_DEVICE_ID_SIIG_2S1P_20x_850	0x2062
 
+#define PCI_VENDOR_ID_RADISYS		0x1331
+#define PCI_DEVICE_ID_RADISYS_ENP2611	0x0030
+
 #define PCI_VENDOR_ID_DOMEX		0x134a
 #define PCI_DEVICE_ID_DOMEX_DMX3191D	0x0001
 


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

* Re: [PATCH] More PCI fixes for 2.6.7
  2004-07-02 21:39 ` [PATCH] " Greg KH
@ 2004-07-02 21:39   ` Greg KH
  2004-07-02 21:39     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2004-07-02 21:39 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1786, 2004/07/02 13:32:11-07:00, roland@topspin.com

[PATCH] PCI: Add some PCI Express constants to pci.h

This patch adds some PCI Express register constants to <linux/pci.h>

For my device, setting the Max_Read_Request_Size value in the PCI
Express device control register makes a huge performance difference.
I wanted my driver code that does this to be a little more
self-documenting than:

	pci_read_config_word(mdev->pdev, cap + 8, &val);
	val = (val & ~(5 << 12)) | (5 << 12);

I went a little overboard and added all the basic device register
fields.  If desired I could go even further overboard and add the
link, slot and root registers as well.

This patch is based on Matthew Wilcox's patch for pciutils, corrected
for some PCI Express spec 1.0a changes.

Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 include/linux/pci.h |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+)


diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	2004-07-02 14:24:47 -07:00
+++ b/include/linux/pci.h	2004-07-02 14:24:47 -07:00
@@ -321,6 +321,50 @@
 #define  PCI_X_STATUS_266MHZ	0x40000000	/* 266 MHz capable */
 #define  PCI_X_STATUS_533MHZ	0x80000000	/* 533 MHz capable */
 
+/* PCI Express capability registers */
+
+#define PCI_EXP_FLAGS		2	/* Capabilities register */
+#define PCI_EXP_FLAGS_VERS	0x000f	/* Capability version */
+#define PCI_EXP_FLAGS_TYPE	0x00f0	/* Device/Port type */
+#define  PCI_EXP_TYPE_ENDPOINT	0x0	/* Express Endpoint */
+#define  PCI_EXP_TYPE_LEG_END	0x1	/* Legacy Endpoint */
+#define  PCI_EXP_TYPE_ROOT_PORT 0x4	/* Root Port */
+#define  PCI_EXP_TYPE_UPSTREAM	0x5	/* Upstream Port */
+#define  PCI_EXP_TYPE_DOWNSTREAM 0x6	/* Downstream Port */
+#define  PCI_EXP_TYPE_PCI_BRIDGE 0x7	/* PCI/PCI-X Bridge */
+#define PCI_EXP_FLAGS_SLOT	0x0100	/* Slot implemented */
+#define PCI_EXP_FLAGS_IRQ	0x3e00	/* Interrupt message number */
+#define PCI_EXP_DEVCAP		4	/* Device capabilities */
+#define  PCI_EXP_DEVCAP_PAYLOAD	0x07	/* Max_Payload_Size */
+#define  PCI_EXP_DEVCAP_PHANTOM	0x18	/* Phantom functions */
+#define  PCI_EXP_DEVCAP_EXT_TAG	0x20	/* Extended tags */
+#define  PCI_EXP_DEVCAP_L0S	0x1c0	/* L0s Acceptable Latency */
+#define  PCI_EXP_DEVCAP_L1	0xe00	/* L1 Acceptable Latency */
+#define  PCI_EXP_DEVCAP_ATN_BUT	0x1000	/* Attention Button Present */
+#define  PCI_EXP_DEVCAP_ATN_IND	0x2000	/* Attention Indicator Present */
+#define  PCI_EXP_DEVCAP_PWR_IND	0x4000	/* Power Indicator Present */
+#define  PCI_EXP_DEVCAP_PWR_VAL	0x3fc0000 /* Slot Power Limit Value */
+#define  PCI_EXP_DEVCAP_PWR_SCL	0xc000000 /* Slot Power Limit Scale */
+#define PCI_EXP_DEVCTL		8	/* Device Control */
+#define  PCI_EXP_DEVCTL_CERE	0x0001	/* Correctable Error Reporting En. */
+#define  PCI_EXP_DEVCTL_NFERE	0x0002	/* Non-Fatal Error Reporting Enable */
+#define  PCI_EXP_DEVCTL_FERE	0x0004	/* Fatal Error Reporting Enable */
+#define  PCI_EXP_DEVCTL_URRE	0x0008	/* Unsupported Request Reporting En. */
+#define  PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
+#define  PCI_EXP_DEVCTL_PAYLOAD	0x00e0	/* Max_Payload_Size */
+#define  PCI_EXP_DEVCTL_EXT_TAG	0x0100	/* Extended Tag Field Enable */
+#define  PCI_EXP_DEVCTL_PHANTOM	0x0200	/* Phantom Functions Enable */
+#define  PCI_EXP_DEVCTL_AUX_PME	0x0400	/* Auxiliary Power PM Enable */
+#define  PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  /* Enable No Snoop */
+#define  PCI_EXP_DEVCTL_READRQ	0x7000	/* Max_Read_Request_Size */
+#define PCI_EXP_DEVSTA		10	/* Device Status */
+#define  PCI_EXP_DEVSTA_CED	0x01	/* Correctable Error Detected */
+#define  PCI_EXP_DEVSTA_NFED	0x02	/* Non-Fatal Error Detected */
+#define  PCI_EXP_DEVSTA_FED	0x04	/* Fatal Error Detected */
+#define  PCI_EXP_DEVSTA_URD	0x08	/* Unsupported Request Detected */
+#define  PCI_EXP_DEVSTA_AUXPD	0x10	/* AUX Power Detected */
+#define  PCI_EXP_DEVSTA_TRPND	0x20	/* Transactions Pending */
+
 /* Extended Capabilities (PCI-X 2.0 and Express) */
 #define PCI_EXT_CAP_ID(header)		(header & 0x0000ffff)
 #define PCI_EXT_CAP_VER(header)		((header >> 16) & 0xf)


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

end of thread, other threads:[~2004-07-02 21:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-02 21:38 [BK PATCH] More PCI fixes for 2.6.7 Greg KH
2004-07-02 21:39 ` [PATCH] " Greg KH
2004-07-02 21:39   ` Greg KH
2004-07-02 21:39     ` Greg KH
2004-07-02 21:39       ` Greg KH
2004-07-02 21:39         ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox