All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Mark Rutland <Mark.Rutland@arm.com>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Tomasz Figa <t.figa@samsung.com>,
	Lina Iyer <lina.iyer@linaro.org>,
	Chander Kashyap <k.chander@samsung.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"grant.likely@linaro.org" <grant.likely@linaro.org>,
	Charles Garcia-Tobin <Charles.Garcia-Tobin@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Kevin Hilman <khilman@linaro.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Sebastian Capella <sebcape@gmail.com>,
	Mark Brown <broonie@kernel.org>, Antti Miettinen <ananaza@iki.fi>,
	Paul Walmsley <paul@pwsan.com>,
	Geoff Levand <geoff@infradead.org>,
	Peter De Schrijver <pdeschrijver@nvidia.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Amit
Subject: Re: [PATCH v7 3/8] drivers: cpuidle: implement DT based idle states infrastructure
Date: Wed, 13 Aug 2014 18:04:40 +0100	[thread overview]
Message-ID: <20140813170440.GA30822@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <alpine.LFD.2.11.1408131223501.1133@knanqh.ubzr>

On Wed, Aug 13, 2014 at 05:31:11PM +0100, Nicolas Pitre wrote:
> On Wed, 13 Aug 2014, Lorenzo Pieralisi wrote:
> 
> > On most common ARM systems, the low-power states a CPU can be put into are
> > not discoverable in HW and require device tree bindings to describe
> > power down suspend operations and idle states parameters.
> > 
> > In order to enable DT based idle states and configure idle drivers, this
> > patch implements the bulk infrastructure required to parse the device tree
> > idle states bindings and initialize the corresponding CPUidle driver states
> > data.
> > 
> > The parsing API accepts a start index that defines the first idle state
> > that should be initialized by the parsing code in order to give new and
> > legacy driver flexibility over which states should be parsed using the
> > new DT mechanism.
> > 
> > The idle states list is obtained from the first cpu in the driver
> > cpumask, which implicitly means the parsing code expects idle states
> > (and related list of phandles) to be the same for all CPUs in the
> > CPUidle driver mask. The kernel does not check this assumption, it must
> > be enforced by the bootloader to ensure correct system behaviour.
> 
> Can we make the kernel a little less reliant on bootloader to ensure 
> correct system behaviour please?  If assumptions are assumed by the 
> kernel, it should at least print a warning and simply ignore the 
> information when such assumption are not respected.

I think the check adds complexity (it means stashing the idle states
phandles for the first cpu, loop through the cpus in the mask and compare
the phandles to the ones stashed for the first cpu for all cpus in the
driver mask) for not much.

I was told that it is not up to the kernel to validate the DT, but if
you want I can implement the check even though I really think it is
overkill.

> > +	/*
> > +	 * We get the idle states for the first logical cpu in the
> > +	 * driver mask. The kernel does not check idle states on all
> > +	 * cpus in the driver mask, they are assumed to be the same
> > +	 * by default.
> > +	 */
> 
> What if they're not?

It boils down to detecting what CPUs share the same idle states and
initialize dynamically a number of CPU idle drivers accordingly. It is
doable on top of this patch which is usable on homogeneous machines as a
starting point.
I do not think it is a big issue to live with this limitation at the moment,
given that it can be augmented when this code gets in the kernel. I did not
want to add more complexity to this already complex patch series, that's
the reason why I have not implemented the multiple driver (whose first
target is obviously bL systems) approach from the beginning, and I think
that's reasonable.

Thanks,
Lorenzo

WARNING: multiple messages have this Message-ID (diff)
From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 3/8] drivers: cpuidle: implement DT based idle states infrastructure
Date: Wed, 13 Aug 2014 18:04:40 +0100	[thread overview]
Message-ID: <20140813170440.GA30822@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <alpine.LFD.2.11.1408131223501.1133@knanqh.ubzr>

On Wed, Aug 13, 2014 at 05:31:11PM +0100, Nicolas Pitre wrote:
> On Wed, 13 Aug 2014, Lorenzo Pieralisi wrote:
> 
> > On most common ARM systems, the low-power states a CPU can be put into are
> > not discoverable in HW and require device tree bindings to describe
> > power down suspend operations and idle states parameters.
> > 
> > In order to enable DT based idle states and configure idle drivers, this
> > patch implements the bulk infrastructure required to parse the device tree
> > idle states bindings and initialize the corresponding CPUidle driver states
> > data.
> > 
> > The parsing API accepts a start index that defines the first idle state
> > that should be initialized by the parsing code in order to give new and
> > legacy driver flexibility over which states should be parsed using the
> > new DT mechanism.
> > 
> > The idle states list is obtained from the first cpu in the driver
> > cpumask, which implicitly means the parsing code expects idle states
> > (and related list of phandles) to be the same for all CPUs in the
> > CPUidle driver mask. The kernel does not check this assumption, it must
> > be enforced by the bootloader to ensure correct system behaviour.
> 
> Can we make the kernel a little less reliant on bootloader to ensure 
> correct system behaviour please?  If assumptions are assumed by the 
> kernel, it should at least print a warning and simply ignore the 
> information when such assumption are not respected.

I think the check adds complexity (it means stashing the idle states
phandles for the first cpu, loop through the cpus in the mask and compare
the phandles to the ones stashed for the first cpu for all cpus in the
driver mask) for not much.

I was told that it is not up to the kernel to validate the DT, but if
you want I can implement the check even though I really think it is
overkill.

> > +	/*
> > +	 * We get the idle states for the first logical cpu in the
> > +	 * driver mask. The kernel does not check idle states on all
> > +	 * cpus in the driver mask, they are assumed to be the same
> > +	 * by default.
> > +	 */
> 
> What if they're not?

It boils down to detecting what CPUs share the same idle states and
initialize dynamically a number of CPU idle drivers accordingly. It is
doable on top of this patch which is usable on homogeneous machines as a
starting point.
I do not think it is a big issue to live with this limitation at the moment,
given that it can be augmented when this code gets in the kernel. I did not
want to add more complexity to this already complex patch series, that's
the reason why I have not implemented the multiple driver (whose first
target is obviously bL systems) approach from the beginning, and I think
that's reasonable.

Thanks,
Lorenzo

  reply	other threads:[~2014-08-13 17:04 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13 15:51 [PATCH v7 0/8] ARM generic idle states Lorenzo Pieralisi
2014-08-13 15:51 ` Lorenzo Pieralisi
2014-08-13 15:52 ` [PATCH v7 1/8] arm64: kernel: refactor the CPU suspend API for retention states Lorenzo Pieralisi
2014-08-13 15:52   ` Lorenzo Pieralisi
2014-08-18  7:47   ` Hanjun Guo
2014-08-18  7:47     ` Hanjun Guo
2014-08-18 14:20   ` Catalin Marinas
2014-08-18 14:20     ` Catalin Marinas
2014-08-13 15:52 ` [PATCH v7 2/8] Documentation: arm: define DT idle states bindings Lorenzo Pieralisi
2014-08-13 15:52   ` Lorenzo Pieralisi
     [not found]   ` <1407945127-27554-3-git-send-email-lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org>
2014-08-13 19:25     ` Lina Iyer
2014-08-13 19:25       ` Lina Iyer
2014-08-13 22:11       ` Lorenzo Pieralisi
2014-08-13 22:11         ` Lorenzo Pieralisi
2014-08-15 17:20   ` Lina Iyer
2014-08-15 17:20     ` Lina Iyer
2014-08-15 17:51     ` Lorenzo Pieralisi
2014-08-15 17:51       ` Lorenzo Pieralisi
2014-08-18 14:20   ` Catalin Marinas
2014-08-18 14:20     ` Catalin Marinas
2014-08-13 15:52 ` [PATCH v7 3/8] drivers: cpuidle: implement DT based idle states infrastructure Lorenzo Pieralisi
2014-08-13 15:52   ` Lorenzo Pieralisi
2014-08-13 16:31   ` Nicolas Pitre
2014-08-13 16:31     ` Nicolas Pitre
2014-08-13 17:04     ` Lorenzo Pieralisi [this message]
2014-08-13 17:04       ` Lorenzo Pieralisi
2014-08-13 17:29       ` Nicolas Pitre
2014-08-13 17:29         ` Nicolas Pitre
2014-08-14 11:29         ` Lorenzo Pieralisi
2014-08-14 11:29           ` Lorenzo Pieralisi
2014-08-14 15:47           ` Nicolas Pitre
2014-08-14 15:47             ` Nicolas Pitre
2014-08-14 16:02             ` Lorenzo Pieralisi
2014-08-14 16:02               ` Lorenzo Pieralisi
2014-08-18 14:21           ` Catalin Marinas
2014-08-18 14:21             ` Catalin Marinas
2014-08-13 15:52 ` [PATCH v7 4/8] arm64: kernel: introduce cpu_init_idle CPU operation Lorenzo Pieralisi
2014-08-13 15:52   ` Lorenzo Pieralisi
2014-08-18 14:21   ` Catalin Marinas
2014-08-18 14:21     ` Catalin Marinas
     [not found] ` <1407945127-27554-1-git-send-email-lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org>
2014-08-13 15:52   ` [PATCH v7 5/8] arm64: add PSCI CPU_SUSPEND based cpu_suspend support Lorenzo Pieralisi
2014-08-13 15:52     ` Lorenzo Pieralisi
2014-08-18 14:21     ` Catalin Marinas
2014-08-18 14:21       ` Catalin Marinas
2014-08-13 15:52 ` [PATCH v7 6/8] drivers: cpuidle: CPU idle ARM64 driver Lorenzo Pieralisi
2014-08-13 15:52   ` Lorenzo Pieralisi
2014-08-18 14:21   ` Catalin Marinas
2014-08-18 14:21     ` Catalin Marinas
2014-08-18 22:30     ` Lorenzo Pieralisi
2014-08-18 22:30       ` Lorenzo Pieralisi
2014-08-18 14:21   ` Catalin Marinas
2014-08-18 14:21     ` Catalin Marinas
2014-08-18 22:25     ` Lorenzo Pieralisi
2014-08-18 22:25       ` Lorenzo Pieralisi
2014-08-13 15:52 ` [PATCH v7 7/8] drivers: cpuidle: initialize big.LITTLE driver through DT Lorenzo Pieralisi
2014-08-13 15:52   ` Lorenzo Pieralisi
2014-08-18 14:21   ` Catalin Marinas
2014-08-18 14:21     ` Catalin Marinas
2014-08-13 15:52 ` [PATCH v7 8/8] drivers: cpuidle: initialize Exynos " Lorenzo Pieralisi
2014-08-13 15:52   ` Lorenzo Pieralisi
2014-08-15 21:12   ` Lina Iyer
2014-08-15 21:12     ` Lina Iyer
2014-08-15 21:40     ` Lorenzo Pieralisi
2014-08-15 21:40       ` Lorenzo Pieralisi
2014-08-15 21:45       ` Lina Iyer
2014-08-15 21:45         ` Lina Iyer
2014-08-15 21:52         ` Lorenzo Pieralisi
2014-08-15 21:52           ` Lorenzo Pieralisi
2014-08-18 14:22   ` Catalin Marinas
2014-08-18 14:22     ` Catalin Marinas

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=20140813170440.GA30822@e102568-lin.cambridge.arm.com \
    --to=lorenzo.pieralisi@arm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Charles.Garcia-Tobin@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=ananaza@iki.fi \
    --cc=broonie@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geoff@infradead.org \
    --cc=grant.likely@linaro.org \
    --cc=k.chander@samsung.com \
    --cc=khilman@linaro.org \
    --cc=lina.iyer@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=paul@pwsan.com \
    --cc=pdeschrijver@nvidia.com \
    --cc=sboyd@codeaurora.org \
    --cc=sebcape@gmail.com \
    --cc=t.figa@samsung.com \
    --cc=vincent.guittot@linaro.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.