All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Pitre <nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Abhilash Kesavan
	<kesavan.abhilash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Lorenzo Pieralisi
	<lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org>,
	Dave P Martin <Dave.Martin-5wv7dgnIgG8@public.gmane.org>,
	"daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
	<daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
	<kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
	<t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org"
	<abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	"thomas.ab-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
	<thomas.ab-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"inderpal.s-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
	<inderpal.s-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Mark Rutland <Mark.Rutland-5wv7dgnIgG8@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Will Deacon <Will.Deacon-5wv7dgnIgG8@public.gmane.org>,
	"arnd-r2nGTMty4D4@public.gmane.org"
	<arnd-r2nGTMty4D4@public.gmane.org>
Subject: Re: [PATCH v3 5/6] arm: exynos: Add MCPM call-back functions
Date: Tue, 29 Apr 2014 14:49:48 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.11.1404291435450.980@knanqh.ubzr> (raw)
In-Reply-To: <CAM4voa=mhcZO9v7nDdrcz+T8RVN-Av3eERVErCX52k1ftUcKcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, 29 Apr 2014, Abhilash Kesavan wrote:

> >> +/*
> >> + * Enable cluster-level coherency, in preparation for turning on the MMU.
> >> + */
> >> +static void __naked exynos_pm_power_up_setup(unsigned int affinity_level)
> >> +{
> >> +       asm volatile ("\n"
> >> +       "cmp    r0, #1\n"
> >> +       "bxne   lr\n"
> >> +       "b      cci_enable_port_for_self");
> >> +}
> >
> > How many times are we going to duplicate this function before we decide
> > to move it to a common header ?
> I see this being used in arch/arm/mach-vexpress/tc2_pm.c (where I
> copied it from for exynos) and arch/arm/mach-vexpress/dcscb.c. A
> common function named "mcpm_default_power_up_setup" in the mcpm header
> would be acceptable ?

Not necessarily.

First of all, this can't be a static inline as we need a pointer to it.  
And moving this to a header would create multiple instances of the same 
function in a multiplatform build for example.

Furthermore, this can't be called "default_power_up_setup" as this is 
specific to systems with a CCI.

It is true that the code in dcscb_setup.S does the same thing as this 
3-line inline assembly, but the former is heavily commented and may 
serve as an example template for platforms that may require something 
more sophisticated here.

There are other patterns that seem to emerge as more MCPM backends are 
being submitted.  I'm making a list of them and I intend to address such 
duplications after those backends do hit mainline.


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: nicolas.pitre@linaro.org (Nicolas Pitre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 5/6] arm: exynos: Add MCPM call-back functions
Date: Tue, 29 Apr 2014 14:49:48 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.11.1404291435450.980@knanqh.ubzr> (raw)
In-Reply-To: <CAM4voa=mhcZO9v7nDdrcz+T8RVN-Av3eERVErCX52k1ftUcKcQ@mail.gmail.com>

On Tue, 29 Apr 2014, Abhilash Kesavan wrote:

> >> +/*
> >> + * Enable cluster-level coherency, in preparation for turning on the MMU.
> >> + */
> >> +static void __naked exynos_pm_power_up_setup(unsigned int affinity_level)
> >> +{
> >> +       asm volatile ("\n"
> >> +       "cmp    r0, #1\n"
> >> +       "bxne   lr\n"
> >> +       "b      cci_enable_port_for_self");
> >> +}
> >
> > How many times are we going to duplicate this function before we decide
> > to move it to a common header ?
> I see this being used in arch/arm/mach-vexpress/tc2_pm.c (where I
> copied it from for exynos) and arch/arm/mach-vexpress/dcscb.c. A
> common function named "mcpm_default_power_up_setup" in the mcpm header
> would be acceptable ?

Not necessarily.

First of all, this can't be a static inline as we need a pointer to it.  
And moving this to a header would create multiple instances of the same 
function in a multiplatform build for example.

Furthermore, this can't be called "default_power_up_setup" as this is 
specific to systems with a CCI.

It is true that the code in dcscb_setup.S does the same thing as this 
3-line inline assembly, but the former is heavily commented and may 
serve as an example template for platforms that may require something 
more sophisticated here.

There are other patterns that seem to emerge as more MCPM backends are 
being submitted.  I'm making a list of them and I intend to address such 
duplications after those backends do hit mainline.


Nicolas

  parent reply	other threads:[~2014-04-29 18:49 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-26 16:05 [PATCH v3 0/6] MCPM backend for Exynos5420 Abhilash Kesavan
2014-04-26 16:05 ` Abhilash Kesavan
     [not found] ` <1398528348-21214-1-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-04-26 16:05   ` [PATCH v3 1/6] ARM: EXYNOS: Add generic cpu power control functions for all exynos based SoCs Abhilash Kesavan
2014-04-26 16:05     ` Abhilash Kesavan
2014-04-26 16:05   ` [PATCH v3 2/6] ARM: EXYNOS: use generic exynos cpu power control functions Abhilash Kesavan
2014-04-26 16:05     ` Abhilash Kesavan
     [not found]     ` <1398528348-21214-3-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-05-02 15:25       ` [PATCH v4 2/5] " Abhilash Kesavan
2014-05-02 15:25         ` Abhilash Kesavan
2014-04-26 16:05   ` [PATCH v3 3/6] arm: exynos: Add generic cluster " Abhilash Kesavan
2014-04-26 16:05     ` Abhilash Kesavan
     [not found]     ` <1398528348-21214-4-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-05-02 15:25       ` [PATCH v4 3/5] " Abhilash Kesavan
2014-05-02 15:25         ` Abhilash Kesavan
2014-04-26 16:05   ` [PATCH v3 4/6] ARM: dts: exynos5420: add CCI node Abhilash Kesavan
2014-04-26 16:05     ` Abhilash Kesavan
     [not found]     ` <1398528348-21214-5-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-05-02 15:25       ` [PATCH v4 4/5] " Abhilash Kesavan
2014-05-02 15:25         ` Abhilash Kesavan
2014-04-26 16:05   ` [PATCH v3 5/6] arm: exynos: Add MCPM call-back functions Abhilash Kesavan
2014-04-26 16:05     ` Abhilash Kesavan
2014-04-28 17:44     ` Lorenzo Pieralisi
2014-04-28 17:44       ` Lorenzo Pieralisi
     [not found]       ` <20140428174456.GE31782-7AyDDHkRsp3ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2014-04-29  3:32         ` Abhilash Kesavan
2014-04-29  3:32           ` Abhilash Kesavan
     [not found]           ` <CAM4voa=mhcZO9v7nDdrcz+T8RVN-Av3eERVErCX52k1ftUcKcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-29 18:49             ` Nicolas Pitre [this message]
2014-04-29 18:49               ` Nicolas Pitre
     [not found]               ` <alpine.LFD.2.11.1404291435450.980-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>
2014-04-30  3:01                 ` Abhilash Kesavan
2014-04-30  3:01                   ` Abhilash Kesavan
     [not found]                   ` <CAM4voa=Po9r5MpxyjQKcYhyES1UjfVaqbP_PnKCbsw5LtEkpZg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-30 10:24                     ` Dave Martin
2014-04-30 10:24                       ` Dave Martin
     [not found]     ` <1398528348-21214-6-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-04-30 14:43       ` Nicolas Pitre
2014-04-30 14:43         ` Nicolas Pitre
     [not found]         ` <alpine.LFD.2.11.1404301021270.980-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>
2014-05-01  9:39           ` Abhilash Kesavan
2014-05-01  9:39             ` Abhilash Kesavan
2014-04-30 14:59       ` Lorenzo Pieralisi
2014-04-30 14:59         ` Lorenzo Pieralisi
     [not found]         ` <20140430145911.GA32671-7AyDDHkRsp3ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2014-05-01  9:39           ` Abhilash Kesavan
2014-05-01  9:39             ` Abhilash Kesavan
2014-05-02 15:25       ` [PATCH v4 5/5] " Abhilash Kesavan
2014-05-02 15:25         ` Abhilash Kesavan
     [not found]         ` <1399044359-15784-1-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-05-02 18:16           ` Nicolas Pitre
2014-05-02 18:16             ` Nicolas Pitre
     [not found]             ` <alpine.LFD.2.11.1405021347500.980-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>
2014-05-02 18:23               ` Andrew Bresticker
2014-05-02 18:23                 ` Andrew Bresticker
2014-05-02 18:37                 ` Nicolas Pitre
2014-05-02 18:37                   ` Nicolas Pitre
     [not found]                 ` <CAL1qeaHrP+i4EhOQKkSX7xFNyiyBiBfpsV3B0EHCFcrNzc6KLQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-05 16:26                   ` Abhilash Kesavan
2014-05-05 16:26                     ` Abhilash Kesavan
2014-05-05 16:25               ` Abhilash Kesavan
2014-05-05 16:25                 ` Abhilash Kesavan
2014-04-26 16:05   ` [PATCH v3 6/6] arm: exynos: Add /dev/bL_status user interface on Exynos5420 Abhilash Kesavan
2014-04-26 16:05     ` Abhilash Kesavan
     [not found]     ` <1398528348-21214-7-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-04-28 11:25       ` Daniel Lezcano
2014-04-28 11:25         ` Daniel Lezcano
     [not found]         ` <535E3A8C.6070304-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-04-28 12:49           ` Abhilash Kesavan
2014-04-28 12:49             ` Abhilash Kesavan
     [not found]             ` <CAM4voak-oXToBK=owO=jmpwk3rDkg71JS=8YOTz1HfiQvZa5Vw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-30 14:49               ` Nicolas Pitre
2014-04-30 14:49                 ` Nicolas Pitre
     [not found]                 ` <alpine.LFD.2.11.1404301044280.980-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>
2014-05-01  9:39                   ` Abhilash Kesavan
2014-05-01  9:39                     ` Abhilash Kesavan
2014-05-02 15:24   ` [PATCH v4 0/5] MCPM backend for Exynos5420 Abhilash Kesavan
2014-05-02 15:24     ` Abhilash Kesavan

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=alpine.LFD.2.11.1404291435450.980@knanqh.ubzr \
    --to=nicolas.pitre-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=Dave.Martin-5wv7dgnIgG8@public.gmane.org \
    --cc=Mark.Rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=Will.Deacon-5wv7dgnIgG8@public.gmane.org \
    --cc=abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=inderpal.s-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kesavan.abhilash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=thomas.ab-Sze3O3UU22JBDgjK7y7TUQ@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.