File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -512,6 +512,10 @@ static u64 __init fadump_locate_reserve_mem(u64 base, u64 size)
512
512
phys_addr_t mstart , mend ;
513
513
int idx = 0 ;
514
514
u64 i , ret = 0 ;
515
+ unsigned long align = PAGE_SIZE ;
516
+
517
+ if (IS_ENABLED (CONFIG_CMA ) && !fw_dump .nocma )
518
+ align = CMA_MIN_ALIGNMENT_BYTES ;
515
519
516
520
mrngs = reserved_mrange_info .mem_ranges ;
517
521
for_each_free_mem_range (i , NUMA_NO_NODE , MEMBLOCK_NONE ,
@@ -520,7 +524,7 @@ static u64 __init fadump_locate_reserve_mem(u64 base, u64 size)
520
524
i , mstart , mend , base );
521
525
522
526
if (mstart > base )
523
- base = PAGE_ALIGN (mstart );
527
+ base = ALIGN (mstart , align );
524
528
525
529
while ((mend > base ) && ((mend - base ) >= size )) {
526
530
if (!overlaps_reserved_ranges (base , base + size , & idx )) {
@@ -529,7 +533,7 @@ static u64 __init fadump_locate_reserve_mem(u64 base, u64 size)
529
533
}
530
534
531
535
base = mrngs [idx ].base + mrngs [idx ].size ;
532
- base = PAGE_ALIGN (base );
536
+ base = ALIGN (base , align );
533
537
}
534
538
}
535
539
Original file line number Diff line number Diff line change 5
5
#include <linux/init.h>
6
6
#include <linux/types.h>
7
7
#include <linux/numa.h>
8
+ #include <linux/minmax.h>
8
9
9
10
#ifdef CONFIG_CMA_AREAS
10
11
#define MAX_CMA_AREAS CONFIG_CMA_AREAS
17
18
* -- can deal with only some pageblocks of a higher-order page being
18
19
* MIGRATE_CMA, we can use pageblock_nr_pages.
19
20
*/
20
- #define CMA_MIN_ALIGNMENT_PAGES pageblock_nr_pages
21
+ #define CMA_MIN_ALIGNMENT_PAGES \
22
+ (1ULL << min_not_zero(MAX_PAGE_ORDER, pageblock_order))
21
23
#define CMA_MIN_ALIGNMENT_BYTES (PAGE_SIZE * CMA_MIN_ALIGNMENT_PAGES)
22
24
23
25
struct cma ;
You can’t perform that action at this time.
0 commit comments