s390/mm: fix MAX_DMA_ADDRESS physical vs virtual confusion
authorAlexander Gordeev <agordeev@linux.ibm.com>
Fri, 1 Sep 2023 13:12:13 +0000 (15:12 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 5 Sep 2023 18:12:51 +0000 (20:12 +0200)
MAX_DMA_ADDRESS is defined and treated as a physical address,
whereas it should be virtual.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/dma.h
arch/s390/mm/init.c

index c260adb..7fe3e31 100644 (file)
@@ -9,6 +9,6 @@
  * to DMA. It _is_ used for the s390 memory zone split at 2GB caused
  * by the 31 bit heritage.
  */
-#define MAX_DMA_ADDRESS         0x80000000
+#define MAX_DMA_ADDRESS                __va(0x80000000)
 
 #endif /* _ASM_S390_DMA_H */
index d1631f8..8b94d22 100644 (file)
@@ -98,7 +98,7 @@ void __init paging_init(void)
        sparse_init();
        zone_dma_bits = 31;
        memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
-       max_zone_pfns[ZONE_DMA] = PFN_DOWN(MAX_DMA_ADDRESS);
+       max_zone_pfns[ZONE_DMA] = virt_to_pfn(MAX_DMA_ADDRESS);
        max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
        free_area_init(max_zone_pfns);
 }