From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 5/9] ARM: pass size to dma_free_coherent
Date: Mon, 1 Aug 2011 15:29:39 +0200 [thread overview]
Message-ID: <1312205383-13266-5-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20110801132643.GH6255@game.jcrosoft.org>
From: Sascha Hauer <s.hauer@pengutronix.de>
We'll need it later once we remap dma memory.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/mmu.c | 2 +-
arch/arm/include/asm/mmu.h | 9 +++++++--
drivers/usb/gadget/fsl_udc.c | 2 +-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 8465d1a..bb067e3 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -155,7 +155,7 @@ void *phys_to_virt(unsigned long phys)
return (void *)(phys + dma_coherent_offset);
}
-void dma_free_coherent(void *mem)
+void dma_free_coherent(void *mem, size_t size)
{
free(mem - dma_coherent_offset);
}
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index d96c728..9ebc2cd 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -17,7 +17,7 @@ void setup_dma_coherent(unsigned long offset);
#ifdef CONFIG_MMU
void *dma_alloc_coherent(size_t size);
-void dma_free_coherent(void *mem);
+void dma_free_coherent(void *mem, size_t size);
void dma_clean_range(unsigned long, unsigned long);
void dma_flush_range(unsigned long, unsigned long);
@@ -26,12 +26,17 @@ unsigned long virt_to_phys(void *virt);
void *phys_to_virt(unsigned long phys);
#else
+static inline int mmu_init(void)
+{
+ return -EINVAL;
+}
+
static inline void *dma_alloc_coherent(size_t size)
{
return xmemalign(4096, size);
}
-static inline void dma_free_coherent(void *mem)
+static inline void dma_free_coherent(void *mem, size_t size)
{
free(mem);
}
diff --git a/drivers/usb/gadget/fsl_udc.c b/drivers/usb/gadget/fsl_udc.c
index c321e8f..1e4d4b0 100644
--- a/drivers/usb/gadget/fsl_udc.c
+++ b/drivers/usb/gadget/fsl_udc.c
@@ -560,7 +560,7 @@ static void done(struct fsl_ep *ep, struct fsl_req *req, int status)
if (j != req->dtd_count - 1) {
next_td = curr_td->next_td_virt;
}
- dma_free_coherent(curr_td);
+ dma_free_coherent(curr_td, sizeof(struct ep_td_struct));
}
dma_inv_range((unsigned long)req->req.buf,
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-08-01 13:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-01 13:26 rework MMU support Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 13:29 ` [PATCH 1/9 v2] arm: introduce arm_add_mem_device to register dram device Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 13:29 ` [PATCH 2/9] ARM cache l2x0: depend on MMU Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 13:29 ` [PATCH 3/9] ARM: move armlinux_add_dram to location which is always compiled Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 13:29 ` [PATCH 4/9] ARM l2x0: make init function static inline if l2 is not available Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 13:29 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-08-01 13:29 ` [PATCH 6/9] init: introduce mem, mmu and postmmu initcall Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 13:29 ` [PATCH 7/9 v2] ARM boards: move sdram setup before mmu setup Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 13:29 ` [PATCH 8/9] ARM: rework MMU support Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 13:29 ` [PATCH 9/9 v2] ARM boards: remove now unnecessary mmu calls Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 15:54 ` rework MMU support Sascha Hauer
2011-08-01 16:12 ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 16:32 ` Jean-Christophe PLAGNIOL-VILLARD
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=1312205383-13266-5-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=barebox@lists.infradead.org \
/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