]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
[SCSI] aic7xxx: fix MMIO for PPC 44x platforms
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Fri, 18 Apr 2008 19:30:45 +0000 (23:30 +0400)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 24 Apr 2008 14:09:49 +0000 (09:09 -0500)
The driver stores the PCI resource address into 'u_long' variable before
calling ioremap_nocache() on it. This warrants kernel oops when the registers
are accessed on PPC 44x platforms which (being 32-bit) have PCI memory space
mapped beyond 4 GB.

The arch/ppc/ kernel has a fixup in ioremap() that helps create an illusion
that the PCI memory resources are mapped below 4 GB, but arch/powerpc/ code
got rid of this trick, having instead CONFIG_RESOURCES_64BIT enabled.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/aic7xxx/aic7xxx_osm.h
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c

index 9d6e0660ddbc603ee08f40051b977673f9f5ac8a..c2a9ad76d35d1c71316d24b32bcac10958557a7a 100644 (file)
@@ -365,7 +365,7 @@ struct ahc_platform_data {
 #define AHC_LINUX_NOIRQ        ((uint32_t)~0)
        uint32_t                 irq;           /* IRQ for this adapter */
        uint32_t                 bios_address;
-       uint32_t                 mem_busaddr;   /* Mem Base Addr */
+       resource_size_t          mem_busaddr;   /* Mem Base Addr */
 };
 
 /************************** OS Utility Wrappers *******************************/
index bd422a80e9d5a1109e7cbc861e35b40d92037dbf..950a046788f0bad84ec466c8ced4a6af0bf0b938 100644 (file)
@@ -344,7 +344,7 @@ ahc_linux_pci_exit(void)
 }
 
 static int
-ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, u_long *base)
+ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, resource_size_t *base)
 {
        if (aic7xxx_allow_memio == 0)
                return (ENOMEM);
@@ -359,10 +359,10 @@ ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, u_long *base)
 
 static int
 ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc,
-                                u_long *bus_addr,
+                                resource_size_t *bus_addr,
                                 uint8_t __iomem **maddr)
 {
-       u_long  start;
+       resource_size_t start;
        int     error;
 
        error = 0;
@@ -387,7 +387,7 @@ int
 ahc_pci_map_registers(struct ahc_softc *ahc)
 {
        uint32_t command;
-       u_long   base;
+       resource_size_t base;
        uint8_t __iomem *maddr;
        int      error;
 
@@ -425,12 +425,12 @@ ahc_pci_map_registers(struct ahc_softc *ahc)
                } else
                        command |= PCIM_CMD_MEMEN;
        } else {
-               printf("aic7xxx: PCI%d:%d:%d MEM region 0x%lx "
+               printf("aic7xxx: PCI%d:%d:%d MEM region 0x%llx "
                       "unavailable. Cannot memory map device.\n",
                       ahc_get_pci_bus(ahc->dev_softc),
                       ahc_get_pci_slot(ahc->dev_softc),
                       ahc_get_pci_function(ahc->dev_softc),
-                      base);
+                      (unsigned long long)base);
        }
 
        /*
@@ -441,15 +441,15 @@ ahc_pci_map_registers(struct ahc_softc *ahc)
                error = ahc_linux_pci_reserve_io_region(ahc, &base);
                if (error == 0) {
                        ahc->tag = BUS_SPACE_PIO;
-                       ahc->bsh.ioport = base;
+                       ahc->bsh.ioport = (u_long)base;
                        command |= PCIM_CMD_PORTEN;
                } else {
-                       printf("aic7xxx: PCI%d:%d:%d IO region 0x%lx[0..255] "
+                       printf("aic7xxx: PCI%d:%d:%d IO region 0x%llx[0..255] "
                               "unavailable. Cannot map device.\n",
                               ahc_get_pci_bus(ahc->dev_softc),
                               ahc_get_pci_slot(ahc->dev_softc),
                               ahc_get_pci_function(ahc->dev_softc),
-                              base);
+                              (unsigned long long)base);
                }
        }
        ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, command, 4);