aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMadhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>2018-12-11 06:54:15 -0800
committerManjukumar Matha <manjukumar.harthikote-matha@xilinx.com>2019-06-28 14:20:30 -0700
commit22d9e2a8e00a029be125178ddddd1bbf653eb002 (patch)
tree7ce9d891c2b47b1a23a23ba3f41ae15b36b21b4d
parent092608220442b2ca86ef802cb9599c825f27216b (diff)
downloadmeta-xilinx-22d9e2a8e00a029be125178ddddd1bbf653eb002.tar.gz
meta-xilinx-22d9e2a8e00a029be125178ddddd1bbf653eb002.tar.bz2
meta-xilinx-22d9e2a8e00a029be125178ddddd1bbf653eb002.zip
kernel-module-mali: Fix errors associated with kernel upgrade to 4.19
These patches fixes errors caused by removal of ancient init_timer API. Also, addresses the removal of hot/cold cache pages in the kernel. Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
-rw-r--r--meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb3
-rw-r--r--meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch33
-rw-r--r--meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch34
-rw-r--r--meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch156
4 files changed, 226 insertions, 0 deletions
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
index 327f8f09..fe2fbdcf 100644
--- a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
+++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
@@ -21,6 +21,9 @@ SRC_URI = " \
file://0009-mali_memory_swap_alloc.c-Rename-global_page_state-wi.patch \
file://0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch \
file://0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch\
+ file://0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch\
+ file://0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch\
+ file://0014-linux-mali_-timer-Get-rid-of-init_timer.patch\
"
SRC_URI[md5sum] = "8f04ae86957fd56197ad5a9d017b84ff"
SRC_URI[sha256sum] = "bfd14fa3f75a71d4ba313534e651ca1c58dc354e882c0b39867e335882a06350"
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch
new file mode 100644
index 00000000..24f0a22c
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch
@@ -0,0 +1,33 @@
+From 779b1883d56804ecd08fe7f57d6c01e3db4e893b Mon Sep 17 00:00:00 2001
+From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
+Date: Wed, 5 Dec 2018 18:07:29 -0800
+Subject: [PATCH 1/3] linux: mali_memory_os_alloc: Remove __GFP_COLD
+
+The support for Cache hot and cold pages are removed from the kernel.
+For more information refer kernel commit 453f85d43fa9ee243f0fc3ac4e1be45615301e3f
+
+Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
+Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
+Upstream Status: Pending
+---
+ driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c
+index 1602371..830e8c6 100644
+--- linux/mali_memory_os_alloc.c
++++ b/linux/mali_memory_os_alloc.c
+@@ -202,7 +202,9 @@ int mali_mem_os_alloc_pages(mali_mem_os_mem *os_mem, u32 size)
+ /* Allocate new pages, if needed. */
+ for (i = 0; i < remaining; i++) {
+ dma_addr_t dma_addr;
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
++ gfp_t flags = __GFP_ZERO | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
++#elif LINUX_VERSION_CODE == KERNEL_VERSION(4, 14, 0)
+ gfp_t flags = __GFP_ZERO | __GFP_RETRY_MAYFAIL | __GFP_NOWARN | __GFP_COLD;
+ #else
+ gfp_t flags = __GFP_ZERO | __GFP_REPEAT | __GFP_NOWARN | __GFP_COLD;
+--
+2.7.4
+
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch
new file mode 100644
index 00000000..c28a83f4
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch
@@ -0,0 +1,34 @@
+From d20b6eb3e48e56558488dbdda98875b1aed0c29f Mon Sep 17 00:00:00 2001
+From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
+Date: Wed, 5 Dec 2018 18:13:28 -0800
+Subject: [PATCH 2/3] linux: mali_memory_secure: Add header file dma-direct.h
+
+Add dma-direct.h header, as API dma_to_phys is defined here.
+refer kernel commit ea8c64ace86647260ec4255f483e5844d62af2df
+
+Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
+Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
+Upstream Status: Pending
+---
+ driver/src/devicedrv/mali/linux/mali_memory_secure.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/driver/src/devicedrv/mali/linux/mali_memory_secure.c b/driver/src/devicedrv/mali/linux/mali_memory_secure.c
+index 2836b1b..4f55fa5 100644
+--- linux/mali_memory_secure.c
++++ b/linux/mali_memory_secure.c
+@@ -13,7 +13,11 @@
+ #include "mali_memory_secure.h"
+ #include "mali_osk.h"
+ #include <linux/mutex.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)
++#include <linux/dma-direct.h>
++#else
+ #include <linux/dma-mapping.h>
++#endif
+ #include <linux/dma-buf.h>
+
+ _mali_osk_errcode_t mali_mem_secure_attach_dma_buf(mali_mem_secure *secure_mem, u32 size, int mem_fd)
+--
+2.7.4
+
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch
new file mode 100644
index 00000000..a7c1d5cc
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch
@@ -0,0 +1,156 @@
+From b6936450484b5aa9dd2438367a907af020341d1d Mon Sep 17 00:00:00 2001
+From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
+Date: Thu, 6 Dec 2018 13:30:44 -0800
+Subject: [PATCH 3/3] linux: mali_*timer: Get rid of init_timer
+
+kernel 4.19 got rid of ancient init_timer. Hence, replace it with
+timer_setup API. For more information refer kernel commit
+7eeb6b893bd28c68b6d664de1d3120e49b855cdb
+
+Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
+Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
+Upstream Status: Pending
+---
+ driver/src/devicedrv/mali/common/mali_control_timer.c | 6 ++++++
+ driver/src/devicedrv/mali/common/mali_group.c | 6 ++++++
+ driver/src/devicedrv/mali/common/mali_osk.h | 15 ++++++++++++++-
+ driver/src/devicedrv/mali/linux/mali_osk_timers.c | 15 ++++++++++++++-
+ 4 files changed, 40 insertions(+), 2 deletions(-)
+
+diff --git a/driver/src/devicedrv/mali/common/mali_control_timer.c b/driver/src/devicedrv/mali/common/mali_control_timer.c
+index 1296ffe..d24b934 100644
+--- common/mali_control_timer.c
++++ b/common/mali_control_timer.c
+@@ -65,11 +65,17 @@ _mali_osk_errcode_t mali_control_timer_init(void)
+ }
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++ mali_control_timer = _mali_osk_timer_init(mali_control_timer_callback);
++#else
+ mali_control_timer = _mali_osk_timer_init();
++#endif
+ if (NULL == mali_control_timer) {
+ return _MALI_OSK_ERR_FAULT;
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
+ _mali_osk_timer_setcallback(mali_control_timer, mali_control_timer_callback, NULL);
++#endif
+
+ return _MALI_OSK_ERR_OK;
+ }
+diff --git a/driver/src/devicedrv/mali/common/mali_group.c b/driver/src/devicedrv/mali/common/mali_group.c
+index 5c7b3f4..1702e9a 100644
+--- common/mali_group.c
++++ b/common/mali_group.c
+@@ -65,9 +65,15 @@ struct mali_group *mali_group_create(struct mali_l2_cache_core *core,
+
+ group = _mali_osk_calloc(1, sizeof(struct mali_group));
+ if (NULL != group) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++ group->timeout_timer = _mali_osk_timer_init(mali_group_timeout);
++#else
+ group->timeout_timer = _mali_osk_timer_init();
++#endif
+ if (NULL != group->timeout_timer) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
+ _mali_osk_timer_setcallback(group->timeout_timer, mali_group_timeout, (void *)group);
++#endif
+
+ group->l2_cache_core[0] = core;
+ _mali_osk_list_init(&group->group_list);
+diff --git a/driver/src/devicedrv/mali/common/mali_osk.h b/driver/src/devicedrv/mali/common/mali_osk.h
+index a501778..fe93d79 100644
+--- common/mali_osk.h
++++ b/common/mali_osk.h
+@@ -947,7 +947,17 @@ _mali_osk_errcode_t _mali_osk_notification_queue_dequeue(_mali_osk_notification_
+ * asked for.
+ *
+ * @{ */
+-
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++/** @brief Initialize a timer
++ *
++ * Allocates resources for a new timer, and initializes them. This does not
++ * start the timer.
++ *
++ * @param callback Function to call when timer expires
++ * @return a pointer to the allocated timer object, or NULL on failure.
++ */
++_mali_osk_timer_t *_mali_osk_timer_init(_mali_osk_timer_callback_t callback);
++#else
+ /** @brief Initialize a timer
+ *
+ * Allocates resources for a new timer, and initializes them. This does not
+@@ -956,6 +966,7 @@ _mali_osk_errcode_t _mali_osk_notification_queue_dequeue(_mali_osk_notification_
+ * @return a pointer to the allocated timer object, or NULL on failure.
+ */
+ _mali_osk_timer_t *_mali_osk_timer_init(void);
++#endif
+
+ /** @brief Start a timer
+ *
+@@ -1034,6 +1045,7 @@ void _mali_osk_timer_del_async(_mali_osk_timer_t *tim);
+ */
+ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim);
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
+ /** @brief Set a timer's callback parameters.
+ *
+ * This must be called at least once before a timer is started/modified.
+@@ -1047,6 +1059,7 @@ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim);
+ * @param data Function-specific data to supply to the function on expiry.
+ */
+ void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data);
++#endif
+
+ /** @brief Terminate a timer, and deallocate resources.
+ *
+diff --git a/driver/src/devicedrv/mali/linux/mali_osk_timers.c b/driver/src/devicedrv/mali/linux/mali_osk_timers.c
+index e5d7238..f9b5a86 100644
+--- linux/mali_osk_timers.c
++++ b/linux/mali_osk_timers.c
+@@ -21,13 +21,24 @@
+ struct _mali_osk_timer_t_struct {
+ struct timer_list timer;
+ };
+-
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++typedef void (*timer_timeout_function_t)(struct timer_list *);
++#else
+ typedef void (*timer_timeout_function_t)(unsigned long);
++#endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++_mali_osk_timer_t *_mali_osk_timer_init(_mali_osk_timer_callback_t callback)
++#else
+ _mali_osk_timer_t *_mali_osk_timer_init(void)
++#endif
+ {
+ _mali_osk_timer_t *t = (_mali_osk_timer_t *)kmalloc(sizeof(_mali_osk_timer_t), GFP_KERNEL);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++ if (NULL != t) timer_setup(&t->timer, (timer_timeout_function_t)callback, 0);
++#else
+ if (NULL != t) init_timer(&t->timer);
++#endif
+ return t;
+ }
+
+@@ -62,12 +73,14 @@ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim)
+ return 1 == timer_pending(&(tim->timer));
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
+ void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data)
+ {
+ MALI_DEBUG_ASSERT_POINTER(tim);
+ tim->timer.data = (unsigned long)data;
+ tim->timer.function = (timer_timeout_function_t)callback;
+ }
++#endif
+
+ void _mali_osk_timer_term(_mali_osk_timer_t *tim)
+ {
+--
+2.7.4
+