PCI fixes for 2.6.11-rc3
PATCH 1/1 PCI fixes for 2.6.11-rc3
Hi,
Here are a few PCI and PCI Hotplug bugfixes 2.6.11-rc3. All of these patches have been in the past few -mm releases.
Please pull from:
bk://kernel.bkbits.net/gregkh/linux/2.6.11-rc3/pci
Patches will be posted to linux-kernel and linux-pci as a follow-up thread for those who want to see them.
thanks,
greg k-h
MAINTAINERS | 1 drivers/pci/hotplug/rpaphp.h | 7 -- drivers/pci/hotplug/rpaphp_core.c | 39 ++++++++---- drivers/pci/pci-sysfs.c | 1 drivers/pci/pcie/portdrv.h | 7 -- drivers/pci/pcie/portdrv_bus.c | 15 ---- drivers/pci/pcie/portdrv_core.c | 119 +++++++++++++++----------------------- drivers/pci/pcie/portdrv_pci.c | 22 ------- drivers/pci/probe.c | 2 drivers/pci/quirks.c | 10 +++ 10 files changed, 99 insertions(+), 124 deletions(-)
-----
Brian King:
o pci: Add Citrine quirk
Greg Kroah-Hartman:
o PCI: add linux-pci mailing list to PCI maintainers entry
John Rose:
o PCI Hotplug: remove incorrect rpaphp firmware dependency
Kay Sievers:
o PCI: memset rom attribute before using it
Olaf Hering:
o PCI: typo in pci_scan_bus_parented
Tom L. Nguyen:
o PCI: change sysfs representation of PCI-E devices
PATCH 1/1 PCI: typo in pci_scan_bus_parented
ChangeSet 1.2041, 2005/02/03 00:39:41-08:00, [email protected]
[PATCH] PCI: typo in pci_scan_bus_parented
From: Olaf Hering <[email protected]>
printk format string misses a x
drivers/pci/probe.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/pci/probe.c +1 -1
@@ -879,7 +879,7 @@if (pci_find_bus (pci_domain_nr (b), bus)) {/* If we already got to this bus through a different bridge, ignore it */ -DBG ("PCI: Bus %04:%02x already known\n" ,pci_domain_nr (b), bus); +DBG ("PCI: Bus %04x:%02x already known\n" ,pci_domain_nr (b), bus); goto err_out; }list_add_tail (&b->node, &pci_root_buses);
PATCH 1/1 pci: Add Citrine quirk
ChangeSet 1.2042, 2005/02/03 00:40:09-08:00, [email protected]
[PATCH] pci: Add Citrine quirk
The IBM Citrine chipset has a feature that if PCI config register 0xA0 is read while DMAs are being performed to it, there is the possiblity that the parity will be wrong on the PCI bus, causing a parity error and a master abort. On this chipset, this register is simply a debug register for the chip developers and the registers after it are not defined. Patch sets cfg_size to 0xA0 to prevent this problem from being seen.
drivers/pci/quirks.c | 10 ++++++++++ 1 files changed, 10 insertions(+)
drivers/pci/quirks.c +10 -0
@@ -216,6 +216,16 @@DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_82443BX_2 , quirk_natoma );/* +* This chip can cause PCI parity errors if config register 0xA0 is read +* while DMAs are occurring. +*/ +static void __devinit quirk_citrine (struct pci_dev *dev) +{ + dev->cfg_size =0xA0 ; +} +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_IBM ,PCI_DEVICE_ID_IBM_CITRINE , quirk_citrine ); + +/* * S3 868 and 968 chips report region size equal to 32M, but they decode 64M. * If it's needed, re-allocate the region. */
PATCH 1/1 PCI: memset rom attribute before using it
ChangeSet 1.2043, 2005/02/03 00:40:37-08:00, [email protected]
[PATCH] PCI: memset rom attribute before using it
Initialize the allocated bin_attribute structure, otherwise unused fields are pointing to random places.
drivers/pci/pci-sysfs.c | 1 + 1 files changed, 1 insertion(+)
drivers/pci/pci-sysfs.c +1 -0
@@ -436,6 +436,7 @@ rom_attr =kmalloc (sizeof (*rom_attr),GFP_ATOMIC );if (rom_attr) { +memset (rom_attr,0x00 ,sizeof (*rom_attr)); pdev->rom_attr = rom_attr; rom_attr->size =pci_resource_len (pdev,PCI_ROM_RESOURCE ); rom_attr->attr.name ="rom" ;
PATCH 1/1 PCI Hotplug: remove incorrect rpaphp firmware dependency
ChangeSet 1.2044, 2005/02/03 00:41:04-08:00, [email protected]
[PATCH] PCI Hotplug: remove incorrect rpaphp firmware dependency
The RPA PCI Hotplug module incorrectly uses a certain firmware property when determining the hotplug capabilities of a slot. Recent firmware changes have demonstrated that this property should not be referenced or depended upon by the OS. This patch removes the dependency, and implements a correct set of logic for determining hotplug capabilities.
diff -puN drivers/pci/hotplug/rpadlpar_core.c~02_rpadebug drivers/pci/hotplug/rpadlpar_core.c
drivers/pci/hotplug/rpaphp.h | 7 ------ drivers/pci/hotplug/rpaphp_core.c | 39 +++++++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 18 deletions(-)
drivers/pci/hotplug/rpaphp.h +0 -7
@@ -109,13 +109,6 @@extern struct list_head rpaphp_slot_head;extern int num_slots; -static inline int is_hotplug_capable (struct device_node *dn) -{ -unsigned char *ptr =get_property (dn,"ibm,fw-pci-hot-plug-ctrl" ,NULL ); - -return (int ) (ptr !=NULL ); -} -/* function prototypes */ /* rpaphp_pci.c */
drivers/pci/hotplug/rpaphp_core.c +28 -11
@@ -287,26 +287,43 @@return 1 ; } -static int is_php_dn (struct device_node *dn,int **indexes,int **names,int **types, -int **power_domains) +static int is_php_type (char *drc_type) { +unsigned long value; +char *endptr; + +/* PCI Hotplug nodes have an integer for drc_type */ + value =simple_strtoul (drc_type, &endptr,10 ); +if (endptr == drc_type) +return 0 ; + +return 1 ; +} + +static int is_php_dn (struct device_node *dn,int **indexes,int **names, +int **types,int **power_domains) +{ +int *drc_types;int rc; -if (!is_hotplug_capable (dn)) -return (0 ); - rc =get_children_props (dn, indexes, names, types, power_domains); -if (rc) -return (0 ); -return (1 ); + rc =get_children_props (dn, indexes, names, &drc_types, power_domains); +if (rc) { +if (is_php_type ((char *) &drc_types[1 ])) { + *types = drc_types; +return 1 ; + } + } + +return 0 ; } -static int is_dr_dn (struct device_node *dn,int **indexes,int **names,int **types, -int **power_domains,int **my_drc_index) +static int is_dr_dn (struct device_node *dn,int **indexes,int **names, +int **types,int **power_domains,int **my_drc_index) {int rc; *my_drc_index = (int *)get_property (dn,"ibm,my-drc-index" ,NULL ); -if (!*my_drc_index) +if (!*my_drc_index)return (0 );if (!dn->parent)
PATCH 1/1 PCI: add linux-pci mailing list to PCI maintainers entry.
ChangeSet 1.2045, 2005/02/03 00:41:32-08:00, [email protected]
[PATCH] PCI: add linux-pci mailing list to PCI maintainers entry.
MAINTAINERS | 1 + 1 files changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -1746,6 +1746,7 @@ P: Greg Kroah-Hartman M: [email protected] L: [email protected] +L: [email protected] S: Supported PCI HOTPLUG CORE
PATCH 1/1 PCI: change sysfs representation of PCI-E devices
ChangeSet 1.2046, 2005/02/03 00:42:00-08:00, [email protected]
[PATCH] PCI: change sysfs representation of PCI-E devices
Before changes:
The patch makes the parent of the device pointing to the pci_dev structure. The parents portX devices are in /sys/devices which should be removed based on your suggestions. Below is /sys/devices before any changes made.
/sys/devices
| __ ide0 | __ pci0000:00 | __ pnp0 | __ port1 | | | __ port1.00 | | | __ port1.01 | . | . | . | __ port2 | __ port3 | __ system
After changes:
The parents portX devices are no longer necessary because port1.00 and port1.01 devices shoud have the parent of the pci_dev structure (based on your suggestion). The patch does the following changes:
- remove code creating and handling the parent portX devices.
- rename portX.YZ to pcieYZ (for example port1.00 renamed to pcie00) since portX is no longer needed.
- make pcieYZ have the parent of the pci_dev structure.
Below is /sys/devices after changes made to the patch.
/sys/devices
| __ ide0 | __ pci0000:00 | | | __ 0000:00:00.0 | | | __ 0000:00:04.0 | | | | . __ class | . | | . __ pcie00 | | | __ pcie01 | . | . | . | __ platform | __ pnp0 | __ system
drivers/pci/pcie/portdrv.h | 7 +- drivers/pci/pcie/portdrv_bus.c | 15 ----- drivers/pci/pcie/portdrv_core.c | 119 ++++++++++++++++------------------------ drivers/pci/pcie/portdrv_pci.c | 22 +------ 4 files changed, 58 insertions(+), 105 deletions(-)
drivers/pci/pcie/portdrv.h +3 -4
@@ -28,14 +28,13 @@#define get_descriptor_id (type, service) (((type - 4) << 4) | service)extern struct bus_type pcie_port_bus_type; -extern struct device_driver pcieport_generic_driver;extern int pcie_port_device_probe (struct pci_dev *dev);extern int pcie_port_device_register (struct pci_dev *dev);#ifdef CONFIG_PM -extern int pcie_port_device_suspend (struct pcie_device *dev,u32 state); -extern int pcie_port_device_resume (struct pcie_device *dev); +extern int pcie_port_device_suspend (struct pci_dev *dev,u32 state); +extern int pcie_port_device_resume (struct pci_dev *dev);#endif -extern void pcie_port_device_remove (struct pcie_device *dev); +extern void pcie_port_device_remove (struct pci_dev *dev);extern void pcie_port_bus_register (void );extern void pcie_port_bus_unregister (void );
drivers/pci/pcie/portdrv_bus.c +2 -13
@@ -14,8 +14,6 @@#include <linux/pcieport_if.h> -static int generic_probe (struct device *dev) {return 0 ;} -static int generic_remove (struct device *dev) {return 0 ;}static int pcie_port_bus_match (struct device *dev,struct device_driver *drv);static int pcie_port_bus_suspend (struct device *dev,u32 state);static int pcie_port_bus_resume (struct device *dev);
@@ -27,23 +25,14 @@ .resume = pcie_port_bus_resume, }; -struct device_driver pcieport_generic_driver = { - .name ="pcieport" , - .bus = &pcie_port_bus_type, - .probe = generic_probe, - .remove = generic_remove, -}; -static int pcie_port_bus_match (struct device *dev,struct device_driver *drv) {struct pcie_device *pciedev;struct pcie_port_service_driver *driver; -if ( drv->bus != &pcie_port_bus_type || - dev->bus != &pcie_port_bus_type || - drv == &pcieport_generic_driver) { +if (drv->bus != &pcie_port_bus_type || dev->bus != &pcie_port_bus_type)return 0 ; - } + pciedev =to_pcie_device (dev); driver =to_service_driver (drv); if ( (driver->id_table->vendor != PCI_ANY_ID &&
drivers/pci/pcie/portdrv_core.c +50 -69
230 lines not on this page · raw message
drivers/pci/pcie/portdrv_pci.c +3 -19
@@ -63,34 +63,18 @@static void pcie_portdrv_remove (struct pci_dev *dev) { -struct pcie_device *pciedev; - - pciedev = (struct pcie_device *)pci_get_drvdata (dev); -if (pciedev) { -pcie_port_device_remove (pciedev); -pci_set_drvdata (dev,NULL ); - } +pcie_port_device_remove (dev); }#ifdef CONFIG_PM static int pcie_portdrv_suspend (struct pci_dev *dev,u32 state) { -struct pcie_device *pciedev; - - pciedev = (struct pcie_device *)pci_get_drvdata (dev); -if (pciedev) -pcie_port_device_suspend (pciedev, state); -return 0 ; +return pcie_port_device_suspend (dev, state); }static int pcie_portdrv_resume (struct pci_dev *dev) { -struct pcie_device *pciedev; - - pciedev = (struct pcie_device *)pci_get_drvdata (dev); -if (pciedev) -pcie_port_device_resume (pciedev); -return 0 ; +return pcie_port_device_resume (dev); }#endif