diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-09 16:21:38 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-09 16:21:38 -0800 |
commit | e777bbc09f0785f314aae0367fdc8f9e3e1f28a7 (patch) | |
tree | b4c7ad2da47d146758077e2c0f9976ad894973d7 /pci | |
parent | fa6cd02ad70f7398b0df0a099238d468e4108838 (diff) | |
download | patches-e777bbc09f0785f314aae0367fdc8f9e3e1f28a7.tar.gz |
new patches and 2.6.16-rc5-git13 refresh
Diffstat (limited to 'pci')
3 files changed, 470 insertions, 0 deletions
diff --git a/pci/pci-cpqphp_ctrl.c-board_replaced-remove-dead-code.patch b/pci/pci-cpqphp_ctrl.c-board_replaced-remove-dead-code.patch new file mode 100644 index 0000000000000..d385fa73089cd --- /dev/null +++ b/pci/pci-cpqphp_ctrl.c-board_replaced-remove-dead-code.patch @@ -0,0 +1,140 @@ +From owner-linux-pci@atrey.karlin.mff.cuni.cz Sun Feb 26 13:16:54 2006 +Date: Sun, 26 Feb 2006 22:16:51 +0100 +From: Adrian Bunk <bunk@stusta.de> +To: greg@kroah.com +Cc: linux-pci@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org +Subject: PCI: cpqphp_ctrl.c: board_replaced(): remove dead code +Message-ID: <20060226211651.GN3674@stusta.de> +Content-Disposition: inline + +The Coverity checker correctly noted, that in function board_replaced in +drivers/pci/hotplug/cpqphp_ctrl.c, the variable src always has the +value 8, and therefore much code after the + +... + if (rc || src) { +... + if (rc) + return rc; + else + return 1; + } +... + + +can never be called. + +This patch removes the unreachable code in this function fixing kernel +Bugzilla #6073. + + +Signed-off-by: Adrian Bunk <bunk@stusta.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/pci/hotplug/cpqphp_ctrl.c | 76 +++++++------------------------------- + 1 file changed, 14 insertions(+), 62 deletions(-) + +--- gregkh-2.6.orig/drivers/pci/hotplug/cpqphp_ctrl.c ++++ gregkh-2.6/drivers/pci/hotplug/cpqphp_ctrl.c +@@ -1282,9 +1282,7 @@ static u32 board_replaced(struct pci_fun + u8 hp_slot; + u8 temp_byte; + u8 adapter_speed; +- u32 index; + u32 rc = 0; +- u32 src = 8; + + hp_slot = func->device - ctrl->slot_device_offset; + +@@ -1368,68 +1366,17 @@ static u32 board_replaced(struct pci_fun + + rc = cpqhp_configure_board(ctrl, func); + +- if (rc || src) { +- /* If configuration fails, turn it off +- * Get slot won't work for devices behind +- * bridges, but in this case it will always be +- * called for the "base" bus/dev/func of an +- * adapter. */ +- +- mutex_lock(&ctrl->crit_sect); +- +- amber_LED_on (ctrl, hp_slot); +- green_LED_off (ctrl, hp_slot); +- slot_disable (ctrl, hp_slot); +- +- set_SOGO(ctrl); +- +- /* Wait for SOBS to be unset */ +- wait_for_ctrl_irq (ctrl); +- +- mutex_unlock(&ctrl->crit_sect); +- +- if (rc) +- return rc; +- else +- return 1; +- } +- +- func->status = 0; +- func->switch_save = 0x10; +- +- index = 1; +- while (((func = cpqhp_slot_find(func->bus, func->device, index)) != NULL) && !rc) { +- rc |= cpqhp_configure_board(ctrl, func); +- index++; +- } +- +- if (rc) { +- /* If configuration fails, turn it off +- * Get slot won't work for devices behind +- * bridges, but in this case it will always be +- * called for the "base" bus/dev/func of an +- * adapter. */ +- +- mutex_lock(&ctrl->crit_sect); +- +- amber_LED_on (ctrl, hp_slot); +- green_LED_off (ctrl, hp_slot); +- slot_disable (ctrl, hp_slot); +- +- set_SOGO(ctrl); +- +- /* Wait for SOBS to be unset */ +- wait_for_ctrl_irq (ctrl); +- +- mutex_unlock(&ctrl->crit_sect); +- +- return rc; +- } +- /* Done configuring so turn LED on full time */ ++ /* If configuration fails, turn it off ++ * Get slot won't work for devices behind ++ * bridges, but in this case it will always be ++ * called for the "base" bus/dev/func of an ++ * adapter. */ + + mutex_lock(&ctrl->crit_sect); + +- green_LED_on (ctrl, hp_slot); ++ amber_LED_on (ctrl, hp_slot); ++ green_LED_off (ctrl, hp_slot); ++ slot_disable (ctrl, hp_slot); + + set_SOGO(ctrl); + +@@ -1437,7 +1384,12 @@ static u32 board_replaced(struct pci_fun + wait_for_ctrl_irq (ctrl); + + mutex_unlock(&ctrl->crit_sect); +- rc = 0; ++ ++ if (rc) ++ return rc; ++ else ++ return 1; ++ + } else { + /* Something is wrong + diff --git a/pci/pci-provide-a-boot-parameter-to-disable-msi.patch b/pci/pci-provide-a-boot-parameter-to-disable-msi.patch new file mode 100644 index 0000000000000..9be5f1f681792 --- /dev/null +++ b/pci/pci-provide-a-boot-parameter-to-disable-msi.patch @@ -0,0 +1,126 @@ +From willy@parisc-linux.org Sun Mar 5 21:33:37 2006 +Date: Sun, 5 Mar 2006 22:33:34 -0700 +From: Matthew Wilcox <matthew@wil.cx> +Cc: "Randy.Dunlap" <rdunlap@xenotime.net>, Greg KH <greg@kroah.com> +Subject: PCI: Provide a boot parameter to disable MSI +Message-ID: <20060306053334.GO1598@parisc-linux.org> +Content-Disposition: inline + + +Several drivers are starting to grow options to disable MSI. However, +it's often a host chipset issue, not something which individual drivers +should handle. So we add the pci=nomsi kernel parameter to allow the user +to disable MSI modes for systems we haven't added to the quirk list yet. + +Signed-off-by: Matthew Wilcox <matthew@wil.cx> +Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> +Acked-by: Jeff Garzik <jeff@garzik.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + Documentation/kernel-parameters.txt | 4 ++++ + drivers/pci/Kconfig | 4 ++++ + drivers/pci/msi.c | 10 ++++++++++ + drivers/pci/pci.c | 8 ++++++-- + drivers/pci/pci.h | 2 ++ + 5 files changed, 26 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/Documentation/kernel-parameters.txt ++++ gregkh-2.6/Documentation/kernel-parameters.txt +@@ -49,6 +49,7 @@ restrictions referred to are that the re + MCA MCA bus support is enabled. + MDA MDA console support is enabled. + MOUSE Appropriate mouse support is enabled. ++ MSI Message Signaled Interrupts (PCI). + MTD MTD support is enabled. + NET Appropriate network support is enabled. + NUMA NUMA support is enabled. +@@ -1143,6 +1144,9 @@ running once the system is up. + Mechanism 2. + nommconf [IA-32,X86_64] Disable use of MMCONFIG for PCI + Configuration ++ nomsi [MSI] If the PCI_MSI kernel config parameter is ++ enabled, this kernel boot option can be used to ++ disable the use of MSI interrupts system-wide. + nosort [IA-32] Don't sort PCI devices according to + order given by the PCI BIOS. This sorting is + done to get a device order compatible with +--- gregkh-2.6.orig/drivers/pci/Kconfig ++++ gregkh-2.6/drivers/pci/Kconfig +@@ -11,6 +11,10 @@ config PCI_MSI + generate an interrupt using an inbound Memory Write on its + PCI bus instead of asserting a device IRQ pin. + ++ Use of PCI MSI interrupts can be disabled at kernel boot time ++ by using the 'pci=nomsi' option. This disables MSI for the ++ entire system. ++ + If you don't know what to do here, say N. + + config PCI_DEBUG +--- gregkh-2.6.orig/drivers/pci/msi.c ++++ gregkh-2.6/drivers/pci/msi.c +@@ -984,8 +984,11 @@ void pci_disable_msi(struct pci_dev* dev + u16 control; + unsigned long flags; + ++ if (!pci_msi_enable) ++ return; + if (!dev) + return; ++ + pos = pci_find_capability(dev, PCI_CAP_ID_MSI); + if (!pos) + return; +@@ -1247,6 +1250,8 @@ void pci_disable_msix(struct pci_dev* de + int pos, temp; + u16 control; + ++ if (!pci_msi_enable) ++ return; + if (!dev) + return; + +@@ -1373,6 +1378,11 @@ void msi_remove_pci_irq_vectors(struct p + } + } + ++void pci_no_msi(void) ++{ ++ pci_msi_enable = 0; ++} ++ + EXPORT_SYMBOL(pci_enable_msi); + EXPORT_SYMBOL(pci_disable_msi); + EXPORT_SYMBOL(pci_enable_msix); +--- gregkh-2.6.orig/drivers/pci/pci.c ++++ gregkh-2.6/drivers/pci/pci.c +@@ -909,8 +909,12 @@ static int __devinit pci_setup(char *str + if (k) + *k++ = 0; + if (*str && (str = pcibios_setup(str)) && *str) { +- /* PCI layer options should be handled here */ +- printk(KERN_ERR "PCI: Unknown option `%s'\n", str); ++ if (!strcmp(str, "nomsi")) { ++ pci_no_msi(); ++ } else { ++ printk(KERN_ERR "PCI: Unknown option `%s'\n", ++ str); ++ } + } + str = k; + } +--- gregkh-2.6.orig/drivers/pci/pci.h ++++ gregkh-2.6/drivers/pci/pci.h +@@ -52,9 +52,11 @@ struct msi_ops; + #ifdef CONFIG_PCI_MSI + void disable_msi_mode(struct pci_dev *dev, int pos, int type); + int msi_register(struct msi_ops *ops); ++void pci_no_msi(void); + #else + static inline void disable_msi_mode(struct pci_dev *dev, int pos, int type) { } + static inline int msi_register(struct msi_ops *ops) { return 0; } ++static inline void pci_no_msi(void) { } + #endif + + #if defined(CONFIG_PCI_MSI) && defined(CONFIG_PM) diff --git a/pci/pci-the-scheduled-removal-of-pci_legacy_proc.patch b/pci/pci-the-scheduled-removal-of-pci_legacy_proc.patch new file mode 100644 index 0000000000000..2057c78878165 --- /dev/null +++ b/pci/pci-the-scheduled-removal-of-pci_legacy_proc.patch @@ -0,0 +1,204 @@ +From bunk@stusta.de Sun Mar 5 07:50:07 2006 +Date: Sun, 5 Mar 2006 16:49:48 +0100 +From: Adrian Bunk <bunk@stusta.de> +To: gregkh@suse.de +Subject: PCI: the scheduled removal of PCI_LEGACY_PROC +Message-ID: <20060305154948.GA20287@stusta.de> +Content-Disposition: inline + +This patch contains the scheduled removal of PCI_LEGACY_PROC. + + +Signed-off-by: Adrian Bunk <bunk@stusta.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + Documentation/feature-removal-schedule.txt | 7 - + drivers/pci/Kconfig | 17 --- + drivers/pci/proc.c | 126 ----------------------------- + 3 files changed, 150 deletions(-) + +--- gregkh-2.6.orig/Documentation/feature-removal-schedule.txt ++++ gregkh-2.6/Documentation/feature-removal-schedule.txt +@@ -151,13 +151,6 @@ Who: Ralf Baechle <ralf@linux-mips.org> + + --------------------------- + +-What: Legacy /proc/pci interface (PCI_LEGACY_PROC) +-When: March 2006 +-Why: deprecated since 2.5.53 in favor of lspci(8) +-Who: Adrian Bunk <bunk@stusta.de> +- +---------------------------- +- + What: pci_module_init(driver) + When: January 2007 + Why: Is replaced by pci_register_driver(pci_driver). +--- gregkh-2.6.orig/drivers/pci/Kconfig ++++ gregkh-2.6/drivers/pci/Kconfig +@@ -13,23 +13,6 @@ config PCI_MSI + + If you don't know what to do here, say N. + +-config PCI_LEGACY_PROC +- bool "Legacy /proc/pci interface" +- depends on PCI +- ---help--- +- This feature enables a procfs file -- /proc/pci -- that provides a +- summary of PCI devices in the system. +- +- This feature has been deprecated as of v2.5.53, in favor of using the +- tool lspci(8). This feature may be removed at a future date. +- +- lspci can provide the same data, as well as much more. lspci is a part of +- the pci-utils package, which should be installed by your distribution. +- See <file:Documentation/Changes> for information on where to get the latest +- version. +- +- When in doubt, say N. +- + config PCI_DEBUG + bool "PCI Debugging" + depends on PCI && DEBUG_KERNEL +--- gregkh-2.6.orig/drivers/pci/proc.c ++++ gregkh-2.6/drivers/pci/proc.c +@@ -458,131 +458,6 @@ int pci_proc_detach_bus(struct pci_bus* + return 0; + } + +-#ifdef CONFIG_PCI_LEGACY_PROC +- +-/* +- * Backward compatible /proc/pci interface. +- */ +- +-/* +- * Convert some of the configuration space registers of the device at +- * address (bus,devfn) into a string (possibly several lines each). +- * The configuration string is stored starting at buf[len]. If the +- * string would exceed the size of the buffer (SIZE), 0 is returned. +- */ +-static int show_dev_config(struct seq_file *m, void *v) +-{ +- struct pci_dev *dev = v; +- struct pci_dev *first_dev; +- struct pci_driver *drv; +- u32 class_rev; +- unsigned char latency, min_gnt, max_lat; +- int reg; +- +- first_dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL); +- if (dev == first_dev) +- seq_puts(m, "PCI devices found:\n"); +- pci_dev_put(first_dev); +- +- drv = pci_dev_driver(dev); +- +- pci_user_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); +- pci_user_read_config_byte (dev, PCI_LATENCY_TIMER, &latency); +- pci_user_read_config_byte (dev, PCI_MIN_GNT, &min_gnt); +- pci_user_read_config_byte (dev, PCI_MAX_LAT, &max_lat); +- seq_printf(m, " Bus %2d, device %3d, function %2d:\n", +- dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); +- seq_printf(m, " Class %04x", class_rev >> 16); +- seq_printf(m, ": PCI device %04x:%04x", dev->vendor, dev->device); +- seq_printf(m, " (rev %d).\n", class_rev & 0xff); +- +- if (dev->irq) +- seq_printf(m, " IRQ %d.\n", dev->irq); +- +- if (latency || min_gnt || max_lat) { +- seq_printf(m, " Master Capable. "); +- if (latency) +- seq_printf(m, "Latency=%d. ", latency); +- else +- seq_puts(m, "No bursts. "); +- if (min_gnt) +- seq_printf(m, "Min Gnt=%d.", min_gnt); +- if (max_lat) +- seq_printf(m, "Max Lat=%d.", max_lat); +- seq_putc(m, '\n'); +- } +- +- for (reg = 0; reg < 6; reg++) { +- struct resource *res = dev->resource + reg; +- unsigned long base, end, flags; +- +- base = res->start; +- end = res->end; +- flags = res->flags; +- if (!end) +- continue; +- +- if (flags & PCI_BASE_ADDRESS_SPACE_IO) { +- seq_printf(m, " I/O at 0x%lx [0x%lx].\n", +- base, end); +- } else { +- const char *pref, *type = "unknown"; +- +- if (flags & PCI_BASE_ADDRESS_MEM_PREFETCH) +- pref = "P"; +- else +- pref = "Non-p"; +- switch (flags & PCI_BASE_ADDRESS_MEM_TYPE_MASK) { +- case PCI_BASE_ADDRESS_MEM_TYPE_32: +- type = "32 bit"; break; +- case PCI_BASE_ADDRESS_MEM_TYPE_1M: +- type = "20 bit"; break; +- case PCI_BASE_ADDRESS_MEM_TYPE_64: +- type = "64 bit"; break; +- } +- seq_printf(m, " %srefetchable %s memory at " +- "0x%lx [0x%lx].\n", pref, type, +- base, +- end); +- } +- } +- return 0; +-} +- +-static struct seq_operations proc_pci_op = { +- .start = pci_seq_start, +- .next = pci_seq_next, +- .stop = pci_seq_stop, +- .show = show_dev_config +-}; +- +-static int proc_pci_open(struct inode *inode, struct file *file) +-{ +- return seq_open(file, &proc_pci_op); +-} +-static struct file_operations proc_pci_operations = { +- .open = proc_pci_open, +- .read = seq_read, +- .llseek = seq_lseek, +- .release = seq_release, +-}; +- +-static void legacy_proc_init(void) +-{ +- struct proc_dir_entry * entry = create_proc_entry("pci", 0, NULL); +- if (entry) +- entry->proc_fops = &proc_pci_operations; +-} +- +-#else +- +-static void legacy_proc_init(void) +-{ +- +-} +- +-#endif /* CONFIG_PCI_LEGACY_PROC */ +- + static int proc_bus_pci_dev_open(struct inode *inode, struct file *file) + { + return seq_open(file, &proc_bus_pci_devices_op); +@@ -606,7 +481,6 @@ static int __init pci_proc_init(void) + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + pci_proc_attach_device(dev); + } +- legacy_proc_init(); + return 0; + } + |