Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1190877 > unrolled thread

[PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index

Started byXunlei Pang <xlpang@126.com>
First post2015-07-23 14:40 +0200
Last post2015-08-04 07:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index Xunlei Pang <xlpang@126.com> - 2015-07-23 14:40 +0200
    Re: [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-03 18:30 +0200
      Re: [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index pang.xunlei@zte.com.cn - 2015-08-04 07:20 +0200

#1190877 — [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index

FromXunlei Pang <xlpang@126.com>
Date2015-07-23 14:40 +0200
Subject[PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index
Message-ID<pPnX4-6M5-11@gated-at.bofh.it>
From: Xunlei Pang <pang.xunlei@zte.com.cn>

cpuidle_device::safe_state_index need to be initialized before use,
so assign the driver's safe_state_index to it.

Signed-off-by: Xunlei Pang <pang.xunlei@zte.com.cn>
---
 drivers/cpuidle/cpuidle.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index e8e2775..ed5c8efe 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -585,6 +585,8 @@ int cpuidle_register(struct cpuidle_driver *drv,
 		 */
 		if (coupled_cpus)
 			device->coupled_cpus = *coupled_cpus;
+
+		device->safe_state_index = drv->safe_state_index;
 #endif
 		ret = cpuidle_register_device(device);
 		if (!ret)
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1199017

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-03 18:30 +0200
Message-ID<pTqMG-8nK-17@gated-at.bofh.it>
In reply to#1190877
On 07/23/2015 02:31 PM, Xunlei Pang wrote:
> From: Xunlei Pang <pang.xunlei@zte.com.cn>
>
> cpuidle_device::safe_state_index need to be initialized before use,
> so assign the driver's safe_state_index to it.
>
> Signed-off-by: Xunlei Pang <pang.xunlei@zte.com.cn>
> ---
>   drivers/cpuidle/cpuidle.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index e8e2775..ed5c8efe 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -585,6 +585,8 @@ int cpuidle_register(struct cpuidle_driver *drv,
>   		 */
>   		if (coupled_cpus)
>   			device->coupled_cpus = *coupled_cpus;
> +
> +		device->safe_state_index = drv->safe_state_index;

Hey, good catch. We are lucky the safe_state_index is always zero.

I think we can simplify the code by removing the safe_state_index from 
the cpuidle_device structure and use the one in the cpuidle_driver 
structure in coupled.c




-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1199412

Frompang.xunlei@zte.com.cn
Date2015-08-04 07:20 +0200
Message-ID<pTCNQ-Kb-5@gated-at.bofh.it>
In reply to#1199017
Hi Daniel,

Daniel Lezcano <daniel.lezcano@linaro.org> wrote 2015-08-04 AM 12:22:54:
> Re: [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index
> 
> On 07/23/2015 02:31 PM, Xunlei Pang wrote:
> > From: Xunlei Pang <pang.xunlei@zte.com.cn>
> >
> > cpuidle_device::safe_state_index need to be initialized before use,
> > so assign the driver's safe_state_index to it.
> >
> > Signed-off-by: Xunlei Pang <pang.xunlei@zte.com.cn>
> > ---
> >   drivers/cpuidle/cpuidle.c | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> > index e8e2775..ed5c8efe 100644
> > --- a/drivers/cpuidle/cpuidle.c
> > +++ b/drivers/cpuidle/cpuidle.c
> > @@ -585,6 +585,8 @@ int cpuidle_register(struct cpuidle_driver *drv,
> >          */
> >         if (coupled_cpus)
> >            device->coupled_cpus = *coupled_cpus;
> > +
> > +      device->safe_state_index = drv->safe_state_index;
> 
> Hey, good catch. We are lucky the safe_state_index is always zero.
> 
> I think we can simplify the code by removing the safe_state_index from 
> the cpuidle_device structure and use the one in the cpuidle_driver 
> structure in coupled.c

Will do, thanks!

Regards,
-Xunlei

--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s).  If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited.  If you have received this mail in error, please delete it and notify us immediately.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web