[Top] [All Lists]

Re: [PATCH V9 03/13] MIPS: Loongson: Introduce and use cpu_has_coherent_

To: Huacai Chen <>
Subject: Re: [PATCH V9 03/13] MIPS: Loongson: Introduce and use cpu_has_coherent_cache feature
From: "Steven J. Hill" <>
Date: Thu, 11 Apr 2013 12:05:42 -0500
Cc: Ralf Baechle <>,,, Fuxin Zhang <>, Zhangjin Wu <>, Hongliang Tao <>, Hua Yan <>
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <> <>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4
Hash: SHA1

On 01/30/2013 12:24 AM, Huacai Chen wrote:
> Loongson-3 maintains cache coherency by hardware. So we introduce a cpu 
> feature named cpu_has_coherent_cache and use it to modify MIPS's cache 
> flushing functions.
> Signed-off-by: Huacai Chen <> Signed-off-by: Hongliang Tao
> <> Signed-off-by: Hua Yan <> --- 
> arch/mips/include/asm/cacheflush.h                 |    6 +++++ 
> arch/mips/include/asm/cpu-features.h               |    3 ++ 
> .../asm/mach-loongson/cpu-feature-overrides.h      |    6 +++++ 
> arch/mips/mm/c-r4k.c                               |   21
> ++++++++++++++++++- 4 files changed, 34 insertions(+), 2 deletions(-)

This patch masks the problem that you are not properly probing your L1 caches
to start with. For some reason in 'probe_pcache()' you reach the default case
where the primary data cache is marked as having aliases. If your CPU truly is
HW coherent with no aliases, then MIPS_CACHE_ALIASES should never get set.
Fixing this would eliminate the 'arch/mips/include/asm/cacheflush.h' and
'arch/mips/mm/c-r4k.c' changes completely. There is no need to add more CPU
feature bits for this single platform, thus changes to 'cpu-features.h' and
'cpu-features-overrides.h' will not be accepted.

Also, please do not copy the <> mailing list
unless your patch touches files outside of 'arch/mips' in order to cut down
traffic on an already busy list. Thanks.

- -----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


<Prev in Thread] Current Thread [Next in Thread>