Commit 1e4230f5 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'pm-sleep', 'pm-cpuidle', 'pm-cpufreq', 'pm-devfreq' and 'pm-avs'

* pm-sleep:
  ACPI: PM: s2idle: Rework ACPI events synchronization
  ACPI: EC: Rework flushing of pending work

* pm-cpuidle:
  cpuidle: minor Kconfig help text fixes
  cpuidle: Drop disabled field from struct cpuidle_state
  cpuidle: Fix Kconfig indentation

* pm-cpufreq:
  cpufreq: Fix Kconfig indentation

* pm-devfreq:
  PM / devfreq: Add missing locking while setting suspend_freq

* pm-avs:
  power: avs: Fix Kconfig indentation
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static struct cpuidle_driver cpuidle_driver = {
			.enter = cpuidle_sleep_enter,
			.name = "C2",
			.desc = "SuperH Sleep Mode [SF]",
			.disabled = true,
			.flags = CPUIDLE_FLAG_UNUSABLE,
		},
		{
			.exit_latency = 2300,
@@ -76,7 +76,7 @@ static struct cpuidle_driver cpuidle_driver = {
			.enter = cpuidle_sleep_enter,
			.name = "C3",
			.desc = "SuperH Mobile Standby Mode [SF]",
			.disabled = true,
			.flags = CPUIDLE_FLAG_UNUSABLE,
		},
	},
	.safe_state_index = 0,
@@ -86,10 +86,10 @@ static struct cpuidle_driver cpuidle_driver = {
int __init sh_mobile_setup_cpuidle(void)
{
	if (sh_mobile_sleep_supported & SUSP_SH_SF)
		cpuidle_driver.states[1].disabled = false;
		cpuidle_driver.states[1].flags = CPUIDLE_FLAG_NONE;

	if (sh_mobile_sleep_supported & SUSP_SH_STANDBY)
		cpuidle_driver.states[2].disabled = false;
		cpuidle_driver.states[2].flags = CPUIDLE_FLAG_NONE;

	return cpuidle_register(&cpuidle_driver, NULL);
}
+13 −23
Original line number Diff line number Diff line
@@ -533,26 +533,10 @@ static void acpi_ec_enable_event(struct acpi_ec *ec)
}

#ifdef CONFIG_PM_SLEEP
static bool acpi_ec_query_flushed(struct acpi_ec *ec)
static void __acpi_ec_flush_work(void)
{
	bool flushed;
	unsigned long flags;

	spin_lock_irqsave(&ec->lock, flags);
	flushed = !ec->nr_pending_queries;
	spin_unlock_irqrestore(&ec->lock, flags);
	return flushed;
}

static void __acpi_ec_flush_event(struct acpi_ec *ec)
{
	/*
	 * When ec_freeze_events is true, we need to flush events in
	 * the proper position before entering the noirq stage.
	 */
	wait_event(ec->wait, acpi_ec_query_flushed(ec));
	if (ec_query_wq)
		flush_workqueue(ec_query_wq);
	flush_scheduled_work(); /* flush ec->work */
	flush_workqueue(ec_query_wq); /* flush queries */
}

static void acpi_ec_disable_event(struct acpi_ec *ec)
@@ -562,15 +546,21 @@ static void acpi_ec_disable_event(struct acpi_ec *ec)
	spin_lock_irqsave(&ec->lock, flags);
	__acpi_ec_disable_event(ec);
	spin_unlock_irqrestore(&ec->lock, flags);
	__acpi_ec_flush_event(ec);

	/*
	 * When ec_freeze_events is true, we need to flush events in
	 * the proper position before entering the noirq stage.
	 */
	__acpi_ec_flush_work();
}

void acpi_ec_flush_work(void)
{
	if (first_ec)
		__acpi_ec_flush_event(first_ec);
	/* Without ec_query_wq there is nothing to flush. */
	if (!ec_query_wq)
		return;

	flush_scheduled_work();
	__acpi_ec_flush_work();
}
#endif /* CONFIG_PM_SLEEP */

+19 −7
Original line number Diff line number Diff line
@@ -977,6 +977,16 @@ static int acpi_s2idle_prepare_late(void)
	return 0;
}

static void acpi_s2idle_sync(void)
{
	/*
	 * The EC driver uses the system workqueue and an additional special
	 * one, so those need to be flushed too.
	 */
	acpi_ec_flush_work();
	acpi_os_wait_events_complete(); /* synchronize Notify handling */
}

static void acpi_s2idle_wake(void)
{
	/*
@@ -1001,13 +1011,8 @@ static void acpi_s2idle_wake(void)
		 * should be missed by canceling the wakeup here.
		 */
		pm_system_cancel_wakeup();
		/*
		 * The EC driver uses the system workqueue and an additional
		 * special one, so those need to be flushed too.
		 */
		acpi_os_wait_events_complete(); /* synchronize EC GPE processing */
		acpi_ec_flush_work();
		acpi_os_wait_events_complete(); /* synchronize Notify handling */

		acpi_s2idle_sync();

		rearm_wake_irq(acpi_sci_irq);
	}
@@ -1024,6 +1029,13 @@ static void acpi_s2idle_restore_early(void)

static void acpi_s2idle_restore(void)
{
	/*
	 * Drain pending events before restoring the working-state configuration
	 * of GPEs.
	 */
	acpi_os_wait_events_complete(); /* synchronize GPE processing */
	acpi_s2idle_sync();

	s2idle_wakeup = false;

	acpi_enable_all_runtime_gpes();
+11 −11
Original line number Diff line number Diff line
@@ -65,21 +65,21 @@ config ARM_U8500_CPUIDLE
	bool "Cpu Idle Driver for the ST-E u8500 processors"
	depends on ARCH_U8500 && !ARM64
	help
	  Select this to enable cpuidle for ST-E u8500 processors
	  Select this to enable cpuidle for ST-E u8500 processors.

config ARM_AT91_CPUIDLE
	bool "Cpu Idle Driver for the AT91 processors"
	default y
	depends on ARCH_AT91 && !ARM64
	help
	  Select this to enable cpuidle for AT91 processors
	  Select this to enable cpuidle for AT91 processors.

config ARM_EXYNOS_CPUIDLE
	bool "Cpu Idle Driver for the Exynos processors"
	depends on ARCH_EXYNOS && !ARM64
	select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
	help
	  Select this to enable cpuidle for Exynos processors
	  Select this to enable cpuidle for Exynos processors.

config ARM_MVEBU_V7_CPUIDLE
	bool "CPU Idle Driver for mvebu v7 family processors"
+1 −1
Original line number Diff line number Diff line
@@ -572,7 +572,7 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)
		return -EINVAL;

	for (i = 0; i < drv->state_count; i++)
		if (drv->states[i].disabled)
		if (drv->states[i].flags & CPUIDLE_FLAG_UNUSABLE)
			dev->states_usage[i].disable |= CPUIDLE_STATE_DISABLED_BY_DRIVER;

	per_cpu(cpuidle_devices, dev->cpu) = dev;
Loading