From: Zeng Tao <prime.zeng@huawei.com>
To: <gregkh@linuxfoundation.org>, <john.stultz@linaro.org>,
<ccross@android.com>, <benjamin.gaignard@linaro.org>,
<rebecca@android.com>, <fabio.estevam@freescale.com>
Cc: <devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] staging: ion : ion_cma_heap: fix bug for highmem cma
Date: Sat, 29 Nov 2014 09:31:57 +0800 [thread overview]
Message-ID: <1417224717-203170-1-git-send-email-prime.zeng@huawei.com> (raw)
when cma is located in highmem, virt_to_page will not
work the right way, use pfn_to_page instead.
Signed-off-by: Zeng Tao <prime.zeng@huawei.com>
---
drivers/staging/android/ion/ion_cma_heap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c
index f8cabcb..cc45fc0 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -47,7 +47,7 @@ struct ion_cma_buffer_info {
static int ion_cma_get_sgtable(struct device *dev, struct sg_table *sgt,
void *cpu_addr, dma_addr_t handle, size_t size)
{
- struct page *page = virt_to_page(cpu_addr);
+ struct page *page = pfn_to_page(handle >> PAGE_SHIFT);
int ret;
ret = sg_alloc_table(sgt, 1, GFP_KERNEL);
--
1.9.1
next reply other threads:[~2014-11-29 1:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-29 1:31 Zeng Tao [this message]
2014-12-01 18:36 ` Laura Abbott
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=1417224717-203170-1-git-send-email-prime.zeng@huawei.com \
--to=prime.zeng@huawei.com \
--cc=benjamin.gaignard@linaro.org \
--cc=ccross@android.com \
--cc=devel@driverdev.osuosl.org \
--cc=fabio.estevam@freescale.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rebecca@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
all inboxes | Powered by JetHome®