diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-23 11:24:04 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-23 11:24:04 -0700 |
commit | 6b2cc2c720aef774f5773aa48d14267107634537 (patch) | |
tree | 99b7f9dfd6e7a30df5dd32522694f7b6c4e02314 /pci | |
parent | 2564d8d16f5c2825e28f756e2cf66d390a18dac4 (diff) | |
download | patches-6b2cc2c720aef774f5773aa48d14267107634537.tar.gz |
refresh for 2.6.17-git4 and remove pci patches that are in mainline
Diffstat (limited to 'pci')
37 files changed, 41 insertions, 3855 deletions
diff --git a/pci/64bit-resource-c99-changes-for-struct-resource-declarations.patch b/pci/64bit-resource-c99-changes-for-struct-resource-declarations.patch index 3ef7dd562401f..84054ee91a31b 100644 --- a/pci/64bit-resource-c99-changes-for-struct-resource-declarations.patch +++ b/pci/64bit-resource-c99-changes-for-struct-resource-declarations.patch @@ -84,7 +84,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - { "ega", 0x3B0, 0x3BF }; + { .name = "ega", .start = 0x3B0, .end = 0x3BF }; vga_video_type = VIDEO_TYPE_EGAM; - vga_vram_end = 0xb8000; + vga_vram_size = 0x8000; display_desc = "EGA+"; @@ -397,9 +397,9 @@ static const char __init *vgacon_startup &ega_console_resource); @@ -96,7 +96,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - { "mda", 0x3BF, 0x3BF }; + { .name = "mda", .start = 0x3BF, .end = 0x3BF }; vga_video_type = VIDEO_TYPE_MDA; - vga_vram_end = 0xb2000; + vga_vram_size = 0x2000; display_desc = "*MDA"; @@ -422,14 +422,14 @@ static const char __init *vgacon_startup @@ -122,5 +122,5 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - { "cga", 0x3D4, 0x3D5 }; + { .name = "cga", .start = 0x3D4, .end = 0x3D5 }; vga_video_type = VIDEO_TYPE_CGA; - vga_vram_end = 0xba000; + vga_vram_size = 0x2000; display_desc = "*CGA"; diff --git a/pci/64bit-resource-change-pci-core-and-arch-code-to-use-resource_size_t.patch b/pci/64bit-resource-change-pci-core-and-arch-code-to-use-resource_size_t.patch index 6645c0563e77b..1d9ee48c2076c 100644 --- a/pci/64bit-resource-change-pci-core-and-arch-code-to-use-resource_size_t.patch +++ b/pci/64bit-resource-change-pci-core-and-arch-code-to-use-resource_size_t.patch @@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> arch/mips/pci/pci.c | 4 ++-- arch/mips/pmc-sierra/yosemite/ht.c | 4 ++-- arch/parisc/kernel/pci.c | 2 +- - arch/powerpc/kernel/pci_32.c | 22 +++++++++++++++------- + arch/powerpc/kernel/pci_32.c | 10 +++++----- arch/powerpc/kernel/pci_64.c | 4 ++-- arch/ppc/kernel/pci.c | 12 ++++++------ arch/sh/boards/mpc1211/pci.c | 4 ++-- @@ -41,7 +41,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> include/asm-powerpc/pci.h | 2 +- include/asm-ppc/pci.h | 2 +- include/linux/pci.h | 13 +++++++------ - 31 files changed, 86 insertions(+), 76 deletions(-) + 31 files changed, 76 insertions(+), 74 deletions(-) --- gregkh-2.6.orig/arch/alpha/kernel/pci.c +++ gregkh-2.6/arch/alpha/kernel/pci.c @@ -220,26 +220,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } if (start & 0x300) { -@@ -1114,8 +1114,16 @@ check_for_io_childs(struct pci_bus *bus, - int i; - int rc = 0; - --#define push_end(res, size) do { unsigned long __sz = (size) ; \ -- res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \ -+ /* -+ * Assuming mask is a power of two - 1, push_end -+ * moves res->end to the end of the next -+ * mask-aligned boundary. -+ * e.g. res->end of 0x1fff moves to 0x2fff -+ */ -+#define push_end(res, mask) do { \ -+ BUG_ON(((mask+1) & mask) != 0); \ -+ res->end = -(-res->end & ~(unsigned long)mask); \ -+ res->end += mask; \ - } while (0) - - list_for_each_entry(dev, &bus->devices, bus_list) { -@@ -1756,7 +1764,7 @@ long sys_pciconfig_iobase(long which, un +@@ -1757,7 +1757,7 @@ long sys_pciconfig_iobase(long which, un void pci_resource_to_user(const struct pci_dev *dev, int bar, const struct resource *rsrc, @@ -250,7 +231,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> unsigned long offset = 0; --- gregkh-2.6.orig/arch/powerpc/kernel/pci_64.c +++ gregkh-2.6/arch/powerpc/kernel/pci_64.c -@@ -146,11 +146,11 @@ EXPORT_SYMBOL(pcibios_bus_to_resource); +@@ -138,11 +138,11 @@ EXPORT_SYMBOL(pcibios_bus_to_resource); * which might have be mirrored at 0x0100-0x03ff.. */ void pcibios_align_resource(void *data, struct resource *res, @@ -440,7 +421,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- gregkh-2.6.orig/drivers/pci/pci-sysfs.c +++ gregkh-2.6/drivers/pci/pci-sysfs.c -@@ -64,7 +64,7 @@ resource_show(struct device * dev, struc +@@ -87,7 +87,7 @@ resource_show(struct device * dev, struc char * str = buf; int i; int max = 7; @@ -449,7 +430,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if (pci_dev->subordinate) max = DEVICE_COUNT_RESOURCE; -@@ -320,7 +320,7 @@ pci_mmap_resource(struct kobject *kobj, +@@ -365,7 +365,7 @@ pci_mmap_resource(struct kobject *kobj, struct device, kobj)); struct resource *res = (struct resource *)attr->private; enum pci_mmap_state mmap_type; @@ -540,7 +521,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> int ret; size = res->end - res->start + 1; -@@ -169,7 +169,7 @@ pdev_sort_resources(struct pci_dev *dev, +@@ -209,7 +209,7 @@ pdev_sort_resources(struct pci_dev *dev, for (i = 0; i < PCI_NUM_RESOURCES; i++) { struct resource *r; struct resource_list *list, *tmp; @@ -549,7 +530,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> r = &dev->resource[i]; r_align = r->end - r->start; -@@ -185,7 +185,7 @@ pdev_sort_resources(struct pci_dev *dev, +@@ -225,7 +225,7 @@ pdev_sort_resources(struct pci_dev *dev, } r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start; for (list = head; ; list = list->next) { @@ -593,7 +574,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> #endif /* __KERNEL__ */ --- gregkh-2.6.orig/include/linux/pci.h +++ gregkh-2.6/include/linux/pci.h -@@ -401,8 +401,8 @@ int pcibios_enable_device(struct pci_dev +@@ -404,8 +404,8 @@ int pcibios_enable_device(struct pci_dev char *pcibios_setup (char *str); /* Used only when drivers/pci/setup.c is used */ @@ -604,7 +585,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> void pcibios_update_irq(struct pci_dev *, int irq); /* Generic PCI functions used internally */ -@@ -528,10 +528,10 @@ void pci_release_region(struct pci_dev * +@@ -532,10 +532,10 @@ void pci_release_region(struct pci_dev * /* drivers/pci/bus.c */ int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, @@ -618,7 +599,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> void *alignf_data); void pci_enable_bridges(struct pci_bus *bus); -@@ -726,7 +726,8 @@ static inline char *pci_name(struct pci_ +@@ -730,7 +730,8 @@ static inline char *pci_name(struct pci_ */ #ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, diff --git a/pci/64bit-resource-convert-a-few-remaining-drivers-to-use-resource_size_t-where-needed.patch b/pci/64bit-resource-convert-a-few-remaining-drivers-to-use-resource_size_t-where-needed.patch index df13605e3475a..4964f38962225 100644 --- a/pci/64bit-resource-convert-a-few-remaining-drivers-to-use-resource_size_t-where-needed.patch +++ b/pci/64bit-resource-convert-a-few-remaining-drivers-to-use-resource_size_t-where-needed.patch @@ -42,7 +42,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> printk(KERN_WARNING "HFC-PCI: No PCI card found\n"); --- gregkh-2.6.orig/drivers/net/8139cp.c +++ gregkh-2.6/drivers/net/8139cp.c -@@ -1668,7 +1668,7 @@ static int cp_init_one (struct pci_dev * +@@ -1823,7 +1823,7 @@ static int cp_init_one (struct pci_dev * struct cp_private *cp; int rc; void __iomem *regs; diff --git a/pci/64bit-resource-finally-enable-64bit-resource-sizes.patch b/pci/64bit-resource-finally-enable-64bit-resource-sizes.patch index c971afaa95331..41bcd8ada94e6 100644 --- a/pci/64bit-resource-finally-enable-64bit-resource-sizes.patch +++ b/pci/64bit-resource-finally-enable-64bit-resource-sizes.patch @@ -198,7 +198,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> depends on 64BIT --- gregkh-2.6.orig/arch/powerpc/Kconfig +++ gregkh-2.6/arch/powerpc/Kconfig -@@ -626,6 +626,14 @@ config CRASH_DUMP +@@ -645,6 +645,14 @@ config CRASH_DUMP Don't change this unless you know what you are doing. @@ -215,7 +215,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> depends on 8xx || 8260 --- gregkh-2.6.orig/arch/ppc/Kconfig +++ gregkh-2.6/arch/ppc/Kconfig -@@ -953,6 +953,13 @@ source kernel/Kconfig.hz +@@ -957,6 +957,13 @@ source kernel/Kconfig.hz source kernel/Kconfig.preempt source "mm/Kconfig" diff --git a/pci/64bit-resource-fix-up-printks-for-resources-in-arch-and-core-code.patch b/pci/64bit-resource-fix-up-printks-for-resources-in-arch-and-core-code.patch index 59096efac0cba..a114c0c97cedd 100644 --- a/pci/64bit-resource-fix-up-printks-for-resources-in-arch-and-core-code.patch +++ b/pci/64bit-resource-fix-up-printks-for-resources-in-arch-and-core-code.patch @@ -150,7 +150,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> /* Set up the top and bottom of the PCI I/O segment for this bus. */ pci_read_config_dword(bridge, PCI_IO_BASE, &l); -@@ -1222,8 +1223,8 @@ do_fixup_p2p_level(struct pci_bus *bus) +@@ -1223,8 +1224,8 @@ do_fixup_p2p_level(struct pci_bus *bus) continue; if ((r->flags & IORESOURCE_IO) == 0) continue; @@ -161,7 +161,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> res->start, res->end, i, r->start, r->end); if (allocate_resource(r, res, res->end + 1, res->start, max, -@@ -1573,8 +1574,8 @@ static pgprot_t __pci_mmap_set_pgprot(st +@@ -1574,8 +1575,8 @@ static pgprot_t __pci_mmap_set_pgprot(st else prot |= _PAGE_GUARDED; diff --git a/pci/64bit-resource-fix-up-printks-for-resources-in-networks-drivers.patch b/pci/64bit-resource-fix-up-printks-for-resources-in-networks-drivers.patch index e0eb83b971abd..537bc07ad9e19 100644 --- a/pci/64bit-resource-fix-up-printks-for-resources-in-networks-drivers.patch +++ b/pci/64bit-resource-fix-up-printks-for-resources-in-networks-drivers.patch @@ -42,7 +42,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> EL3WINDOW(2); --- gregkh-2.6.orig/drivers/net/8139cp.c +++ gregkh-2.6/drivers/net/8139cp.c -@@ -1728,8 +1728,8 @@ static int cp_init_one (struct pci_dev * +@@ -1883,8 +1883,8 @@ static int cp_init_one (struct pci_dev * } if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) { rc = -EIO; @@ -53,7 +53,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> goto err_out_res; } -@@ -1761,8 +1761,9 @@ static int cp_init_one (struct pci_dev * +@@ -1916,8 +1916,9 @@ static int cp_init_one (struct pci_dev * regs = ioremap(pciaddr, CP_REGS_SIZE); if (!regs) { rc = -EIO; diff --git a/pci/64bit-resource-fix-up-printks-for-resources-in-pci-core-and-hotplug-drivers.patch b/pci/64bit-resource-fix-up-printks-for-resources-in-pci-core-and-hotplug-drivers.patch index 8bec0603581c8..0a8c4262a5451 100644 --- a/pci/64bit-resource-fix-up-printks-for-resources-in-pci-core-and-hotplug-drivers.patch +++ b/pci/64bit-resource-fix-up-printks-for-resources-in-pci-core-and-hotplug-drivers.patch @@ -129,7 +129,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> out += sprintf(out, "Free resources: bus numbers\n"); --- gregkh-2.6.orig/drivers/pci/pci.c +++ gregkh-2.6/drivers/pci/pci.c -@@ -679,10 +679,12 @@ int pci_request_region(struct pci_dev *p +@@ -691,10 +691,12 @@ int pci_request_region(struct pci_dev *p return 0; err_out: @@ -183,7 +183,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if (drv) --- gregkh-2.6.orig/drivers/pci/setup-bus.c +++ gregkh-2.6/drivers/pci/setup-bus.c -@@ -356,8 +356,10 @@ pbus_size_mem(struct pci_bus *bus, unsig +@@ -357,8 +357,10 @@ pbus_size_mem(struct pci_bus *bus, unsig order = __ffs(align) - 20; if (order > 11) { printk(KERN_WARNING "PCI: region %s/%d " @@ -242,7 +242,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } else if (resno < PCI_BRIDGE_RESOURCES) { pci_update_resource(dev, res, resno); } -@@ -173,8 +178,9 @@ pdev_sort_resources(struct pci_dev *dev, +@@ -213,8 +218,9 @@ pdev_sort_resources(struct pci_dev *dev, continue; if (!r_align) { printk(KERN_WARNING "PCI: Ignore bogus resource %d " diff --git a/pci/64bit-resource-fix-up-printks-for-resources-in-sound-drivers.patch b/pci/64bit-resource-fix-up-printks-for-resources-in-sound-drivers.patch index f49f5af461d1c..76fda68c87cf3 100644 --- a/pci/64bit-resource-fix-up-printks-for-resources-in-sound-drivers.patch +++ b/pci/64bit-resource-fix-up-printks-for-resources-in-sound-drivers.patch @@ -110,7 +110,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if ((ret = forte_chip_init (chip)) == 0) --- gregkh-2.6.orig/sound/pci/bt87x.c +++ gregkh-2.6/sound/pci/bt87x.c -@@ -886,8 +886,9 @@ static int __devinit snd_bt87x_probe(str +@@ -888,8 +888,9 @@ static int __devinit snd_bt87x_probe(str strcpy(card->driver, "Bt87x"); sprintf(card->shortname, "Brooktree Bt%x", pci->device); @@ -139,21 +139,21 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if ((err = snd_sonicvibes_pcm(sonic, 0, NULL)) < 0) { --- gregkh-2.6.orig/sound/ppc/pmac.c +++ gregkh-2.6/sound/ppc/pmac.c -@@ -1198,9 +1198,10 @@ int __init snd_pmac_new(struct snd_card +@@ -1170,9 +1170,10 @@ int __init snd_pmac_new(struct snd_card chip->rsrc[i].start + 1, rnames[i]) == NULL) { printk(KERN_ERR "snd: can't request rsrc " - " %d (%s: 0x%08lx:%08lx)\n", - i, rnames[i], chip->rsrc[i].start, - chip->rsrc[i].end); -+ " %d (%s: 0x%016llx:%016llx)\n", ++ " %d (%s: 0x%016lx:%016lx)\n", + i, rnames[i], + (unsigned long long)chip->rsrc[i].start, + (unsigned long long)chip->rsrc[i].end); err = -ENODEV; goto __error; } -@@ -1229,9 +1230,10 @@ int __init snd_pmac_new(struct snd_card +@@ -1201,9 +1202,10 @@ int __init snd_pmac_new(struct snd_card chip->rsrc[i].start + 1, rnames[i]) == NULL) { printk(KERN_ERR "snd: can't request rsrc " diff --git a/pci/fix-pci_get_device-usage-in-mpc85xx.patch b/pci/fix-pci_get_device-usage-in-mpc85xx.patch deleted file mode 100644 index 917bf8eb2f37b..0000000000000 --- a/pci/fix-pci_get_device-usage-in-mpc85xx.patch +++ /dev/null @@ -1,32 +0,0 @@ -From foo@baz Tue Apr 9 12:12:43 2002 -Date: Tue, 6 Jun 2006 16:58:25 -0400 -To: Greg KH <greg@kroah.com> -From: Greg Kroah-Hartman <gregkh@suse.de> -Subject: PCI: fix error with pci_get_device() call in the mpc85xx driver - -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - arch/ppc/platforms/85xx/mpc85xx_cds_common.c | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - ---- gregkh-2.6.orig/arch/ppc/platforms/85xx/mpc85xx_cds_common.c -+++ gregkh-2.6/arch/ppc/platforms/85xx/mpc85xx_cds_common.c -@@ -379,13 +379,12 @@ mpc85xx_cds_pcibios_fixup(void) - PCI_DEVICE_ID_VIA_82C586_2, NULL))) { - dev->irq = 10; - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 10); -- pci_dev_put(dev); -- } - -- if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, -+ if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, - PCI_DEVICE_ID_VIA_82C586_2, dev))) { -- dev->irq = 11; -- pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11); -+ dev->irq = 11; -+ pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11); -+ } - pci_dev_put(dev); - } - } diff --git a/pci/pci-acpi-rename-the-functions-to-avoid-multiple-instances.patch b/pci/pci-acpi-rename-the-functions-to-avoid-multiple-instances.patch deleted file mode 100644 index 84d3fe6ddd702..0000000000000 --- a/pci/pci-acpi-rename-the-functions-to-avoid-multiple-instances.patch +++ /dev/null @@ -1,68 +0,0 @@ -From muthu.lkml@gmail.com Fri Apr 28 00:42:24 2006 -Message-ID: <7da560840604280042q33450573p9b21751c9046500c@mail.gmail.com> -Date: Fri, 28 Apr 2006 00:42:21 -0700 -From: "Muthu Kumar" <muthu.lkml@gmail.com> -To: "Greg KH" <greg@kroah.com> -Subject: PCI ACPI: Rename the functions to avoid multiple instances. -Content-Disposition: inline - -There were two instances of pci_acpi_init(), one in -drivers/pci/pci-acpi.c and another in arch/i386/pci/acpi.c. -Rename the one in pci-acpi.c and make it consistent with -other names in the same file. - -Signed-off-by: Muthukumar R <muthur@gmail.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/pci-acpi.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - ---- gregkh-2.6.orig/drivers/pci/pci-acpi.c -+++ gregkh-2.6/drivers/pci/pci-acpi.c -@@ -267,7 +267,7 @@ static int acpi_pci_set_power_state(stru - - - /* ACPI bus type */ --static int pci_acpi_find_device(struct device *dev, acpi_handle *handle) -+static int acpi_pci_find_device(struct device *dev, acpi_handle *handle) - { - struct pci_dev * pci_dev; - acpi_integer addr; -@@ -281,7 +281,7 @@ static int pci_acpi_find_device(struct d - return 0; - } - --static int pci_acpi_find_root_bridge(struct device *dev, acpi_handle *handle) -+static int acpi_pci_find_root_bridge(struct device *dev, acpi_handle *handle) - { - int num; - unsigned int seg, bus; -@@ -299,21 +299,21 @@ static int pci_acpi_find_root_bridge(str - return 0; - } - --static struct acpi_bus_type pci_acpi_bus = { -+static struct acpi_bus_type acpi_pci_bus = { - .bus = &pci_bus_type, -- .find_device = pci_acpi_find_device, -- .find_bridge = pci_acpi_find_root_bridge, -+ .find_device = acpi_pci_find_device, -+ .find_bridge = acpi_pci_find_root_bridge, - }; - --static int __init pci_acpi_init(void) -+static int __init acpi_pci_init(void) - { - int ret; - -- ret = register_acpi_bus_type(&pci_acpi_bus); -+ ret = register_acpi_bus_type(&acpi_pci_bus); - if (ret) - return 0; - platform_pci_choose_state = acpi_pci_choose_state; - platform_pci_set_power_state = acpi_pci_set_power_state; - return 0; - } --arch_initcall(pci_acpi_init); -+arch_initcall(acpi_pci_init); diff --git a/pci/pci-add-a-enable-sysfs-attribute-to-the-pci-devices-to-allow-userspace-to-enable-devices-without-doing-foul-direct-access.patch b/pci/pci-add-a-enable-sysfs-attribute-to-the-pci-devices-to-allow-userspace-to-enable-devices-without-doing-foul-direct-access.patch deleted file mode 100644 index e9dd33f0e744e..0000000000000 --- a/pci/pci-add-a-enable-sysfs-attribute-to-the-pci-devices-to-allow-userspace-to-enable-devices-without-doing-foul-direct-access.patch +++ /dev/null @@ -1,71 +0,0 @@ -From arjan@linux.intel.com Sat Apr 29 01:59:16 2006 -From: Arjan van de Ven <arjan@linux.intel.com> -Subject: PCI: Add a "enable" sysfs attribute to the pci devices to allow userspace (Xorg) to enable devices without doing foul direct access -To: Andrew Morton <akpm@osdl.org> -Cc: greg@kroah.com, airlied@linux.ie, pjones@redhat.com -Date: Sat, 29 Apr 2006 10:59:08 +0200 -Message-Id: <1146301148.3125.7.camel@laptopd505.fenrus.org> - - -This patch adds an "enable" sysfs attribute to each PCI device. When read it -shows the "enabled-ness" of the device, but you can write a "0" into it to -disable a device, and a "1" to enable it. - -This later is needed for X and other cases where userspace wants to enable -the BARs on a device (typical example: to run the video bios on a secundary -head). Right now X does all this "by hand" via bitbanging, that's just evil. -This allows X to no longer do that but to just let the kernel do this. - -Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> -CC: Peter Jones <pjones@redhat.com> -Acked-by: Dave Airlie <airlied@linux.ie> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/pci-sysfs.c | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - ---- gregkh-2.6.orig/drivers/pci/pci-sysfs.c -+++ gregkh-2.6/drivers/pci/pci-sysfs.c -@@ -43,6 +43,7 @@ pci_config_attr(subsystem_vendor, "0x%04 - pci_config_attr(subsystem_device, "0x%04x\n"); - pci_config_attr(class, "0x%06x\n"); - pci_config_attr(irq, "%u\n"); -+pci_config_attr(is_enabled, "%u\n"); - - static ssize_t local_cpus_show(struct device *dev, - struct device_attribute *attr, char *buf) -@@ -90,6 +91,25 @@ static ssize_t modalias_show(struct devi - (u8)(pci_dev->class >> 16), (u8)(pci_dev->class >> 8), - (u8)(pci_dev->class)); - } -+static ssize_t -+is_enabled_store(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ struct pci_dev *pdev = to_pci_dev(dev); -+ -+ /* this can crash the machine when done on the "wrong" device */ -+ if (!capable(CAP_SYS_ADMIN)) -+ return count; -+ -+ if (*buf == '0') -+ pci_disable_device(pdev); -+ -+ if (*buf == '1') -+ pci_enable_device(pdev); -+ -+ return count; -+} -+ - - struct device_attribute pci_dev_attrs[] = { - __ATTR_RO(resource), -@@ -101,6 +121,7 @@ struct device_attribute pci_dev_attrs[] - __ATTR_RO(irq), - __ATTR_RO(local_cpus), - __ATTR_RO(modalias), -+ __ATTR(enable, 0600, is_enabled_show, is_enabled_store), - __ATTR_NULL, - }; - diff --git a/pci/pci-add-pci_assign_resource_fixed-allow-fixed-address-assignments.patch b/pci/pci-add-pci_assign_resource_fixed-allow-fixed-address-assignments.patch deleted file mode 100644 index f1e00c3d9a06d..0000000000000 --- a/pci/pci-add-pci_assign_resource_fixed-allow-fixed-address-assignments.patch +++ /dev/null @@ -1,88 +0,0 @@ -From owner-linux-pci@atrey.karlin.mff.cuni.cz Mon May 1 08:47:15 2006 -Date: Mon, 1 May 2006 10:43:46 -0500 (CDT) -From: Kumar Gala <galak@kernel.crashing.org> -To: Andrew Morton <akpm@osdl.org> -Cc: greg@kroah.com -Subject: PCI: Add pci_assign_resource_fixed -- allow fixed address assignments -Message-ID: <Pine.LNX.4.44.0605011043270.11156-100000@gate.crashing.org> - -PCI: Add pci_assign_resource_fixed -- allow fixed address assignments - -On some embedded systems the PCI address for hotplug devices are not only -known a priori but are required to be at a given PCI address for other -master in the system to be able to access. - -An example of such a system would be an FPGA which is setup from user space -after the system has booted. The FPGA may be access by DSPs in the system -and those DSPs expect the FPGA at a fixed PCI address. - -Added pci_assign_resource_fixed() as a way to allow assignment of the PCI -devices's BARs at fixed PCI addresses. - -Signed-off-by: Kumar Gala <galak@kernel.crashing.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/setup-res.c | 40 ++++++++++++++++++++++++++++++++++++++++ - include/linux/pci.h | 1 + - 2 files changed, 41 insertions(+) - ---- gregkh-2.6.orig/drivers/pci/setup-res.c -+++ gregkh-2.6/drivers/pci/setup-res.c -@@ -160,6 +160,46 @@ int pci_assign_resource(struct pci_dev * - return ret; - } - -+#ifdef CONFIG_EMBEDDED -+int pci_assign_resource_fixed(struct pci_dev *dev, int resno) -+{ -+ struct pci_bus *bus = dev->bus; -+ struct resource *res = dev->resource + resno; -+ unsigned int type_mask; -+ int i, ret = -EBUSY; -+ -+ type_mask = IORESOURCE_IO | IORESOURCE_MEM | IORESOURCE_PREFETCH; -+ -+ for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { -+ struct resource *r = bus->resource[i]; -+ if (!r) -+ continue; -+ -+ /* type_mask must match */ -+ if ((res->flags ^ r->flags) & type_mask) -+ continue; -+ -+ ret = request_resource(r, res); -+ -+ if (ret == 0) -+ break; -+ } -+ -+ if (ret) { -+ printk(KERN_ERR "PCI: Failed to allocate %s resource " -+ "#%d:%llx@%llx for %s\n", -+ res->flags & IORESOURCE_IO ? "I/O" : "mem", -+ resno, (unsigned long long)(res->end - res->start + 1), -+ (unsigned long long)res->start, pci_name(dev)); -+ } else if (resno < PCI_BRIDGE_RESOURCES) { -+ pci_update_resource(dev, res, resno); -+ } -+ -+ return ret; -+} -+EXPORT_SYMBOL_GPL(pci_assign_resource_fixed); -+#endif -+ - /* Sort resources by alignment */ - void __devinit - pdev_sort_resources(struct pci_dev *dev, struct resource_list *head) ---- gregkh-2.6.orig/include/linux/pci.h -+++ gregkh-2.6/include/linux/pci.h -@@ -497,6 +497,7 @@ int pci_set_dma_mask(struct pci_dev *dev - int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); - void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); - int pci_assign_resource(struct pci_dev *dev, int i); -+int pci_assign_resource_fixed(struct pci_dev *dev, int i); - void pci_restore_bars(struct pci_dev *dev); - int pci_select_bars(struct pci_dev *dev, unsigned long flags); - diff --git a/pci/pci-add-pci_cap_id_vndr.patch b/pci/pci-add-pci_cap_id_vndr.patch deleted file mode 100644 index 5ac04dff574d9..0000000000000 --- a/pci/pci-add-pci_cap_id_vndr.patch +++ /dev/null @@ -1,31 +0,0 @@ -From akpm@osdl.org Tue May 9 10:49:33 2006 -Message-Id: <200605091749.k49HnRbn016281@shell0.pdx.osdl.net> -From: Brice Goglin <brice@myri.com> -Subject: PCI: Add PCI_CAP_ID_VNDR -To: brice@myri.com, greg@kroah.com, mm-commits@vger.kernel.org -From: akpm@osdl.org -Date: Tue, 9 May 2006 10:52:09 -0700 - -From: Brice Goglin <brice@myri.com> - -Add the vendor-specific extended capability PCI_CAP_ID_VNDR. It will be -used by the Myri-10G Ethernet driver (will be submitted soon). - -Signed-off-by: Brice Goglin <brice@myri.com> -Signed-off-by: Andrew Morton <akpm@osdl.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - include/linux/pci_regs.h | 1 + - 1 file changed, 1 insertion(+) - ---- gregkh-2.6.orig/include/linux/pci_regs.h -+++ gregkh-2.6/include/linux/pci_regs.h -@@ -197,6 +197,7 @@ - #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ - #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ - #define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */ -+#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */ - #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ - #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ - #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ diff --git a/pci/pci-allow-msi-to-work-on-kexec-kernel.patch b/pci/pci-allow-msi-to-work-on-kexec-kernel.patch deleted file mode 100644 index 922c97596c255..0000000000000 --- a/pci/pci-allow-msi-to-work-on-kexec-kernel.patch +++ /dev/null @@ -1,45 +0,0 @@ -From owner-linux-pci@atrey.karlin.mff.cuni.cz Tue May 23 10:16:46 2006 -Date: Tue, 23 May 2006 10:14:36 -0700 -From: Rajesh Shah <rajesh.shah@intel.com> -To: gregkh@suse.de, <ak@suse.de> -Subject: PCI: Allow MSI to work on kexec kernel -Message-ID: <20060523101436.A25249@unix-os.sc.intel.com> -Content-Disposition: inline - -We recently ran into a problem where the e1000 device failed to -work properly on the kexec kernel. MSI was enabled for the -device in the main kernel when it crashed. The e1000 driver -tried to enable MSI on the kexec kernel, but the code bailed -early when it found that MSI was already enabled in the hardware, -even though the software state was not properly set up in the -kexec'd kernel. This patch fixes the problem by moving the -early return to after making sure that the software state -is properly initialized. - -Signed-off-by: Rajesh Shah <rajesh.shah@intel.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/msi.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - ---- gregkh-2.6.orig/drivers/pci/msi.c -+++ gregkh-2.6/drivers/pci/msi.c -@@ -940,14 +940,13 @@ int pci_enable_msi(struct pci_dev* dev) - if (!pos) - return -EINVAL; - -- pci_read_config_word(dev, msi_control_reg(pos), &control); -- if (control & PCI_MSI_FLAGS_ENABLE) -- return 0; /* Already in MSI mode */ -- - if (!msi_lookup_vector(dev, PCI_CAP_ID_MSI)) { - /* Lookup Sucess */ - unsigned long flags; - -+ pci_read_config_word(dev, msi_control_reg(pos), &control); -+ if (control & PCI_MSI_FLAGS_ENABLE) -+ return 0; /* Already in MSI mode */ - spin_lock_irqsave(&msi_lock, flags); - if (!vector_irq[dev->irq]) { - msi_desc[dev->irq]->msi_attrib.state = 0; diff --git a/pci/pci-altix-msi-support.patch b/pci/pci-altix-msi-support.patch deleted file mode 100644 index cce0333d71ae9..0000000000000 --- a/pci/pci-altix-msi-support.patch +++ /dev/null @@ -1,1000 +0,0 @@ -From maule@sgi.com Fri Apr 14 14:11:32 2006 -Date: Fri, 14 Apr 2006 16:03:54 -0500 (CDT) -From: Mark Maule <maule@sgi.com> -To: gregkh@suse.de -Cc: Mark Maule <maule@sgi.com> -Message-Id: <20060414210354.10934.41057.73078@attica.americas.sgi.com> -Subject: PCI: altix: msi support - -MSI callouts for altix. Involves a fair amount of code reorg in sn irq.c -code as well as adding some extensions to the altix PCI provider abstaction. - -Signed-off-by: Mark Maule <maule@sgi.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - arch/ia64/sn/kernel/io_init.c | 9 - - arch/ia64/sn/kernel/irq.c | 143 +++++++++++--------- - arch/ia64/sn/pci/pci_dma.c | 10 - - arch/ia64/sn/pci/pcibr/pcibr_dma.c | 62 ++++++-- - arch/ia64/sn/pci/tioca_provider.c | 8 + - arch/ia64/sn/pci/tioce_provider.c | 65 ++++++--- - drivers/pci/msi-altix.c | 200 ++++++++++++++++++++++++++++- - include/asm-ia64/sn/intr.h | 8 + - include/asm-ia64/sn/pcibr_provider.h | 5 - include/asm-ia64/sn/pcibus_provider_defs.h | 17 ++ - include/asm-ia64/sn/tiocp.h | 3 - 11 files changed, 405 insertions(+), 125 deletions(-) - ---- gregkh-2.6.orig/arch/ia64/sn/kernel/io_init.c -+++ gregkh-2.6/arch/ia64/sn/kernel/io_init.c -@@ -58,7 +58,7 @@ static int max_pcibus_number = 255; /* D - */ - - static dma_addr_t --sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size) -+sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size, int type) - { - return 0; - } -@@ -457,13 +457,6 @@ void sn_pci_fixup_slot(struct pci_dev *d - pcidev_info->pdi_sn_irq_info = NULL; - kfree(sn_irq_info); - } -- -- /* -- * MSI currently not supported on altix. Remove this when -- * the MSI abstraction patches are integrated into the kernel -- * (sometime after 2.6.16 releases) -- */ -- dev->no_msi = 1; - } - - /* ---- gregkh-2.6.orig/arch/ia64/sn/kernel/irq.c -+++ gregkh-2.6/arch/ia64/sn/kernel/irq.c -@@ -26,11 +26,11 @@ static void unregister_intr_pda(struct s - - int sn_force_interrupt_flag = 1; - extern int sn_ioif_inited; --static struct list_head **sn_irq_lh; -+struct list_head **sn_irq_lh; - static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */ - --static inline u64 sn_intr_alloc(nasid_t local_nasid, int local_widget, -- u64 sn_irq_info, -+u64 sn_intr_alloc(nasid_t local_nasid, int local_widget, -+ struct sn_irq_info *sn_irq_info, - int req_irq, nasid_t req_nasid, - int req_slice) - { -@@ -40,12 +40,13 @@ static inline u64 sn_intr_alloc(nasid_t - - SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_INTERRUPT, - (u64) SAL_INTR_ALLOC, (u64) local_nasid, -- (u64) local_widget, (u64) sn_irq_info, (u64) req_irq, -+ (u64) local_widget, __pa(sn_irq_info), (u64) req_irq, - (u64) req_nasid, (u64) req_slice); -+ - return ret_stuff.status; - } - --static inline void sn_intr_free(nasid_t local_nasid, int local_widget, -+void sn_intr_free(nasid_t local_nasid, int local_widget, - struct sn_irq_info *sn_irq_info) - { - struct ia64_sal_retval ret_stuff; -@@ -112,73 +113,91 @@ static void sn_end_irq(unsigned int irq) - - static void sn_irq_info_free(struct rcu_head *head); - --static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) -+struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *sn_irq_info, -+ nasid_t nasid, int slice) - { -- struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; -- int cpuid, cpuphys; -+ int vector; -+ int cpuphys; -+ int64_t bridge; -+ int local_widget, status; -+ nasid_t local_nasid; -+ struct sn_irq_info *new_irq_info; -+ struct sn_pcibus_provider *pci_provider; - -- cpuid = first_cpu(mask); -- cpuphys = cpu_physical_id(cpuid); -+ new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); -+ if (new_irq_info == NULL) -+ return NULL; -+ -+ memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info)); -+ -+ bridge = (u64) new_irq_info->irq_bridge; -+ if (!bridge) { -+ kfree(new_irq_info); -+ return NULL; /* irq is not a device interrupt */ -+ } - -- list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, -- sn_irq_lh[irq], list) { -- u64 bridge; -- int local_widget, status; -- nasid_t local_nasid; -- struct sn_irq_info *new_irq_info; -- struct sn_pcibus_provider *pci_provider; -- -- new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); -- if (new_irq_info == NULL) -- break; -- memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info)); -- -- bridge = (u64) new_irq_info->irq_bridge; -- if (!bridge) { -- kfree(new_irq_info); -- break; /* irq is not a device interrupt */ -- } -+ local_nasid = NASID_GET(bridge); - -- local_nasid = NASID_GET(bridge); -+ if (local_nasid & 1) -+ local_widget = TIO_SWIN_WIDGETNUM(bridge); -+ else -+ local_widget = SWIN_WIDGETNUM(bridge); -+ -+ vector = sn_irq_info->irq_irq; -+ /* Free the old PROM new_irq_info structure */ -+ sn_intr_free(local_nasid, local_widget, new_irq_info); -+ /* Update kernels new_irq_info with new target info */ -+ unregister_intr_pda(new_irq_info); -+ -+ /* allocate a new PROM new_irq_info struct */ -+ status = sn_intr_alloc(local_nasid, local_widget, -+ new_irq_info, vector, -+ nasid, slice); -+ -+ /* SAL call failed */ -+ if (status) { -+ kfree(new_irq_info); -+ return NULL; -+ } - -- if (local_nasid & 1) -- local_widget = TIO_SWIN_WIDGETNUM(bridge); -- else -- local_widget = SWIN_WIDGETNUM(bridge); -- -- /* Free the old PROM new_irq_info structure */ -- sn_intr_free(local_nasid, local_widget, new_irq_info); -- /* Update kernels new_irq_info with new target info */ -- unregister_intr_pda(new_irq_info); -- -- /* allocate a new PROM new_irq_info struct */ -- status = sn_intr_alloc(local_nasid, local_widget, -- __pa(new_irq_info), irq, -- cpuid_to_nasid(cpuid), -- cpuid_to_slice(cpuid)); -- -- /* SAL call failed */ -- if (status) { -- kfree(new_irq_info); -- break; -- } -+ cpuphys = nasid_slice_to_cpuid(nasid, slice); -+ new_irq_info->irq_cpuid = cpuphys; -+ register_intr_pda(new_irq_info); - -- new_irq_info->irq_cpuid = cpuid; -- register_intr_pda(new_irq_info); -+ pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type]; - -- pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type]; -- if (pci_provider && pci_provider->target_interrupt) -- (pci_provider->target_interrupt)(new_irq_info); -- -- spin_lock(&sn_irq_info_lock); -- list_replace_rcu(&sn_irq_info->list, &new_irq_info->list); -- spin_unlock(&sn_irq_info_lock); -- call_rcu(&sn_irq_info->rcu, sn_irq_info_free); -+ /* -+ * If this represents a line interrupt, target it. If it's -+ * an msi (irq_int_bit < 0), it's already targeted. -+ */ -+ if (new_irq_info->irq_int_bit >= 0 && -+ pci_provider && pci_provider->target_interrupt) -+ (pci_provider->target_interrupt)(new_irq_info); -+ -+ spin_lock(&sn_irq_info_lock); -+ list_replace_rcu(&sn_irq_info->list, &new_irq_info->list); -+ spin_unlock(&sn_irq_info_lock); -+ call_rcu(&sn_irq_info->rcu, sn_irq_info_free); - - #ifdef CONFIG_SMP -- set_irq_affinity_info((irq & 0xff), cpuphys, 0); -+ set_irq_affinity_info((vector & 0xff), cpuphys, 0); - #endif -- } -+ -+ return new_irq_info; -+} -+ -+static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) -+{ -+ struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; -+ nasid_t nasid; -+ int slice; -+ -+ nasid = cpuid_to_nasid(first_cpu(mask)); -+ slice = cpuid_to_slice(first_cpu(mask)); -+ -+ list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, -+ sn_irq_lh[irq], list) -+ (void)sn_retarget_vector(sn_irq_info, nasid, slice); - } - - struct hw_interrupt_type irq_type_sn = { ---- gregkh-2.6.orig/arch/ia64/sn/pci/pci_dma.c -+++ gregkh-2.6/arch/ia64/sn/pci/pci_dma.c -@@ -11,7 +11,7 @@ - - #include <linux/module.h> - #include <asm/dma.h> --#include <asm/sn/pcibr_provider.h> -+#include <asm/sn/intr.h> - #include <asm/sn/pcibus_provider_defs.h> - #include <asm/sn/pcidev.h> - #include <asm/sn/sn_sal.h> -@@ -113,7 +113,8 @@ void *sn_dma_alloc_coherent(struct devic - * resources. - */ - -- *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size); -+ *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size, -+ SN_DMA_ADDR_PHYS); - if (!*dma_handle) { - printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); - free_pages((unsigned long)cpuaddr, get_order(size)); -@@ -176,7 +177,7 @@ dma_addr_t sn_dma_map_single(struct devi - BUG_ON(dev->bus != &pci_bus_type); - - phys_addr = __pa(cpu_addr); -- dma_addr = provider->dma_map(pdev, phys_addr, size); -+ dma_addr = provider->dma_map(pdev, phys_addr, size, SN_DMA_ADDR_PHYS); - if (!dma_addr) { - printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); - return 0; -@@ -260,7 +261,8 @@ int sn_dma_map_sg(struct device *dev, st - for (i = 0; i < nhwentries; i++, sg++) { - phys_addr = SG_ENT_PHYS_ADDRESS(sg); - sg->dma_address = provider->dma_map(pdev, -- phys_addr, sg->length); -+ phys_addr, sg->length, -+ SN_DMA_ADDR_PHYS); - - if (!sg->dma_address) { - printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); ---- gregkh-2.6.orig/arch/ia64/sn/pci/pcibr/pcibr_dma.c -+++ gregkh-2.6/arch/ia64/sn/pci/pcibr/pcibr_dma.c -@@ -41,7 +41,7 @@ extern int sn_ioif_inited; - - static dma_addr_t - pcibr_dmamap_ate32(struct pcidev_info *info, -- u64 paddr, size_t req_size, u64 flags) -+ u64 paddr, size_t req_size, u64 flags, int dma_flags) - { - - struct pcidev_info *pcidev_info = info->pdi_host_pcidev_info; -@@ -81,9 +81,12 @@ pcibr_dmamap_ate32(struct pcidev_info *i - if (IS_PCIX(pcibus_info)) - ate_flags &= ~(PCI32_ATE_PREF); - -- xio_addr = -- IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : -- PHYS_TO_TIODMA(paddr); -+ if (SN_DMA_ADDRTYPE(dma_flags == SN_DMA_ADDR_PHYS)) -+ xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : -+ PHYS_TO_TIODMA(paddr); -+ else -+ xio_addr = paddr; -+ - offset = IOPGOFF(xio_addr); - ate = ate_flags | (xio_addr - offset); - -@@ -91,6 +94,13 @@ pcibr_dmamap_ate32(struct pcidev_info *i - if (IS_PIC_SOFT(pcibus_info)) { - ate |= (pcibus_info->pbi_hub_xid << PIC_ATE_TARGETID_SHFT); - } -+ -+ /* -+ * If we're mapping for MSI, set the MSI bit in the ATE -+ */ -+ if (dma_flags & SN_DMA_MSI) -+ ate |= PCI32_ATE_MSI; -+ - ate_write(pcibus_info, ate_index, ate_count, ate); - - /* -@@ -105,20 +115,27 @@ pcibr_dmamap_ate32(struct pcidev_info *i - if (pcibus_info->pbi_devreg[internal_device] & PCIBR_DEV_SWAP_DIR) - ATE_SWAP_ON(pci_addr); - -+ - return pci_addr; - } - - static dma_addr_t - pcibr_dmatrans_direct64(struct pcidev_info * info, u64 paddr, -- u64 dma_attributes) -+ u64 dma_attributes, int dma_flags) - { - struct pcibus_info *pcibus_info = (struct pcibus_info *) - ((info->pdi_host_pcidev_info)->pdi_pcibus_info); - u64 pci_addr; - - /* Translate to Crosstalk View of Physical Address */ -- pci_addr = (IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : -- PHYS_TO_TIODMA(paddr)) | dma_attributes; -+ if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) -+ pci_addr = IS_PIC_SOFT(pcibus_info) ? -+ PHYS_TO_DMA(paddr) : -+ PHYS_TO_TIODMA(paddr) | dma_attributes; -+ else -+ pci_addr = IS_PIC_SOFT(pcibus_info) ? -+ paddr : -+ paddr | dma_attributes; - - /* Handle Bus mode */ - if (IS_PCIX(pcibus_info)) -@@ -130,7 +147,9 @@ pcibr_dmatrans_direct64(struct pcidev_in - ((u64) pcibus_info-> - pbi_hub_xid << PIC_PCI64_ATTR_TARG_SHFT); - } else -- pci_addr |= TIOCP_PCI64_CMDTYPE_MEM; -+ pci_addr |= (dma_flags & SN_DMA_MSI) ? -+ TIOCP_PCI64_CMDTYPE_MSI : -+ TIOCP_PCI64_CMDTYPE_MEM; - - /* If PCI mode, func zero uses VCHAN0, every other func uses VCHAN1 */ - if (!IS_PCIX(pcibus_info) && PCI_FUNC(info->pdi_linux_pcidev->devfn)) -@@ -141,7 +160,7 @@ pcibr_dmatrans_direct64(struct pcidev_in - - static dma_addr_t - pcibr_dmatrans_direct32(struct pcidev_info * info, -- u64 paddr, size_t req_size, u64 flags) -+ u64 paddr, size_t req_size, u64 flags, int dma_flags) - { - struct pcidev_info *pcidev_info = info->pdi_host_pcidev_info; - struct pcibus_info *pcibus_info = (struct pcibus_info *)pcidev_info-> -@@ -156,8 +175,14 @@ pcibr_dmatrans_direct32(struct pcidev_in - return 0; - } - -- xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : -- PHYS_TO_TIODMA(paddr); -+ if (dma_flags & SN_DMA_MSI) -+ return 0; -+ -+ if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) -+ xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : -+ PHYS_TO_TIODMA(paddr); -+ else -+ xio_addr = paddr; - - xio_base = pcibus_info->pbi_dir_xbase; - offset = xio_addr - xio_base; -@@ -327,7 +352,7 @@ void sn_dma_flush(u64 addr) - */ - - dma_addr_t --pcibr_dma_map(struct pci_dev * hwdev, unsigned long phys_addr, size_t size) -+pcibr_dma_map(struct pci_dev * hwdev, unsigned long phys_addr, size_t size, int dma_flags) - { - dma_addr_t dma_handle; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); -@@ -344,11 +369,11 @@ pcibr_dma_map(struct pci_dev * hwdev, un - */ - - dma_handle = pcibr_dmatrans_direct64(pcidev_info, phys_addr, -- PCI64_ATTR_PREF); -+ PCI64_ATTR_PREF, dma_flags); - } else { - /* Handle 32-63 bit cards via direct mapping */ - dma_handle = pcibr_dmatrans_direct32(pcidev_info, phys_addr, -- size, 0); -+ size, 0, dma_flags); - if (!dma_handle) { - /* - * It is a 32 bit card and we cannot do direct mapping, -@@ -356,7 +381,8 @@ pcibr_dma_map(struct pci_dev * hwdev, un - */ - - dma_handle = pcibr_dmamap_ate32(pcidev_info, phys_addr, -- size, PCI32_ATE_PREF); -+ size, PCI32_ATE_PREF, -+ dma_flags); - } - } - -@@ -365,18 +391,18 @@ pcibr_dma_map(struct pci_dev * hwdev, un - - dma_addr_t - pcibr_dma_map_consistent(struct pci_dev * hwdev, unsigned long phys_addr, -- size_t size) -+ size_t size, int dma_flags) - { - dma_addr_t dma_handle; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - - if (hwdev->dev.coherent_dma_mask == ~0UL) { - dma_handle = pcibr_dmatrans_direct64(pcidev_info, phys_addr, -- PCI64_ATTR_BAR); -+ PCI64_ATTR_BAR, dma_flags); - } else { - dma_handle = (dma_addr_t) pcibr_dmamap_ate32(pcidev_info, - phys_addr, size, -- PCI32_ATE_BAR); -+ PCI32_ATE_BAR, dma_flags); - } - - return dma_handle; ---- gregkh-2.6.orig/arch/ia64/sn/pci/tioca_provider.c -+++ gregkh-2.6/arch/ia64/sn/pci/tioca_provider.c -@@ -515,11 +515,17 @@ tioca_dma_unmap(struct pci_dev *pdev, dm - * use the GART mapped mode. - */ - static u64 --tioca_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count) -+tioca_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags) - { - u64 mapaddr; - - /* -+ * Not supported for now ... -+ */ -+ if (dma_flags & SN_DMA_MSI) -+ return 0; -+ -+ /* - * If card is 64 or 48 bit addresable, use a direct mapping. 32 - * bit direct is so restrictive w.r.t. where the memory resides that - * we don't use it even though CA has some support. ---- gregkh-2.6.orig/arch/ia64/sn/pci/tioce_provider.c -+++ gregkh-2.6/arch/ia64/sn/pci/tioce_provider.c -@@ -170,7 +170,8 @@ tioce_mmr_war_post(struct tioce_kernel * - (ATE_PAGE((start)+(len)-1, pagesize) - ATE_PAGE(start, pagesize) + 1) - - #define ATE_VALID(ate) ((ate) & (1UL << 63)) --#define ATE_MAKE(addr, ps) (((addr) & ~ATE_PAGEMASK(ps)) | (1UL << 63)) -+#define ATE_MAKE(addr, ps, msi) \ -+ (((addr) & ~ATE_PAGEMASK(ps)) | (1UL << 63) | ((msi)?(1UL << 62):0)) - - /* - * Flavors of ate-based mapping supported by tioce_alloc_map() -@@ -196,15 +197,17 @@ tioce_mmr_war_post(struct tioce_kernel * - * - * 63 - must be 1 to indicate d64 mode to CE hardware - * 62 - barrier bit ... controlled with tioce_dma_barrier() -- * 61 - 0 since this is not an MSI transaction -+ * 61 - msi bit ... specified through dma_flags - * 60:54 - reserved, MBZ - */ - static u64 --tioce_dma_d64(unsigned long ct_addr) -+tioce_dma_d64(unsigned long ct_addr, int dma_flags) - { - u64 bus_addr; - - bus_addr = ct_addr | (1UL << 63); -+ if (dma_flags & SN_DMA_MSI) -+ bus_addr |= (1UL << 61); - - return bus_addr; - } -@@ -261,7 +264,7 @@ pcidev_to_tioce(struct pci_dev *pdev, st - */ - static u64 - tioce_alloc_map(struct tioce_kernel *ce_kern, int type, int port, -- u64 ct_addr, int len) -+ u64 ct_addr, int len, int dma_flags) - { - int i; - int j; -@@ -270,6 +273,7 @@ tioce_alloc_map(struct tioce_kernel *ce_ - int entries; - int nates; - u64 pagesize; -+ int msi_capable, msi_wanted; - u64 *ate_shadow; - u64 *ate_reg; - u64 addr; -@@ -291,6 +295,7 @@ tioce_alloc_map(struct tioce_kernel *ce_ - ate_reg = ce_mmr->ce_ure_ate3240; - pagesize = ce_kern->ce_ate3240_pagesize; - bus_base = TIOCE_M32_MIN; -+ msi_capable = 1; - break; - case TIOCE_ATE_M40: - first = 0; -@@ -299,6 +304,7 @@ tioce_alloc_map(struct tioce_kernel *ce_ - ate_reg = ce_mmr->ce_ure_ate40; - pagesize = MB(64); - bus_base = TIOCE_M40_MIN; -+ msi_capable = 0; - break; - case TIOCE_ATE_M40S: - /* -@@ -311,11 +317,16 @@ tioce_alloc_map(struct tioce_kernel *ce_ - ate_reg = ce_mmr->ce_ure_ate3240; - pagesize = GB(16); - bus_base = TIOCE_M40S_MIN; -+ msi_capable = 0; - break; - default: - return 0; - } - -+ msi_wanted = dma_flags & SN_DMA_MSI; -+ if (msi_wanted && !msi_capable) -+ return 0; -+ - nates = ATE_NPAGES(ct_addr, len, pagesize); - if (nates > entries) - return 0; -@@ -344,7 +355,7 @@ tioce_alloc_map(struct tioce_kernel *ce_ - for (j = 0; j < nates; j++) { - u64 ate; - -- ate = ATE_MAKE(addr, pagesize); -+ ate = ATE_MAKE(addr, pagesize, msi_wanted); - ate_shadow[i + j] = ate; - tioce_mmr_storei(ce_kern, &ate_reg[i + j], ate); - addr += pagesize; -@@ -371,7 +382,7 @@ tioce_alloc_map(struct tioce_kernel *ce_ - * Map @paddr into 32-bit bus space of the CE associated with @pcidev_info. - */ - static u64 --tioce_dma_d32(struct pci_dev *pdev, u64 ct_addr) -+tioce_dma_d32(struct pci_dev *pdev, u64 ct_addr, int dma_flags) - { - int dma_ok; - int port; -@@ -381,6 +392,9 @@ tioce_dma_d32(struct pci_dev *pdev, u64 - u64 ct_lower; - dma_addr_t bus_addr; - -+ if (dma_flags & SN_DMA_MSI) -+ return 0; -+ - ct_upper = ct_addr & ~0x3fffffffUL; - ct_lower = ct_addr & 0x3fffffffUL; - -@@ -507,7 +521,7 @@ tioce_dma_unmap(struct pci_dev *pdev, dm - */ - static u64 - tioce_do_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count, -- int barrier) -+ int barrier, int dma_flags) - { - unsigned long flags; - u64 ct_addr; -@@ -523,15 +537,18 @@ tioce_do_dma_map(struct pci_dev *pdev, u - if (dma_mask < 0x7fffffffUL) - return 0; - -- ct_addr = PHYS_TO_TIODMA(paddr); -+ if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) -+ ct_addr = PHYS_TO_TIODMA(paddr); -+ else -+ ct_addr = paddr; - - /* - * If the device can generate 64 bit addresses, create a D64 map. -- * Since this should never fail, bypass the rest of the checks. - */ - if (dma_mask == ~0UL) { -- mapaddr = tioce_dma_d64(ct_addr); -- goto dma_map_done; -+ mapaddr = tioce_dma_d64(ct_addr, dma_flags); -+ if (mapaddr) -+ goto dma_map_done; - } - - pcidev_to_tioce(pdev, NULL, &ce_kern, &port); -@@ -574,18 +591,22 @@ tioce_do_dma_map(struct pci_dev *pdev, u - - if (byte_count > MB(64)) { - mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40S, -- port, ct_addr, byte_count); -+ port, ct_addr, byte_count, -+ dma_flags); - if (!mapaddr) - mapaddr = - tioce_alloc_map(ce_kern, TIOCE_ATE_M40, -1, -- ct_addr, byte_count); -+ ct_addr, byte_count, -+ dma_flags); - } else { - mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40, -1, -- ct_addr, byte_count); -+ ct_addr, byte_count, -+ dma_flags); - if (!mapaddr) - mapaddr = - tioce_alloc_map(ce_kern, TIOCE_ATE_M40S, -- port, ct_addr, byte_count); -+ port, ct_addr, byte_count, -+ dma_flags); - } - } - -@@ -593,7 +614,7 @@ tioce_do_dma_map(struct pci_dev *pdev, u - * 32-bit direct is the next mode to try - */ - if (!mapaddr && dma_mask >= 0xffffffffUL) -- mapaddr = tioce_dma_d32(pdev, ct_addr); -+ mapaddr = tioce_dma_d32(pdev, ct_addr, dma_flags); - - /* - * Last resort, try 32-bit ATE-based map. -@@ -601,7 +622,7 @@ tioce_do_dma_map(struct pci_dev *pdev, u - if (!mapaddr) - mapaddr = - tioce_alloc_map(ce_kern, TIOCE_ATE_M32, -1, ct_addr, -- byte_count); -+ byte_count, dma_flags); - - spin_unlock_irqrestore(&ce_kern->ce_lock, flags); - -@@ -622,9 +643,9 @@ dma_map_done: - * in the address. - */ - static u64 --tioce_dma(struct pci_dev *pdev, u64 paddr, size_t byte_count) -+tioce_dma(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags) - { -- return tioce_do_dma_map(pdev, paddr, byte_count, 0); -+ return tioce_do_dma_map(pdev, paddr, byte_count, 0, dma_flags); - } - - /** -@@ -636,9 +657,9 @@ tioce_dma(struct pci_dev *pdev, u64 padd - * Simply call tioce_do_dma_map() to create a map with the barrier bit set - * in the address. - */ static u64 --tioce_dma_consistent(struct pci_dev *pdev, u64 paddr, size_t byte_count) -+tioce_dma_consistent(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags) - { -- return tioce_do_dma_map(pdev, paddr, byte_count, 1); -+ return tioce_do_dma_map(pdev, paddr, byte_count, 1, dma_flags); - } - - /** -@@ -696,7 +717,7 @@ tioce_reserve_m32(struct tioce_kernel *c - while (ate_index <= last_ate) { - u64 ate; - -- ate = ATE_MAKE(0xdeadbeef, ps); -+ ate = ATE_MAKE(0xdeadbeef, ps, 0); - ce_kern->ce_ate3240_shadow[ate_index] = ate; - tioce_mmr_storei(ce_kern, &ce_mmr->ce_ure_ate3240[ate_index], - ate); ---- gregkh-2.6.orig/drivers/pci/msi-altix.c -+++ gregkh-2.6/drivers/pci/msi-altix.c -@@ -6,13 +6,205 @@ - * Copyright (C) 2006 Silicon Graphics, Inc. All Rights Reserved. - */ - --#include <asm/errno.h> -+#include <linux/types.h> -+#include <linux/pci.h> -+#include <linux/cpumask.h> -+ -+#include <asm/sn/addrs.h> -+#include <asm/sn/intr.h> -+#include <asm/sn/pcibus_provider_defs.h> -+#include <asm/sn/pcidev.h> -+#include <asm/sn/nodepda.h> -+ -+#include "msi.h" -+ -+struct sn_msi_info { -+ u64 pci_addr; -+ struct sn_irq_info *sn_irq_info; -+}; -+ -+static struct sn_msi_info *sn_msi_info; -+ -+static void -+sn_msi_teardown(unsigned int vector) -+{ -+ nasid_t nasid; -+ int widget; -+ struct pci_dev *pdev; -+ struct pcidev_info *sn_pdev; -+ struct sn_irq_info *sn_irq_info; -+ struct pcibus_bussoft *bussoft; -+ struct sn_pcibus_provider *provider; -+ -+ sn_irq_info = sn_msi_info[vector].sn_irq_info; -+ if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) -+ return; -+ -+ sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; -+ pdev = sn_pdev->pdi_linux_pcidev; -+ provider = SN_PCIDEV_BUSPROVIDER(pdev); -+ -+ (*provider->dma_unmap)(pdev, -+ sn_msi_info[vector].pci_addr, -+ PCI_DMA_FROMDEVICE); -+ sn_msi_info[vector].pci_addr = 0; -+ -+ bussoft = SN_PCIDEV_BUSSOFT(pdev); -+ nasid = NASID_GET(bussoft->bs_base); -+ widget = (nasid & 1) ? -+ TIO_SWIN_WIDGETNUM(bussoft->bs_base) : -+ SWIN_WIDGETNUM(bussoft->bs_base); -+ -+ sn_intr_free(nasid, widget, sn_irq_info); -+ sn_msi_info[vector].sn_irq_info = NULL; -+ -+ return; -+} - - int --sn_msi_init(void) -+sn_msi_setup(struct pci_dev *pdev, unsigned int vector, -+ u32 *addr_hi, u32 *addr_lo, u32 *data) - { -+ int widget; -+ int status; -+ nasid_t nasid; -+ u64 bus_addr; -+ struct sn_irq_info *sn_irq_info; -+ struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(pdev); -+ struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); -+ -+ if (bussoft == NULL) -+ return -EINVAL; -+ -+ if (provider == NULL || provider->dma_map_consistent == NULL) -+ return -EINVAL; -+ -+ /* -+ * Set up the vector plumbing. Let the prom (via sn_intr_alloc) -+ * decide which cpu to direct this msi at by default. -+ */ -+ -+ nasid = NASID_GET(bussoft->bs_base); -+ widget = (nasid & 1) ? -+ TIO_SWIN_WIDGETNUM(bussoft->bs_base) : -+ SWIN_WIDGETNUM(bussoft->bs_base); -+ -+ sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL); -+ if (! sn_irq_info) -+ return -ENOMEM; -+ -+ status = sn_intr_alloc(nasid, widget, sn_irq_info, vector, -1, -1); -+ if (status) { -+ kfree(sn_irq_info); -+ return -ENOMEM; -+ } -+ -+ sn_irq_info->irq_int_bit = -1; /* mark this as an MSI irq */ -+ sn_irq_fixup(pdev, sn_irq_info); -+ -+ /* Prom probably should fill these in, but doesn't ... */ -+ sn_irq_info->irq_bridge_type = bussoft->bs_asic_type; -+ sn_irq_info->irq_bridge = (void *)bussoft->bs_base; -+ - /* -- * return error until MSI is supported on altix platforms -+ * Map the xio address into bus space - */ -- return -EINVAL; -+ bus_addr = (*provider->dma_map_consistent)(pdev, -+ sn_irq_info->irq_xtalkaddr, -+ sizeof(sn_irq_info->irq_xtalkaddr), -+ SN_DMA_MSI|SN_DMA_ADDR_XIO); -+ if (! bus_addr) { -+ sn_intr_free(nasid, widget, sn_irq_info); -+ kfree(sn_irq_info); -+ return -ENOMEM; -+ } -+ -+ sn_msi_info[vector].sn_irq_info = sn_irq_info; -+ sn_msi_info[vector].pci_addr = bus_addr; -+ -+ *addr_hi = (u32)(bus_addr >> 32); -+ *addr_lo = (u32)(bus_addr & 0x00000000ffffffff); -+ -+ /* -+ * In the SN platform, bit 16 is a "send vector" bit which -+ * must be present in order to move the vector through the system. -+ */ -+ *data = 0x100 + (unsigned int)vector; -+ -+#ifdef CONFIG_SMP -+ set_irq_affinity_info((vector & 0xff), sn_irq_info->irq_cpuid, 0); -+#endif -+ -+ return 0; -+} -+ -+static void -+sn_msi_target(unsigned int vector, unsigned int cpu, -+ u32 *addr_hi, u32 *addr_lo) -+{ -+ int slice; -+ nasid_t nasid; -+ u64 bus_addr; -+ struct pci_dev *pdev; -+ struct pcidev_info *sn_pdev; -+ struct sn_irq_info *sn_irq_info; -+ struct sn_irq_info *new_irq_info; -+ struct sn_pcibus_provider *provider; -+ -+ sn_irq_info = sn_msi_info[vector].sn_irq_info; -+ if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) -+ return; -+ -+ /* -+ * Release XIO resources for the old MSI PCI address -+ */ -+ -+ sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; -+ pdev = sn_pdev->pdi_linux_pcidev; -+ provider = SN_PCIDEV_BUSPROVIDER(pdev); -+ -+ bus_addr = (u64)(*addr_hi) << 32 | (u64)(*addr_lo); -+ (*provider->dma_unmap)(pdev, bus_addr, PCI_DMA_FROMDEVICE); -+ sn_msi_info[vector].pci_addr = 0; -+ -+ nasid = cpuid_to_nasid(cpu); -+ slice = cpuid_to_slice(cpu); -+ -+ new_irq_info = sn_retarget_vector(sn_irq_info, nasid, slice); -+ sn_msi_info[vector].sn_irq_info = new_irq_info; -+ if (new_irq_info == NULL) -+ return; -+ -+ /* -+ * Map the xio address into bus space -+ */ -+ -+ bus_addr = (*provider->dma_map_consistent)(pdev, -+ new_irq_info->irq_xtalkaddr, -+ sizeof(new_irq_info->irq_xtalkaddr), -+ SN_DMA_MSI|SN_DMA_ADDR_XIO); -+ -+ sn_msi_info[vector].pci_addr = bus_addr; -+ *addr_hi = (u32)(bus_addr >> 32); -+ *addr_lo = (u32)(bus_addr & 0x00000000ffffffff); -+} -+ -+struct msi_ops sn_msi_ops = { -+ .setup = sn_msi_setup, -+ .teardown = sn_msi_teardown, -+#ifdef CONFIG_SMP -+ .target = sn_msi_target, -+#endif -+}; -+ -+int -+sn_msi_init(void) -+{ -+ sn_msi_info = -+ kzalloc(sizeof(struct sn_msi_info) * NR_VECTORS, GFP_KERNEL); -+ if (! sn_msi_info) -+ return -ENOMEM; -+ -+ msi_register(&sn_msi_ops); -+ return 0; - } ---- gregkh-2.6.orig/include/asm-ia64/sn/intr.h -+++ gregkh-2.6/include/asm-ia64/sn/intr.h -@@ -10,6 +10,7 @@ - #define _ASM_IA64_SN_INTR_H - - #include <linux/rcupdate.h> -+#include <asm/sn/types.h> - - #define SGI_UART_VECTOR 0xe9 - -@@ -40,6 +41,7 @@ struct sn_irq_info { - int irq_cpuid; /* kernel logical cpuid */ - int irq_irq; /* the IRQ number */ - int irq_int_bit; /* Bridge interrupt pin */ -+ /* <0 means MSI */ - u64 irq_xtalkaddr; /* xtalkaddr IRQ is sent to */ - int irq_bridge_type;/* pciio asic type (pciio.h) */ - void *irq_bridge; /* bridge generating irq */ -@@ -53,6 +55,12 @@ struct sn_irq_info { - }; - - extern void sn_send_IPI_phys(int, long, int, int); -+extern u64 sn_intr_alloc(nasid_t, int, -+ struct sn_irq_info *, -+ int, nasid_t, int); -+extern void sn_intr_free(nasid_t, int, struct sn_irq_info *); -+extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int); -+extern struct list_head **sn_irq_lh; - - #define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector) - ---- gregkh-2.6.orig/include/asm-ia64/sn/pcibr_provider.h -+++ gregkh-2.6/include/asm-ia64/sn/pcibr_provider.h -@@ -55,6 +55,7 @@ - #define PCI32_ATE_V (0x1 << 0) - #define PCI32_ATE_CO (0x1 << 1) - #define PCI32_ATE_PREC (0x1 << 2) -+#define PCI32_ATE_MSI (0x1 << 2) - #define PCI32_ATE_PREF (0x1 << 3) - #define PCI32_ATE_BAR (0x1 << 4) - #define PCI32_ATE_ADDR_SHFT 12 -@@ -117,8 +118,8 @@ struct pcibus_info { - - extern int pcibr_init_provider(void); - extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *); --extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t); --extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t); -+extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t, int type); -+extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t, int type); - extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int); - - /* ---- gregkh-2.6.orig/include/asm-ia64/sn/pcibus_provider_defs.h -+++ gregkh-2.6/include/asm-ia64/sn/pcibus_provider_defs.h -@@ -3,7 +3,7 @@ - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * -- * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. -+ * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. - */ - #ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H - #define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H -@@ -45,13 +45,24 @@ struct pci_controller; - */ - - struct sn_pcibus_provider { -- dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t); -- dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t); -+ dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t, int flags); -+ dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t, int flags); - void (*dma_unmap)(struct pci_dev *, dma_addr_t, int); - void * (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *); - void (*force_interrupt)(struct sn_irq_info *); - void (*target_interrupt)(struct sn_irq_info *); - }; - -+/* -+ * Flags used by the map interfaces -+ * bits 3:0 specifies format of passed in address -+ * bit 4 specifies that address is to be used for MSI -+ */ -+ -+#define SN_DMA_ADDRTYPE(x) ((x) & 0xf) -+#define SN_DMA_ADDR_PHYS 1 /* address is an xio address. */ -+#define SN_DMA_ADDR_XIO 2 /* address is phys memory */ -+#define SN_DMA_MSI 0x10 /* Bus address is to be used for MSI */ -+ - extern struct sn_pcibus_provider *sn_pci_provider[]; - #endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */ ---- gregkh-2.6.orig/include/asm-ia64/sn/tiocp.h -+++ gregkh-2.6/include/asm-ia64/sn/tiocp.h -@@ -3,13 +3,14 @@ - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * -- * Copyright (C) 2003-2004 Silicon Graphics, Inc. All rights reserved. -+ * Copyright (C) 2003-2005 Silicon Graphics, Inc. All rights reserved. - */ - #ifndef _ASM_IA64_SN_PCI_TIOCP_H - #define _ASM_IA64_SN_PCI_TIOCP_H - - #define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL - #define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60) -+#define TIOCP_PCI64_CMDTYPE_MSI (0x3ull << 60) - - - /***************************************************************************** diff --git a/pci/pci-amd-8131-msi-quirk-called-too-late-bus_flags-not-inherited.patch b/pci/pci-amd-8131-msi-quirk-called-too-late-bus_flags-not-inherited.patch deleted file mode 100644 index 9c62a81e1b19e..0000000000000 --- a/pci/pci-amd-8131-msi-quirk-called-too-late-bus_flags-not-inherited.patch +++ /dev/null @@ -1,69 +0,0 @@ -From bgoglin@myri.com Tue May 23 00:05:51 2006 -Date: Tue, 23 May 2006 03:05:27 -0400 -From: Brice Goglin <brice@myri.com> -To: Greg KH <gregkh@suse.de> -Cc: "Michael S. Tsirkin" <mst@mellanox.co.il> -Subject: PCI: AMD 8131 MSI quirk called too late, bus_flags not inherited ? -Message-ID: <20060523070526.GA30499@myri.com> -Content-Disposition: inline - -The PCI_BUS_FLAGS_NO_MSI bus flags does not appear do be inherited -correctly from the amd8131 MSI quirk to its parent busses. It makes -devices behind a bridge behind amd8131 try to enable MSI while the -amd8131 does not support it. -We fix this by looking at flags of all parent busses in -pci_enable_msi() and pci_enable_msix(). - -By the way, also add the missing dev->no_msi check in pci_enable_msix() - -Signed-off-by: Brice Goglin <brice@myri.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/msi.c | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - ---- gregkh-2.6.orig/drivers/pci/msi.c -+++ gregkh-2.6/drivers/pci/msi.c -@@ -916,6 +916,7 @@ static int msix_capability_init(struct p - **/ - int pci_enable_msi(struct pci_dev* dev) - { -+ struct pci_bus *bus; - int pos, temp, status = -EINVAL; - u16 control; - -@@ -925,8 +926,9 @@ int pci_enable_msi(struct pci_dev* dev) - if (dev->no_msi) - return status; - -- if (dev->bus->bus_flags & PCI_BUS_FLAGS_NO_MSI) -- return -EINVAL; -+ for (bus = dev->bus; bus; bus = bus->parent) -+ if (bus->bus_flags & PCI_BUS_FLAGS_NO_MSI) -+ return -EINVAL; - - temp = dev->irq; - -@@ -1162,6 +1164,7 @@ static int reroute_msix_table(int head, - **/ - int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec) - { -+ struct pci_bus *bus; - int status, pos, nr_entries, free_vectors; - int i, j, temp; - u16 control; -@@ -1170,6 +1173,13 @@ int pci_enable_msix(struct pci_dev* dev, - if (!pci_msi_enable || !dev || !entries) - return -EINVAL; - -+ if (dev->no_msi) -+ return -EINVAL; -+ -+ for (bus = dev->bus; bus; bus = bus->parent) -+ if (bus->bus_flags & PCI_BUS_FLAGS_NO_MSI) -+ return -EINVAL; -+ - status = msi_init(); - if (status < 0) - return status; diff --git a/pci/pci-bus-parity-status-broken-hardware-attribute-edac-foundation.patch b/pci/pci-bus-parity-status-broken-hardware-attribute-edac-foundation.patch deleted file mode 100644 index 495ac263f591e..0000000000000 --- a/pci/pci-bus-parity-status-broken-hardware-attribute-edac-foundation.patch +++ /dev/null @@ -1,84 +0,0 @@ -From norsk5@yahoo.com Mon May 8 17:12:56 2006 -Message-ID: <20060509000609.62160.qmail@web50101.mail.yahoo.com> -Date: Mon, 8 May 2006 17:06:09 -0700 (PDT) -From: Doug Thompson <norsk5@yahoo.com> -Subject: PCI Bus Parity Status-broken hardware attribute, EDAC foundation -To: Greg K-H <greg@kroah.com>, <arjan@infradead.org> - -Currently, the EDAC (error detection and correction) modules that are in -the kernel contain some features that need to be moved. After some good -feedback on the PCI Parity detection code and interface -(http://www.ussg.iu.edu/hypermail/linux/kernel/0603.1/0897.html) this -patch ADDs an new attribute to the pci_dev structure: Namely the -'broken_parity_status' bit. - -When set this indicates that the respective hardware generates false -positives of Parity errors. - -The EDAC "blacklist" solution was inferior and will be removed in a -future patch. - -Also in this patch is a PCI quirk.c entry for an Infiniband PCI-X card -which generates false positive parity errors. - -I am requesting comments on this AND on the possibility of a exposing -this 'broken_parity_status' bit to userland via the PCI device sysfs -directory for devices. This access would allow for enabling of this -feature on new devices and for old devices that have their drivers -updated. (SLES 9 SP3 did this on an ATI motherboard video device). There -is a need to update such a PCI attribute between kernel releases. - -This patch just adds a storage place for the attribute and a quirk entry -for a known bad PCI device. PCI Parity reaper/harvestor operations are -in EDAC itself and will be refactored to use this PCI attribute instead -of its own mechanisms (which are currently disabled) in the future. - -Signed-off-by: Doug Thompson <norsk5@xmission.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/quirks.c | 11 +++++++++++ - include/linux/pci.h | 1 + - include/linux/pci_ids.h | 1 + - 3 files changed, 13 insertions(+) - ---- gregkh-2.6.orig/drivers/pci/quirks.c -+++ gregkh-2.6/drivers/pci/quirks.c -@@ -24,6 +24,17 @@ - #include <linux/acpi.h> - #include "pci.h" - -+/* The Mellanox Tavor device gives false positive parity errors -+ * Mark this device with a broken_parity_status, to allow -+ * PCI scanning code to "skip" this now blacklisted device. -+ */ -+static void __devinit quirk_mellanox_tavor(struct pci_dev *dev) -+{ -+ dev->broken_parity_status = 1; /* This device gives false positives */ -+} -+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR,quirk_mellanox_tavor); -+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE,quirk_mellanox_tavor); -+ - /* Deal with broken BIOS'es that neglect to enable passive release, - which can cause problems in combination with the 82441FX/PPro MTRRs */ - static void __devinit quirk_passive_release(struct pci_dev *dev) ---- gregkh-2.6.orig/include/linux/pci.h -+++ gregkh-2.6/include/linux/pci.h -@@ -162,6 +162,7 @@ struct pci_dev { - unsigned int is_busmaster:1; /* device is busmaster */ - unsigned int no_msi:1; /* device may not use msi */ - unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ -+ unsigned int broken_parity_status:1; /* Device generates false positive parity */ - - u32 saved_config_space[16]; /* config space saved at suspend time */ - struct hlist_head saved_cap_space; ---- gregkh-2.6.orig/include/linux/pci_ids.h -+++ gregkh-2.6/include/linux/pci_ids.h -@@ -1951,6 +1951,7 @@ - - #define PCI_VENDOR_ID_MELLANOX 0x15b3 - #define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 -+#define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46 - #define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 - #define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 - #define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c diff --git a/pci/pci-bus-parity-status-sysfs-interface.patch b/pci/pci-bus-parity-status-sysfs-interface.patch deleted file mode 100644 index 5c7c6ebdf6d08..0000000000000 --- a/pci/pci-bus-parity-status-sysfs-interface.patch +++ /dev/null @@ -1,65 +0,0 @@ -From norsk5@yahoo.com Wed Jun 14 17:06:36 2006 -Message-ID: <20060614235948.44337.qmail@web50114.mail.yahoo.com> -Date: Wed, 14 Jun 2006 16:59:48 -0700 (PDT) -From: Doug Thompson <norsk5@yahoo.com> -To: Greg K-H <greg@kroah.com> -Subject: PCI: Bus Parity Status sysfs interface - - -From: Doug Thompson <norsk5@yahoo.com> - -This patch adds the 'broken_parity_status' sysfs attribute file to a PCI device. -Reading this attribute a userland program can determine if PCI device provides false -positives (value of 1) in its generation of PCI Parity status, or not (value of 0). -As PCI devices are found to be 'bad' in this regard, userland programs can also set -the appropriate value (root access only) of a faulty device. This per device -information will be used in the EDAC PCI Parity scanner code in a future patch once -this interface becomes available. - -Signed-off-by: Doug Thompson <norsk5@yahoo.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/pci-sysfs.c | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - ---- gregkh-2.6.orig/drivers/pci/pci-sysfs.c -+++ gregkh-2.6/drivers/pci/pci-sysfs.c -@@ -45,6 +45,28 @@ pci_config_attr(class, "0x%06x\n"); - pci_config_attr(irq, "%u\n"); - pci_config_attr(is_enabled, "%u\n"); - -+static ssize_t broken_parity_status_show(struct device *dev, -+ struct device_attribute *attr, -+ char *buf) -+{ -+ struct pci_dev *pdev = to_pci_dev(dev); -+ return sprintf (buf, "%u\n", pdev->broken_parity_status); -+} -+ -+static ssize_t broken_parity_status_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ struct pci_dev *pdev = to_pci_dev(dev); -+ ssize_t consumed = -EINVAL; -+ -+ if ((count > 0) && (*buf == '0' || *buf == '1')) { -+ pdev->broken_parity_status = *buf == '1' ? 1 : 0; -+ consumed = count; -+ } -+ return consumed; -+} -+ - static ssize_t local_cpus_show(struct device *dev, - struct device_attribute *attr, char *buf) - { -@@ -122,6 +144,8 @@ struct device_attribute pci_dev_attrs[] - __ATTR_RO(local_cpus), - __ATTR_RO(modalias), - __ATTR(enable, 0600, is_enabled_show, is_enabled_store), -+ __ATTR(broken_parity_status,(S_IRUGO|S_IWUSR), -+ broken_parity_status_show,broken_parity_status_store), - __ATTR_NULL, - }; - 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 deleted file mode 100644 index c661c01a959f0..0000000000000 --- a/pci/pci-clean-up-pci-documentation-to-be-more-specific.patch +++ /dev/null @@ -1,50 +0,0 @@ -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 deleted file mode 100644 index ce8242d961053..0000000000000 --- a/pci/pci-cleanup-unused-variable-about-msi-driver.patch +++ /dev/null @@ -1,64 +0,0 @@ -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-disable-msi-mode-in-pci_disable_device.patch b/pci/pci-disable-msi-mode-in-pci_disable_device.patch deleted file mode 100644 index bf220e431d684..0000000000000 --- a/pci/pci-disable-msi-mode-in-pci_disable_device.patch +++ /dev/null @@ -1,97 +0,0 @@ -From shaohua.li@intel.com Thu May 25 20:00:07 2006 -Subject: PCI: disable msi mode in pci_disable_device -From: Shaohua Li <shaohua.li@intel.com> -Cc: Andrew Morton <akpm@osdl.org>, Greg <greg@kroah.com>, tom long <tom.l.nguyen@intel.com>, Brice Goglin <brice@myri.com>, Rajesh Shah <rajesh.shah@intel.com> -Date: Fri, 26 May 2006 10:58:27 +0800 -Message-Id: <1148612307.32046.132.camel@sli10-desk.sh.intel.com> - -Brice said the pci_save_msi_state breaks his driver in his special usage -(not in suspend/resume), as pci_save_msi_state will disable msi mode. In -his usage, pci_save_state will be called at runtime, and later (after -the device operates for some time and has an error) pci_restore_state -will be called. -In another hand, suspend/resume needs disable msi mode, as device should -stop working completely. This patch try to workaround this issue. -Drivers are expected call pci_disable_device in suspend time after -pci_save_state. - -Signed-off-by: Shaohua Li <shaohua.li@intel.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/msi.c | 6 ++++-- - drivers/pci/pci.c | 9 ++++++++- - include/linux/pci.h | 2 ++ - 3 files changed, 14 insertions(+), 3 deletions(-) - ---- gregkh-2.6.orig/drivers/pci/msi.c -+++ gregkh-2.6/drivers/pci/msi.c -@@ -453,9 +453,11 @@ static void enable_msi_mode(struct pci_d - /* Set enabled bits to single MSI & enable MSI_enable bit */ - msi_enable(control, 1); - pci_write_config_word(dev, msi_control_reg(pos), control); -+ dev->msi_enabled = 1; - } else { - msix_enable(control); - pci_write_config_word(dev, msi_control_reg(pos), control); -+ dev->msix_enabled = 1; - } - if (pci_find_capability(dev, PCI_CAP_ID_EXP)) { - /* PCI Express Endpoint device detected */ -@@ -472,9 +474,11 @@ void disable_msi_mode(struct pci_dev *de - /* Set enabled bits to single MSI & enable MSI_enable bit */ - msi_disable(control); - pci_write_config_word(dev, msi_control_reg(pos), control); -+ dev->msi_enabled = 0; - } else { - msix_disable(control); - pci_write_config_word(dev, msi_control_reg(pos), control); -+ dev->msix_enabled = 0; - } - if (pci_find_capability(dev, PCI_CAP_ID_EXP)) { - /* PCI Express Endpoint device detected */ -@@ -549,7 +553,6 @@ int pci_save_msi_state(struct pci_dev *d - pci_read_config_dword(dev, pos + PCI_MSI_DATA_32, &cap[i++]); - if (control & PCI_MSI_FLAGS_MASKBIT) - pci_read_config_dword(dev, pos + PCI_MSI_MASK_BIT, &cap[i++]); -- disable_msi_mode(dev, pos, PCI_CAP_ID_MSI); - save_state->cap_nr = PCI_CAP_ID_MSI; - pci_add_saved_cap(dev, save_state); - return 0; -@@ -639,7 +642,6 @@ int pci_save_msix_state(struct pci_dev * - } - dev->irq = temp; - -- disable_msi_mode(dev, pos, PCI_CAP_ID_MSIX); - save_state->cap_nr = PCI_CAP_ID_MSIX; - pci_add_saved_cap(dev, save_state); - return 0; ---- gregkh-2.6.orig/drivers/pci/pci.c -+++ gregkh-2.6/drivers/pci/pci.c -@@ -548,7 +548,14 @@ void - pci_disable_device(struct pci_dev *dev) - { - u16 pci_command; -- -+ -+ if (dev->msi_enabled) -+ disable_msi_mode(dev, pci_find_capability(dev, PCI_CAP_ID_MSI), -+ PCI_CAP_ID_MSI); -+ if (dev->msix_enabled) -+ disable_msi_mode(dev, pci_find_capability(dev, PCI_CAP_ID_MSI), -+ PCI_CAP_ID_MSIX); -+ - pci_read_config_word(dev, PCI_COMMAND, &pci_command); - if (pci_command & PCI_COMMAND_MASTER) { - pci_command &= ~PCI_COMMAND_MASTER; ---- gregkh-2.6.orig/include/linux/pci.h -+++ gregkh-2.6/include/linux/pci.h -@@ -163,6 +163,8 @@ struct pci_dev { - unsigned int no_msi:1; /* device may not use msi */ - unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ - unsigned int broken_parity_status:1; /* Device generates false positive parity */ -+ unsigned int msi_enabled:1; -+ unsigned int msix_enabled:1; - - u32 saved_config_space[16]; /* config space saved at suspend time */ - struct hlist_head saved_cap_space; diff --git a/pci/pci-don-t-enable-device-if-already-enabled.patch b/pci/pci-don-t-enable-device-if-already-enabled.patch deleted file mode 100644 index e572ee4c23ba8..0000000000000 --- a/pci/pci-don-t-enable-device-if-already-enabled.patch +++ /dev/null @@ -1,36 +0,0 @@ -From owner-linux-pci@atrey.karlin.mff.cuni.cz Fri Apr 28 11:28:26 2006 -From: Kristen Accardi <kristen.c.accardi@intel.com> -Subject: PCI: don't enable device if already enabled -Cc: arjan@linux.intel.com, greg@kroah.com -Date: Fri, 28 Apr 2006 11:37:38 -0700 -Message-Id: <1146249458.25490.12.camel@whizzy> - -If a device is already enabled, don't bother reenabling it. - -Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> -Acked-By: Arjan van de Ven <arjan@linux.intel.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - - ---- - drivers/pci/pci.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - ---- gregkh-2.6.orig/drivers/pci/pci.c -+++ gregkh-2.6/drivers/pci/pci.c -@@ -520,10 +520,11 @@ pci_enable_device_bars(struct pci_dev *d - int - pci_enable_device(struct pci_dev *dev) - { -- int err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1); -- if (err) -- return err; -- return 0; -+ int err = 0; -+ -+ if (!dev->is_enabled) -+ err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1); -+ return err; - } - - /** diff --git a/pci/pci-don-t-move-ioapics-below-pci-bridge.patch b/pci/pci-don-t-move-ioapics-below-pci-bridge.patch deleted file mode 100644 index e79a8b7921b74..0000000000000 --- a/pci/pci-don-t-move-ioapics-below-pci-bridge.patch +++ /dev/null @@ -1,41 +0,0 @@ -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-fix-issues-with-extended-conf-space-when-mmconfig-disabled-because-of-e820.patch b/pci/pci-fix-issues-with-extended-conf-space-when-mmconfig-disabled-because-of-e820.patch deleted file mode 100644 index 229ba2aa0e14a..0000000000000 --- a/pci/pci-fix-issues-with-extended-conf-space-when-mmconfig-disabled-because-of-e820.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 76306.1226@compuserve.com Thu Jun 15 01:45:12 2006 -Date: Thu, 15 Jun 2006 04:41:52 -0400 -From: Chuck Ebbert <76306.1226@compuserve.com> -Subject: PCI: fix issues with extended conf space when MMCONFIG disabled because of e820 -To: Andi Kleen <ak@suse.de> -Cc: Brice Goglin <brice@myri.com>, Arjan van de Ven <arjan@linux.intel.com>, Greg KH <greg@kroah.com> -Message-ID: <200606150443_MC3-1-C283-D4F7@compuserve.com> -Content-Disposition: inline - -On 15 Jun 2006 03:45:10 +0200, Andi Kleen wrote: - -> Anyways I would say that if the BIOS can't get MCFG right then -> it's likely not been validated on that board and shouldn't be used. - -According to Petr Vandrovec: - - ... "What is important (and checked) is address of MMCONFIG reported by MCFG - table... Unfortunately code does not bother with printing that address :-( - - "Another problem is that code has hardcoded that MMCONFIG area is 256MB large. - Unfortunately for the code PCI specification allows any power of two between 2MB - and 256MB if vendor knows that such amount of busses (from 2 to 128) will be - sufficient for system. With notebook it is quite possible that not full 8 bits - are implemented for MMCONFIG bus number." - - -So here is a patch. Unfortunately my system still fails the test because -it doesn't reserve any part of the MMCONFIG area, but this may fix others. - -Booted on x86_64, only compiled on i386. x86_64 still remaps the max area -(256MB) even though only 2MB is checked... but 2.6.16 had no check at all -so it is still better. - - -PCI: reduce size of x86 MMCONFIG reserved area check - -1. Print the address of the MMCONFIG area when the test for that area - being reserved fails. - -2. Only check if the first 2MB is reserved, as that is the minimum. - -Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com> -Acked-by: Arjan van de Ven <arjan@linux.intel.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - arch/i386/pci/mmconfig.c | 9 ++++++--- - arch/x86_64/pci/mmconfig.c | 13 +++++++++---- - 2 files changed, 15 insertions(+), 7 deletions(-) - ---- gregkh-2.6.orig/arch/i386/pci/mmconfig.c -+++ gregkh-2.6/arch/i386/pci/mmconfig.c -@@ -15,7 +15,9 @@ - #include <asm/e820.h> - #include "pci.h" - --#define MMCONFIG_APER_SIZE (256*1024*1024) -+/* aperture is up to 256MB but BIOS may reserve less */ -+#define MMCONFIG_APER_MIN (2 * 1024*1024) -+#define MMCONFIG_APER_MAX (256 * 1024*1024) - - /* Assume systems with more busses have correct MCFG */ - #define MAX_CHECK_BUS 16 -@@ -197,9 +199,10 @@ void __init pci_mmcfg_init(void) - return; - - if (!e820_all_mapped(pci_mmcfg_config[0].base_address, -- pci_mmcfg_config[0].base_address + MMCONFIG_APER_SIZE, -+ pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN, - E820_RESERVED)) { -- printk(KERN_ERR "PCI: BIOS Bug: MCFG area is not E820-reserved\n"); -+ printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %x is not E820-reserved\n", -+ pci_mmcfg_config[0].base_address); - printk(KERN_ERR "PCI: Not using MMCONFIG.\n"); - return; - } ---- gregkh-2.6.orig/arch/x86_64/pci/mmconfig.c -+++ gregkh-2.6/arch/x86_64/pci/mmconfig.c -@@ -13,7 +13,10 @@ - - #include "pci.h" - --#define MMCONFIG_APER_SIZE (256*1024*1024) -+/* aperture is up to 256MB but BIOS may reserve less */ -+#define MMCONFIG_APER_MIN (2 * 1024*1024) -+#define MMCONFIG_APER_MAX (256 * 1024*1024) -+ - /* Verify the first 16 busses. We assume that systems with more busses - get MCFG right. */ - #define MAX_CHECK_BUS 16 -@@ -175,9 +178,10 @@ void __init pci_mmcfg_init(void) - return; - - if (!e820_all_mapped(pci_mmcfg_config[0].base_address, -- pci_mmcfg_config[0].base_address + MMCONFIG_APER_SIZE, -+ pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN, - E820_RESERVED)) { -- printk(KERN_ERR "PCI: BIOS Bug: MCFG area is not E820-reserved\n"); -+ printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %x is not E820-reserved\n", -+ pci_mmcfg_config[0].base_address); - printk(KERN_ERR "PCI: Not using MMCONFIG.\n"); - return; - } -@@ -190,7 +194,8 @@ void __init pci_mmcfg_init(void) - } - for (i = 0; i < pci_mmcfg_config_num; ++i) { - pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i]; -- pci_mmcfg_virt[i].virt = ioremap_nocache(pci_mmcfg_config[i].base_address, MMCONFIG_APER_SIZE); -+ pci_mmcfg_virt[i].virt = ioremap_nocache(pci_mmcfg_config[i].base_address, -+ MMCONFIG_APER_MAX); - if (!pci_mmcfg_virt[i].virt) { - printk("PCI: Cannot map mmconfig aperture for segment %d\n", - pci_mmcfg_config[i].pci_segment_group_number); diff --git a/pci/pci-fix-memory-leak-in-mmconfig-error-path.patch b/pci/pci-fix-memory-leak-in-mmconfig-error-path.patch deleted file mode 100644 index 2d72cfd7cb7fa..0000000000000 --- a/pci/pci-fix-memory-leak-in-mmconfig-error-path.patch +++ /dev/null @@ -1,32 +0,0 @@ -From darnok@68k.org Thu Jun 15 09:08:35 2006 -Date: Thu, 15 Jun 2006 12:08:30 -0400 -From: Konrad Rzeszutek <konradr@redhat.com> -To: Greg KH <greg@kroah.com> -Subject: PCI: fix memory leak in MMCONFIG error path -Message-ID: <20060615160830.GD3242@andromeda.dapyr.net> -Content-Disposition: inline - -This a bit late (yours patch was posted about a year ago), but -a co-worker of spotted part of the code that looks like a memory -leak. Looking at the code it seems that pci_mmcfg_config should -be free-ed if MMCONFIG is above 4GB. - - -From: Konrad Rzeszutek <konradr@redhat.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - arch/i386/kernel/acpi/boot.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- gregkh-2.6.orig/arch/i386/kernel/acpi/boot.c -+++ gregkh-2.6/arch/i386/kernel/acpi/boot.c -@@ -202,6 +202,8 @@ int __init acpi_parse_mcfg(unsigned long - if (mcfg->config[i].base_reserved) { - printk(KERN_ERR PREFIX - "MMCONFIG not in low 4GB of memory\n"); -+ kfree(pci_mmcfg_config); -+ pci_mmcfg_config_num = 0; - return -ENODEV; - } - } diff --git a/pci/pci-fix-race-with-pci_walk_bus-and-pci_destroy_dev.patch b/pci/pci-fix-race-with-pci_walk_bus-and-pci_destroy_dev.patch deleted file mode 100644 index cd4d3a84fabe5..0000000000000 --- a/pci/pci-fix-race-with-pci_walk_bus-and-pci_destroy_dev.patch +++ /dev/null @@ -1,326 +0,0 @@ -From yanmin_zhang@linux.intel.com Thu Jun 1 21:41:48 2006 -From: Zhang Yanmin <yanmin_zhang@linux.intel.com> -Subject: PCI: fix race with pci_walk_bus and pci_destroy_dev -To: Greg KH <greg@kroah.com> -Message-Id: <1149222942.8436.189.camel@ymzhang-perf.sh.intel.com> -Date: Fri, 02 Jun 2006 12:35:43 +0800 - -From: Zhang Yanmin <yanmin.zhang@intel.com> - -pci_walk_bus has a race with pci_destroy_dev. When cb is called -in pci_walk_bus, pci_destroy_dev might unlink the dev pointed by next. -Later on in the next loop, pointer next becomes NULL and cause -kernel panic. - -Below patch against 2.6.17-rc4 fixes it by changing pci_bus_lock (spin_lock) -to pci_bus_sem (rw_semaphore). - -Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - - ---- - drivers/pci/bus.c | 21 +++++++++------------ - drivers/pci/pci.h | 2 +- - drivers/pci/probe.c | 17 +++++++++-------- - drivers/pci/remove.c | 12 ++++++------ - drivers/pci/search.c | 32 ++++++++++++++++---------------- - 5 files changed, 41 insertions(+), 43 deletions(-) - ---- gregkh-2.6.orig/drivers/pci/bus.c -+++ gregkh-2.6/drivers/pci/bus.c -@@ -81,9 +81,9 @@ void __devinit pci_bus_add_device(struct - { - device_add(&dev->dev); - -- spin_lock(&pci_bus_lock); -+ down_write(&pci_bus_sem); - list_add_tail(&dev->global_list, &pci_devices); -- spin_unlock(&pci_bus_lock); -+ up_write(&pci_bus_sem); - - pci_proc_attach_device(dev); - pci_create_sysfs_dev_files(dev); -@@ -125,10 +125,10 @@ void __devinit pci_bus_add_devices(struc - */ - if (dev->subordinate) { - if (list_empty(&dev->subordinate->node)) { -- spin_lock(&pci_bus_lock); -+ down_write(&pci_bus_sem); - list_add_tail(&dev->subordinate->node, - &dev->bus->children); -- spin_unlock(&pci_bus_lock); -+ up_write(&pci_bus_sem); - } - pci_bus_add_devices(dev->subordinate); - -@@ -168,7 +168,7 @@ void pci_walk_bus(struct pci_bus *top, v - struct list_head *next; - - bus = top; -- spin_lock(&pci_bus_lock); -+ down_read(&pci_bus_sem); - next = top->devices.next; - for (;;) { - if (next == &bus->devices) { -@@ -180,22 +180,19 @@ void pci_walk_bus(struct pci_bus *top, v - continue; - } - dev = list_entry(next, struct pci_dev, bus_list); -- pci_dev_get(dev); - if (dev->subordinate) { - /* this is a pci-pci bridge, do its devices next */ - next = dev->subordinate->devices.next; - bus = dev->subordinate; - } else - next = dev->bus_list.next; -- spin_unlock(&pci_bus_lock); - -- /* Run device routines with the bus unlocked */ -+ /* Run device routines with the device locked */ -+ down(&dev->dev.sem); - cb(dev, userdata); -- -- spin_lock(&pci_bus_lock); -- pci_dev_put(dev); -+ up(&dev->dev.sem); - } -- spin_unlock(&pci_bus_lock); -+ up_read(&pci_bus_sem); - } - EXPORT_SYMBOL_GPL(pci_walk_bus); - ---- gregkh-2.6.orig/drivers/pci/pci.h -+++ gregkh-2.6/drivers/pci/pci.h -@@ -40,7 +40,7 @@ extern int pci_bus_find_capability (stru - extern void pci_remove_legacy_files(struct pci_bus *bus); - - /* Lock for read/write access to pci device and bus lists */ --extern spinlock_t pci_bus_lock; -+extern struct rw_semaphore pci_bus_sem; - - #ifdef CONFIG_X86_IO_APIC - extern int pci_msi_quirk; ---- gregkh-2.6.orig/drivers/pci/probe.c -+++ gregkh-2.6/drivers/pci/probe.c -@@ -383,9 +383,9 @@ struct pci_bus * __devinit pci_add_new_b - - child = pci_alloc_child_bus(parent, dev, busnr); - if (child) { -- spin_lock(&pci_bus_lock); -+ down_write(&pci_bus_sem); - list_add_tail(&child->node, &parent->children); -- spin_unlock(&pci_bus_lock); -+ up_write(&pci_bus_sem); - } - return child; - } -@@ -844,9 +844,9 @@ void __devinit pci_device_add(struct pci - * and the bus list for fixup functions, etc. - */ - INIT_LIST_HEAD(&dev->global_list); -- spin_lock(&pci_bus_lock); -+ down_write(&pci_bus_sem); - list_add_tail(&dev->bus_list, &bus->devices); -- spin_unlock(&pci_bus_lock); -+ up_write(&pci_bus_sem); - } - - struct pci_dev * __devinit -@@ -981,9 +981,10 @@ struct pci_bus * __devinit pci_create_bu - pr_debug("PCI: Bus %04x:%02x already known\n", pci_domain_nr(b), bus); - goto err_out; - } -- spin_lock(&pci_bus_lock); -+ -+ down_write(&pci_bus_sem); - list_add_tail(&b->node, &pci_root_buses); -- spin_unlock(&pci_bus_lock); -+ up_write(&pci_bus_sem); - - memset(dev, 0, sizeof(*dev)); - dev->parent = parent; -@@ -1023,9 +1024,9 @@ class_dev_create_file_err: - class_dev_reg_err: - device_unregister(dev); - dev_reg_err: -- spin_lock(&pci_bus_lock); -+ down_write(&pci_bus_sem); - list_del(&b->node); -- spin_unlock(&pci_bus_lock); -+ up_write(&pci_bus_sem); - err_out: - kfree(dev); - kfree(b); ---- gregkh-2.6.orig/drivers/pci/remove.c -+++ gregkh-2.6/drivers/pci/remove.c -@@ -22,18 +22,18 @@ static void pci_destroy_dev(struct pci_d - pci_proc_detach_device(dev); - pci_remove_sysfs_dev_files(dev); - device_unregister(&dev->dev); -- spin_lock(&pci_bus_lock); -+ down_write(&pci_bus_sem); - list_del(&dev->global_list); - dev->global_list.next = dev->global_list.prev = NULL; -- spin_unlock(&pci_bus_lock); -+ up_write(&pci_bus_sem); - } - - /* Remove the device from the device lists, and prevent any further - * list accesses from this device */ -- spin_lock(&pci_bus_lock); -+ down_write(&pci_bus_sem); - list_del(&dev->bus_list); - dev->bus_list.next = dev->bus_list.prev = NULL; -- spin_unlock(&pci_bus_lock); -+ up_write(&pci_bus_sem); - - pci_free_resources(dev); - pci_dev_put(dev); -@@ -62,9 +62,9 @@ void pci_remove_bus(struct pci_bus *pci_ - { - pci_proc_detach_bus(pci_bus); - -- spin_lock(&pci_bus_lock); -+ down_write(&pci_bus_sem); - list_del(&pci_bus->node); -- spin_unlock(&pci_bus_lock); -+ up_write(&pci_bus_sem); - pci_remove_legacy_files(pci_bus); - class_device_remove_file(&pci_bus->class_dev, - &class_device_attr_cpuaffinity); ---- gregkh-2.6.orig/drivers/pci/search.c -+++ gregkh-2.6/drivers/pci/search.c -@@ -13,7 +13,7 @@ - #include <linux/interrupt.h> - #include "pci.h" - --DEFINE_SPINLOCK(pci_bus_lock); -+DECLARE_RWSEM(pci_bus_sem); - - static struct pci_bus * __devinit - pci_do_find_bus(struct pci_bus* bus, unsigned char busnr) -@@ -72,11 +72,11 @@ pci_find_next_bus(const struct pci_bus * - struct pci_bus *b = NULL; - - WARN_ON(in_interrupt()); -- spin_lock(&pci_bus_lock); -+ down_read(&pci_bus_sem); - n = from ? from->node.next : pci_root_buses.next; - if (n != &pci_root_buses) - b = pci_bus_b(n); -- spin_unlock(&pci_bus_lock); -+ up_read(&pci_bus_sem); - return b; - } - -@@ -124,7 +124,7 @@ struct pci_dev * pci_get_slot(struct pci - struct pci_dev *dev; - - WARN_ON(in_interrupt()); -- spin_lock(&pci_bus_lock); -+ down_read(&pci_bus_sem); - - list_for_each(tmp, &bus->devices) { - dev = pci_dev_b(tmp); -@@ -135,7 +135,7 @@ struct pci_dev * pci_get_slot(struct pci - dev = NULL; - out: - pci_dev_get(dev); -- spin_unlock(&pci_bus_lock); -+ up_read(&pci_bus_sem); - return dev; - } - -@@ -167,7 +167,7 @@ static struct pci_dev * pci_find_subsys( - struct pci_dev *dev; - - WARN_ON(in_interrupt()); -- spin_lock(&pci_bus_lock); -+ down_read(&pci_bus_sem); - n = from ? from->global_list.next : pci_devices.next; - - while (n && (n != &pci_devices)) { -@@ -181,7 +181,7 @@ static struct pci_dev * pci_find_subsys( - } - dev = NULL; - exit: -- spin_unlock(&pci_bus_lock); -+ up_read(&pci_bus_sem); - return dev; - } - -@@ -232,7 +232,7 @@ pci_get_subsys(unsigned int vendor, unsi - struct pci_dev *dev; - - WARN_ON(in_interrupt()); -- spin_lock(&pci_bus_lock); -+ down_read(&pci_bus_sem); - n = from ? from->global_list.next : pci_devices.next; - - while (n && (n != &pci_devices)) { -@@ -247,7 +247,7 @@ pci_get_subsys(unsigned int vendor, unsi - dev = NULL; - exit: - dev = pci_dev_get(dev); -- spin_unlock(&pci_bus_lock); -+ up_read(&pci_bus_sem); - pci_dev_put(from); - return dev; - } -@@ -292,7 +292,7 @@ pci_find_device_reverse(unsigned int ven - struct pci_dev *dev; - - WARN_ON(in_interrupt()); -- spin_lock(&pci_bus_lock); -+ down_read(&pci_bus_sem); - n = from ? from->global_list.prev : pci_devices.prev; - - while (n && (n != &pci_devices)) { -@@ -304,7 +304,7 @@ pci_find_device_reverse(unsigned int ven - } - dev = NULL; - exit: -- spin_unlock(&pci_bus_lock); -+ up_read(&pci_bus_sem); - return dev; - } - -@@ -328,7 +328,7 @@ struct pci_dev *pci_get_class(unsigned i - struct pci_dev *dev; - - WARN_ON(in_interrupt()); -- spin_lock(&pci_bus_lock); -+ down_read(&pci_bus_sem); - n = from ? from->global_list.next : pci_devices.next; - - while (n && (n != &pci_devices)) { -@@ -340,7 +340,7 @@ struct pci_dev *pci_get_class(unsigned i - dev = NULL; - exit: - dev = pci_dev_get(dev); -- spin_unlock(&pci_bus_lock); -+ up_read(&pci_bus_sem); - pci_dev_put(from); - return dev; - } -@@ -362,7 +362,7 @@ int pci_dev_present(const struct pci_dev - int found = 0; - - WARN_ON(in_interrupt()); -- spin_lock(&pci_bus_lock); -+ down_read(&pci_bus_sem); - while (ids->vendor || ids->subvendor || ids->class_mask) { - list_for_each_entry(dev, &pci_devices, global_list) { - if (pci_match_one_device(ids, dev)) { -@@ -372,8 +372,8 @@ int pci_dev_present(const struct pci_dev - } - ids++; - } --exit: -- spin_unlock(&pci_bus_lock); -+exit: -+ up_read(&pci_bus_sem); - return found; - } - EXPORT_SYMBOL(pci_dev_present); diff --git a/pci/pci-fix-to-pci-ignore-pre-set-64-bit-bars-on-32-bit-platforms.patch b/pci/pci-fix-to-pci-ignore-pre-set-64-bit-bars-on-32-bit-platforms.patch deleted file mode 100644 index 20cecfb1eadee..0000000000000 --- a/pci/pci-fix-to-pci-ignore-pre-set-64-bit-bars-on-32-bit-platforms.patch +++ /dev/null @@ -1,41 +0,0 @@ -From hpa@c2micro.com Fri Jun 9 11:28:41 2006 -Message-ID: <4489BDCD.4000400@c2micro.com> -Date: Fri, 09 Jun 2006 11:28:29 -0700 -From: "H. Peter Anvin" <hpa@c2micro.com> -To: Bjorn Helgaas <bjorn.helgaas@hp.com> -Cc: Andrew Morton <akpm@osdl.org>, Greg KH <greg@kroah.com>, mchan@broadcom.com -Subject: PCI: fix to pci ignore pre-set 64-bit bars on 32-bit platforms - -From: Bjorn Helgaas <bjorn.helgaas@hp.com> - -When we detect a 64-bit pre-set address in a BAR on a 32-bit platform, -we disable it and treat it as if it had been unset, thus allowing the -general address assignment code to assign a new address to it when the -device is enabled. This can happen either if the firmware assigns -64-bit addresses; additionally, some cards have been found "in the -wild" which do not come out of reset with all the BAR registers set to -zero. - -Unfortunately, the patch that implemented this tested the low part of -the address instead of the high part of the address. This patch fixes -that. - -Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> -Signed-off-by: H. Peter Anvin <hpa@zytor.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/probe.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- gregkh-2.6.orig/drivers/pci/probe.c -+++ gregkh-2.6/drivers/pci/probe.c -@@ -199,7 +199,7 @@ static void pci_read_bases(struct pci_de - printk(KERN_ERR "PCI: Unable to handle 64-bit BAR for device %s\n", pci_name(dev)); - res->start = 0; - res->flags = 0; -- } else if (l) { -+ } else if (lhi) { - /* 64-bit wide address, treat as disabled */ - pci_write_config_dword(dev, reg, l & ~(u32)PCI_BASE_ADDRESS_MEM_MASK); - pci_write_config_dword(dev, reg+4, 0); diff --git a/pci/pci-i386-x86_84-disable-pci-resource-decode-on-device-disable.patch b/pci/pci-i386-x86_84-disable-pci-resource-decode-on-device-disable.patch deleted file mode 100644 index 74fbfdc98af89..0000000000000 --- a/pci/pci-i386-x86_84-disable-pci-resource-decode-on-device-disable.patch +++ /dev/null @@ -1,68 +0,0 @@ -From owner-linux-pci@atrey.karlin.mff.cuni.cz Wed May 3 15:32:07 2006 -Date: Wed, 3 May 2006 15:27:47 -0700 -From: Rajesh Shah <rajesh.shah@intel.com> -To: gregkh@suse.de, <ak@suse.de> -Cc: <akpm@osdl.org> -Subject: PCI: i386/x86_84: disable PCI resource decode on device disable -Message-ID: <20060503152747.A29327@unix-os.sc.intel.com> -Content-Disposition: inline - - -When a PCI device is disabled via pci_disable_device(), it's still -left decoding its BAR resource ranges even though its driver -will have likely released those regions (and may even have -unloaded). pci_enable_device() already explicitly enables -BAR resource decode for the device being enabled. This patch -disables resource decode for the PCI device being disabled, -making it symmetric with the enable call. - -I saw this while doing something else, not because of a -problem report. Still, seems to be the correct thing to do. - -Signed-off-by: Rajesh Shah <rajesh.shah@intel.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - arch/i386/pci/common.c | 1 + - arch/i386/pci/i386.c | 9 +++++++++ - arch/i386/pci/pci.h | 1 + - 3 files changed, 11 insertions(+) - ---- gregkh-2.6.orig/arch/i386/pci/common.c -+++ gregkh-2.6/arch/i386/pci/common.c -@@ -288,6 +288,7 @@ int pcibios_enable_device(struct pci_dev - - void pcibios_disable_device (struct pci_dev *dev) - { -+ pcibios_disable_resources(dev); - if (pcibios_disable_irq) - pcibios_disable_irq(dev); - } ---- gregkh-2.6.orig/arch/i386/pci/i386.c -+++ gregkh-2.6/arch/i386/pci/i386.c -@@ -242,6 +242,15 @@ int pcibios_enable_resources(struct pci_ - return 0; - } - -+void pcibios_disable_resources(struct pci_dev *dev) -+{ -+ u16 cmd; -+ -+ pci_read_config_word(dev, PCI_COMMAND, &cmd); -+ cmd &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY); -+ pci_write_config_word(dev, PCI_COMMAND, cmd); -+} -+ - /* - * If we set up a device for bus mastering, we need to check the latency - * timer as certain crappy BIOSes forget to set it properly. ---- gregkh-2.6.orig/arch/i386/pci/pci.h -+++ gregkh-2.6/arch/i386/pci/pci.h -@@ -35,6 +35,7 @@ extern unsigned int pcibios_max_latency; - - void pcibios_resource_survey(void); - int pcibios_enable_resources(struct pci_dev *, int); -+void pcibios_disable_resources(struct pci_dev *); - - /* pci-pc.c */ - diff --git a/pci/pci-ignore-pre-set-64-bit-bars-on-32-bit-platforms.patch b/pci/pci-ignore-pre-set-64-bit-bars-on-32-bit-platforms.patch deleted file mode 100644 index 4f963a165298a..0000000000000 --- a/pci/pci-ignore-pre-set-64-bit-bars-on-32-bit-platforms.patch +++ /dev/null @@ -1,75 +0,0 @@ -From owner-linux-pci@atrey.karlin.mff.cuni.cz Tue Apr 18 17:20:07 2006 -Message-ID: <44458228.1010302@zytor.com> -Date: Tue, 18 Apr 2006 17:19:52 -0700 -From: "H. Peter Anvin" <hpa@zytor.com> -To: Greg KH <greg@kroah.com> -Subject: PCI: Ignore pre-set 64-bit BARs on 32-bit platforms - -From: H. Peter Anvin <hpa@c2micro.com> - -[pci] Ignore pre-set 64-bit BARs on 32-bit platforms - -Currently, Linux always rejects a device which has a pre-set 64-bit -address on a 32-bit platform. On systems which do not do PCI -initialization in firmware, this causes some devices which don't -correctly power up with all BARs zero to fail. - -This patch makes the kernel automatically zero out such an address -(thus treating it as if it had not been set at all, meaning it will -assign an address if necessary). - -I have done this only for devices, not bridges. It seems potentially -hazardous to do for bridges. - -Signed-off-by: H. Peter Anvin <hpa@c2micro.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/probe.c | 28 +++++++++++++++++----------- - 1 file changed, 17 insertions(+), 11 deletions(-) - ---- gregkh-2.6.orig/drivers/pci/probe.c -+++ gregkh-2.6/drivers/pci/probe.c -@@ -180,25 +180,31 @@ static void pci_read_bases(struct pci_de - res->flags |= pci_calc_resource_flags(l); - if ((l & (PCI_BASE_ADDRESS_SPACE | PCI_BASE_ADDRESS_MEM_TYPE_MASK)) - == (PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64)) { -- pci_read_config_dword(dev, reg+4, &l); -+ u32 szhi, lhi; -+ pci_read_config_dword(dev, reg+4, &lhi); -+ pci_write_config_dword(dev, reg+4, ~0); -+ pci_read_config_dword(dev, reg+4, &szhi); -+ pci_write_config_dword(dev, reg+4, lhi); -+ szhi = pci_size(lhi, szhi, 0xffffffff); - next++; - #if BITS_PER_LONG == 64 -- res->start |= ((unsigned long) l) << 32; -+ res->start |= ((unsigned long) lhi) << 32; - res->end = res->start + sz; -- pci_write_config_dword(dev, reg+4, ~0); -- pci_read_config_dword(dev, reg+4, &sz); -- pci_write_config_dword(dev, reg+4, l); -- sz = pci_size(l, sz, 0xffffffff); -- if (sz) { -+ if (szhi) { - /* This BAR needs > 4GB? Wow. */ -- res->end |= (unsigned long)sz<<32; -+ res->end |= (unsigned long)szhi<<32; - } - #else -- if (l) { -- printk(KERN_ERR "PCI: Unable to handle 64-bit address for device %s\n", pci_name(dev)); -+ if (szhi) { -+ printk(KERN_ERR "PCI: Unable to handle 64-bit BAR for device %s\n", pci_name(dev)); - res->start = 0; - res->flags = 0; -- continue; -+ } else if (l) { -+ /* 64-bit wide address, treat as disabled */ -+ pci_write_config_dword(dev, reg, l & ~(u32)PCI_BASE_ADDRESS_MEM_MASK); -+ pci_write_config_dword(dev, reg+4, 0); -+ res->start = 0; -+ res->end = sz; - } - #endif - } diff --git a/pci/pci-legacy-i-o-port-free-driver-changes-to-generic-pci-code.patch b/pci/pci-legacy-i-o-port-free-driver-changes-to-generic-pci-code.patch index f63d2ec11a42d..1e35c374b8ccd 100644 --- a/pci/pci-legacy-i-o-port-free-driver-changes-to-generic-pci-code.patch +++ b/pci/pci-legacy-i-o-port-free-driver-changes-to-generic-pci-code.patch @@ -62,8 +62,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> return 0; } -@@ -520,8 +523,6 @@ pci_enable_device(struct pci_dev *dev) - int err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1); +@@ -525,8 +528,6 @@ pci_enable_device(struct pci_dev *dev) + err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1); if (err) return err; - pci_fixup_device(pci_fixup_enable, dev); @@ -71,7 +71,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> return 0; } -@@ -556,6 +557,7 @@ pci_disable_device(struct pci_dev *dev) +@@ -568,6 +569,7 @@ pci_disable_device(struct pci_dev *dev) pcibios_disable_device(dev); dev->is_enabled = 0; @@ -79,7 +79,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } /** -@@ -638,6 +640,12 @@ void pci_release_region(struct pci_dev * +@@ -650,6 +652,12 @@ void pci_release_region(struct pci_dev * { if (pci_resource_len(pdev, bar) == 0) return; @@ -92,7 +92,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if (pci_resource_flags(pdev, bar) & IORESOURCE_IO) release_region(pci_resource_start(pdev, bar), pci_resource_len(pdev, bar)); -@@ -664,7 +672,12 @@ int pci_request_region(struct pci_dev *p +@@ -676,7 +684,12 @@ int pci_request_region(struct pci_dev *p { if (pci_resource_len(pdev, bar) == 0) return 0; @@ -106,7 +106,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if (pci_resource_flags(pdev, bar) & IORESOURCE_IO) { if (!request_region(pci_resource_start(pdev, bar), pci_resource_len(pdev, bar), res_name)) -@@ -704,7 +717,8 @@ void pci_release_regions(struct pci_dev +@@ -716,7 +729,8 @@ void pci_release_regions(struct pci_dev int i; for (i = 0; i < 6; i++) @@ -116,7 +116,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } /** -@@ -725,13 +739,15 @@ int pci_request_regions(struct pci_dev * +@@ -737,13 +751,15 @@ int pci_request_regions(struct pci_dev * int i; for (i = 0; i < 6; i++) @@ -135,7 +135,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> return -EBUSY; } -@@ -906,6 +922,22 @@ pci_set_consistent_dma_mask(struct pci_d +@@ -918,6 +934,22 @@ pci_set_consistent_dma_mask(struct pci_d } #endif @@ -158,7 +158,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> static int __devinit pci_init(void) { struct pci_dev *dev = NULL; -@@ -963,6 +995,7 @@ EXPORT_SYMBOL(pci_set_dma_mask); +@@ -975,6 +1007,7 @@ EXPORT_SYMBOL(pci_set_dma_mask); EXPORT_SYMBOL(pci_set_consistent_dma_mask); EXPORT_SYMBOL(pci_assign_resource); EXPORT_SYMBOL(pci_find_parent_resource); @@ -168,7 +168,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> EXPORT_SYMBOL(pci_save_state); --- gregkh-2.6.orig/include/linux/pci.h +++ gregkh-2.6/include/linux/pci.h -@@ -168,6 +168,7 @@ struct pci_dev { +@@ -171,6 +171,7 @@ struct pci_dev { struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ int rom_attr_enabled; /* has display of the rom attribute been enabled? */ struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ @@ -176,9 +176,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> }; #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) -@@ -497,6 +498,7 @@ int pci_set_consistent_dma_mask(struct p - void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); +@@ -501,6 +502,7 @@ void pci_update_resource(struct pci_dev int pci_assign_resource(struct pci_dev *dev, int i); + int pci_assign_resource_fixed(struct pci_dev *dev, int i); void pci_restore_bars(struct pci_dev *dev); +int pci_select_bars(struct pci_dev *dev, unsigned long flags); diff --git a/pci/pci-legacy-i-o-port-free-driver-update-documentation-pci_txt.patch b/pci/pci-legacy-i-o-port-free-driver-update-documentation-pci_txt.patch index 43572c5b75ebb..1022f045a9966 100644 --- a/pci/pci-legacy-i-o-port-free-driver-update-documentation-pci_txt.patch +++ b/pci/pci-legacy-i-o-port-free-driver-update-documentation-pci_txt.patch @@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- gregkh-2.6.orig/Documentation/pci.txt +++ gregkh-2.6/Documentation/pci.txt -@@ -279,3 +279,70 @@ having sane locking. +@@ -287,3 +287,70 @@ having sane locking. pci_find_device() Superseded by pci_get_device() pci_find_subsys() Superseded by pci_get_subsys() pci_find_slot() Superseded by pci_get_slot() diff --git a/pci/pci-move-various-pci-ids-to-header-file.patch b/pci/pci-move-various-pci-ids-to-header-file.patch deleted file mode 100644 index 719f8bcaabd51..0000000000000 --- a/pci/pci-move-various-pci-ids-to-header-file.patch +++ /dev/null @@ -1,111 +0,0 @@ -From akpm@osdl.org Wed May 10 01:52:10 2006 -Message-Id: <200605100851.k4A8ptdA006903@shell0.pdx.osdl.net> -From: Brent Casavant <bcasavan@sgi.com> -Subject: PCI: Move various PCI IDs to header file -To: bcasavan@sgi.com, greg@kroah.com, jes@sgi.com, mm-commits@vger.kernel.org -Date: Wed, 10 May 2006 01:49:14 -0700 - -From: Brent Casavant <bcasavan@sgi.com> - -Move various QLogic, Vitesse, and Intel storage controller PCI IDs to the -main header file. - -Signed-off-by: Brent Casavant <bcasavan@sgi.com> -Acked-by: Jes Sorensen <jes@sgi.com> -Signed-off-by: Andrew Morton <akpm@osdl.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> ---- - - drivers/scsi/qla1280.c | 24 ------------------------ - drivers/scsi/sata_vsc.c | 11 ++++++----- - include/linux/pci_ids.h | 9 +++++++++ - 3 files changed, 15 insertions(+), 29 deletions(-) - ---- gregkh-2.6.orig/drivers/scsi/qla1280.c -+++ gregkh-2.6/drivers/scsi/qla1280.c -@@ -397,30 +397,6 @@ - #include "ql1280_fw.h" - #include "ql1040_fw.h" - -- --/* -- * Missing PCI ID's -- */ --#ifndef PCI_DEVICE_ID_QLOGIC_ISP1080 --#define PCI_DEVICE_ID_QLOGIC_ISP1080 0x1080 --#endif --#ifndef PCI_DEVICE_ID_QLOGIC_ISP1240 --#define PCI_DEVICE_ID_QLOGIC_ISP1240 0x1240 --#endif --#ifndef PCI_DEVICE_ID_QLOGIC_ISP1280 --#define PCI_DEVICE_ID_QLOGIC_ISP1280 0x1280 --#endif --#ifndef PCI_DEVICE_ID_QLOGIC_ISP10160 --#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016 --#endif --#ifndef PCI_DEVICE_ID_QLOGIC_ISP12160 --#define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216 --#endif -- --#ifndef PCI_VENDOR_ID_AMI --#define PCI_VENDOR_ID_AMI 0x101e --#endif -- - #ifndef BITS_PER_LONG - #error "BITS_PER_LONG not defined!" - #endif ---- gregkh-2.6.orig/drivers/scsi/sata_vsc.c -+++ gregkh-2.6/drivers/scsi/sata_vsc.c -@@ -433,13 +433,14 @@ err_out: - - - /* -- * 0x1725/0x7174 is the Vitesse VSC-7174 -- * 0x8086/0x3200 is the Intel 31244, which is supposed to be identical -- * compatibility is untested as of yet -+ * Intel 31244 is supposed to be identical. -+ * Compatibility is untested as of yet. - */ - static const struct pci_device_id vsc_sata_pci_tbl[] = { -- { 0x1725, 0x7174, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 }, -- { 0x8086, 0x3200, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 }, -+ { PCI_VENDOR_ID_VITESSE, PCI_DEVICE_ID_VITESSE_VSC7174, -+ PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 }, -+ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GD31244, -+ PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 }, - { } - }; - ---- gregkh-2.6.orig/include/linux/pci_ids.h -+++ gregkh-2.6/include/linux/pci_ids.h -@@ -851,7 +851,12 @@ - - - #define PCI_VENDOR_ID_QLOGIC 0x1077 -+#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016 - #define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 -+#define PCI_DEVICE_ID_QLOGIC_ISP1080 0x1080 -+#define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216 -+#define PCI_DEVICE_ID_QLOGIC_ISP1240 0x1240 -+#define PCI_DEVICE_ID_QLOGIC_ISP1280 0x1280 - #define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 - #define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 - #define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 -@@ -1975,6 +1980,9 @@ - #define PCI_VENDOR_ID_NETCELL 0x169c - #define PCI_DEVICE_ID_REVOLUTION 0x0044 - -+#define PCI_VENDOR_ID_VITESSE 0x1725 -+#define PCI_DEVICE_ID_VITESSE_VSC7174 0x7174 -+ - #define PCI_VENDOR_ID_LINKSYS 0x1737 - #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 - -@@ -2154,6 +2162,7 @@ - #define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 - #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e - #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 -+#define PCI_DEVICE_ID_INTEL_GD31244 0x3200 - #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 - #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 - #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 diff --git a/pci/pci-msi-abstractions-and-support-for-altix.patch b/pci/pci-msi-abstractions-and-support-for-altix.patch deleted file mode 100644 index 5b08bc40cde51..0000000000000 --- a/pci/pci-msi-abstractions-and-support-for-altix.patch +++ /dev/null @@ -1,827 +0,0 @@ -From maule@lnx-maule.americas.sgi.com Thu Apr 13 16:51:11 2006 -Date: Mon, 10 Apr 2006 21:17:48 -0500 -From: Mark Maule <maule@sgi.com> -To: Shaohua Li <shaohua.li@intel.com> -Cc: Greg KH <greg@kroah.com> -Subject: PCI: msi abstractions and support for altix -Message-ID: <20060411021748.GA9342@sgi.com> -Content-Disposition: inline - - -Abstract portions of the MSI core for platforms that do not use standard -APIC interrupt controllers. This is implemented through a new arch-specific -msi setup routine, and a set of msi ops which can be set on a per platform -basis. - -Signed-off-by: Mark Maule <maule@sgi.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/Makefile | 6 - - drivers/pci/msi-altix.c | 18 +++ - drivers/pci/msi-apic.c | 100 +++++++++++++++++++ - drivers/pci/msi.c | 210 +++++++++++++++++++++++++---------------- - drivers/pci/msi.h | 133 +++++++++++++------------ - include/asm-i386/msi.h | 8 + - include/asm-ia64/machvec.h | 7 + - include/asm-ia64/machvec_sn2.h | 7 + - include/asm-ia64/msi.h | 12 ++ - include/asm-x86_64/msi.h | 8 + - 10 files changed, 366 insertions(+), 143 deletions(-) - ---- gregkh-2.6.orig/drivers/pci/Makefile -+++ gregkh-2.6/drivers/pci/Makefile -@@ -26,7 +26,11 @@ obj-$(CONFIG_PPC32) += setup-irq.o - obj-$(CONFIG_PPC64) += setup-bus.o - obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o - obj-$(CONFIG_X86_VISWS) += setup-irq.o --obj-$(CONFIG_PCI_MSI) += msi.o -+ -+msiobj-y := msi.o msi-apic.o -+msiobj-$(CONFIG_IA64_GENERIC) += msi-altix.o -+msiobj-$(CONFIG_IA64_SGI_SN2) += msi-altix.o -+obj-$(CONFIG_PCI_MSI) += $(msiobj-y) - - # - # ACPI Related PCI FW Functions ---- /dev/null -+++ gregkh-2.6/drivers/pci/msi-altix.c -@@ -0,0 +1,18 @@ -+/* -+ * This file is subject to the terms and conditions of the GNU General Public -+ * License. See the file "COPYING" in the main directory of this archive -+ * for more details. -+ * -+ * Copyright (C) 2006 Silicon Graphics, Inc. All Rights Reserved. -+ */ -+ -+#include <asm/errno.h> -+ -+int -+sn_msi_init(void) -+{ -+ /* -+ * return error until MSI is supported on altix platforms -+ */ -+ return -EINVAL; -+} ---- /dev/null -+++ gregkh-2.6/drivers/pci/msi-apic.c -@@ -0,0 +1,100 @@ -+/* -+ * MSI hooks for standard x86 apic -+ */ -+ -+#include <linux/pci.h> -+#include <linux/irq.h> -+ -+#include "msi.h" -+ -+/* -+ * Shifts for APIC-based data -+ */ -+ -+#define MSI_DATA_VECTOR_SHIFT 0 -+#define MSI_DATA_VECTOR(v) (((u8)v) << MSI_DATA_VECTOR_SHIFT) -+ -+#define MSI_DATA_DELIVERY_SHIFT 8 -+#define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_SHIFT) -+#define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_SHIFT) -+ -+#define MSI_DATA_LEVEL_SHIFT 14 -+#define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT) -+#define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT) -+ -+#define MSI_DATA_TRIGGER_SHIFT 15 -+#define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT) -+#define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT) -+ -+/* -+ * Shift/mask fields for APIC-based bus address -+ */ -+ -+#define MSI_ADDR_HEADER 0xfee00000 -+ -+#define MSI_ADDR_DESTID_MASK 0xfff0000f -+#define MSI_ADDR_DESTID_CPU(cpu) ((cpu) << MSI_TARGET_CPU_SHIFT) -+ -+#define MSI_ADDR_DESTMODE_SHIFT 2 -+#define MSI_ADDR_DESTMODE_PHYS (0 << MSI_ADDR_DESTMODE_SHIFT) -+#define MSI_ADDR_DESTMODE_LOGIC (1 << MSI_ADDR_DESTMODE_SHIFT) -+ -+#define MSI_ADDR_REDIRECTION_SHIFT 3 -+#define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT) -+#define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT) -+ -+ -+static void -+msi_target_apic(unsigned int vector, -+ unsigned int dest_cpu, -+ u32 *address_hi, /* in/out */ -+ u32 *address_lo) /* in/out */ -+{ -+ u32 addr = *address_lo; -+ -+ addr &= MSI_ADDR_DESTID_MASK; -+ addr |= MSI_ADDR_DESTID_CPU(cpu_physical_id(dest_cpu)); -+ -+ *address_lo = addr; -+} -+ -+static int -+msi_setup_apic(struct pci_dev *pdev, /* unused in generic */ -+ unsigned int vector, -+ u32 *address_hi, -+ u32 *address_lo, -+ u32 *data) -+{ -+ unsigned long dest_phys_id; -+ -+ dest_phys_id = cpu_physical_id(first_cpu(cpu_online_map)); -+ -+ *address_hi = 0; -+ *address_lo = MSI_ADDR_HEADER | -+ MSI_ADDR_DESTMODE_PHYS | -+ MSI_ADDR_REDIRECTION_CPU | -+ MSI_ADDR_DESTID_CPU(dest_phys_id); -+ -+ *data = MSI_DATA_TRIGGER_EDGE | -+ MSI_DATA_LEVEL_ASSERT | -+ MSI_DATA_DELIVERY_FIXED | -+ MSI_DATA_VECTOR(vector); -+ -+ return 0; -+} -+ -+static void -+msi_teardown_apic(unsigned int vector) -+{ -+ return; /* no-op */ -+} -+ -+/* -+ * Generic ops used on most IA archs/platforms. Set with msi_register() -+ */ -+ -+struct msi_ops msi_apic_ops = { -+ .setup = msi_setup_apic, -+ .teardown = msi_teardown_apic, -+ .target = msi_target_apic, -+}; ---- gregkh-2.6.orig/drivers/pci/msi.c -+++ gregkh-2.6/drivers/pci/msi.c -@@ -23,8 +23,6 @@ - #include "pci.h" - #include "msi.h" - --#define MSI_TARGET_CPU first_cpu(cpu_online_map) -- - static DEFINE_SPINLOCK(msi_lock); - static struct msi_desc* msi_desc[NR_IRQS] = { [0 ... NR_IRQS-1] = NULL }; - static kmem_cache_t* msi_cachep; -@@ -40,6 +38,15 @@ int vector_irq[NR_VECTORS] = { [0 ... NR - u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 }; - #endif - -+static struct msi_ops *msi_ops; -+ -+int -+msi_register(struct msi_ops *ops) -+{ -+ msi_ops = ops; -+ return 0; -+} -+ - static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags) - { - memset(p, 0, NR_IRQS * sizeof(struct msi_desc)); -@@ -92,7 +99,7 @@ static void msi_set_mask_bit(unsigned in - static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask) - { - struct msi_desc *entry; -- struct msg_address address; -+ u32 address_hi, address_lo; - unsigned int irq = vector; - unsigned int dest_cpu = first_cpu(cpu_mask); - -@@ -108,28 +115,36 @@ static void set_msi_affinity(unsigned in - if (!pos) - return; - -+ pci_read_config_dword(entry->dev, msi_upper_address_reg(pos), -+ &address_hi); - pci_read_config_dword(entry->dev, msi_lower_address_reg(pos), -- &address.lo_address.value); -- address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; -- address.lo_address.value |= (cpu_physical_id(dest_cpu) << -- MSI_TARGET_CPU_SHIFT); -- entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu); -+ &address_lo); -+ -+ msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); -+ -+ pci_write_config_dword(entry->dev, msi_upper_address_reg(pos), -+ address_hi); - pci_write_config_dword(entry->dev, msi_lower_address_reg(pos), -- address.lo_address.value); -+ address_lo); - set_native_irq_info(irq, cpu_mask); - break; - } - case PCI_CAP_ID_MSIX: - { -- int offset = entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + -- PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET; -+ int offset_hi = -+ entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + -+ PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET; -+ int offset_lo = -+ entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + -+ PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET; -+ -+ address_hi = readl(entry->mask_base + offset_hi); -+ address_lo = readl(entry->mask_base + offset_lo); - -- address.lo_address.value = readl(entry->mask_base + offset); -- address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; -- address.lo_address.value |= (cpu_physical_id(dest_cpu) << -- MSI_TARGET_CPU_SHIFT); -- entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu); -- writel(address.lo_address.value, entry->mask_base + offset); -+ msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); -+ -+ writel(address_hi, entry->mask_base + offset_hi); -+ writel(address_lo, entry->mask_base + offset_lo); - set_native_irq_info(irq, cpu_mask); - break; - } -@@ -251,30 +266,6 @@ static struct hw_interrupt_type msi_irq_ - .set_affinity = set_msi_affinity - }; - --static void msi_data_init(struct msg_data *msi_data, -- unsigned int vector) --{ -- memset(msi_data, 0, sizeof(struct msg_data)); -- msi_data->vector = (u8)vector; -- msi_data->delivery_mode = MSI_DELIVERY_MODE; -- msi_data->level = MSI_LEVEL_MODE; -- msi_data->trigger = MSI_TRIGGER_MODE; --} -- --static void msi_address_init(struct msg_address *msi_address) --{ -- unsigned int dest_id; -- unsigned long dest_phys_id = cpu_physical_id(MSI_TARGET_CPU); -- -- memset(msi_address, 0, sizeof(struct msg_address)); -- msi_address->hi_address = (u32)0; -- dest_id = (MSI_ADDRESS_HEADER << MSI_ADDRESS_HEADER_SHIFT); -- msi_address->lo_address.u.dest_mode = MSI_PHYSICAL_MODE; -- msi_address->lo_address.u.redirection_hint = MSI_REDIRECTION_HINT_MODE; -- msi_address->lo_address.u.dest_id = dest_id; -- msi_address->lo_address.value |= (dest_phys_id << MSI_TARGET_CPU_SHIFT); --} -- - static int msi_free_vector(struct pci_dev* dev, int vector, int reassign); - static int assign_msi_vector(void) - { -@@ -369,13 +360,29 @@ static int msi_init(void) - return status; - } - -+ status = msi_arch_init(); -+ if (status < 0) { -+ pci_msi_enable = 0; -+ printk(KERN_WARNING -+ "PCI: MSI arch init failed. MSI disabled.\n"); -+ return status; -+ } -+ -+ if (! msi_ops) { -+ printk(KERN_WARNING -+ "PCI: MSI ops not registered. MSI disabled.\n"); -+ status = -EINVAL; -+ return status; -+ } -+ -+ last_alloc_vector = assign_irq_vector(AUTO_ASSIGN); - status = msi_cache_init(); - if (status < 0) { - pci_msi_enable = 0; - printk(KERN_WARNING "PCI: MSI cache init failed\n"); - return status; - } -- last_alloc_vector = assign_irq_vector(AUTO_ASSIGN); -+ - if (last_alloc_vector < 0) { - pci_msi_enable = 0; - printk(KERN_WARNING "PCI: No interrupt vectors available for MSI\n"); -@@ -575,6 +582,8 @@ void pci_restore_msi_state(struct pci_de - int pci_save_msix_state(struct pci_dev *dev) - { - int pos; -+ int temp; -+ int vector, head, tail = 0; - u16 control; - struct pci_cap_saved_state *save_state; - -@@ -582,6 +591,7 @@ int pci_save_msix_state(struct pci_dev * - if (pos <= 0 || dev->no_msi) - return 0; - -+ /* save the capability */ - pci_read_config_word(dev, msi_control_reg(pos), &control); - if (!(control & PCI_MSIX_FLAGS_ENABLE)) - return 0; -@@ -593,6 +603,38 @@ int pci_save_msix_state(struct pci_dev * - } - *((u16 *)&save_state->data[0]) = control; - -+ /* save the table */ -+ temp = dev->irq; -+ if (msi_lookup_vector(dev, PCI_CAP_ID_MSIX)) { -+ kfree(save_state); -+ return -EINVAL; -+ } -+ -+ vector = head = dev->irq; -+ while (head != tail) { -+ int j; -+ void __iomem *base; -+ struct msi_desc *entry; -+ -+ entry = msi_desc[vector]; -+ base = entry->mask_base; -+ j = entry->msi_attrib.entry_nr; -+ -+ entry->address_lo_save = -+ readl(base + j * PCI_MSIX_ENTRY_SIZE + -+ PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET); -+ entry->address_hi_save = -+ readl(base + j * PCI_MSIX_ENTRY_SIZE + -+ PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET); -+ entry->data_save = -+ readl(base + j * PCI_MSIX_ENTRY_SIZE + -+ PCI_MSIX_ENTRY_DATA_OFFSET); -+ -+ tail = msi_desc[vector]->link.tail; -+ vector = tail; -+ } -+ dev->irq = temp; -+ - disable_msi_mode(dev, pos, PCI_CAP_ID_MSIX); - save_state->cap_nr = PCI_CAP_ID_MSIX; - pci_add_saved_cap(dev, save_state); -@@ -606,8 +648,6 @@ void pci_restore_msix_state(struct pci_d - int vector, head, tail = 0; - void __iomem *base; - int j; -- struct msg_address address; -- struct msg_data data; - struct msi_desc *entry; - int temp; - struct pci_cap_saved_state *save_state; -@@ -633,20 +673,13 @@ void pci_restore_msix_state(struct pci_d - base = entry->mask_base; - j = entry->msi_attrib.entry_nr; - -- msi_address_init(&address); -- msi_data_init(&data, vector); -- -- address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; -- address.lo_address.value |= entry->msi_attrib.current_cpu << -- MSI_TARGET_CPU_SHIFT; -- -- writel(address.lo_address.value, -+ writel(entry->address_lo_save, - base + j * PCI_MSIX_ENTRY_SIZE + - PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET); -- writel(address.hi_address, -+ writel(entry->address_hi_save, - base + j * PCI_MSIX_ENTRY_SIZE + - PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET); -- writel(*(u32*)&data, -+ writel(entry->data_save, - base + j * PCI_MSIX_ENTRY_SIZE + - PCI_MSIX_ENTRY_DATA_OFFSET); - -@@ -660,30 +693,32 @@ void pci_restore_msix_state(struct pci_d - } - #endif - --static void msi_register_init(struct pci_dev *dev, struct msi_desc *entry) -+static int msi_register_init(struct pci_dev *dev, struct msi_desc *entry) - { -- struct msg_address address; -- struct msg_data data; -+ int status; -+ u32 address_hi; -+ u32 address_lo; -+ u32 data; - int pos, vector = dev->irq; - u16 control; - - pos = pci_find_capability(dev, PCI_CAP_ID_MSI); - pci_read_config_word(dev, msi_control_reg(pos), &control); -+ - /* Configure MSI capability structure */ -- msi_address_init(&address); -- msi_data_init(&data, vector); -- entry->msi_attrib.current_cpu = ((address.lo_address.u.dest_id >> -- MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK); -- pci_write_config_dword(dev, msi_lower_address_reg(pos), -- address.lo_address.value); -+ status = msi_ops->setup(dev, vector, &address_hi, &address_lo, &data); -+ if (status < 0) -+ return status; -+ -+ pci_write_config_dword(dev, msi_lower_address_reg(pos), address_lo); - if (is_64bit_address(control)) { - pci_write_config_dword(dev, -- msi_upper_address_reg(pos), address.hi_address); -+ msi_upper_address_reg(pos), address_hi); - pci_write_config_word(dev, -- msi_data_reg(pos, 1), *((u32*)&data)); -+ msi_data_reg(pos, 1), data); - } else - pci_write_config_word(dev, -- msi_data_reg(pos, 0), *((u32*)&data)); -+ msi_data_reg(pos, 0), data); - if (entry->msi_attrib.maskbit) { - unsigned int maskbits, temp; - /* All MSIs are unmasked by default, Mask them all */ -@@ -697,6 +732,8 @@ static void msi_register_init(struct pci - msi_mask_bits_reg(pos, is_64bit_address(control)), - maskbits); - } -+ -+ return 0; - } - - /** -@@ -710,6 +747,7 @@ static void msi_register_init(struct pci - **/ - static int msi_capability_init(struct pci_dev *dev) - { -+ int status; - struct msi_desc *entry; - int pos, vector; - u16 control; -@@ -742,7 +780,12 @@ static int msi_capability_init(struct pc - /* Replace with MSI handler */ - irq_handler_init(PCI_CAP_ID_MSI, vector, entry->msi_attrib.maskbit); - /* Configure MSI capability structure */ -- msi_register_init(dev, entry); -+ status = msi_register_init(dev, entry); -+ if (status != 0) { -+ dev->irq = entry->msi_attrib.default_vector; -+ kmem_cache_free(msi_cachep, entry); -+ return status; -+ } - - attach_msi_entry(entry, vector); - /* Set MSI enabled bits */ -@@ -765,8 +808,10 @@ static int msix_capability_init(struct p - struct msix_entry *entries, int nvec) - { - struct msi_desc *head = NULL, *tail = NULL, *entry = NULL; -- struct msg_address address; -- struct msg_data data; -+ u32 address_hi; -+ u32 address_lo; -+ u32 data; -+ int status; - int vector, pos, i, j, nr_entries, temp = 0; - unsigned long phys_addr; - u32 table_offset; -@@ -822,18 +867,20 @@ static int msix_capability_init(struct p - /* Replace with MSI-X handler */ - irq_handler_init(PCI_CAP_ID_MSIX, vector, 1); - /* Configure MSI-X capability structure */ -- msi_address_init(&address); -- msi_data_init(&data, vector); -- entry->msi_attrib.current_cpu = -- ((address.lo_address.u.dest_id >> -- MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK); -- writel(address.lo_address.value, -+ status = msi_ops->setup(dev, vector, -+ &address_hi, -+ &address_lo, -+ &data); -+ if (status < 0) -+ break; -+ -+ writel(address_lo, - base + j * PCI_MSIX_ENTRY_SIZE + - PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET); -- writel(address.hi_address, -+ writel(address_hi, - base + j * PCI_MSIX_ENTRY_SIZE + - PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET); -- writel(*(u32*)&data, -+ writel(data, - base + j * PCI_MSIX_ENTRY_SIZE + - PCI_MSIX_ENTRY_DATA_OFFSET); - attach_msi_entry(entry, vector); -@@ -901,9 +948,10 @@ int pci_enable_msi(struct pci_dev* dev) - vector_irq[dev->irq] = -1; - nr_released_vectors--; - spin_unlock_irqrestore(&msi_lock, flags); -- msi_register_init(dev, msi_desc[dev->irq]); -- enable_msi_mode(dev, pos, PCI_CAP_ID_MSI); -- return 0; -+ status = msi_register_init(dev, msi_desc[dev->irq]); -+ if (status == 0) -+ enable_msi_mode(dev, pos, PCI_CAP_ID_MSI); -+ return status; - } - spin_unlock_irqrestore(&msi_lock, flags); - dev->irq = temp; -@@ -980,6 +1028,8 @@ static int msi_free_vector(struct pci_de - void __iomem *base; - unsigned long flags; - -+ msi_ops->teardown(vector); -+ - spin_lock_irqsave(&msi_lock, flags); - entry = msi_desc[vector]; - if (!entry || entry->dev != dev) { ---- gregkh-2.6.orig/drivers/pci/msi.h -+++ gregkh-2.6/drivers/pci/msi.h -@@ -6,6 +6,68 @@ - #ifndef MSI_H - #define MSI_H - -+/* -+ * MSI operation vector. Used by the msi core code (drivers/pci/msi.c) -+ * to abstract platform-specific tasks relating to MSI address generation -+ * and resource management. -+ */ -+struct msi_ops { -+ /** -+ * setup - generate an MSI bus address and data for a given vector -+ * @pdev: PCI device context (in) -+ * @vector: vector allocated by the msi core (in) -+ * @addr_hi: upper 32 bits of PCI bus MSI address (out) -+ * @addr_lo: lower 32 bits of PCI bus MSI address (out) -+ * @data: MSI data payload (out) -+ * -+ * Description: The setup op is used to generate a PCI bus addres and -+ * data which the msi core will program into the card MSI capability -+ * registers. The setup routine is responsible for picking an initial -+ * cpu to target the MSI at. The setup routine is responsible for -+ * examining pdev to determine the MSI capabilities of the card and -+ * generating a suitable address/data. The setup routine is -+ * responsible for allocating and tracking any system resources it -+ * needs to route the MSI to the cpu it picks, and for associating -+ * those resources with the passed in vector. -+ * -+ * Returns 0 if the MSI address/data was successfully setup. -+ **/ -+ -+ int (*setup) (struct pci_dev *pdev, unsigned int vector, -+ u32 *addr_hi, u32 *addr_lo, u32 *data); -+ -+ /** -+ * teardown - release resources allocated by setup -+ * @vector: vector context for resources (in) -+ * -+ * Description: The teardown op is used to release any resources -+ * that were allocated in the setup routine associated with the passed -+ * in vector. -+ **/ -+ -+ void (*teardown) (unsigned int vector); -+ -+ /** -+ * target - retarget an MSI at a different cpu -+ * @vector: vector context for resources (in) -+ * @cpu: new cpu to direct vector at (in) -+ * @addr_hi: new value of PCI bus upper 32 bits (in/out) -+ * @addr_lo: new value of PCI bus lower 32 bits (in/out) -+ * -+ * Description: The target op is used to redirect an MSI vector -+ * at a different cpu. addr_hi/addr_lo coming in are the existing -+ * values that the MSI core has programmed into the card. The -+ * target code is responsible for freeing any resources (if any) -+ * associated with the old address, and generating a new PCI bus -+ * addr_hi/addr_lo that will redirect the vector at the indicated cpu. -+ **/ -+ -+ void (*target) (unsigned int vector, unsigned int cpu, -+ u32 *addr_hi, u32 *addr_lo); -+}; -+ -+extern int msi_register(struct msi_ops *ops); -+ - #include <asm/msi.h> - - /* -@@ -63,67 +125,6 @@ extern int pci_vector_resources(int last - #define msix_mask(address) (address | PCI_MSIX_FLAGS_BITMASK) - #define msix_is_pending(address) (address & PCI_MSIX_FLAGS_PENDMASK) - --/* -- * MSI Defined Data Structures -- */ --#define MSI_ADDRESS_HEADER 0xfee --#define MSI_ADDRESS_HEADER_SHIFT 12 --#define MSI_ADDRESS_HEADER_MASK 0xfff000 --#define MSI_ADDRESS_DEST_ID_MASK 0xfff0000f --#define MSI_TARGET_CPU_MASK 0xff --#define MSI_DELIVERY_MODE 0 --#define MSI_LEVEL_MODE 1 /* Edge always assert */ --#define MSI_TRIGGER_MODE 0 /* MSI is edge sensitive */ --#define MSI_PHYSICAL_MODE 0 --#define MSI_LOGICAL_MODE 1 --#define MSI_REDIRECTION_HINT_MODE 0 -- --struct msg_data { --#if defined(__LITTLE_ENDIAN_BITFIELD) -- __u32 vector : 8; -- __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */ -- __u32 reserved_1 : 3; -- __u32 level : 1; /* 0: deassert | 1: assert */ -- __u32 trigger : 1; /* 0: edge | 1: level */ -- __u32 reserved_2 : 16; --#elif defined(__BIG_ENDIAN_BITFIELD) -- __u32 reserved_2 : 16; -- __u32 trigger : 1; /* 0: edge | 1: level */ -- __u32 level : 1; /* 0: deassert | 1: assert */ -- __u32 reserved_1 : 3; -- __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */ -- __u32 vector : 8; --#else --#error "Bitfield endianness not defined! Check your byteorder.h" --#endif --} __attribute__ ((packed)); -- --struct msg_address { -- union { -- struct { --#if defined(__LITTLE_ENDIAN_BITFIELD) -- __u32 reserved_1 : 2; -- __u32 dest_mode : 1; /*0:physic | 1:logic */ -- __u32 redirection_hint: 1; /*0: dedicated CPU -- 1: lowest priority */ -- __u32 reserved_2 : 4; -- __u32 dest_id : 24; /* Destination ID */ --#elif defined(__BIG_ENDIAN_BITFIELD) -- __u32 dest_id : 24; /* Destination ID */ -- __u32 reserved_2 : 4; -- __u32 redirection_hint: 1; /*0: dedicated CPU -- 1: lowest priority */ -- __u32 dest_mode : 1; /*0:physic | 1:logic */ -- __u32 reserved_1 : 2; --#else --#error "Bitfield endianness not defined! Check your byteorder.h" --#endif -- }u; -- __u32 value; -- }lo_address; -- __u32 hi_address; --} __attribute__ ((packed)); -- - struct msi_desc { - struct { - __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ -@@ -132,7 +133,7 @@ struct msi_desc { - __u8 reserved: 1; /* reserved */ - __u8 entry_nr; /* specific enabled entry */ - __u8 default_vector; /* default pre-assigned vector */ -- __u8 current_cpu; /* current destination cpu */ -+ __u8 unused; /* formerly unused destination cpu*/ - }msi_attrib; - - struct { -@@ -142,6 +143,14 @@ struct msi_desc { - - void __iomem *mask_base; - struct pci_dev *dev; -+ -+#ifdef CONFIG_PM -+ /* PM save area for MSIX address/data */ -+ -+ u32 address_hi_save; -+ u32 address_lo_save; -+ u32 data_save; -+#endif - }; - - #endif /* MSI_H */ ---- gregkh-2.6.orig/include/asm-i386/msi.h -+++ gregkh-2.6/include/asm-i386/msi.h -@@ -12,4 +12,12 @@ - #define LAST_DEVICE_VECTOR 232 - #define MSI_TARGET_CPU_SHIFT 12 - -+extern struct msi_ops msi_apic_ops; -+ -+static inline int msi_arch_init(void) -+{ -+ msi_register(&msi_apic_ops); -+ return 0; -+} -+ - #endif /* ASM_MSI_H */ ---- gregkh-2.6.orig/include/asm-ia64/machvec.h -+++ gregkh-2.6/include/asm-ia64/machvec.h -@@ -75,6 +75,7 @@ typedef unsigned char ia64_mv_readb_rela - typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *); - typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); - typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); -+typedef int ia64_mv_msi_init_t (void); - - static inline void - machvec_noop (void) -@@ -153,6 +154,7 @@ extern void machvec_tlb_migrate_finish ( - # define platform_readl_relaxed ia64_mv.readl_relaxed - # define platform_readq_relaxed ia64_mv.readq_relaxed - # define platform_migrate ia64_mv.migrate -+# define platform_msi_init ia64_mv.msi_init - # endif - - /* __attribute__((__aligned__(16))) is required to make size of the -@@ -202,6 +204,7 @@ struct ia64_machine_vector { - ia64_mv_readl_relaxed_t *readl_relaxed; - ia64_mv_readq_relaxed_t *readq_relaxed; - ia64_mv_migrate_t *migrate; -+ ia64_mv_msi_init_t *msi_init; - } __attribute__((__aligned__(16))); /* align attrib? see above comment */ - - #define MACHVEC_INIT(name) \ -@@ -247,6 +250,7 @@ struct ia64_machine_vector { - platform_readl_relaxed, \ - platform_readq_relaxed, \ - platform_migrate, \ -+ platform_msi_init, \ - } - - extern struct ia64_machine_vector ia64_mv; -@@ -400,5 +404,8 @@ extern int ia64_pci_legacy_write(struct - #ifndef platform_migrate - # define platform_migrate machvec_noop_task - #endif -+#ifndef platform_msi_init -+# define platform_msi_init ((ia64_mv_msi_init_t*)NULL) -+#endif - - #endif /* _ASM_IA64_MACHVEC_H */ ---- gregkh-2.6.orig/include/asm-ia64/machvec_sn2.h -+++ gregkh-2.6/include/asm-ia64/machvec_sn2.h -@@ -67,6 +67,8 @@ extern ia64_mv_dma_sync_sg_for_device sn - extern ia64_mv_dma_mapping_error sn_dma_mapping_error; - extern ia64_mv_dma_supported sn_dma_supported; - extern ia64_mv_migrate_t sn_migrate; -+extern ia64_mv_msi_init_t sn_msi_init; -+ - - /* - * This stuff has dual use! -@@ -117,6 +119,11 @@ extern ia64_mv_migrate_t sn_migrate; - #define platform_dma_mapping_error sn_dma_mapping_error - #define platform_dma_supported sn_dma_supported - #define platform_migrate sn_migrate -+#ifdef CONFIG_PCI_MSI -+#define platform_msi_init sn_msi_init -+#else -+#define platform_msi_init ((ia64_mv_msi_init_t*)NULL) -+#endif - - #include <asm/sn/io.h> - ---- gregkh-2.6.orig/include/asm-ia64/msi.h -+++ gregkh-2.6/include/asm-ia64/msi.h -@@ -14,4 +14,16 @@ static inline void set_intr_gate (int nr - #define ack_APIC_irq ia64_eoi - #define MSI_TARGET_CPU_SHIFT 4 - -+extern struct msi_ops msi_apic_ops; -+ -+static inline int msi_arch_init(void) -+{ -+ if (platform_msi_init) -+ return platform_msi_init(); -+ -+ /* default ops for most ia64 platforms */ -+ msi_register(&msi_apic_ops); -+ return 0; -+} -+ - #endif /* ASM_MSI_H */ ---- gregkh-2.6.orig/include/asm-x86_64/msi.h -+++ gregkh-2.6/include/asm-x86_64/msi.h -@@ -13,4 +13,12 @@ - #define LAST_DEVICE_VECTOR 232 - #define MSI_TARGET_CPU_SHIFT 12 - -+extern struct msi_ops msi_apic_ops; -+ -+static inline int msi_arch_init(void) -+{ -+ msi_register(&msi_apic_ops); -+ return 0; -+} -+ - #endif /* ASM_MSI_H */ diff --git a/pci/pci-msi-k8t-neo2-fir-run-only-where-needed.patch b/pci/pci-msi-k8t-neo2-fir-run-only-where-needed.patch deleted file mode 100644 index 984d6ad673db8..0000000000000 --- a/pci/pci-msi-k8t-neo2-fir-run-only-where-needed.patch +++ /dev/null @@ -1,61 +0,0 @@ -From akpm@osdl.org Mon Jun 5 00:13:26 2006 -Message-Id: <200606050713.k557DLt9003979@shell0.pdx.osdl.net> -Subject: PCI: MSI-K8T-Neo2-Fir: run only where needed -To: cw@f00f.org, greg@kroah.com, mm-commits@vger.kernel.org -From: akpm@osdl.org -Date: Mon, 05 Jun 2006 00:13:21 -0700 - -From: Chris Wedgwood <cw@f00f.org> - -Be more selective when running the MSI-K8T-Neo2Fir soundcard PCI quirk so -as not to run this on hardware where it's probably not needed. - -Signed-off-by: Chris Wedgwood <cw@f00f.org> -Signed-off-by: Andrew Morton <akpm@osdl.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - - ---- - drivers/pci/quirks.c | 17 ++++++++++------- - 1 file changed, 10 insertions(+), 7 deletions(-) - ---- gregkh-2.6.orig/drivers/pci/quirks.c -+++ gregkh-2.6/drivers/pci/quirks.c -@@ -889,27 +889,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I - * when a PCI-Soundcard is added. The BIOS only gives Options - * "Disabled" and "AUTO". This Quirk Sets the corresponding - * Register-Value to enable the Soundcard. -+ * -+ * FIXME: Presently this quirk will run on anything that has an 8237 -+ * which isn't correct, we need to check DMI tables or something in -+ * order to make sure it only runs on the MSI-K8T-Neo2Fir. Because it -+ * runs everywhere at present we suppress the printk output in most -+ * irrelevant cases. - */ - static void __init k8t_sound_hostbridge(struct pci_dev *dev) - { - unsigned char val; - -- printk(KERN_INFO "PCI: Quirk-MSI-K8T Soundcard On\n"); - pci_read_config_byte(dev, 0x50, &val); - if (val == 0x88 || val == 0xc8) { -+ /* Assume it's probably a MSI-K8T-Neo2Fir */ -+ printk(KERN_INFO "PCI: MSI-K8T-Neo2Fir, attempting to turn soundcard ON\n"); - pci_write_config_byte(dev, 0x50, val & (~0x40)); - - /* Verify the Change for Status output */ - pci_read_config_byte(dev, 0x50, &val); - if (val & 0x40) -- printk(KERN_INFO "PCI: MSI-K8T soundcard still off\n"); -+ printk(KERN_INFO "PCI: MSI-K8T-Neo2Fir, soundcard still off\n"); - else -- printk(KERN_INFO "PCI: MSI-K8T soundcard on\n"); -- } else { -- printk(KERN_INFO "PCI: Unexpected Value in PCI-Register: " -- "no Change!\n"); -+ printk(KERN_INFO "PCI: MSI-K8T-Neo2Fir, soundcard on\n"); - } -- - } - DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_hostbridge); - diff --git a/pci/pci-nvidia-quirk-to-make-aer-pci-e-extended-capability-visible.patch b/pci/pci-nvidia-quirk-to-make-aer-pci-e-extended-capability-visible.patch deleted file mode 100644 index b42fe1fb3ebb9..0000000000000 --- a/pci/pci-nvidia-quirk-to-make-aer-pci-e-extended-capability-visible.patch +++ /dev/null @@ -1,62 +0,0 @@ -From brice@myri.com Tue Jun 13 11:36:06 2006 -Message-ID: <448F057E.1040104@myri.com> -Date: Tue, 13 Jun 2006 14:35:42 -0400 -From: Brice Goglin <brice@myri.com> -To: Greg KH <gregkh@suse.de> -Subject: PCI: nVidia quirk to make AER PCI-E extended capability visible - -The nVidia CK804 PCI-E chipset supports the AER extended capability -but sometimes fails to link it (with some BIOS or after a warm reboot). -It makes the AER cap invisible to pci_find_ext_capability(). - -The patch adds a quirk to set the missing bit that controls the -linking of the capability. -By the way, it removes the corresponding code in the myri10ge driver. - -Signed-off-by: Brice Goglin <brice@myri.com> -Signed-off-by: Loic Prylli <loic@myri.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/pci/quirks.c | 19 +++++++++++++++++++ - include/linux/pci_ids.h | 1 + - 2 files changed, 20 insertions(+) - ---- gregkh-2.6.orig/drivers/pci/quirks.c -+++ gregkh-2.6/drivers/pci/quirks.c -@@ -1499,6 +1499,25 @@ static void __devinit quirk_p64h2_1k_io( - } - DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io); - -+/* Under some circumstances, AER is not linked with extended capabilities. -+ * Force it to be linked by setting the corresponding control bit in the -+ * config space. -+ */ -+static void __devinit quirk_nvidia_ck804_pcie_aer_ext_cap(struct pci_dev *dev) -+{ -+ uint8_t b; -+ if (pci_read_config_byte(dev, 0xf41, &b) == 0) { -+ if (!(b & 0x20)) { -+ pci_write_config_byte(dev, 0xf41, b | 0x20); -+ printk(KERN_INFO -+ "PCI: Linking AER extended capability on %s\n", -+ pci_name(dev)); -+ } -+ } -+} -+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, -+ quirk_nvidia_ck804_pcie_aer_ext_cap); -+ - EXPORT_SYMBOL(pcie_mch_quirk); - #ifdef CONFIG_HOTPLUG - EXPORT_SYMBOL(pci_fixup_device); ---- gregkh-2.6.orig/include/linux/pci_ids.h -+++ gregkh-2.6/include/linux/pci_ids.h -@@ -1026,6 +1026,7 @@ - #define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056 - #define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057 - #define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 -+#define PCI_DEVICE_ID_NVIDIA_CK804_PCIE 0x005d - #define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 - #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065 - #define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066 diff --git a/pci/pci-per-platform-ia64_-first-last-_device_vector-definitions.patch b/pci/pci-per-platform-ia64_-first-last-_device_vector-definitions.patch deleted file mode 100644 index c0e4ff3929eff..0000000000000 --- a/pci/pci-per-platform-ia64_-first-last-_device_vector-definitions.patch +++ /dev/null @@ -1,153 +0,0 @@ -From maule@sgi.com Fri Apr 14 14:10:57 2006 -Date: Fri, 14 Apr 2006 16:03:49 -0500 (CDT) -From: Mark Maule <maule@sgi.com> -To: gregkh@suse.de -Cc: Mark Maule <maule@sgi.com> -Message-Id: <20060414210349.10934.79945.49083@attica.americas.sgi.com> -Subject: PCI: per-platform IA64_{FIRST,LAST}_DEVICE_VECTOR definitions - -Abstract IA64_FIRST_DEVICE_VECTOR/IA64_LAST_DEVICE_VECTOR since SN platforms -use a subset of the IA64 range. Implement this by making the above macros -global variables which the platform can override in it setup code. - -Also add a reserve_irq_vector() routine used by SN to mark a vector's as -in-use when that weren't allocated through assign_irq_vector(). - -Signed-off-by: Mark Maule <maule@sgi.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - arch/ia64/kernel/irq_ia64.c | 19 ++++++++++++++++++- - arch/ia64/sn/kernel/irq.c | 7 +++++++ - drivers/pci/msi.c | 6 +++++- - include/asm-ia64/hw_irq.h | 15 +++++++++++++-- - 4 files changed, 43 insertions(+), 4 deletions(-) - ---- gregkh-2.6.orig/arch/ia64/kernel/irq_ia64.c -+++ gregkh-2.6/arch/ia64/kernel/irq_ia64.c -@@ -46,6 +46,10 @@ - - #define IRQ_DEBUG 0 - -+/* These can be overridden in platform_irq_init */ -+int ia64_first_device_vector = IA64_DEF_FIRST_DEVICE_VECTOR; -+int ia64_last_device_vector = IA64_DEF_LAST_DEVICE_VECTOR; -+ - /* default base addr of IPI table */ - void __iomem *ipi_base_addr = ((void __iomem *) - (__IA64_UNCACHED_OFFSET | IA64_IPI_DEFAULT_BASE_ADDR)); -@@ -60,7 +64,7 @@ __u8 isa_irq_to_vector_map[16] = { - }; - EXPORT_SYMBOL(isa_irq_to_vector_map); - --static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_NUM_DEVICE_VECTORS)]; -+static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_MAX_DEVICE_VECTORS)]; - - int - assign_irq_vector (int irq) -@@ -89,6 +93,19 @@ free_irq_vector (int vector) - printk(KERN_WARNING "%s: double free!\n", __FUNCTION__); - } - -+int -+reserve_irq_vector (int vector) -+{ -+ int pos; -+ -+ if (vector < IA64_FIRST_DEVICE_VECTOR || -+ vector > IA64_LAST_DEVICE_VECTOR) -+ return -EINVAL; -+ -+ pos = vector - IA64_FIRST_DEVICE_VECTOR; -+ return test_and_set_bit(pos, ia64_vector_mask); -+} -+ - #ifdef CONFIG_SMP - # define IS_RESCHEDULE(vec) (vec == IA64_IPI_RESCHEDULE) - #else ---- gregkh-2.6.orig/arch/ia64/sn/kernel/irq.c -+++ gregkh-2.6/arch/ia64/sn/kernel/irq.c -@@ -202,6 +202,9 @@ void sn_irq_init(void) - int i; - irq_desc_t *base_desc = irq_desc; - -+ ia64_first_device_vector = IA64_SN2_FIRST_DEVICE_VECTOR; -+ ia64_last_device_vector = IA64_SN2_LAST_DEVICE_VECTOR; -+ - for (i = 0; i < NR_IRQS; i++) { - if (base_desc[i].handler == &no_irq_type) { - base_desc[i].handler = &irq_type_sn; -@@ -285,6 +288,7 @@ void sn_irq_fixup(struct pci_dev *pci_de - /* link it into the sn_irq[irq] list */ - spin_lock(&sn_irq_info_lock); - list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]); -+ reserve_irq_vector(sn_irq_info->irq_irq); - spin_unlock(&sn_irq_info_lock); - - register_intr_pda(sn_irq_info); -@@ -310,8 +314,11 @@ void sn_irq_unfixup(struct pci_dev *pci_ - spin_lock(&sn_irq_info_lock); - list_del_rcu(&sn_irq_info->list); - spin_unlock(&sn_irq_info_lock); -+ if (list_empty(sn_irq_lh[sn_irq_info->irq_irq])) -+ free_irq_vector(sn_irq_info->irq_irq); - call_rcu(&sn_irq_info->rcu, sn_irq_info_free); - pci_dev_put(pci_dev); -+ - } - - static inline void ---- gregkh-2.6.orig/drivers/pci/msi.c -+++ gregkh-2.6/drivers/pci/msi.c -@@ -35,7 +35,7 @@ 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] = { FIRST_DEVICE_VECTOR , 0 }; -+u8 irq_vector[NR_IRQ_VECTORS]; - #endif - - static struct msi_ops *msi_ops; -@@ -383,6 +383,10 @@ 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-ia64/hw_irq.h -+++ gregkh-2.6/include/asm-ia64/hw_irq.h -@@ -47,9 +47,19 @@ typedef u8 ia64_vector; - #define IA64_CMC_VECTOR 0x1f /* corrected machine-check interrupt vector */ - /* - * Vectors 0x20-0x2f are reserved for legacy ISA IRQs. -+ * Use vectors 0x30-0xe7 as the default device vector range for ia64. -+ * Platforms may choose to reduce this range in platform_irq_setup, but the -+ * platform range must fall within -+ * [IA64_DEF_FIRST_DEVICE_VECTOR..IA64_DEF_LAST_DEVICE_VECTOR] - */ --#define IA64_FIRST_DEVICE_VECTOR 0x30 --#define IA64_LAST_DEVICE_VECTOR 0xe7 -+extern int ia64_first_device_vector; -+extern int ia64_last_device_vector; -+ -+#define IA64_DEF_FIRST_DEVICE_VECTOR 0x30 -+#define IA64_DEF_LAST_DEVICE_VECTOR 0xe7 -+#define IA64_FIRST_DEVICE_VECTOR ia64_first_device_vector -+#define IA64_LAST_DEVICE_VECTOR ia64_last_device_vector -+#define IA64_MAX_DEVICE_VECTORS (IA64_DEF_LAST_DEVICE_VECTOR - IA64_DEF_FIRST_DEVICE_VECTOR + 1) - #define IA64_NUM_DEVICE_VECTORS (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1) - - #define IA64_MCA_RENDEZ_VECTOR 0xe8 /* MCA rendez interrupt */ -@@ -83,6 +93,7 @@ extern struct hw_interrupt_type irq_type - - extern int assign_irq_vector (int irq); /* allocate a free vector */ - extern void free_irq_vector (int vector); -+extern int reserve_irq_vector (int vector); - extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); - extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); - diff --git a/pci/pci-remove-unneeded-msi-code.patch b/pci/pci-remove-unneeded-msi-code.patch deleted file mode 100644 index 0241be3e8ca4e..0000000000000 --- a/pci/pci-remove-unneeded-msi-code.patch +++ /dev/null @@ -1,85 +0,0 @@ -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", |