All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 1/6] arm: cache-l2x0: make outer_cache_fns a field of l2x0_of_data
Date: Sat, 15 Sep 2012 21:35:39 +0100	[thread overview]
Message-ID: <20120915203539.GK12245@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1346852677-5381-2-git-send-email-gregory.clement@free-electrons.com>

On Wed, Sep 05, 2012 at 03:44:32PM +0200, Gregory CLEMENT wrote:
> Instead of having multiple functions belonging to outer_cache and
> filling this structure on the fly, use a outer_cache_fns field inside
> l2x0_of_data and just memcopy it into outer_cache depending of the
> type of the l2x0 cache. For non DT case, the former code was kept.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> Tested-and-reviewed-by: Yehuda Yitschak <yehuday@marvell.com>
> Tested-and-reviewed-by: Lior Amsalem <alior@marvell.com>

Just tried pulling this and got conflicts, so I looked a little deeper
at this.  This patch advertises itself as merely changing the way
outer_cache is initialized:

> +#ifndef CONFIG_OF
>  	outer_cache.inv_range = l2x0_inv_range;
>  	outer_cache.clean_range = l2x0_clean_range;
>  	outer_cache.flush_range = l2x0_flush_range;
> @@ -383,6 +384,7 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
>  	outer_cache.flush_all = l2x0_flush_all;
>  	outer_cache.inv_all = l2x0_inv_all;
>  	outer_cache.disable = l2x0_disable;
> +#endif

It disables this assignment...

>  static const struct l2x0_of_data pl310_data = {
...
> +	.outer_cache = {
> +		.resume      = pl310_resume,

moves the resume here...

> +		.inv_range   = l2x0_inv_range,
> +		.clean_range = l2x0_clean_range,
> +		.flush_range = l2x0_flush_range,
> +		.sync        = l2x0_cache_sync,
> +		.flush_all   = l2x0_flush_all,
> +		.inv_all     = l2x0_inv_all,
> +		.disable     = l2x0_disable,

initializes all these values that were previously set...

> +		.set_debug   = pl310_set_debug,

and adds one extra, which gets added because we blat over the assignment
of it in l2x0_init() after we read the ID from the device.

Plus, doesn't this patch break systems which may enable CONFIG_OF, but
don't supply a DT file, relying on the old way to initialize the L2 cache
operations functions?

This patch just looks buggy to me.

  parent reply	other threads:[~2012-09-15 20:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 13:44 [PATCH V3] Add support for Aurora L2 Cache Controller Gregory CLEMENT
2012-09-05 13:44 ` [PATCH V3 1/6] arm: cache-l2x0: make outer_cache_fns a field of l2x0_of_data Gregory CLEMENT
2012-09-09 19:27   ` Jason Cooper
2012-09-15 20:35   ` Russell King - ARM Linux [this message]
2012-09-20  6:40     ` Gregory CLEMENT
2012-09-05 13:44 ` [PATCH V3 2/6] arm: cache-l2x0: add an optional register to save/restore Gregory CLEMENT
2012-09-09 19:28   ` Jason Cooper
2012-09-05 13:44 ` [PATCH V3 3/6] arm: cache-l2x0: add support for Aurora L2 cache ctrl Gregory CLEMENT
2012-09-06 11:11   ` Will Deacon
2012-09-06 11:49     ` Gregory CLEMENT
2012-09-06 13:02       ` Will Deacon
2012-09-09 19:33   ` Jason Cooper
2012-09-15 20:42   ` Russell King - ARM Linux
2012-09-20  7:26     ` Gregory CLEMENT
2012-09-05 13:44 ` [PATCH V3 4/6] arm: mvebu: add L2 cache support Gregory CLEMENT
2012-09-09 19:35   ` Jason Cooper
2012-09-05 13:44 ` [PATCH V3 5/6] arm: mvebu: add Aurora L2 Cache Controller to the DT Gregory CLEMENT
2012-09-09 19:36   ` Jason Cooper
2012-09-05 13:44 ` [PATCH V3 6/6] arm: l2x0: add aurora related properties to OF binding Gregory CLEMENT
2012-09-09 19:37   ` Jason Cooper

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=20120915203539.GK12245@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@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 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.