Commit 55ab5942 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'tegra-for-5.16-cpuidle' of...

Merge tag 'tegra-for-5.16-cpuidle' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers

cpuidle: tegra: Changes for v5.16-rc1

This pulls in the for-5.16/clk and for-5.16/soc branches and uses the
stubs added in them to enable compile testing of the cpuidle driver.
While at it, this also fixes a potential driver probe order race
condition between the PMC and the cpuidle driver.

* tag 'tegra-for-5.16-cpuidle' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  cpuidle: tegra: Check whether PMC is ready
  cpuidle: tegra: Enable compile testing
  clk: tegra: Add stubs needed for compile testing

Link: https://lore.kernel.org/r/20211008201132.1678814-5-thierry.reding@gmail.comSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 94b847c7 bdb1ffda
...@@ -99,7 +99,7 @@ config ARM_MVEBU_V7_CPUIDLE ...@@ -99,7 +99,7 @@ config ARM_MVEBU_V7_CPUIDLE
config ARM_TEGRA_CPUIDLE config ARM_TEGRA_CPUIDLE
bool "CPU Idle Driver for NVIDIA Tegra SoCs" bool "CPU Idle Driver for NVIDIA Tegra SoCs"
depends on ARCH_TEGRA && !ARM64 depends on (ARCH_TEGRA || COMPILE_TEST) && !ARM64 && MMU
select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
select ARM_CPU_SUSPEND select ARM_CPU_SUSPEND
help help
......
...@@ -337,6 +337,9 @@ static void tegra_cpuidle_setup_tegra114_c7_state(void) ...@@ -337,6 +337,9 @@ static void tegra_cpuidle_setup_tegra114_c7_state(void)
static int tegra_cpuidle_probe(struct platform_device *pdev) static int tegra_cpuidle_probe(struct platform_device *pdev)
{ {
if (tegra_pmc_get_suspend_mode() == TEGRA_SUSPEND_NOT_READY)
return -EPROBE_DEFER;
/* LP2 could be disabled in device-tree */ /* LP2 could be disabled in device-tree */
if (tegra_pmc_get_suspend_mode() < TEGRA_SUSPEND_LP2) if (tegra_pmc_get_suspend_mode() < TEGRA_SUSPEND_LP2)
tegra_cpuidle_disable_state(TEGRA_CC6); tegra_cpuidle_disable_state(TEGRA_CC6);
......
...@@ -42,6 +42,7 @@ struct tegra_cpu_car_ops { ...@@ -42,6 +42,7 @@ struct tegra_cpu_car_ops {
#endif #endif
}; };
#ifdef CONFIG_ARCH_TEGRA
extern struct tegra_cpu_car_ops *tegra_cpu_car_ops; extern struct tegra_cpu_car_ops *tegra_cpu_car_ops;
static inline void tegra_wait_cpu_in_reset(u32 cpu) static inline void tegra_wait_cpu_in_reset(u32 cpu)
...@@ -83,8 +84,29 @@ static inline void tegra_disable_cpu_clock(u32 cpu) ...@@ -83,8 +84,29 @@ static inline void tegra_disable_cpu_clock(u32 cpu)
tegra_cpu_car_ops->disable_clock(cpu); tegra_cpu_car_ops->disable_clock(cpu);
} }
#else
static inline void tegra_wait_cpu_in_reset(u32 cpu)
{
}
#ifdef CONFIG_PM_SLEEP static inline void tegra_put_cpu_in_reset(u32 cpu)
{
}
static inline void tegra_cpu_out_of_reset(u32 cpu)
{
}
static inline void tegra_enable_cpu_clock(u32 cpu)
{
}
static inline void tegra_disable_cpu_clock(u32 cpu)
{
}
#endif
#if defined(CONFIG_ARCH_TEGRA) && defined(CONFIG_PM_SLEEP)
static inline bool tegra_cpu_rail_off_ready(void) static inline bool tegra_cpu_rail_off_ready(void)
{ {
if (WARN_ON(!tegra_cpu_car_ops->rail_off_ready)) if (WARN_ON(!tegra_cpu_car_ops->rail_off_ready))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment