powerpc: Fix assmption of end_of_DRAM() returns end address
authorBharat Bhushan <r65777@freescale.com>
Tue, 5 Jun 2012 03:55:04 +0000 (03:55 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 3 Jul 2012 04:14:49 +0000 (14:14 +1000)
memblock_end_of_DRAM() returns end_address + 1, not end address.
While some code assumes that it returns end address.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/44x/currituck.c
arch/powerpc/platforms/85xx/corenet_ds.c
arch/powerpc/platforms/85xx/ge_imp3a.c
arch/powerpc/platforms/85xx/mpc8536_ds.c
arch/powerpc/platforms/85xx/mpc85xx_ds.c
arch/powerpc/platforms/85xx/mpc85xx_mds.c
arch/powerpc/platforms/85xx/p1022_ds.c
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c

index 583e67fee37ee1fd4daddc84ea3064fc4178ed6c..9f6c33d63a42c207a80444650646c1b3a1af7d08 100644 (file)
@@ -160,7 +160,7 @@ static void __init ppc47x_setup_arch(void)
        /* No need to check the DMA config as we /know/ our windows are all of
         * RAM.  Lets hope that doesn't change */
 #ifdef CONFIG_SWIOTLB
-       if (memblock_end_of_DRAM() > 0xffffffff) {
+       if ((memblock_end_of_DRAM() - 1) > 0xffffffff) {
                ppc_swiotlb_enable = 1;
                set_pci_dma_ops(&swiotlb_dma_ops);
                ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
index dd3617c531d74260e01cbd88640e586a9f9ea2bd..925b02874233fe52dc118eec691a334d3be5fde8 100644 (file)
@@ -77,7 +77,7 @@ void __init corenet_ds_setup_arch(void)
 #endif
 
 #ifdef CONFIG_SWIOTLB
-       if (memblock_end_of_DRAM() > max) {
+       if ((memblock_end_of_DRAM() - 1) > max) {
                ppc_swiotlb_enable = 1;
                set_pci_dma_ops(&swiotlb_dma_ops);
                ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
index 18014629416df50976ccc74e93fcb99cccc6f7ce..b6a728b0a8ca0aae6427e619046633b94a35cd25 100644 (file)
@@ -125,7 +125,7 @@ static void __init ge_imp3a_setup_arch(void)
        mpc85xx_smp_init();
 
 #ifdef CONFIG_SWIOTLB
-       if (memblock_end_of_DRAM() > max) {
+       if ((memblock_end_of_DRAM() - 1) > max) {
                ppc_swiotlb_enable = 1;
                set_pci_dma_ops(&swiotlb_dma_ops);
                ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
index 585bd22b14062b897bc18d0be1244f8e52cc4030..767c7cf18a9c978f7b9b70f700ed5ca496fdfd73 100644 (file)
@@ -75,7 +75,7 @@ static void __init mpc8536_ds_setup_arch(void)
 #endif
 
 #ifdef CONFIG_SWIOTLB
-       if (memblock_end_of_DRAM() > max) {
+       if ((memblock_end_of_DRAM() - 1) > max) {
                ppc_swiotlb_enable = 1;
                set_pci_dma_ops(&swiotlb_dma_ops);
                ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
index 1fd91e9e0ffbc766452a925edd6eb8007b56a422..d30f6c47917d968ca72e088fae7bccf0b7207356 100644 (file)
@@ -173,7 +173,7 @@ static void __init mpc85xx_ds_setup_arch(void)
        mpc85xx_smp_init();
 
 #ifdef CONFIG_SWIOTLB
-       if (memblock_end_of_DRAM() > max) {
+       if ((memblock_end_of_DRAM() - 1) > max) {
                ppc_swiotlb_enable = 1;
                set_pci_dma_ops(&swiotlb_dma_ops);
                ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
index d208ebccb91cc5f5db92bee1cf47e82e0e0c4b31..8e4b094c553b49d142bceba1f29cf48c0805ed18 100644 (file)
@@ -359,7 +359,7 @@ static void __init mpc85xx_mds_setup_arch(void)
        mpc85xx_mds_qe_init();
 
 #ifdef CONFIG_SWIOTLB
-       if (memblock_end_of_DRAM() > max) {
+       if ((memblock_end_of_DRAM() - 1) > max) {
                ppc_swiotlb_enable = 1;
                set_pci_dma_ops(&swiotlb_dma_ops);
                ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
index f700c81a1321ca2de222b6f1561408e454094204..74e310b4b460b3ddba96b336014bb74e1b642591 100644 (file)
@@ -450,7 +450,7 @@ static void __init p1022_ds_setup_arch(void)
        mpc85xx_smp_init();
 
 #ifdef CONFIG_SWIOTLB
-       if (memblock_end_of_DRAM() > max) {
+       if ((memblock_end_of_DRAM() - 1) > max) {
                ppc_swiotlb_enable = 1;
                set_pci_dma_ops(&swiotlb_dma_ops);
                ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
index 3755e61d7ecfac489a8ca6837a93f49c54132782..817245bc02195a37917b5dd341d7790ba5a50737 100644 (file)
@@ -102,7 +102,7 @@ mpc86xx_hpcn_setup_arch(void)
 #endif
 
 #ifdef CONFIG_SWIOTLB
-       if (memblock_end_of_DRAM() > max) {
+       if ((memblock_end_of_DRAM() - 1) > max) {
                ppc_swiotlb_enable = 1;
                set_pci_dma_ops(&swiotlb_dma_ops);
                ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;