]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
siimage: fix kernel oops on PPC 44x
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Mon, 7 Apr 2008 21:30:10 +0000 (23:30 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Mon, 7 Apr 2008 21:30:10 +0000 (23:30 +0200)
Fix kernel oops due to machine check occuring in init_chipset_siimage() on PPC
44x platforms.  These 32-bit CPUs have 36-bit physical address and PCI I/O and
memory spaces are mapped beyond 4 GB; arch/ppc/ code has a fixup in ioremap()
that creates an illusion of the PCI I/O and memory resources being mapped below
4 GB, while arch/powerpc/ code got rid of this fixup with PPC 44x having instead
CONFIG_RESOURCES_64BIT=y -- this causes the resources to be truncated to 32-bit
'unsigned long' type in this driver, and so non-existant memory being ioremap'ed
and then accessed...

Thanks to Valentine Barshak for providing an initial patch and explanations.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/pci/siimage.c

index cc4be9621bc0ec04048f9811183283ece1d55e10..8d624afe8529995988f328770ac3cc266e9e14d4 100644 (file)
@@ -492,7 +492,7 @@ static void proc_reports_siimage (struct pci_dev *dev, u8 clocking, const char *
  
 static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name)
 {
-       unsigned long bar5      = pci_resource_start(dev, 5);
+       resource_size_t bar5    = pci_resource_start(dev, 5);
        unsigned long barsize   = pci_resource_len(dev, 5);
        u8 tmpbyte      = 0;
        void __iomem *ioaddr;