All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: naveen yadav <yad.naveen@gmail.com>
Cc: linux-mips@linux-mips.org, Christoph Hellwig <hch@lst.de>
Subject: Re: flush_kernel_vmap_range() invalidate_kernel_vmap_range() API not exists for MIPS
Date: Fri, 17 Jun 2011 01:05:58 +0100	[thread overview]
Message-ID: <20110617000558.GA23883@linux-mips.org> (raw)
In-Reply-To: <BANLkTimo6BEgDnTh+sPVR+MELyxiwJoFGw@mail.gmail.com>

On Wed, Jun 15, 2011 at 11:58:24AM +0530, naveen yadav wrote:

> diff -Nrup clean/linux-2.6.35.9/arch/mips/include/asm/cacheflush.h linux-2.6.35.9/arch/mips/include/asm/cacheflush.h
> --- clean/linux-2.6.35.9/arch/mips/include/asm/cacheflush.h	2010-11-23 04:01:26.000000000 +0900
> +++ linux-2.6.35.9/arch/mips/include/asm/cacheflush.h	2011-06-14 11:08:16.000000000 +0900
> @@ -114,4 +114,31 @@ unsigned long run_uncached(void *func);
>  extern void *kmap_coherent(struct page *page, unsigned long addr);
>  extern void kunmap_coherent(void);
>  
> +/* New function added which are missed in  MIPS */
> +#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
> +static inline void flush_kernel_vmap_range(void *addr, int size)
> +{
> +/*	if ((cache_is_vivt() || cache_is_vipt_aliasing()))*/
> +	if ((c->icache.flags & MIPS_CACHE_VTAG) ||	\
> +			(c->dcache.flags & MIPS_CACHE_ALIASES)) {

Don't access the flags fields directly but use the feature test macros
like cpu_has_vtag_icache or cpu_has_dc_aliases.  These macros allow the
compiler to optimize unused parts of the cache code.

cache_is_vivt is an ARM CPU feature test macro.  I guess you ported it but
don't quite understand what it meant.  The good news is there are no such
VIVT data caches on MIPS.  And the Icache we just don't care about.

You're accessing c->icache.flags - but I see nothing like "struct
cpuinfo_mips *c;" anywhere.  This doesn't even compile.

> +			unsigned long start = (unsigned long)addr;
> +			dma_cache_wback_inv(start, (size_t)size);

This is a function used for DMA I/O.  On a system that has DMA coherence
in hardware it will do nothing at all!

> +	}
> +}
> +static inline void invalidate_kernel_vmap_range(void *addr, int size)
> +{
> +/*	if ((cache_is_vivt() || cache_is_vipt_aliasing()))*/
> +	if ((c->icache.flags & MIPS_CACHE_VTAG) ||	\
> +		(c->dcache.flags & MIPS_CACHE_ALIASES)) {
> +			unsigned long start = (unsigned long)addr;
> +			dma_cache_inv(start, (size_t)size);
> +}
> +}

Same problems.

> +static inline void flush_kernel_dcache_page(struct page *page)
> +{
> +
> +}

This function should also be implemented if your target has highmem.

  Ralf

      parent reply	other threads:[~2011-06-17  0:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25  9:08 flush_kernel_vmap_range() invalidate_kernel_vmap_range() API not exists for MIPS naveen yadav
2011-03-25 17:27 ` Ralf Baechle
2011-03-29  5:54   ` naveen yadav
2011-05-19  4:35     ` naveen yadav
2011-06-15  6:28   ` naveen yadav
2011-06-16 18:02     ` Christoph Hellwig
2011-06-17 15:20       ` Ralf Baechle
2011-06-18 10:51         ` naveen yadav
2011-06-18 13:06         ` Sergei Shtylyov
2011-06-20  9:56           ` Ralf Baechle
2011-06-24  5:06             ` naveen yadav
2011-06-24  7:09               ` Ralf Baechle
2011-06-17  0:05     ` Ralf Baechle [this message]

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=20110617000558.GA23883@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=hch@lst.de \
    --cc=linux-mips@linux-mips.org \
    --cc=yad.naveen@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.