Commit f7d50a15 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge back cpuidle material for v5.6.

parents 57388a2c 53eb82b0
...@@ -25,7 +25,7 @@ config ARM_PSCI_CPUIDLE ...@@ -25,7 +25,7 @@ config ARM_PSCI_CPUIDLE
config ARM_BIG_LITTLE_CPUIDLE config ARM_BIG_LITTLE_CPUIDLE
bool "Support for ARM big.LITTLE processors" bool "Support for ARM big.LITTLE processors"
depends on ARCH_VEXPRESS_TC2_PM || ARCH_EXYNOS depends on ARCH_VEXPRESS_TC2_PM || ARCH_EXYNOS || COMPILE_TEST
depends on MCPM && !ARM64 depends on MCPM && !ARM64
select ARM_CPU_SUSPEND select ARM_CPU_SUSPEND
select CPU_IDLE_MULTIPLE_DRIVERS select CPU_IDLE_MULTIPLE_DRIVERS
...@@ -51,13 +51,13 @@ config ARM_HIGHBANK_CPUIDLE ...@@ -51,13 +51,13 @@ config ARM_HIGHBANK_CPUIDLE
config ARM_KIRKWOOD_CPUIDLE config ARM_KIRKWOOD_CPUIDLE
bool "CPU Idle Driver for Marvell Kirkwood SoCs" bool "CPU Idle Driver for Marvell Kirkwood SoCs"
depends on MACH_KIRKWOOD && !ARM64 depends on (MACH_KIRKWOOD || COMPILE_TEST) && !ARM64
help help
This adds the CPU Idle driver for Marvell Kirkwood SoCs. This adds the CPU Idle driver for Marvell Kirkwood SoCs.
config ARM_ZYNQ_CPUIDLE config ARM_ZYNQ_CPUIDLE
bool "CPU Idle Driver for Xilinx Zynq processors" bool "CPU Idle Driver for Xilinx Zynq processors"
depends on ARCH_ZYNQ && !ARM64 depends on (ARCH_ZYNQ || COMPILE_TEST) && !ARM64
help help
Select this to enable cpuidle on Xilinx Zynq processors. Select this to enable cpuidle on Xilinx Zynq processors.
...@@ -70,19 +70,19 @@ config ARM_U8500_CPUIDLE ...@@ -70,19 +70,19 @@ config ARM_U8500_CPUIDLE
config ARM_AT91_CPUIDLE config ARM_AT91_CPUIDLE
bool "Cpu Idle Driver for the AT91 processors" bool "Cpu Idle Driver for the AT91 processors"
default y default y
depends on ARCH_AT91 && !ARM64 depends on (ARCH_AT91 || COMPILE_TEST) && !ARM64
help help
Select this to enable cpuidle for AT91 processors. Select this to enable cpuidle for AT91 processors.
config ARM_EXYNOS_CPUIDLE config ARM_EXYNOS_CPUIDLE
bool "Cpu Idle Driver for the Exynos processors" bool "Cpu Idle Driver for the Exynos processors"
depends on ARCH_EXYNOS && !ARM64 depends on (ARCH_EXYNOS || COMPILE_TEST) && !ARM64
select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
help help
Select this to enable cpuidle for Exynos processors. Select this to enable cpuidle for Exynos processors.
config ARM_MVEBU_V7_CPUIDLE config ARM_MVEBU_V7_CPUIDLE
bool "CPU Idle Driver for mvebu v7 family processors" bool "CPU Idle Driver for mvebu v7 family processors"
depends on ARCH_MVEBU && !ARM64 depends on (ARCH_MVEBU || COMPILE_TEST) && !ARM64
help help
Select this to enable cpuidle on Armada 370, 38x and XP processors. Select this to enable cpuidle on Armada 370, 38x and XP processors.
...@@ -37,10 +37,7 @@ static struct cpuidle_driver clps711x_idle_driver = { ...@@ -37,10 +37,7 @@ static struct cpuidle_driver clps711x_idle_driver = {
static int __init clps711x_cpuidle_probe(struct platform_device *pdev) static int __init clps711x_cpuidle_probe(struct platform_device *pdev)
{ {
struct resource *res; clps711x_halt = devm_platform_ioremap_resource(pdev, 0);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
clps711x_halt = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(clps711x_halt)) if (IS_ERR(clps711x_halt))
return PTR_ERR(clps711x_halt); return PTR_ERR(clps711x_halt);
......
...@@ -55,10 +55,7 @@ static struct cpuidle_driver kirkwood_idle_driver = { ...@@ -55,10 +55,7 @@ static struct cpuidle_driver kirkwood_idle_driver = {
/* Initialize CPU idle by registering the idle states */ /* Initialize CPU idle by registering the idle states */
static int kirkwood_cpuidle_probe(struct platform_device *pdev) static int kirkwood_cpuidle_probe(struct platform_device *pdev)
{ {
struct resource *res; ddr_operation_base = devm_platform_ioremap_resource(pdev, 0);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ddr_operation_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(ddr_operation_base)) if (IS_ERR(ddr_operation_base))
return PTR_ERR(ddr_operation_base); return PTR_ERR(ddr_operation_base);
......
...@@ -155,8 +155,6 @@ static void __cpuidle_driver_init(struct cpuidle_driver *drv) ...@@ -155,8 +155,6 @@ static void __cpuidle_driver_init(struct cpuidle_driver *drv)
{ {
int i; int i;
drv->refcnt = 0;
/* /*
* Use all possible CPUs as the default, because if the kernel boots * Use all possible CPUs as the default, because if the kernel boots
* with some CPUs offline and then we online one of them, the CPU * with some CPUs offline and then we online one of them, the CPU
...@@ -240,9 +238,6 @@ static int __cpuidle_register_driver(struct cpuidle_driver *drv) ...@@ -240,9 +238,6 @@ static int __cpuidle_register_driver(struct cpuidle_driver *drv)
*/ */
static void __cpuidle_unregister_driver(struct cpuidle_driver *drv) static void __cpuidle_unregister_driver(struct cpuidle_driver *drv)
{ {
if (WARN_ON(drv->refcnt > 0))
return;
if (drv->bctimer) { if (drv->bctimer) {
drv->bctimer = 0; drv->bctimer = 0;
on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer, on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer,
...@@ -349,47 +344,6 @@ struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev) ...@@ -349,47 +344,6 @@ struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev)
} }
EXPORT_SYMBOL_GPL(cpuidle_get_cpu_driver); EXPORT_SYMBOL_GPL(cpuidle_get_cpu_driver);
/**
* cpuidle_driver_ref - get a reference to the driver.
*
* Increment the reference counter of the cpuidle driver associated with
* the current CPU.
*
* Returns a pointer to the driver, or NULL if the current CPU has no driver.
*/
struct cpuidle_driver *cpuidle_driver_ref(void)
{
struct cpuidle_driver *drv;
spin_lock(&cpuidle_driver_lock);
drv = cpuidle_get_driver();
if (drv)
drv->refcnt++;
spin_unlock(&cpuidle_driver_lock);
return drv;
}
/**
* cpuidle_driver_unref - puts down the refcount for the driver
*
* Decrement the reference counter of the cpuidle driver associated with
* the current CPU.
*/
void cpuidle_driver_unref(void)
{
struct cpuidle_driver *drv;
spin_lock(&cpuidle_driver_lock);
drv = cpuidle_get_driver();
if (drv && !WARN_ON(drv->refcnt <= 0))
drv->refcnt--;
spin_unlock(&cpuidle_driver_lock);
}
/** /**
* cpuidle_driver_state_disabled - Disable or enable an idle state * cpuidle_driver_state_disabled - Disable or enable an idle state
* @drv: cpuidle driver owning the state * @drv: cpuidle driver owning the state
......
...@@ -115,7 +115,6 @@ DECLARE_PER_CPU(struct cpuidle_device, cpuidle_dev); ...@@ -115,7 +115,6 @@ DECLARE_PER_CPU(struct cpuidle_device, cpuidle_dev);
struct cpuidle_driver { struct cpuidle_driver {
const char *name; const char *name;
struct module *owner; struct module *owner;
int refcnt;
/* used by the cpuidle framework to setup the broadcast timer */ /* used by the cpuidle framework to setup the broadcast timer */
unsigned int bctimer:1; unsigned int bctimer:1;
...@@ -147,8 +146,6 @@ extern u64 cpuidle_poll_time(struct cpuidle_driver *drv, ...@@ -147,8 +146,6 @@ extern u64 cpuidle_poll_time(struct cpuidle_driver *drv,
extern int cpuidle_register_driver(struct cpuidle_driver *drv); extern int cpuidle_register_driver(struct cpuidle_driver *drv);
extern struct cpuidle_driver *cpuidle_get_driver(void); extern struct cpuidle_driver *cpuidle_get_driver(void);
extern struct cpuidle_driver *cpuidle_driver_ref(void);
extern void cpuidle_driver_unref(void);
extern void cpuidle_driver_state_disabled(struct cpuidle_driver *drv, int idx, extern void cpuidle_driver_state_disabled(struct cpuidle_driver *drv, int idx,
bool disable); bool disable);
extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
...@@ -186,8 +183,6 @@ static inline u64 cpuidle_poll_time(struct cpuidle_driver *drv, ...@@ -186,8 +183,6 @@ static inline u64 cpuidle_poll_time(struct cpuidle_driver *drv,
static inline int cpuidle_register_driver(struct cpuidle_driver *drv) static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
{return -ENODEV; } {return -ENODEV; }
static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; } static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; }
static inline void cpuidle_driver_unref(void) {}
static inline void cpuidle_driver_state_disabled(struct cpuidle_driver *drv, static inline void cpuidle_driver_state_disabled(struct cpuidle_driver *drv,
int idx, bool disable) { } int idx, bool disable) { }
static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
......
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