diff mbox

[4/6] sh: add mm API for DMA to vmalloc/vmap areas

Message ID 1252511536-22066-5-git-send-email-James.Bottomley@suse.de (mailing list archive)
State Superseded
Headers show

Commit Message

James Bottomley Sept. 9, 2009, 3:52 p.m. UTC
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
---
 arch/sh/include/asm/cacheflush.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Comments

Paul Mundt Sept. 10, 2009, 12:27 a.m. UTC | #1
On Wed, Sep 09, 2009 at 10:52:14AM -0500, James Bottomley wrote:
> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
> ---
>  arch/sh/include/asm/cacheflush.h |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/sh/include/asm/cacheflush.h b/arch/sh/include/asm/cacheflush.h
> index 4c5462d..db06611 100644
> --- a/arch/sh/include/asm/cacheflush.h
> +++ b/arch/sh/include/asm/cacheflush.h
> @@ -48,6 +48,14 @@ static inline void flush_kernel_dcache_page(struct page *page)
>  {
>  	flush_dcache_page(page);
>  }
> +static inline void flush_kernel_dcache_addr(void *addr)
> +{
> +	__flush_invalidate_region(addr, PAGE_SIZE);
> +}
> +static inline void invalidate_kernel_dcache_addr(void *addr)
> +{
> +	__flush_invalidate_region(addr, PAGE_SIZE);
> +}
>  
Actually, I spoke too soon. The first one should be either a
__flush_purge_region() or __flush_wback_region() I suspect. The former
does both a writeback and invalidate, while the latter only does the
writeback.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
James Bottomley Sept. 10, 2009, 12:32 a.m. UTC | #2
On Thu, 2009-09-10 at 09:27 +0900, Paul Mundt wrote:
> On Wed, Sep 09, 2009 at 10:52:14AM -0500, James Bottomley wrote:
> > Signed-off-by: James Bottomley <James.Bottomley@suse.de>
> > ---
> >  arch/sh/include/asm/cacheflush.h |    8 ++++++++
> >  1 files changed, 8 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/sh/include/asm/cacheflush.h b/arch/sh/include/asm/cacheflush.h
> > index 4c5462d..db06611 100644
> > --- a/arch/sh/include/asm/cacheflush.h
> > +++ b/arch/sh/include/asm/cacheflush.h
> > @@ -48,6 +48,14 @@ static inline void flush_kernel_dcache_page(struct page *page)
> >  {
> >  	flush_dcache_page(page);
> >  }
> > +static inline void flush_kernel_dcache_addr(void *addr)
> > +{
> > +	__flush_invalidate_region(addr, PAGE_SIZE);
> > +}
> > +static inline void invalidate_kernel_dcache_addr(void *addr)
> > +{
> > +	__flush_invalidate_region(addr, PAGE_SIZE);
> > +}
> >  
> Actually, I spoke too soon. The first one should be either a
> __flush_purge_region() or __flush_wback_region() I suspect. The former
> does both a writeback and invalidate, while the latter only does the
> writeback.

OK, will update.  I used the _flush_invalidate on the grounds that it
must completely kill the cacheline, so it was the safest semantic ...
actually, it's the only parisc semantic, so it's pretty much what occurs
to me most of the time.

James


--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/sh/include/asm/cacheflush.h b/arch/sh/include/asm/cacheflush.h
index 4c5462d..db06611 100644
--- a/arch/sh/include/asm/cacheflush.h
+++ b/arch/sh/include/asm/cacheflush.h
@@ -48,6 +48,14 @@  static inline void flush_kernel_dcache_page(struct page *page)
 {
 	flush_dcache_page(page);
 }
+static inline void flush_kernel_dcache_addr(void *addr)
+{
+	__flush_invalidate_region(addr, PAGE_SIZE);
+}
+static inline void invalidate_kernel_dcache_addr(void *addr)
+{
+	__flush_invalidate_region(addr, PAGE_SIZE);
+}
 
 #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_CACHE_OFF)
 extern void copy_to_user_page(struct vm_area_struct *vma,