From: Michael Ellerman <mpe@ellerman•id.au>
To: "Gautham R. Shenoy" <ego@linux•vnet.ibm.com>,
Benjamin Herrenschmidt <benh@kernel•crashing.org>,
Paul Mackerras <paulus@samba•org>,
"Rafael J. Wysocki" <rjw@rjwysocki•net>,
Daniel Lezcano <daniel.lezcano@linaro•org>,
Michael Neuling <mikey@neuling•org>,
Vaidyanathan Srinivasan <svaidy@linux•vnet.ibm.com>,
"Shreyas B. Prabhu" <shreyasbp@gmail•com>,
Shilpasri G Bhat <shilpa.bhat@linux•vnet.ibm.com>,
Stewart Smith <stewart@linux•vnet.ibm.com>,
Balbir Singh <bsingharora@gmail•com>,
Oliver O'Halloran <oohall@gmail•com>
Cc: <linuxppc-dev@lists•ozlabs.org>, <linux-kernel@vger•kernel.org>,
<linux-pm@vger•kernel.org>, <skiboot@lists•ozlabs.org>,
"Gautham R. Shenoy" <ego@linux•vnet.ibm.com>
Subject: Re: [PATCH v3 2/3] cpuidle:powernv: Add helper function to populate powernv idle states.
Date: Wed, 23 Nov 2016 20:49:08 +1100 [thread overview]
Message-ID: <87vavettkb.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <9c2b5cae68b54ec5dcb2651f352f740f1d09051c.1478760806.git.ego@linux.vnet.ibm.com>
"Gautham R. Shenoy" <ego@linux•vnet.ibm.com> writes:
> diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c
> index 7fe442c..9240e08 100644
> --- a/drivers/cpuidle/cpuidle-powernv.c
> +++ b/drivers/cpuidle/cpuidle-powernv.c
> @@ -243,28 +262,31 @@ static int powernv_add_idle_states(void)
> */
> if (latency_ns[i] > POWERNV_THRESHOLD_LATENCY_NS)
> continue;
> + /*
> + * Firmware passes residency and latency values in ns.
> + * cpuidle expects it in us.
> + */
> + exit_latency = ((unsigned int)latency_ns[i]) / 1000;
> + target_residency = (!rc) ? ((unsigned int)residency_ns[i]) : 0;
> + target_residency /= 1000;
Urk.
Can you just do it normally:
if (rc == 0)
target_residency = (unsigned int)residency_ns[i] / 1000;
I also don't see why you need the cast?
cheers
next prev parent reply other threads:[~2016-11-23 9:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-10 7:54 [PATCH v3 0/3] powernv:stop: Use psscr_val,mask provided by firmware Gautham R. Shenoy
2016-11-10 7:54 ` [PATCH v3 1/3] powernv:idle: Add IDLE_STATE_ENTER_SEQ_NORET macro Gautham R. Shenoy
2016-11-29 10:42 ` Balbir Singh
2016-11-10 7:54 ` [PATCH v3 2/3] cpuidle:powernv: Add helper function to populate powernv idle states Gautham R. Shenoy
2016-11-23 9:49 ` Michael Ellerman [this message]
2016-11-29 6:09 ` Gautham R Shenoy
2016-11-10 7:54 ` [PATCH v3 3/3] powernv: Pass PSSCR value and mask to power9_idle_stop Gautham R. Shenoy
2016-11-23 9:51 ` Michael Ellerman
2016-11-29 6:10 ` Gautham R Shenoy
2016-11-29 6:34 ` [PATCH v3 0/3] powernv:stop: Use psscr_val,mask provided by firmware Balbir Singh
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=87vavettkb.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman$(echo .)id.au \
--cc=benh@kernel$(echo .)crashing.org \
--cc=bsingharora@gmail$(echo .)com \
--cc=daniel.lezcano@linaro$(echo .)org \
--cc=ego@linux$(echo .)vnet.ibm.com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-pm@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=mikey@neuling$(echo .)org \
--cc=oohall@gmail$(echo .)com \
--cc=paulus@samba$(echo .)org \
--cc=rjw@rjwysocki$(echo .)net \
--cc=shilpa.bhat@linux$(echo .)vnet.ibm.com \
--cc=shreyasbp@gmail$(echo .)com \
--cc=skiboot@lists$(echo .)ozlabs.org \
--cc=stewart@linux$(echo .)vnet.ibm.com \
--cc=svaidy@linux$(echo .)vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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