linux-mips
[Top] [All Lists]

Re: [PATCH mips-for-linux-next] MIPS: check for D$ line size and CONFIG_

To: Florian Fainelli <florian@openwrt.org>
Subject: Re: [PATCH mips-for-linux-next] MIPS: check for D$ line size and CONFIG_MIPS_L1_SHIFT
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 23 Jan 2014 00:11:13 +0100
Cc: linux-mips@linux-mips.org, blogic@openwrt.org
In-reply-to: <1389812722-30035-1-git-send-email-florian@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1389812722-30035-1-git-send-email-florian@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Jan 15, 2014 at 11:05:22AM -0800, Florian Fainelli wrote:

> When a platform overrides the dcache_line_size detection in its
> cpu-features-override.h file, check that the value matches
> (1 << CONFIG_MIPS_L1_SHIFT) to ensure both settings are correct.

Conceptually wrong - the two values serve an entirely different purpose.
dcache_line_size is used for cache maintenance by the MIPS code while
CONFIG_MIPS_L1_SHIFT - which has to be a constant due to the way it's
being used - are being used to define L1_CACHE_SHIFT in <asm/cache.h>
which in turn is being used primarily to optimize the memory layout of
various structures for performance - and in case of IP27 we lie, set
L1_CACHE_SHIFT to 7 which is the size of the S-cache.

On top of that it breaks the ip27 build.

And while we're at it, the use of CONFIG_MIPS_L1_SHIFT in
arch/mips/kernel/vmlinux.lds.S is fishy - but it needs a constant and
this should be good enough for all users.

  Ralf

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