Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e50bfac8 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Todd Kjos
Browse files

UPSTREAM: cpuidle: Clean up fallback handling in cpuidle_idle_call()



Move the fallback code path in cpuidle_idle_call() to the end of the
function to avoid jumping to a label in an if () branch.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm


br: linux-next
(cherry picked from commit dfcacc154fb38fdb2c243c3dbbdc1f26a64cedc8)

BUG=None
TEST=1) Change power state of system to "freeze"
     2) Use echo freeze > /sys/power/state
     3) Check whether system wakes up on any interrupt(set rtc timer)

Change-Id: I4b9af89afd369d302d27ad77672d1256f436b54d
Signed-off-by: default avatarJay Patel <jay.p.patel@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/282860


Reviewed-by: default avatarEric Caruso <ejcaruso@chromium.org>
Tested-by: default avatarPrathyushi Nangia <prathyushi.nangia@intel.com>
parent 4681963c
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -134,20 +134,8 @@ static void cpuidle_idle_call(void)
	 * Fall back to the default arch idle method on errors.
	 */
	next_state = cpuidle_select(drv, dev);
	if (next_state < 0) {
use_default:
		/*
		 * We can't use the cpuidle framework, let's use the default
		 * idle routine.
		 */
		if (current_clr_polling_and_test())
			local_irq_enable();
		else
			arch_cpu_idle();

		goto exit_idle;
	}

	if (next_state < 0)
		goto use_default;

	/*
	 * The idle task must be scheduled, it is pointless to
@@ -205,6 +193,19 @@ exit_idle:

	rcu_idle_exit();
	start_critical_timings();
	return;

use_default:
	/*
	 * We can't use the cpuidle framework, let's use the default
	 * idle routine.
	 */
	if (current_clr_polling_and_test())
		local_irq_enable();
	else
		arch_cpu_idle();

	goto exit_idle;
}

/*