[PATCH v2 10/10] arm: zynq: Add cpuidle support

Arnd Bergmann arnd at arndb.de
Wed Mar 27 05:27:21 EDT 2013


On Wednesday 27 March 2013, Michal Simek wrote:
> 2013/3/26 Arnd Bergmann <arnd at arndb.de>:
> > On Tuesday 26 March 2013, Michal Simek wrote:
> >>  arch/arm/mach-zynq/Makefile  |    1 +
> >>  arch/arm/mach-zynq/cpuidle.c |  133 ++++++++++++++++++++++++++++++++++++++++++
> >>  2 files changed, 134 insertions(+)
> >>  create mode 100644 arch/arm/mach-zynq/cpuidle.c
> >
> > Can you move that file to drivers/cpuidle instead?
> 
> I can't see any problem in it right now.

Ok.

Adding Daniel Lezcano to CC, he's currently doing a lot of work on
the cpuidle drivers and may have some input as well.

> >>+/* Initialize CPU idle by registering the idle states */
> >>+static int xilinx_init_cpuidle(void)
> >>+{
> >>+       unsigned int cpu;
> >>+       struct cpuidle_device *device;
> >>+       int ret;
> >>+
> >>+       ret = cpuidle_register_driver(&xilinx_idle_driver);
> >>+       if (ret) {
> >>+               pr_err("Registering Xilinx CpuIdle Driver failed.\n");
> >>+               return ret;
> >>+       }
> >
> > I think you have to check that you actually run on a Zynq system before
> > registering the driver.
> 
> Is there any elegant way how to do it?
> I see that Rob is checking compatible machine with of_machine_is_compatible().
> 

Most drivers use some resource that they can check the presence of, which is
better than checking the global "compatible" property of the system. I don't
see any of that in your driver, but I may be missing something. What is it
specifically that makes this cpuidle driver special to Zynq and different
from other cpuidle drivers? Is that difference something we can describe
using the device tree in more specific terms than the root compatible
property?

	Arnd



More information about the linux-arm-kernel mailing list