Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 1 | From a8190cd3b346633016d1c0096ef73e0e1ceef438 Mon Sep 17 00:00:00 2001 |
| 2 | From: Madhurkiran Harikrishnan <madhurki@xilinx.com> |
| 3 | Date: Tue, 5 Dec 2017 09:25:15 -0800 |
| 4 | Subject: [PATCH 7/9] Replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL |
| 5 | |
| 6 | Refer kernel patch dcda9b04713c3f6ff0875652924844fae28286ea |
| 7 | which replaces with a useful semantic |
| 8 | |
| 9 | Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com> |
| 10 | Upstream-Status: Pending |
| 11 | --- |
| 12 | driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c | 4 ++++ |
| 13 | driver/src/devicedrv/mali/linux/mali_osk_notification.c | 7 ++++++- |
| 14 | 2 files changed, 10 insertions(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c |
| 17 | index 5fe1270..1602371 100644 |
| 18 | --- linux/mali_memory_os_alloc.c |
| 19 | +++ b/linux/mali_memory_os_alloc.c |
| 20 | @@ -202,7 +202,11 @@ int mali_mem_os_alloc_pages(mali_mem_os_mem *os_mem, u32 size) |
| 21 | /* Allocate new pages, if needed. */ |
| 22 | for (i = 0; i < remaining; i++) { |
| 23 | dma_addr_t dma_addr; |
| 24 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) |
| 25 | + gfp_t flags = __GFP_ZERO | __GFP_RETRY_MAYFAIL | __GFP_NOWARN | __GFP_COLD; |
| 26 | +#else |
| 27 | gfp_t flags = __GFP_ZERO | __GFP_REPEAT | __GFP_NOWARN | __GFP_COLD; |
| 28 | +#endif |
| 29 | int err; |
| 30 | |
| 31 | #if defined(CONFIG_ARM) && !defined(CONFIG_ARM_LPAE) |
| 32 | diff --git a/driver/src/devicedrv/mali/linux/mali_osk_notification.c b/driver/src/devicedrv/mali/linux/mali_osk_notification.c |
| 33 | index b22fe68..d0c302a 100644 |
| 34 | --- linux/mali_osk_notification.c |
| 35 | +++ b/linux/mali_osk_notification.c |
| 36 | @@ -55,9 +55,14 @@ _mali_osk_notification_t *_mali_osk_notification_create(u32 type, u32 size) |
| 37 | { |
| 38 | /* OPT Recycling of notification objects */ |
| 39 | _mali_osk_notification_wrapper_t *notification; |
| 40 | - |
| 41 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) |
| 42 | + notification = (_mali_osk_notification_wrapper_t *)kmalloc(sizeof(_mali_osk_notification_wrapper_t) + size, |
| 43 | + GFP_KERNEL | __GFP_HIGH | __GFP_RETRY_MAYFAIL); |
| 44 | +#else |
| 45 | notification = (_mali_osk_notification_wrapper_t *)kmalloc(sizeof(_mali_osk_notification_wrapper_t) + size, |
| 46 | GFP_KERNEL | __GFP_HIGH | __GFP_REPEAT); |
| 47 | +#endif |
| 48 | + |
| 49 | if (NULL == notification) { |
| 50 | MALI_DEBUG_PRINT(1, ("Failed to create a notification object\n")); |
| 51 | return NULL; |
| 52 | -- |
| 53 | 2.7.4 |
| 54 | |