public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ganesh Mahendran <opensource.ganesh@gmail.com>
To: gregkh@linuxfoundation.org, arve@android.com, riandrews@android.com
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Ganesh Mahendran <opensource.ganesh@gmail.com>
Subject: [PATCH] android: binder: use VM_ALLOC to get vm area.
Date: Thu,  1 Sep 2016 14:41:04 +0800	[thread overview]
Message-ID: <1472712064-3643-1-git-send-email-opensource.ganesh@gmail.com> (raw)

VM_IOREMAP is used to access hardware through a mechanism called
I/O mapped memory. Android binder is a IPC machanism which will
not access I/O memory.

Also VM_IOREMAP has alignment requiement which may not needed in
binder.
----
__get_vm_area_node()
{
...
    if (flags & VM_IOREMAP)
        align = 1ul << clamp_t(int, fls_long(size),
           PAGE_SHIFT, IOREMAP_MAX_ORDER);
...
}
----

This patch use VM_ALLOC to get vm area.

Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
---
 drivers/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 16288e7..3511d5c 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -2885,7 +2885,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
 		goto err_already_mapped;
 	}
 
-	area = get_vm_area(vma->vm_end - vma->vm_start, VM_IOREMAP);
+	area = get_vm_area(vma->vm_end - vma->vm_start, VM_ALLOC);
 	if (area == NULL) {
 		ret = -ENOMEM;
 		failure_string = "get_vm_area";
-- 
1.9.1

             reply	other threads:[~2016-09-01  6:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01  6:41 Ganesh Mahendran [this message]
2016-09-01 19:02 ` [PATCH] android: binder: use VM_ALLOC to get vm area Greg KH
2016-09-01 19:59   ` Arve Hjønnevåg
2016-09-06  2:42     ` Ganesh Mahendran
2016-09-06  2:40   ` Ganesh Mahendran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472712064-3643-1-git-send-email-opensource.ganesh@gmail.com \
    --to=opensource.ganesh@gmail.com \
    --cc=arve@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riandrews@android.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox