diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-02 14:48:14 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-02 14:48:14 -0700 |
commit | ce6089ada2fea84bef30a839543688664859162b (patch) | |
tree | 5f305696e88c5d7e5191d2ab47ba2c008073db1c /pci | |
parent | 1243a917553e97fa5adaa2010bbfaf6e86acefb3 (diff) | |
download | patches-ce6089ada2fea84bef30a839543688664859162b.tar.gz |
new usb and pci patches
Diffstat (limited to 'pci')
5 files changed, 313 insertions, 0 deletions
diff --git a/pci/pci-clean-up-pci-documentation-to-be-more-specific.patch b/pci/pci-clean-up-pci-documentation-to-be-more-specific.patch new file mode 100644 index 0000000000000..c661c01a959f0 --- /dev/null +++ b/pci/pci-clean-up-pci-documentation-to-be-more-specific.patch @@ -0,0 +1,50 @@ +From grundler@lackof.org Thu Jun 1 10:16:09 2006 +Date: Thu, 1 Jun 2006 11:15:59 -0600 +From: Grant Grundler <grundler@parisc-linux.org> +To: Rajesh Shah <rajesh.shah@intel.com> +Cc: "bibo,mao" <bibo.mao@intel.com>, akpm@osdl.org, + Greg KH <greg@kroah.com>, linux-kernel@vger.kernel.org, + linux-pci@atrey.karlin.mff.cuni.cz, kaneshige.kenji@jp.fujitsu.com +Subject: PCI: clean up pci documentation to be more specific +Message-ID: <20060601171559.GA16288@colo.lackof.org> + +On Thu, Jun 01, 2006 at 02:46:11AM -0700, Rajesh Shah wrote: +> This patch assumes that pci_request_region() will always be called +> after pci_enable_device() and pci_release_region() will always +> be called before pci_disable_device(). We cannot make this +> assumption,since it's perfectly legal to disable a device +> first and then release it's regions. So, I think that patch +> needs to change. + +Patch below clarifies comments in Documentation/pci.txt. + +Signed-off-by: Grant Grundler <grundler@parisc-linux.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + Documentation/pci.txt | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +--- gregkh-2.6.orig/Documentation/pci.txt ++++ gregkh-2.6/Documentation/pci.txt +@@ -213,9 +213,17 @@ have been remapped by the kernel. + + See Documentation/IO-mapping.txt for how to access device memory. + +- You still need to call request_region() for I/O regions and +-request_mem_region() for memory regions to make sure nobody else is using the +-same device. ++ The device driver needs to call pci_request_region() to make sure ++no other device is already using the same resource. The driver is expected ++to determine MMIO and IO Port resource availability _before_ calling ++pci_enable_device(). Conversely, drivers should call pci_release_region() ++_after_ calling pci_disable_device(). The idea is to prevent two devices ++colliding on the same address range. ++ ++Generic flavors of pci_request_region() are request_mem_region() ++(for MMIO ranges) and request_region() (for IO Port ranges). ++Use these for address resources that are not described by "normal" PCI ++interfaces (e.g. BAR). + + All interrupt handlers should be registered with SA_SHIRQ and use the devid + to map IRQs to devices (remember that all PCI interrupts are shared). diff --git a/pci/pci-cleanup-unused-variable-about-msi-driver.patch b/pci/pci-cleanup-unused-variable-about-msi-driver.patch new file mode 100644 index 0000000000000..ce8242d961053 --- /dev/null +++ b/pci/pci-cleanup-unused-variable-about-msi-driver.patch @@ -0,0 +1,64 @@ +From bibo.mao@intel.com Wed May 31 03:18:55 2006 +Message-ID: <447D6D3D.5020608@intel.com> +Date: Wed, 31 May 2006 18:17:33 +0800 +From: "bibo,mao" <bibo.mao@intel.com> +To: greg@kroah.com +Subject: PCI: cleanup unused variable about msi driver + +In IA64 platform, msi driver does not use irq_vector variable, and in +x86 platform LAST_DEVICE_VECTOR should one before FIRST_SYSTEM_VECTOR, +this patch modify this. + +Signed-off-by: bibo, mao <bibo.mao@intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/pci/msi.c | 5 ----- + include/asm-i386/msi.h | 2 +- + include/asm-x86_64/msi.h | 2 +- + 3 files changed, 2 insertions(+), 7 deletions(-) + +--- gregkh-2.6.orig/drivers/pci/msi.c ++++ gregkh-2.6/drivers/pci/msi.c +@@ -35,7 +35,6 @@ static int nr_msix_devices; + + #ifndef CONFIG_X86_IO_APIC + int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1}; +-u8 irq_vector[NR_IRQ_VECTORS]; + #endif + + static struct msi_ops *msi_ops; +@@ -383,10 +382,6 @@ static int msi_init(void) + return status; + } + +-#ifndef CONFIG_X86_IO_APIC +- irq_vector[0] = FIRST_DEVICE_VECTOR; +-#endif +- + if (last_alloc_vector < 0) { + pci_msi_enable = 0; + printk(KERN_WARNING "PCI: No interrupt vectors available for MSI\n"); +--- gregkh-2.6.orig/include/asm-i386/msi.h ++++ gregkh-2.6/include/asm-i386/msi.h +@@ -9,7 +9,7 @@ + #include <asm/desc.h> + #include <mach_apic.h> + +-#define LAST_DEVICE_VECTOR 232 ++#define LAST_DEVICE_VECTOR (FIRST_SYSTEM_VECTOR - 1) + #define MSI_TARGET_CPU_SHIFT 12 + + extern struct msi_ops msi_apic_ops; +--- gregkh-2.6.orig/include/asm-x86_64/msi.h ++++ gregkh-2.6/include/asm-x86_64/msi.h +@@ -10,7 +10,7 @@ + #include <asm/mach_apic.h> + #include <asm/smp.h> + +-#define LAST_DEVICE_VECTOR 232 ++#define LAST_DEVICE_VECTOR (FIRST_SYSTEM_VECTOR - 1) + #define MSI_TARGET_CPU_SHIFT 12 + + extern struct msi_ops msi_apic_ops; diff --git a/pci/pci-don-t-move-ioapics-below-pci-bridge.patch b/pci/pci-don-t-move-ioapics-below-pci-bridge.patch new file mode 100644 index 0000000000000..e79a8b7921b74 --- /dev/null +++ b/pci/pci-don-t-move-ioapics-below-pci-bridge.patch @@ -0,0 +1,41 @@ +From kimball.murray@gmail.com Wed May 31 11:20:11 2006 +Date: Wed, 31 May 2006 14:20:04 -0400 +From: Kimball Murray <kimball.murray@gmail.com> +Cc: Kimball Murray <kimball.murray@gmail.com>, <greg@kroah.com> +Message-Id: <20060531181358.6617.96108.sendpatchset@dhcp83-97.boston.redhat.com> +Subject: PCI: don't move ioapics below PCI bridge + +A recent Stratus x86_64 platform uses a system ioapic that is a PCI device +located below a PCI bridge. Other platforms like this may exist. + +This patch fixes a problem wherein the kernel's PCI setup code moves +the ioapic to an address other than that assigned by the BIOS. It simply +adds another exclusion (which already includes classless devices and host +bridges) to the function pbus_assign_resources_sorted so that it will not +move the ioapic. + +If the ioapic is moved, the fixmap mapping to it is broken, so the OS should +leave it alone. + +From: Kimball Murray <kimball.murray@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/pci/setup-bus.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/drivers/pci/setup-bus.c ++++ gregkh-2.6/drivers/pci/setup-bus.c +@@ -55,9 +55,10 @@ pbus_assign_resources_sorted(struct pci_ + list_for_each_entry(dev, &bus->devices, bus_list) { + u16 class = dev->class >> 8; + +- /* Don't touch classless devices and host bridges. */ ++ /* Don't touch classless devices or host bridges or ioapics. */ + if (class == PCI_CLASS_NOT_DEFINED || +- class == PCI_CLASS_BRIDGE_HOST) ++ class == PCI_CLASS_BRIDGE_HOST || ++ class == PCI_CLASS_SYSTEM_PIC) + continue; + + pdev_sort_resources(dev, &head); diff --git a/pci/pci-hotplug-fake-null-pointer-dereferences-in-ibm-hot-plug-controller-driver.patch b/pci/pci-hotplug-fake-null-pointer-dereferences-in-ibm-hot-plug-controller-driver.patch new file mode 100644 index 0000000000000..050135c1945ad --- /dev/null +++ b/pci/pci-hotplug-fake-null-pointer-dereferences-in-ibm-hot-plug-controller-driver.patch @@ -0,0 +1,73 @@ +From snakebyte@gmx.de Thu Jun 1 02:41:47 2006 +From: Eric Sesterhenn <snakebyte@gmx.de> +Subject: PCI Hotplug: fake NULL pointer dereferences in IBM Hot Plug Controller Driver +To: Greg KH <gregkh@suse.de> +Date: Thu, 01 Jun 2006 11:41:44 +0200 +Message-Id: <1149154904.9177.3.camel@alice> + +Remove checks for value, since the hotplug core always provides +a valid value. + +Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/pci/hotplug/ibmphp_core.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- gregkh-2.6.orig/drivers/pci/hotplug/ibmphp_core.c ++++ gregkh-2.6/drivers/pci/hotplug/ibmphp_core.c +@@ -285,7 +285,7 @@ static int get_attention_status(struct h + (ulong) hotplug_slot, (ulong) value); + + ibmphp_lock_operations(); +- if (hotplug_slot && value) { ++ if (hotplug_slot) { + pslot = hotplug_slot->private; + if (pslot) { + memcpy(&myslot, pslot, sizeof(struct slot)); +@@ -315,7 +315,7 @@ static int get_latch_status(struct hotpl + debug("get_latch_status - Entry hotplug_slot[%lx] pvalue[%lx]\n", + (ulong) hotplug_slot, (ulong) value); + ibmphp_lock_operations(); +- if (hotplug_slot && value) { ++ if (hotplug_slot) { + pslot = hotplug_slot->private; + if (pslot) { + memcpy(&myslot, pslot, sizeof(struct slot)); +@@ -342,7 +342,7 @@ static int get_power_status(struct hotpl + debug("get_power_status - Entry hotplug_slot[%lx] pvalue[%lx]\n", + (ulong) hotplug_slot, (ulong) value); + ibmphp_lock_operations(); +- if (hotplug_slot && value) { ++ if (hotplug_slot) { + pslot = hotplug_slot->private; + if (pslot) { + memcpy(&myslot, pslot, sizeof(struct slot)); +@@ -369,7 +369,7 @@ static int get_adapter_present(struct ho + debug("get_adapter_status - Entry hotplug_slot[%lx] pvalue[%lx]\n", + (ulong) hotplug_slot, (ulong) value); + ibmphp_lock_operations(); +- if (hotplug_slot && value) { ++ if (hotplug_slot) { + pslot = hotplug_slot->private; + if (pslot) { + memcpy(&myslot, pslot, sizeof(struct slot)); +@@ -401,7 +401,7 @@ static int get_max_bus_speed(struct hotp + + ibmphp_lock_operations(); + +- if (hotplug_slot && value) { ++ if (hotplug_slot) { + pslot = hotplug_slot->private; + if (pslot) { + rc = 0; +@@ -441,7 +441,7 @@ static int get_cur_bus_speed(struct hotp + + ibmphp_lock_operations(); + +- if (hotplug_slot && value) { ++ if (hotplug_slot) { + pslot = hotplug_slot->private; + if (pslot) { + rc = get_cur_bus_info(&pslot); diff --git a/pci/pci-remove-unneeded-msi-code.patch b/pci/pci-remove-unneeded-msi-code.patch new file mode 100644 index 0000000000000..0241be3e8ca4e --- /dev/null +++ b/pci/pci-remove-unneeded-msi-code.patch @@ -0,0 +1,85 @@ +From owner-linux-pci@atrey.karlin.mff.cuni.cz Wed May 31 23:34:43 2006 +Date: Wed, 31 May 2006 23:35:47 -0700 +From: Grant Grundler <iod00d@hp.com> +To: Greg KH <gregkh@suse.de> +Subject: PCI: remove unneeded msi code +Message-ID: <20060601063547.GA5531@esmail.cup.hp.com> +Content-Disposition: inline + +The code is really not needed. +Roland Dreier/Greg KH removed the release_mem_region() calls that +were the only consumers of phys_addr: + http://www.ussg.iu.edu/hypermail/linux/kernel/0503.0/1540.html + +patch below deletes the "dead" code. + +Signed-off-by: Grant Grundler <iod00d@hp.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/pci/msi.c | 45 +-------------------------------------------- + 1 file changed, 1 insertion(+), 44 deletions(-) + +--- gregkh-2.6.orig/drivers/pci/msi.c ++++ gregkh-2.6/drivers/pci/msi.c +@@ -1060,33 +1060,8 @@ static int msi_free_vector(struct pci_de + entry_nr * PCI_MSIX_ENTRY_SIZE + + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET); + +- if (head == vector) { +- /* +- * Detect last MSI-X vector to be released. +- * Release the MSI-X memory-mapped table. +- */ +-#if 0 +- int pos, nr_entries; +- unsigned long phys_addr; +- u32 table_offset; +- u16 control; +- u8 bir; +- +- pos = pci_find_capability(dev, PCI_CAP_ID_MSIX); +- pci_read_config_word(dev, msi_control_reg(pos), +- &control); +- nr_entries = multi_msix_capable(control); +- pci_read_config_dword(dev, msix_table_offset_reg(pos), +- &table_offset); +- bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK); +- table_offset &= ~PCI_MSIX_FLAGS_BIRMASK; +- phys_addr = pci_resource_start(dev, bir) + table_offset; +-/* +- * FIXME! and what did you want to do with phys_addr? +- */ +-#endif ++ if (head == vector) + iounmap(base); +- } + } + + return 0; +@@ -1360,24 +1335,6 @@ void msi_remove_pci_irq_vectors(struct p + } + msi_free_vector(dev, vector, 0); + if (warning) { +- /* Force to release the MSI-X memory-mapped table */ +-#if 0 +- unsigned long phys_addr; +- u32 table_offset; +- u16 control; +- u8 bir; +- +- pci_read_config_word(dev, msi_control_reg(pos), +- &control); +- pci_read_config_dword(dev, msix_table_offset_reg(pos), +- &table_offset); +- bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK); +- table_offset &= ~PCI_MSIX_FLAGS_BIRMASK; +- phys_addr = pci_resource_start(dev, bir) + table_offset; +-/* +- * FIXME! and what did you want to do with phys_addr? +- */ +-#endif + iounmap(base); + printk(KERN_WARNING "PCI: %s: msi_remove_pci_irq_vectors() " + "called without free_irq() on all MSI-X vectors\n", |