aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/proc.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2005-05-13 03:44:10 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-28 00:52:45 -0400
commit2311b1f2bbd36fa5f366a7448c718b2556e0f02c (patch)
tree10e836c5c34893f8098464a5ae15aba351a7bb2a /drivers/pci/proc.c
parenta0d399a808916d22c1c222c6b5ca4e8edd6d91a9 (diff)
[PATCH] PCI: fix-pci-mmap-on-ppc-and-ppc64.patch
This is an updated version of Ben's fix-pci-mmap-on-ppc-and-ppc64.patch which is in 2.6.12-rc4-mm1. It fixes the patch to work on PPC iSeries, removes some debug printks at Ben's request, and incorporates your fix-pci-mmap-on-ppc-and-ppc64-fix.patch also. Originally from Benjamin Herrenschmidt <benh@kernel.crashing.org> This patch was discussed at length on linux-pci and so far, the last iteration of it didn't raise any comment. It's effect is a nop on architecture that don't define the new pci_resource_to_user() callback anyway. It allows architecture like ppc who put weird things inside of PCI resource structures to convert to some different value for user visible ones. It also fixes mmap'ing of IO space on those archs. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/proc.c')
-rw-r--r--drivers/pci/proc.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index e68bbfb1e7c3..7988fc8df3fd 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -355,14 +355,20 @@ static int show_device(struct seq_file *m, void *v)
355 dev->device, 355 dev->device,
356 dev->irq); 356 dev->irq);
357 /* Here should be 7 and not PCI_NUM_RESOURCES as we need to preserve compatibility */ 357 /* Here should be 7 and not PCI_NUM_RESOURCES as we need to preserve compatibility */
358 for(i=0; i<7; i++) 358 for (i=0; i<7; i++) {
359 u64 start, end;
360 pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
359 seq_printf(m, LONG_FORMAT, 361 seq_printf(m, LONG_FORMAT,
360 dev->resource[i].start | 362 ((unsigned long)start) |
361 (dev->resource[i].flags & PCI_REGION_FLAG_MASK)); 363 (dev->resource[i].flags & PCI_REGION_FLAG_MASK));
362 for(i=0; i<7; i++) 364 }
365 for (i=0; i<7; i++) {
366 u64 start, end;
367 pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
363 seq_printf(m, LONG_FORMAT, 368 seq_printf(m, LONG_FORMAT,
364 dev->resource[i].start < dev->resource[i].end ? 369 dev->resource[i].start < dev->resource[i].end ?
365 dev->resource[i].end - dev->resource[i].start + 1 : 0); 370 (unsigned long)(end - start) + 1 : 0);
371 }
366 seq_putc(m, '\t'); 372 seq_putc(m, '\t');
367 if (drv) 373 if (drv)
368 seq_printf(m, "%s", drv->name); 374 seq_printf(m, "%s", drv->name);