From: Nicolas Pitre <nicolas.pitre@linaro.org>
To: Tomasz Figa <t.figa@samsung.com>
Cc: Chander Kashyap <chander.kashyap@linaro.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Kukjin Kim <kgene.kim@samsung.com>,
Tomasz Figa <tomasz.figa@gmail.com>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
Jingoo Han <jg1.han@samsung.com>,
Jonghwan Choi <jhbird.choi@samsung.com>,
Abhilash Kesavan <a.kesavan@samsung.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
Kyungmin Park <kyungmin.park@samsung.com>,
Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>,
Will Deacon <Will.Deacon@arm.com>,
Stephen Boyd <sboyd@codeaurora.org>
Subject: Re: [PATCH] ARM: EXYNOS: Fix incorrect usage of S5P_ARM_CORE1_* registers
Date: Wed, 19 Jun 2013 11:19:30 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.2.03.1306191110130.18597@syhkavp.arg> (raw)
In-Reply-To: <24503071.R7UT57fHdP@amdc1227>
On Wed, 19 Jun 2013, Tomasz Figa wrote:
> On Wednesday 19 of June 2013 20:26:50 Chander Kashyap wrote:
> > On 19 June 2013 19:58, Tomasz Figa <t.figa@samsung.com> wrote:
> > > I mean, calculate register offset based on two parameters - cluster ID
> > > and>
> > > CPU ID, like:
> > > ...
> > >
> > > u32 mpidr = cpu_logical_map(cpu);
> > > u32 phys_cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
> > >
> > > if (soc_is_exynosXXXX()) {
> > >
> > > u32 cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
> > >
> > > phys_cpu += EXYNOSXXXX_CPUS_PER_CLUSTER * cluster;
> > >
> > > }
> > >
> > > reg_base = S5P_ARM_CORE_CONFIGURATION(phys_cpu);
> > > __raw_writel(0, reg_base);
> >
> > This does not seems to viable solution, as eg. clusterID for
> > exynos4210 is 0x9 and exynos 4412 is 0xa.
>
> We don't need to consider cluster ID for any SoC that has just one cluster.
> That's why there is the if (soc_is_exynosXXXX()) clause, where exynosXXXX
> is the SoC that we support and has more clusters.
>
> > But if we wass the cpu nodes
> > thru DT, the we can comfortably rely on the logical cpu number. Also
> > EXYNOSXXXX_CPUS_PER_CLUSTER can vary from cluster to cluster.
>
> There is nothing that prevents you from specifying the CPUs in DT in
> different order. Moreover, even if you specify them in correct order, there
> is nothing that prevents you from using any of the listed CPUs as boot CPU,
> which will get the logical ID of 0.
Relying on the logical CPU number to index into hardware related
register space is wrong, please don't do that.
If the MPIDR allocation isn't linear then this cannot be used either.
The best solution is probably to add this reg_base as a property of each
CPU node in DT, and extract it at boot time to stash it into an array
which can be indexed with the logical CPU number afterwards.
Nicolas
next prev parent reply other threads:[~2013-06-19 15:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 15:26 Tomasz Figa
2013-06-18 17:45 ` Tomasz Figa
2013-06-18 17:59 ` Kukjin Kim
2013-06-19 12:09 ` Chander Kashyap
2013-06-19 12:50 ` Tomasz Figa
2013-06-19 13:24 ` Chander Kashyap
2013-06-19 13:24 ` Lorenzo Pieralisi
2013-06-19 13:31 ` Chander Kashyap
2013-06-19 13:49 ` Tomasz Figa
2013-06-19 13:55 ` Chander Kashyap
2013-06-19 14:28 ` Tomasz Figa
2013-06-19 14:56 ` Chander Kashyap
2013-06-19 15:01 ` Tomasz Figa
2013-06-19 15:07 ` Chander Kashyap
2013-06-19 15:19 ` Nicolas Pitre [this message]
2013-06-20 10:16 ` Tomasz Figa
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.03.1306191110130.18597@syhkavp.arg \
--to=nicolas.pitre@linaro.org \
--cc=Will.Deacon@arm.com \
--cc=a.kesavan@samsung.com \
--cc=arnd@arndb.de \
--cc=chander.kashyap@linaro.org \
--cc=jg1.han@samsung.com \
--cc=jhbird.choi@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=lorenzo.pieralisi@arm.com \
--cc=olof@lixom.net \
--cc=sboyd@codeaurora.org \
--cc=stable@vger.kernel.org \
--cc=t.figa@samsung.com \
--cc=tomasz.figa@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®