linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC] arm: psci: implement cpuidle_ops
@ 2015-07-02  3:10 Jisheng Zhang
  2015-07-02  8:07 ` Daniel Lezcano
  0 siblings, 1 reply; 7+ messages in thread
From: Jisheng Zhang @ 2015-07-02  3:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

we'd like to use cpuidle-arm.c for both arm and arm64 with psci as backend. For
arm64, it works. But for arm, we miss cpuidle_ops. I want to add cpuidle_ops for
arm psci, I dunno whether this is the correct direction, could you please give
suggestions?

Thanks,
Jisheng

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC] arm: psci: implement cpuidle_ops
  2015-07-02  3:10 [RFC] arm: psci: implement cpuidle_ops Jisheng Zhang
@ 2015-07-02  8:07 ` Daniel Lezcano
  2015-07-02  8:16   ` Daniel Lezcano
  2015-07-02  8:18   ` Jisheng Zhang
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Lezcano @ 2015-07-02  8:07 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/02/2015 05:10 AM, Jisheng Zhang wrote:
> Hi all,
>
> we'd like to use cpuidle-arm.c for both arm and arm64 with psci as backend. For
> arm64, it works. But for arm, we miss cpuidle_ops. I want to add cpuidle_ops for
> arm psci, I dunno whether this is the correct direction, could you please give
> suggestions?

You should look at the macro

arch/arm/include/asm/cpuidle.h:

#define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops)


-- 
  <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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC] arm: psci: implement cpuidle_ops
  2015-07-02  8:07 ` Daniel Lezcano
@ 2015-07-02  8:16   ` Daniel Lezcano
  2015-07-02  8:21     ` Jisheng Zhang
  2015-07-02  8:18   ` Jisheng Zhang
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel Lezcano @ 2015-07-02  8:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/02/2015 10:07 AM, Daniel Lezcano wrote:
> On 07/02/2015 05:10 AM, Jisheng Zhang wrote:
>> Hi all,
>>
>> we'd like to use cpuidle-arm.c for both arm and arm64 with psci as
>> backend. For
>> arm64, it works. But for arm, we miss cpuidle_ops. I want to add
>> cpuidle_ops for
>> arm psci, I dunno whether this is the correct direction, could you
>> please give
>> suggestions?
>
> You should look at the macro
>
> arch/arm/include/asm/cpuidle.h:
>
> #define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops)

And more precisely, you can look at the code using it.

https://git.kernel.org/cgit/linux/kernel/git/galak/linux-qcom.git/tree/drivers/soc/qcom/spm.c?h=qcom/all#n282




-- 
  <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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC] arm: psci: implement cpuidle_ops
  2015-07-02  8:07 ` Daniel Lezcano
  2015-07-02  8:16   ` Daniel Lezcano
@ 2015-07-02  8:18   ` Jisheng Zhang
  2015-07-02 15:32     ` Mark Rutland
  1 sibling, 1 reply; 7+ messages in thread
From: Jisheng Zhang @ 2015-07-02  8:18 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Daniel,

On Thu, 2 Jul 2015 10:07:11 +0200
Daniel Lezcano <daniel.lezcano@linaro.org> wrote:

> On 07/02/2015 05:10 AM, Jisheng Zhang wrote:
> > Hi all,
> >
> > we'd like to use cpuidle-arm.c for both arm and arm64 with psci as backend. For
> > arm64, it works. But for arm, we miss cpuidle_ops. I want to add cpuidle_ops for
> > arm psci, I dunno whether this is the correct direction, could you please give
> > suggestions?
> 
> You should look at the macro
> 
> arch/arm/include/asm/cpuidle.h:
> 
> #define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops)

Yep, this is what I want to use. I want to use this MACRO to implement cpuidle_ops
for arm, but I dunno whether this is the correct direction. And I'd like to
reuse cpu_psci_cpu_init_idle() function in arch/arm64/kernel/psci.c to parse
the DT, but I'm not sure where to put cpu_psci_cpu_init_idle() so that can
be shared between arm and arm64. Also I noticed that there's a psci unification
work from Mark Rutland, does it make sense to put it in drivers/firmware/psci.c?

Thanks a lot,
Jisheng

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC] arm: psci: implement cpuidle_ops
  2015-07-02  8:16   ` Daniel Lezcano
@ 2015-07-02  8:21     ` Jisheng Zhang
  0 siblings, 0 replies; 7+ messages in thread
From: Jisheng Zhang @ 2015-07-02  8:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2 Jul 2015 10:16:08 +0200
Daniel Lezcano <daniel.lezcano@linaro.org> wrote:

> On 07/02/2015 10:07 AM, Daniel Lezcano wrote:
> > On 07/02/2015 05:10 AM, Jisheng Zhang wrote:
> >> Hi all,
> >>
> >> we'd like to use cpuidle-arm.c for both arm and arm64 with psci as
> >> backend. For
> >> arm64, it works. But for arm, we miss cpuidle_ops. I want to add
> >> cpuidle_ops for
> >> arm psci, I dunno whether this is the correct direction, could you
> >> please give
> >> suggestions?
> >
> > You should look at the macro
> >
> > arch/arm/include/asm/cpuidle.h:
> >
> > #define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops)
> 
> And more precisely, you can look at the code using it.
> 
> https://git.kernel.org/cgit/linux/kernel/git/galak/linux-qcom.git/tree/drivers/soc/qcom/spm.c?h=qcom/all#n282
> 

Thanks for this URL. I'll cook similar patches for arm psci cpuidle_ops.

Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC] arm: psci: implement cpuidle_ops
  2015-07-02  8:18   ` Jisheng Zhang
@ 2015-07-02 15:32     ` Mark Rutland
  2015-07-07 11:03       ` Lorenzo Pieralisi
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Rutland @ 2015-07-02 15:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 02, 2015 at 09:18:20AM +0100, Jisheng Zhang wrote:
> Dear Daniel,
> 
> On Thu, 2 Jul 2015 10:07:11 +0200
> Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
> 
> > On 07/02/2015 05:10 AM, Jisheng Zhang wrote:
> > > Hi all,
> > >
> > > we'd like to use cpuidle-arm.c for both arm and arm64 with psci as backend. For
> > > arm64, it works. But for arm, we miss cpuidle_ops. I want to add cpuidle_ops for
> > > arm psci, I dunno whether this is the correct direction, could you please give
> > > suggestions?
> > 
> > You should look at the macro
> > 
> > arch/arm/include/asm/cpuidle.h:
> > 
> > #define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops)
> 
> Yep, this is what I want to use. I want to use this MACRO to implement cpuidle_ops
> for arm, but I dunno whether this is the correct direction. And I'd like to
> reuse cpu_psci_cpu_init_idle() function in arch/arm64/kernel/psci.c to parse
> the DT, but I'm not sure where to put cpu_psci_cpu_init_idle() so that can
> be shared between arm and arm64. Also I noticed that there's a psci unification
> work from Mark Rutland, does it make sense to put it in drivers/firmware/psci.c?

I think cpu_psci_cpu_init_idle() should live in drivers/firmware/psci.c.
I also think that Lorenzo had an idea as to what should be done
regarding unifying the arm and arm64 approaches, but he's currently away
and I'm not all that familiar with cpuidle.

Thanks,
Mark.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC] arm: psci: implement cpuidle_ops
  2015-07-02 15:32     ` Mark Rutland
@ 2015-07-07 11:03       ` Lorenzo Pieralisi
  0 siblings, 0 replies; 7+ messages in thread
From: Lorenzo Pieralisi @ 2015-07-07 11:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 02, 2015 at 04:32:53PM +0100, Mark Rutland wrote:
> On Thu, Jul 02, 2015 at 09:18:20AM +0100, Jisheng Zhang wrote:
> > Dear Daniel,
> > 
> > On Thu, 2 Jul 2015 10:07:11 +0200
> > Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
> > 
> > > On 07/02/2015 05:10 AM, Jisheng Zhang wrote:
> > > > Hi all,
> > > >
> > > > we'd like to use cpuidle-arm.c for both arm and arm64 with psci as backend. For
> > > > arm64, it works. But for arm, we miss cpuidle_ops. I want to add cpuidle_ops for
> > > > arm psci, I dunno whether this is the correct direction, could you please give
> > > > suggestions?
> > > 
> > > You should look at the macro
> > > 
> > > arch/arm/include/asm/cpuidle.h:
> > > 
> > > #define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops)
> > 
> > Yep, this is what I want to use. I want to use this MACRO to implement cpuidle_ops
> > for arm, but I dunno whether this is the correct direction. And I'd like to
> > reuse cpu_psci_cpu_init_idle() function in arch/arm64/kernel/psci.c to parse
> > the DT, but I'm not sure where to put cpu_psci_cpu_init_idle() so that can
> > be shared between arm and arm64. Also I noticed that there's a psci unification
> > work from Mark Rutland, does it make sense to put it in drivers/firmware/psci.c?
> 
> I think cpu_psci_cpu_init_idle() should live in drivers/firmware/psci.c.
> I also think that Lorenzo had an idea as to what should be done
> regarding unifying the arm and arm64 approaches, but he's currently away
> and I'm not all that familiar with cpuidle.

Yes, PSCI idle states initialization must be common between arm and arm64,
and also cpu_psci_cpu_suspend now that the cpu_suspend() API was made
common.

The drivers/firmware PSCI implementation for those hooks can be used to
inizialize the respective arm/arm64 structures then, as highlighted
in this thread. I will review the series.

Thanks,
Lorenzo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-07 11:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-02  3:10 [RFC] arm: psci: implement cpuidle_ops Jisheng Zhang
2015-07-02  8:07 ` Daniel Lezcano
2015-07-02  8:16   ` Daniel Lezcano
2015-07-02  8:21     ` Jisheng Zhang
2015-07-02  8:18   ` Jisheng Zhang
2015-07-02 15:32     ` Mark Rutland
2015-07-07 11:03       ` Lorenzo Pieralisi

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).