blob: 6e5f5447973dd0773b51ff2beeded3d90962f0bb [file] [log] [blame]
Brad Bishop286d45c2018-10-02 15:21:57 -04001From a8190cd3b346633016d1c0096ef73e0e1ceef438 Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurki@xilinx.com>
3Date: Tue, 5 Dec 2017 09:25:15 -0800
4Subject: [PATCH 7/9] Replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL
5
6Refer kernel patch dcda9b04713c3f6ff0875652924844fae28286ea
7which replaces with a useful semantic
8
9Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com>
10Upstream-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
16diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c
17index 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)
32diff --git a/driver/src/devicedrv/mali/linux/mali_osk_notification.c b/driver/src/devicedrv/mali/linux/mali_osk_notification.c
33index 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--
532.7.4
54