From: 黄涛 Date: Sat, 3 Aug 2013 06:58:02 +0000 (+0800) Subject: rk: mem_reserve: workaround for RGA driver, which may overflow on physical memory... X-Git-Tag: firefly_0821_release~6761 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=12c921d0814dc1990ddcc3c5c78e02bb9fe774ec;p=firefly-linux-kernel-4.4.55.git rk: mem_reserve: workaround for RGA driver, which may overflow on physical memory address parameter --- diff --git a/arch/arm/plat-rk/mem_reserve.c b/arch/arm/plat-rk/mem_reserve.c index 3e8b50e89d00..4017cb122d77 100644 --- a/arch/arm/plat-rk/mem_reserve.c +++ b/arch/arm/plat-rk/mem_reserve.c @@ -13,8 +13,12 @@ phys_addr_t __init board_mem_reserve_add(char *name, size_t size) phys_addr_t base = 0; size_t align_size = ALIGN_SZ(size, SZ_1M); - if(reserved_base_end == 0) + if (reserved_base_end == 0) { reserved_base_end = meminfo.bank[meminfo.nr_banks - 1].start + meminfo.bank[meminfo.nr_banks - 1].size; + /* Workaround for RGA driver, which may overflow on physical memory address parameter */ + if (reserved_base_end > 0xA0000000) + reserved_base_end = 0xA0000000; + } reserved_size += align_size; base = reserved_base_end - reserved_size;