All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: linux-next: manual merge of the tip tree with the pm tree
Date: Fri, 9 May 2014 14:49:47 +1000	[thread overview]
Message-ID: <20140509144947.1dcd9098@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 4723 bytes --]

Hi all,

Today's linux-next merge of the tip tree got a conflict in
kernel/sched/idle.c between commit 52c324f8a87b ("cpuidle: Combine
cpuidle_enabled() with cpuidle_select()") from the pm tree and commit
37352273ad48 ("sched/idle: Reflow cpuidle_idle_call()") from the tip
tree.

I fixed it up (I hope - see below) and can carry the fix as necessary
(no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc kernel/sched/idle.c
index a8f12247ce7c,34083c9ac976..000000000000
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@@ -101,77 -98,74 +98,69 @@@ static void cpuidle_idle_call(void
  	rcu_idle_enter();
  
  	/*
 -	 * Check if the cpuidle framework is ready, otherwise fallback
 -	 * to the default arch specific idle method
 +	 * Ask the cpuidle framework to choose a convenient idle state.
 +	 * Fall back to the default arch specific idle method on errors.
  	 */
 -	if (cpuidle_enabled(drv, dev)) {
 +	next_state = cpuidle_select(drv, dev);
 +
- 	ret = next_state;
- 	if (ret >= 0) {
++	if (next_state < 0) {
+ use_default:
  		/*
- 		 * The idle task must be scheduled, it is pointless to
- 		 * go to idle, just update no idle residency and get
- 		 * out of this function
+ 		 * We can't use the cpuidle framework, let's use the default
+ 		 * idle routine.
  		 */
- 		if (current_clr_polling_and_test()) {
- 			dev->last_residency = 0;
- 			entered_state = next_state;
+ 		if (current_clr_polling_and_test())
  			local_irq_enable();
- 		} else {
- 			broadcast = !!(drv->states[next_state].flags &
- 				       CPUIDLE_FLAG_TIMER_STOP);
- 
- 			if (broadcast)
- 				/*
- 				 * Tell the time framework to switch
- 				 * to a broadcast timer because our
- 				 * local timer will be shutdown. If a
- 				 * local timer is used from another
- 				 * cpu as a broadcast timer, this call
- 				 * may fail if it is not available
- 				 */
- 				ret = clockevents_notify(
- 					CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
- 					&dev->cpu);
- 
- 			if (ret >= 0) {
- 				trace_cpu_idle_rcuidle(next_state, dev->cpu);
- 
- 				/*
- 				 * Enter the idle state previously
- 				 * returned by the governor
- 				 * decision. This function will block
- 				 * until an interrupt occurs and will
- 				 * take care of re-enabling the local
- 				 * interrupts
- 				 */
- 				entered_state = cpuidle_enter(drv, dev,
- 							      next_state);
- 
- 				trace_cpu_idle_rcuidle(PWR_EVENT_EXIT,
- 						       dev->cpu);
- 
- 				if (broadcast)
- 					clockevents_notify(
- 						CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
- 						&dev->cpu);
- 
- 				/*
- 				 * Give the governor an opportunity to reflect on the
- 				 * outcome
- 				 */
- 				cpuidle_reflect(dev, entered_state);
- 			}
- 		}
+ 		else
+ 			arch_cpu_idle();
+ 
+ 		goto exit_idle;
+ 	}
+ 
+ 	/*
 -	 * Ask the governor to choose an idle state it thinks
 -	 * it is convenient to go to. There is *always* a
 -	 * convenient idle state
 -	 */
 -	next_state = cpuidle_select(drv, dev);
 -
 -	/*
+ 	 * The idle task must be scheduled, it is pointless to
+ 	 * go to idle, just update no idle residency and get
+ 	 * out of this function
+ 	 */
+ 	if (current_clr_polling_and_test()) {
+ 		dev->last_residency = 0;
+ 		entered_state = next_state;
+ 		local_irq_enable();
+ 		goto exit_idle;
  	}
  
+ 	broadcast = !!(drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP);
+ 
  	/*
- 	 * We can't use the cpuidle framework, let's use the default
- 	 * idle routine
+ 	 * Tell the time framework to switch to a broadcast timer
+ 	 * because our local timer will be shutdown. If a local timer
+ 	 * is used from another cpu as a broadcast timer, this call may
+ 	 * fail if it is not available
  	 */
- 	if (ret < 0)
- 		arch_cpu_idle();
+ 	if (broadcast &&
 -	    clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu))
++	    clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu) < 0)
+ 		goto use_default;
  
+ 	trace_cpu_idle_rcuidle(next_state, dev->cpu);
+ 
+ 	/*
+ 	 * Enter the idle state previously returned by the governor decision.
+ 	 * This function will block until an interrupt occurs and will take
+ 	 * care of re-enabling the local interrupts
+ 	 */
+ 	entered_state = cpuidle_enter(drv, dev, next_state);
+ 
+ 	trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
+ 
+ 	if (broadcast)
+ 		clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
+ 
+ 	/*
+ 	 * Give the governor an opportunity to reflect on the outcome
+ 	 */
+ 	cpuidle_reflect(dev, entered_state);
+ 
+ exit_idle:
  	__current_set_polling();
  
  	/*

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2014-05-09  4:49 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09  4:49 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-02-17  5:07 linux-next: manual merge of the tip tree with the pm tree Stephen Rothwell
2021-02-17 10:15 ` Andy Shevchenko
2021-02-22  0:34 ` Stephen Rothwell
2018-10-08  2:44 Stephen Rothwell
2018-10-08 10:06 ` Rafael J. Wysocki
2018-10-08 10:34   ` Andy Shevchenko
2018-10-08  2:40 Stephen Rothwell
2018-10-08 10:05 ` Rafael J. Wysocki
2018-10-08 10:41   ` Andy Shevchenko
2018-03-23  2:20 Stephen Rothwell
2018-03-23  6:09 ` Ingo Molnar
2018-03-23 21:09   ` Rafael J. Wysocki
2018-03-24  8:15     ` Ingo Molnar
2017-11-06  2:10 Stephen Rothwell
2017-11-06 13:09 ` Rafael J. Wysocki
2017-08-11  4:06 Stephen Rothwell
2017-09-04  4:43 ` Stephen Rothwell
2016-11-22  5:48 Stephen Rothwell
2016-06-09  4:34 Stephen Rothwell
2016-04-19  2:59 Stephen Rothwell
2016-03-15  1:55 Stephen Rothwell
2016-03-11  1:57 Stephen Rothwell
2016-03-11 13:51 ` Rafael J. Wysocki
2016-02-29  4:42 Stephen Rothwell
2015-10-06  3:07 Stephen Rothwell
2015-03-31  7:58 Stephen Rothwell
2015-03-31 22:23 ` Rafael J. Wysocki
2015-03-31  7:10 Stephen Rothwell
2014-12-15  2:30 Stephen Rothwell
2014-11-25  5:46 Stephen Rothwell
2014-11-25 21:16 ` Rafael J. Wysocki
2014-08-04  6:55 Stephen Rothwell
2014-01-13  3:29 Stephen Rothwell
2014-01-07  4:20 Stephen Rothwell
2014-01-06  7:18 Stephen Rothwell
2013-08-19  4:09 Stephen Rothwell
2013-04-11  4:08 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140509144947.1dcd9098@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.