diff options
author | Bharat Bhushan <r65777@freescale.com> | 2012-06-04 23:55:04 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-07-03 00:14:49 -0400 |
commit | a5cb82da786f610f7e84a0a8bcf9e0218c363040 (patch) | |
tree | 3c5f1d32541fc6e438c9ee3932eaa1119f58fa9d | |
parent | cf8fb5533f35709ba7e31560264b565a9c7a090f (diff) |
powerpc: Fix assmption of end_of_DRAM() returns end address
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>
-rw-r--r-- | arch/powerpc/platforms/44x/currituck.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/corenet_ds.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/ge_imp3a.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc8536_ds.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_ds.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_mds.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/p1022_ds.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/44x/currituck.c b/arch/powerpc/platforms/44x/currituck.c index 583e67fee37e..9f6c33d63a42 100644 --- a/arch/powerpc/platforms/44x/currituck.c +++ b/arch/powerpc/platforms/44x/currituck.c | |||
@@ -160,7 +160,7 @@ static void __init ppc47x_setup_arch(void) | |||
160 | /* No need to check the DMA config as we /know/ our windows are all of | 160 | /* No need to check the DMA config as we /know/ our windows are all of |
161 | * RAM. Lets hope that doesn't change */ | 161 | * RAM. Lets hope that doesn't change */ |
162 | #ifdef CONFIG_SWIOTLB | 162 | #ifdef CONFIG_SWIOTLB |
163 | if (memblock_end_of_DRAM() > 0xffffffff) { | 163 | if ((memblock_end_of_DRAM() - 1) > 0xffffffff) { |
164 | ppc_swiotlb_enable = 1; | 164 | ppc_swiotlb_enable = 1; |
165 | set_pci_dma_ops(&swiotlb_dma_ops); | 165 | set_pci_dma_ops(&swiotlb_dma_ops); |
166 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | 166 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; |
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c index dd3617c531d7..925b02874233 100644 --- a/arch/powerpc/platforms/85xx/corenet_ds.c +++ b/arch/powerpc/platforms/85xx/corenet_ds.c | |||
@@ -77,7 +77,7 @@ void __init corenet_ds_setup_arch(void) | |||
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #ifdef CONFIG_SWIOTLB | 79 | #ifdef CONFIG_SWIOTLB |
80 | if (memblock_end_of_DRAM() > max) { | 80 | if ((memblock_end_of_DRAM() - 1) > max) { |
81 | ppc_swiotlb_enable = 1; | 81 | ppc_swiotlb_enable = 1; |
82 | set_pci_dma_ops(&swiotlb_dma_ops); | 82 | set_pci_dma_ops(&swiotlb_dma_ops); |
83 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | 83 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; |
diff --git a/arch/powerpc/platforms/85xx/ge_imp3a.c b/arch/powerpc/platforms/85xx/ge_imp3a.c index 18014629416d..b6a728b0a8ca 100644 --- a/arch/powerpc/platforms/85xx/ge_imp3a.c +++ b/arch/powerpc/platforms/85xx/ge_imp3a.c | |||
@@ -125,7 +125,7 @@ static void __init ge_imp3a_setup_arch(void) | |||
125 | mpc85xx_smp_init(); | 125 | mpc85xx_smp_init(); |
126 | 126 | ||
127 | #ifdef CONFIG_SWIOTLB | 127 | #ifdef CONFIG_SWIOTLB |
128 | if (memblock_end_of_DRAM() > max) { | 128 | if ((memblock_end_of_DRAM() - 1) > max) { |
129 | ppc_swiotlb_enable = 1; | 129 | ppc_swiotlb_enable = 1; |
130 | set_pci_dma_ops(&swiotlb_dma_ops); | 130 | set_pci_dma_ops(&swiotlb_dma_ops); |
131 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | 131 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; |
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c index 585bd22b1406..767c7cf18a9c 100644 --- a/arch/powerpc/platforms/85xx/mpc8536_ds.c +++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c | |||
@@ -75,7 +75,7 @@ static void __init mpc8536_ds_setup_arch(void) | |||
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | #ifdef CONFIG_SWIOTLB | 77 | #ifdef CONFIG_SWIOTLB |
78 | if (memblock_end_of_DRAM() > max) { | 78 | if ((memblock_end_of_DRAM() - 1) > max) { |
79 | ppc_swiotlb_enable = 1; | 79 | ppc_swiotlb_enable = 1; |
80 | set_pci_dma_ops(&swiotlb_dma_ops); | 80 | set_pci_dma_ops(&swiotlb_dma_ops); |
81 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | 81 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 1fd91e9e0ffb..d30f6c47917d 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
@@ -173,7 +173,7 @@ static void __init mpc85xx_ds_setup_arch(void) | |||
173 | mpc85xx_smp_init(); | 173 | mpc85xx_smp_init(); |
174 | 174 | ||
175 | #ifdef CONFIG_SWIOTLB | 175 | #ifdef CONFIG_SWIOTLB |
176 | if (memblock_end_of_DRAM() > max) { | 176 | if ((memblock_end_of_DRAM() - 1) > max) { |
177 | ppc_swiotlb_enable = 1; | 177 | ppc_swiotlb_enable = 1; |
178 | set_pci_dma_ops(&swiotlb_dma_ops); | 178 | set_pci_dma_ops(&swiotlb_dma_ops); |
179 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | 179 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index d208ebccb91c..8e4b094c553b 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -359,7 +359,7 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
359 | mpc85xx_mds_qe_init(); | 359 | mpc85xx_mds_qe_init(); |
360 | 360 | ||
361 | #ifdef CONFIG_SWIOTLB | 361 | #ifdef CONFIG_SWIOTLB |
362 | if (memblock_end_of_DRAM() > max) { | 362 | if ((memblock_end_of_DRAM() - 1) > max) { |
363 | ppc_swiotlb_enable = 1; | 363 | ppc_swiotlb_enable = 1; |
364 | set_pci_dma_ops(&swiotlb_dma_ops); | 364 | set_pci_dma_ops(&swiotlb_dma_ops); |
365 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | 365 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; |
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c index f700c81a1321..74e310b4b460 100644 --- a/arch/powerpc/platforms/85xx/p1022_ds.c +++ b/arch/powerpc/platforms/85xx/p1022_ds.c | |||
@@ -450,7 +450,7 @@ static void __init p1022_ds_setup_arch(void) | |||
450 | mpc85xx_smp_init(); | 450 | mpc85xx_smp_init(); |
451 | 451 | ||
452 | #ifdef CONFIG_SWIOTLB | 452 | #ifdef CONFIG_SWIOTLB |
453 | if (memblock_end_of_DRAM() > max) { | 453 | if ((memblock_end_of_DRAM() - 1) > max) { |
454 | ppc_swiotlb_enable = 1; | 454 | ppc_swiotlb_enable = 1; |
455 | set_pci_dma_ops(&swiotlb_dma_ops); | 455 | set_pci_dma_ops(&swiotlb_dma_ops); |
456 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | 456 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; |
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c index 3755e61d7ecf..817245bc0219 100644 --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | |||
@@ -102,7 +102,7 @@ mpc86xx_hpcn_setup_arch(void) | |||
102 | #endif | 102 | #endif |
103 | 103 | ||
104 | #ifdef CONFIG_SWIOTLB | 104 | #ifdef CONFIG_SWIOTLB |
105 | if (memblock_end_of_DRAM() > max) { | 105 | if ((memblock_end_of_DRAM() - 1) > max) { |
106 | ppc_swiotlb_enable = 1; | 106 | ppc_swiotlb_enable = 1; |
107 | set_pci_dma_ops(&swiotlb_dma_ops); | 107 | set_pci_dma_ops(&swiotlb_dma_ops); |
108 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; | 108 | ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; |