All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Christian Daudt <csd-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	"arm-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<arm-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	abhimanyu.kapur-1ViLX0X+lBJBDgjK7y7TUQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH] ARM: bcm281xx: Add L2 cache enable code
Date: Wed, 6 Mar 2013 11:28:56 +0000	[thread overview]
Message-ID: <201303061128.57127.arnd@arndb.de> (raw)
In-Reply-To: <5136F816.2070909-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>

On Wednesday 06 March 2013, Christian Daudt wrote:
> On 13-03-05 10:31 PM, Arnd Bergmann wrote:
> > On Tuesday 05 March 2013, Christian Daudt wrote:
> >> On 13-03-05 01:01 AM, Arnd Bergmann wrote:
> >>> On Tuesday 05 March 2013, Christian Daudt wrote:
> >>> For other firmware interfaces like this, we tend to list the specific commands
> >>> that the firmware understands. If you think there might be different versions
> >>> to consider, you might want to model this like
> >>>
> >>> Documentation/devicetree/bindings/arm/psci.txt
> >> This interface is stable and in shipping products at this time, and so
> >> the api will remain constant.
> > But what about future products? Wouldn't they be able to extend the
> > current interface in a compatible way?
>
> It is highly unlikely that for this family we will be extending that API 
> but even if that is done, it can just added #defines in the C header. Is 
> DT seen as the way to define Software APIs going forward ? It should be 
> trivial to implement this, I'm just trying to understand where the line 
> is drawn between describing APIs in DT vs C headers going forward.

We tend to do it in cases where the software has no other way to find out
what interfaces are supported. I guess if it becomes necessary, we can
use a different "compatible" value for an extended future version of this,
but that scales only to so many different variants.

> >> It was originally in init_machine section but I was told that that was
> >> too late and init_irq would be better, and I saw that highbank also has
> >> it in init_irq. I agree that it is unrelated to irq - is there a better
> >> place to put this in ?
> > IMHO the later the better. Do you know what issues were caused  by having it
> > in init_machine?
> This is some feedback I got a while back:
> "From kernel 3.4 on-wards i think ( if i remember correctly) cache sync
> might be called before your board_init function and you might have to do 
> this in init_irq. "
> 
> I just looked through where l2x0_of_init is currently called and here's 
> the list:
> early_initcall (exynos4, omap2, sirf, ux500)
> init_irq (highbank, imx6q)
> init_machine (socfpga, v2m_dt_init)
> 
> so seems to be everywhere :) So I can move it back to init_machineif 
> that's where itshould be.

Hmm, let's try to solve this another time, I don't think there is an easy
answer. Maybe we really need a common entry point for the cache
controller setup, or move it completely out of platform specific code
for the case where it can be probed from DT.

Thanks for doing the research!

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: bcm281xx: Add L2 cache enable code
Date: Wed, 6 Mar 2013 11:28:56 +0000	[thread overview]
Message-ID: <201303061128.57127.arnd@arndb.de> (raw)
In-Reply-To: <5136F816.2070909@broadcom.com>

On Wednesday 06 March 2013, Christian Daudt wrote:
> On 13-03-05 10:31 PM, Arnd Bergmann wrote:
> > On Tuesday 05 March 2013, Christian Daudt wrote:
> >> On 13-03-05 01:01 AM, Arnd Bergmann wrote:
> >>> On Tuesday 05 March 2013, Christian Daudt wrote:
> >>> For other firmware interfaces like this, we tend to list the specific commands
> >>> that the firmware understands. If you think there might be different versions
> >>> to consider, you might want to model this like
> >>>
> >>> Documentation/devicetree/bindings/arm/psci.txt
> >> This interface is stable and in shipping products at this time, and so
> >> the api will remain constant.
> > But what about future products? Wouldn't they be able to extend the
> > current interface in a compatible way?
>
> It is highly unlikely that for this family we will be extending that API 
> but even if that is done, it can just added #defines in the C header. Is 
> DT seen as the way to define Software APIs going forward ? It should be 
> trivial to implement this, I'm just trying to understand where the line 
> is drawn between describing APIs in DT vs C headers going forward.

We tend to do it in cases where the software has no other way to find out
what interfaces are supported. I guess if it becomes necessary, we can
use a different "compatible" value for an extended future version of this,
but that scales only to so many different variants.

> >> It was originally in init_machine section but I was told that that was
> >> too late and init_irq would be better, and I saw that highbank also has
> >> it in init_irq. I agree that it is unrelated to irq - is there a better
> >> place to put this in ?
> > IMHO the later the better. Do you know what issues were caused  by having it
> > in init_machine?
> This is some feedback I got a while back:
> "From kernel 3.4 on-wards i think ( if i remember correctly) cache sync
> might be called before your board_init function and you might have to do 
> this in init_irq. "
> 
> I just looked through where l2x0_of_init is currently called and here's 
> the list:
> early_initcall (exynos4, omap2, sirf, ux500)
> init_irq (highbank, imx6q)
> init_machine (socfpga, v2m_dt_init)
> 
> so seems to be everywhere :) So I can move it back to init_machineif 
> that's where itshould be.

Hmm, let's try to solve this another time, I don't think there is an easy
answer. Maybe we really need a common entry point for the cache
controller setup, or move it completely out of platform specific code
for the case where it can be probed from DT.

Thanks for doing the research!

	Arnd

  parent reply	other threads:[~2013-03-06 11:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05  2:47 [PATCH] ARM: bcm281xx: Add L2 cache enable code Christian Daudt
2013-03-05  2:47 ` Christian Daudt
     [not found] ` <1362451632-18806-1-git-send-email-csd-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2013-03-05  9:01   ` Arnd Bergmann
2013-03-05  9:01     ` Arnd Bergmann
2013-03-05 22:54     ` Christian Daudt
2013-03-05 22:54       ` Christian Daudt
     [not found]       ` <513677BB.9010309-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2013-03-06  6:31         ` Arnd Bergmann
2013-03-06  6:31           ` Arnd Bergmann
     [not found]           ` <5136F816.2070909@broadcom.com>
     [not found]             ` <5136F816.2070909-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2013-03-06 11:28               ` Arnd Bergmann [this message]
2013-03-06 11:28                 ` Arnd Bergmann
2013-03-06 15:05                 ` Christian Daudt
2013-03-06 15:05                   ` Christian Daudt
2013-04-10 17:33                 ` [GIT PULL] ARM: bcm281xx firmware tags Christian Daudt
2013-04-10 17:33                   ` Christian Daudt
     [not found]                   ` <5165A271.6060407-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2013-04-11  6:52                     ` Olof Johansson
2013-04-11  6:52                       ` Olof Johansson
     [not found]                       ` <20130411065227.GA31465-O5ziIzlqnXUVNXGz7ipsyg@public.gmane.org>
2013-04-11  8:52                         ` Olof Johansson
2013-04-11  8:52                           ` Olof Johansson
2013-03-05 18:20   ` [PATCH] ARM: bcm281xx: Add L2 cache enable code Stephen Warren
2013-03-05 18:20     ` Stephen Warren
2013-03-05 22:56     ` Christian Daudt
2013-03-05 22:56       ` Christian Daudt

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=201303061128.57127.arnd@arndb.de \
    --to=arnd-r2ngtmty4d4@public.gmane.org \
    --cc=abhimanyu.kapur-1ViLX0X+lBJBDgjK7y7TUQ@public.gmane.org \
    --cc=arm-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=csd-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.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.