hello there,
A new kernel branch for the HiKey is now available: hikey-mainline-rebase,
which is now v4.4-rc3 based. That's a start (meaning there are issues), but
topics and patches are keep coming. Goal here is to make HiKey finally land
linus' tree.
What’s new in this release?
* Based on Linux kernel v4.4-rc3
* Debian Jessie developer image, with HDMI console.
* patches are upstreaming targeted, and
* managed by topic branches, for easy rebase to latest kernel
* topics include:
hikey-tracking-dts
hikey-tracking-gpio
hikey-tracking-pmic
hikey-tracking-mmc
hikey-tracking-wifi
hikey-tracking-usb
hikey-tracking-adv7511
hikey-tracking-drm
hikey-tracking-pm
What to expect in soon future?
* topic on iommu, bt
* new builds: Debian Jessie ALIP image
* new builds: AOSP (Android M)
* patches be accepted by mainline.
Resources:
For kernel source code, ref:
https://github.com/96boards/linux/tree/hikey-mainline-rebase
For download of Debian developer image, ref:
https://builds.96boards.org/snapshots/hikey/community/hikey-mainline-rebase…
For UEFI to use with this snapshots build, ref:
https://builds.96boards.org/releases/hikey/linaro/binaries/15.11/
For documentation about everything of HiKey, please ref:
https://github.com/96boards/documentation/wiki/HiKey
Support & Bug Report:
For general question or support request, please go to 96boards Community
forum:
https://www.96boards.org/forums/forum/products/hikey/
<https://www.96boards.org/dragonboard410c/forum>
For any bug related to this release, please submit issues to the
96Boards Bug tracking system:
https://bugs.96boards.org/enter_bug.cgi?product=HiKey
Finally, to get in touch with us, you can also use IRC:
#96boards on irc.freenode.net
On behalf of the Linaro HiSilicon Landing team,
cheers,
Guodong
When a process fork a child process, we should not allow the
child process use the binder which opened by parent process.
But if the binder-object creater is a thread of one process who exit,
the other thread can also use this binder-object normally.
We can distinguish this by the member proc->tsk->mm.
If the thread exit the tsk->mm will be NULL.
proc->tsk->mm != current->mm && proc->tsk->mm
So only allow the shared mm_struct to use the same binder-object and
check the existence of mm_struct.
Signed-off-by: Chen Feng <puck.chen(a)hisilicon.com>
Signed-off-by: Wei Dong <weidong2(a)hisilicon.com>
Signed-off-by: Junmin Zhao <zhaojunmin(a)huawei.com>
Reviewed-by: Zhuangluan Su <suzhuangluan(a)hisilicon.com>
---
drivers/android/binder.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index a39e85f..279063c 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -2736,6 +2736,8 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
/*pr_info("binder_ioctl: %d:%d %x %lx\n",
proc->pid, current->pid, cmd, arg);*/
+ if (unlikely(proc->tsk->mm != current->mm && proc->tsk->mm))
+ return -EINVAL;
trace_binder_ioctl(cmd, arg);
--
1.9.1
When a process fork a child process, we should not allow the
child process use the binder which opened by parent process.
But if the binder-object creater is a thread of one process who exit,
the other thread can also use this binder-object normally.
We can distinguish this by the member proc->tsk->mm.
If the thread exit the tsk->mm will be NULL.
proc->tsk->mm != current->tsk->mm && proc->tsk->mm
So only allow the shared mm_struct to use the same binder-object and
check the existence of mm_struct.
Signed-off-by: Chen Feng <puck.chen(a)hisilicon.com>
Signed-off-by: Wei Dong <weidong2(a)hisilicon.com>
Signed-off-by: Junmin Zhao <zhaojunmin(a)huawei.com>
Reviewed-by: Zhuangluan Su <suzhuangluan(a)hisilicon.com>
---
drivers/android/binder.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index a39e85f..3a74c5d 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -2736,6 +2736,8 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
/*pr_info("binder_ioctl: %d:%d %x %lx\n",
proc->pid, current->pid, cmd, arg);*/
+ if (unlikely(proc->tsk->mm != current->tsk->mm && proc->tsk->mm))
+ return -EINVAL;
trace_binder_ioctl(cmd, arg);
--
1.9.1
The page is already alloc at ion_alloc function,
ion_mmap map the alloced pages to user-space.
The default prot can be PTE_RDONLY. Take a look at
here:
set_pte_at()
arch/arm64/include/asm:
if (pte_dirty(pte) && pte_write(pte))
pte_val(pte) &= ~PTE_RDONLY;
else
pte_val(pte) |= PTE_RDONLY;
So with the dirty bit,it can improve the efficiency
and donnot need to handle memory fault when use access.
Signed-off-by: Chen Feng <puck.chen(a)hisilicon.com>
Signed-off-by: Wei Dong <weidong2(a)hisilicon.com>
Reviewed-by: Zhuangluan Su <suzhuangluan(a)hisilicon.com>
---
drivers/staging/android/ion/ion.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index e237e9f..dba5942 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1026,6 +1026,9 @@ static int ion_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
if (!(buffer->flags & ION_FLAG_CACHED))
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+ /*Default writeable*/
+ vma->vm_page_prot = pte_mkdirty(vma->vm_page_prot);
+
mutex_lock(&buffer->lock);
/* now map it to userspace */
ret = buffer->heap->ops->map_user(buffer->heap, buffer, vma);
--
1.9.1
Since ion alloc can be called by userspace,eg gralloc.
When it is called frequently, the efficiency of kswapd is
to low. And the reclaimed memory is too lower. In this way,
the kswapd can use to much cpu resources.
With 3.5GB DMA Zone and 0.5 Normal Zone.
pgsteal_kswapd_dma 9364140
pgsteal_kswapd_normal 7071043
pgscan_kswapd_dma 10428250
pgscan_kswapd_normal 37840094
With this change the reclaim ratio has greatly improved
18.9% -> 72.5%
Signed-off-by: Chen Feng <puck.chen(a)hisilicon.com>
Signed-off-by: Lu bing <albert.lubing(a)hisilicon.com>
---
drivers/staging/android/ion/ion_system_heap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index d4c3e55..b69dfc7 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -27,7 +27,7 @@
#include "ion_priv.h"
static gfp_t high_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN |
- __GFP_NORETRY) & ~__GFP_DIRECT_RECLAIM;
+ __GFP_NORETRY) & ~__GFP_RECLAIM;
static gfp_t low_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN);
static const unsigned int orders[] = {8, 4, 0};
static const int num_orders = ARRAY_SIZE(orders);
--
1.9.1
Hi Cheeramvelil & Hilman,
I found this patch do not ACK into the kernel mainline, and there is an obvious logical error.
commit 7f00db6493e69a3b6b7b9929218b127c62e6a53b
Author: Vinil Cheeramvelil <vinil.cheeramvelil(a)intel.com>
Date: Wed Jul 8 10:35:06 2015 +0800
ion: Handle the memory mapping correctly on x86
This patch modifies the ion page pool code to address
limitation in x86 PAT. When one physical page is mapped
to multiple virtual pages, the same cache policy
should be used. Add set_memory_wc/uc call to avoid aliases.
If not, all mappings will be cached(write back).
Change-Id: I98ee8902df0c80135dddfa998c4ca4c2bb44e40e
Signed-off-by: Zhebin Jin <zhebin.jin(a)intel.com>
Signed-off-by: Vinil Cheeramvelil <vinil.cheeramvelil(a)intel.com>
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index da2a63c..1f9feb7 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -85,8 +85,10 @@ static void free_buffer_page(struct ion_system_heap *heap,
if (!cached && !(buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)) {
struct ion_page_pool *pool = heap->pools[order_to_index(order)];
-
- ion_page_pool_free(pool, page);
+ if (buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)
+ ion_page_pool_free_immediate(pool, page);
+ else
+ ion_page_pool_free(pool, page);
the if else here is totally redundant
} else {
__free_pages(page, order);
}
Currently CMakeLists.txt searches only for libftdi but on platforms
where libftdi may be parallel installed this is insufficient. Fix
the package detection and ensure we apply the detection results to
the default build arguments.
Also removes the check for libusb; 96boardsctl.c does not directly use
this library so we can rely on pkg-config to get the link line right.
Signed-off-by: Daniel Thompson <daniel.thompson(a)linaro.org>
---
96boardsctl/CMakeLists.txt | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/96boardsctl/CMakeLists.txt b/96boardsctl/CMakeLists.txt
index a55852894f95..2e74c4e63de2 100644
--- a/96boardsctl/CMakeLists.txt
+++ b/96boardsctl/CMakeLists.txt
@@ -8,10 +8,18 @@ configure_file ("${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/confi
include_directories ("${PROJECT_BINARY_DIR}")
find_package(PkgConfig)
-pkg_check_modules(PC_LIBS REQUIRED libusb libftdi)
+
+pkg_check_modules(LIBFTDI libftdi1)
+if (NOT LIBFTDI_FOUND)
+ pkg_check_modules(LIBFTDI REQUIRED libftdi)
+endif()
+
+include_directories(${LIBFTDI_INCLUDE_DIRS})
+link_directories(${LIBFTDI_LIBRARY_DIRS})
+add_definitions(${LIBFTDI_CFLAGS_OTHER})
add_executable(96boardsctl 96boardsctl.c)
-target_link_libraries(96boardsctl usb ftdi)
+target_link_libraries(96boardsctl ${LIBFTDI_LIBRARIES})
install (TARGETS 96boardsctl DESTINATION bin)
install (FILES udev-rules/71-ftdi_sio.rules DESTINATION etc/udev/rules.d)
--
2.5.0
Since ion alloc can be called by userspace,eg gralloc.
When it is called frequently, the efficiency of kswapd is
to low. And the reclaimed memory is too lower. In this way,
the kswapd can use to much cpu resources.
With 3.5GB DMA Zone and 0.5 Normal Zone.
pgsteal_kswapd_dma 9364140
pgsteal_kswapd_normal 7071043
pgscan_kswapd_dma 10428250
pgscan_kswapd_normal 37840094
With this change the reclaim ratio has greatly improved
18.9% -> 72.5%
Signed-off-by: Chen Feng <puck.chen(a)hisilicon.com>
Signed-off-by: Lu bing <albert.lubing(a)hisilicon.com>
---
drivers/staging/android/ion/ion_system_heap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index d4c3e55..b69dfc7 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -27,7 +27,7 @@
#include "ion_priv.h"
static gfp_t high_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN |
- __GFP_NORETRY) & ~__GFP_DIRECT_RECLAIM;
+ __GFP_NORETRY) & ~__GFP_RECLAIM;
static gfp_t low_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN);
static const unsigned int orders[] = {8, 4, 0};
static const int num_orders = ARRAY_SIZE(orders);
--
1.9.1