linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Lina Iyer <lina.iyer@linaro.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
	"khilman@linaro.org" <khilman@linaro.org>,
	"sboyd@codeaurora.org" <sboyd@codeaurora.org>,
	"davidb@codeaurora.org" <davidb@codeaurora.org>,
	"galak@codeaurora.org" <galak@codeaurora.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"msivasub@codeaurora.org" <msivasub@codeaurora.org>
Subject: Re: [PATCH v4 7/8] qcom: cpuidle: Add cpuidle driver for QCOM cpus
Date: Thu, 21 Aug 2014 16:07:25 +0100	[thread overview]
Message-ID: <20140821150725.GA29752@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <20140821143643.GA60920@ilina-mac.local>

On Thu, Aug 21, 2014 at 03:36:43PM +0100, Lina Iyer wrote:

[...]

> >>+	cpu_node = of_cpu_device_node_get(cpumask_first(drv->cpumask));
> >>+	if (!cpu_node)
> >>+		return;
> >>+
> >>+	/**
> >>+	 * Get the state description from idle-state node entry-method
> >>+	 * First state is always WFI, per spec.
> >>+	 */
> >>+	modes[0] = MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT;
> >>+	for (i = 1; i < drv->state_count; i++) {
> >>+		mode_name = NULL;
> >>+		state_node = of_parse_phandle(cpu_node, "cpu-idle-states", i);
> >>+		of_property_read_string(state_node, "entry-method",
> >>+						&mode_name);
> >>+		for (j = 0; mode_name && (j < ARRAY_SIZE(c_states)); j++) {
> >>+			if (!strcmp(mode_name, c_states[j].name)) {
> >>+				modes[i] = c_states[j].mode;
> >>+				break;
> >>+			}
> >>+		}
> >>+	}
> >>+}
> >
> >For the function above, I believe we can do better with the 
> >idle_dt_init function to prevent to have to reparse the infos.
> >
> >I had the opportunity to discuss with Lorenzo privately and we found a 
> >solution he will submit to solve that.
> >
> Hmm. Thanks, I was asked to use the entry-method. FWIW, I dont like this
> either :)

You weren't asked to use entry-method, you were asked to do what psci
does, namely defining a per-state parameter.

Anyway, we will rely on compatible string to initialize the state enter
pointer so that we are all happy again.

The driver will pass an array of pairs {compatible, enter_function},
the dt init will initialize the idle state enter pointer accordingly.

I still have a feeling that DT parsing code should also return an array to
the CPUidle driver corresponding to DT nodes that were used to
initialize idle states, this way, if it is needed, the CPUidle driver
can parse for each index the platform specific idle state properties.

Otherwise we will end up with a function pointer per-state even if two
states are almost identical and just differ in the parameter passed.

It is more a matter of taste than anything else, I will implement the
code discussed with Daniel that will be on the lists at -rc3.

Thanks,
Lorenzo

  reply	other threads:[~2014-08-21 15:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19 22:15 [PATCH v4 0/8] QCOM 8074 cpuidle driver Lina Iyer
2014-08-19 22:15 ` [PATCH v4 1/8] msm: scm: Move scm-boot files to drivers/soc and include/soc Lina Iyer
2014-08-19 22:15 ` [PATCH v4 2/8] msm: scm: Add SCM warmboot flags for quad core targets Lina Iyer
2014-08-19 22:15 ` [PATCH v4 3/8] qcom: spm: Add Subsystem Power Manager driver (SAW2) Lina Iyer
2014-08-20  2:01   ` Stephen Boyd
2014-08-20  3:24     ` Lina Iyer
2014-08-21  0:25       ` Stephen Boyd
2014-08-21 15:50         ` Lina Iyer
2014-08-19 22:15 ` [PATCH v4 4/8] qcom: spm-devices: Add SPM device manager for the SoC Lina Iyer
2014-08-25 23:40   ` Stephen Boyd
2014-08-26  0:31     ` Lina Iyer
2014-08-26  2:17       ` Stephen Boyd
     [not found]         ` <53FBEE2B.7020008-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2014-08-26 15:33           ` Lina Iyer
2014-08-27 14:00   ` Kumar Gala
2014-08-27 15:35     ` Lina Iyer
2014-08-19 22:15 ` [PATCH v4 5/8] arm: dts: qcom: Add SPM device bindings for 8974 Lina Iyer
2014-08-19 22:15 ` [PATCH v4 6/8] qcom: msm-pm: Add cpu low power mode functions Lina Iyer
2014-08-19 22:15 ` [PATCH v4 7/8] qcom: cpuidle: Add cpuidle driver for QCOM cpus Lina Iyer
2014-08-21  1:24   ` Daniel Lezcano
2014-08-21 14:36     ` Lina Iyer
2014-08-21 15:07       ` Lorenzo Pieralisi [this message]
2014-08-27 17:31       ` Kevin Hilman
2014-08-27 20:35         ` Lina Iyer
2014-08-22 15:36     ` Lina Iyer
2014-08-23 10:37       ` Lorenzo Pieralisi
2014-08-19 22:15 ` [PATCH v4 8/8] arm: dts: qcom: Add idle states device nodes for 8974 Lina Iyer

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=20140821150725.GA29752@e102568-lin.cambridge.arm.com \
    --to=lorenzo.pieralisi@arm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=davidb@codeaurora.org \
    --cc=galak@codeaurora.org \
    --cc=khilman@linaro.org \
    --cc=lina.iyer@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=msivasub@codeaurora.org \
    --cc=sboyd@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).