All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.12 001/146] introduce for_each_thread() to replace the buggy while_each_thread()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
@ 2014-06-09  8:48 ` Jiri Slaby
  2014-06-09  8:48 ` [PATCH 3.12 002/146] oom_kill: change oom_kill.c to use for_each_thread() Jiri Slaby
                   ` (146 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:48 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Oleg Nesterov, Eric W. Biederman,
	Frederic Weisbecker, Mandeep Singh Baines, Ma, Xindong,
	Michal Hocko, Tu, Xiaobing, Andrew Morton, Linus Torvalds,
	Jiri Slaby

From: Oleg Nesterov <oleg@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 0c740d0afc3bff0a097ad03a1c8df92757516f5c upstream.

while_each_thread() and next_thread() should die, almost every lockless
usage is wrong.

1. Unless g == current, the lockless while_each_thread() is not safe.

   while_each_thread(g, t) can loop forever if g exits, next_thread()
   can't reach the unhashed thread in this case. Note that this can
   happen even if g is the group leader, it can exec.

2. Even if while_each_thread() itself was correct, people often use
   it wrongly.

   It was never safe to just take rcu_read_lock() and loop unless
   you verify that pid_alive(g) == T, even the first next_thread()
   can point to the already freed/reused memory.

This patch adds signal_struct->thread_head and task->thread_node to
create the normal rcu-safe list with the stable head.  The new
for_each_thread(g, t) helper is always safe under rcu_read_lock() as
long as this task_struct can't go away.

Note: of course it is ugly to have both task_struct->thread_node and the
old task_struct->thread_group, we will kill it later, after we change
the users of while_each_thread() to use for_each_thread().

Perhaps we can kill it even before we convert all users, we can
reimplement next_thread(t) using the new thread_head/thread_node.  But
we can't do this right now because this will lead to subtle behavioural
changes.  For example, do/while_each_thread() always sees at least one
task, while for_each_thread() can do nothing if the whole thread group
has died.  Or thread_group_empty(), currently its semantics is not clear
unless thread_group_leader(p) and we need to audit the callers before we
can change it.

So this patch adds the new interface which has to coexist with the old
one for some time, hopefully the next changes will be more or less
straightforward and the old one will go away soon.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Sergey Dyasly <dserrg@gmail.com>
Tested-by: Sergey Dyasly <dserrg@gmail.com>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mandeep Singh Baines <msb@chromium.org>
Cc: "Ma, Xindong" <xindong.ma@intel.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: "Tu, Xiaobing" <xiaobing.tu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/linux/init_task.h |  2 ++
 include/linux/sched.h     | 12 ++++++++++++
 kernel/exit.c             |  1 +
 kernel/fork.c             |  7 +++++++
 4 files changed, 22 insertions(+)

diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 5cd0f0949927..998f4dfedecf 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -40,6 +40,7 @@ extern struct fs_struct init_fs;
 
 #define INIT_SIGNALS(sig) {						\
 	.nr_threads	= 1,						\
+	.thread_head	= LIST_HEAD_INIT(init_task.thread_node),	\
 	.wait_chldexit	= __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
 	.shared_pending	= { 						\
 		.list = LIST_HEAD_INIT(sig.shared_pending.list),	\
@@ -213,6 +214,7 @@ extern struct task_group root_task_group;
 		[PIDTYPE_SID]  = INIT_PID_LINK(PIDTYPE_SID),		\
 	},								\
 	.thread_group	= LIST_HEAD_INIT(tsk.thread_group),		\
+	.thread_node	= LIST_HEAD_INIT(init_signals.thread_head),	\
 	INIT_IDS							\
 	INIT_PERF_EVENTS(tsk)						\
 	INIT_TRACE_IRQFLAGS						\
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8594b065d3a8..0827bec7d82f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -470,6 +470,7 @@ struct signal_struct {
 	atomic_t		sigcnt;
 	atomic_t		live;
 	int			nr_threads;
+	struct list_head	thread_head;
 
 	wait_queue_head_t	wait_chldexit;	/* for wait4() */
 
@@ -1148,6 +1149,7 @@ struct task_struct {
 	/* PID/PID hash table linkage. */
 	struct pid_link pids[PIDTYPE_MAX];
 	struct list_head thread_group;
+	struct list_head thread_node;
 
 	struct completion *vfork_done;		/* for vfork() */
 	int __user *set_child_tid;		/* CLONE_CHILD_SETTID */
@@ -2181,6 +2183,16 @@ extern bool current_is_single_threaded(void);
 #define while_each_thread(g, t) \
 	while ((t = next_thread(t)) != g)
 
+#define __for_each_thread(signal, t)	\
+	list_for_each_entry_rcu(t, &(signal)->thread_head, thread_node)
+
+#define for_each_thread(p, t)		\
+	__for_each_thread((p)->signal, t)
+
+/* Careful: this is a double loop, 'break' won't work as expected. */
+#define for_each_process_thread(p, t)	\
+	for_each_process(p) for_each_thread(p, t)
+
 static inline int get_nr_threads(struct task_struct *tsk)
 {
 	return tsk->signal->nr_threads;
diff --git a/kernel/exit.c b/kernel/exit.c
index dcde2c4b61d0..81b3d6789ee8 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -74,6 +74,7 @@ static void __unhash_process(struct task_struct *p, bool group_dead)
 		__this_cpu_dec(process_counts);
 	}
 	list_del_rcu(&p->thread_group);
+	list_del_rcu(&p->thread_node);
 }
 
 /*
diff --git a/kernel/fork.c b/kernel/fork.c
index 458953ca4d50..11a23afc6ee5 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1038,6 +1038,11 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
 	sig->nr_threads = 1;
 	atomic_set(&sig->live, 1);
 	atomic_set(&sig->sigcnt, 1);
+
+	/* list_add(thread_node, thread_head) without INIT_LIST_HEAD() */
+	sig->thread_head = (struct list_head)LIST_HEAD_INIT(tsk->thread_node);
+	tsk->thread_node = (struct list_head)LIST_HEAD_INIT(sig->thread_head);
+
 	init_waitqueue_head(&sig->wait_chldexit);
 	sig->curr_target = tsk;
 	init_sigpending(&sig->shared_pending);
@@ -1476,6 +1481,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
 			atomic_inc(&current->signal->sigcnt);
 			list_add_tail_rcu(&p->thread_group,
 					  &p->group_leader->thread_group);
+			list_add_tail_rcu(&p->thread_node,
+					  &p->signal->thread_head);
 		}
 		attach_pid(p, PIDTYPE_PID);
 		nr_threads++;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 002/146] oom_kill: change oom_kill.c to use for_each_thread()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
  2014-06-09  8:48 ` [PATCH 3.12 001/146] introduce for_each_thread() to replace the buggy while_each_thread() Jiri Slaby
@ 2014-06-09  8:48 ` Jiri Slaby
  2014-06-09  8:48 ` [PATCH 3.12 003/146] oom_kill: has_intersects_mems_allowed() needs rcu_read_lock() Jiri Slaby
                   ` (145 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:48 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Oleg Nesterov, Eric W. Biederman,
	Frederic Weisbecker, Mandeep Singh Baines, Ma, Xindong, Tu,
	Xiaobing, Andrew Morton, Linus Torvalds, Jiri Slaby

From: Oleg Nesterov <oleg@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 1da4db0cd5c8a31d4468ec906b413e75e604b465 upstream.

Change oom_kill.c to use for_each_thread() rather than the racy
while_each_thread() which can loop forever if we race with exit.

Note also that most users were buggy even if while_each_thread() was
fine, the task can exit even _before_ rcu_read_lock().

Fortunately the new for_each_thread() only requires the stable
task_struct, so this change fixes both problems.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Sergey Dyasly <dserrg@gmail.com>
Tested-by: Sergey Dyasly <dserrg@gmail.com>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mandeep Singh Baines <msb@chromium.org>
Cc: "Ma, Xindong" <xindong.ma@intel.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: "Tu, Xiaobing" <xiaobing.tu@intel.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/oom_kill.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index e73f01c56d10..cae791c15c51 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -59,7 +59,7 @@ static bool has_intersects_mems_allowed(struct task_struct *tsk,
 {
 	struct task_struct *start = tsk;
 
-	do {
+	for_each_thread(start, tsk) {
 		if (mask) {
 			/*
 			 * If this is a mempolicy constrained oom, tsk's
@@ -77,7 +77,7 @@ static bool has_intersects_mems_allowed(struct task_struct *tsk,
 			if (cpuset_mems_allowed_intersects(current, tsk))
 				return true;
 		}
-	} while_each_thread(start, tsk);
+	}
 
 	return false;
 }
@@ -97,14 +97,14 @@ static bool has_intersects_mems_allowed(struct task_struct *tsk,
  */
 struct task_struct *find_lock_task_mm(struct task_struct *p)
 {
-	struct task_struct *t = p;
+	struct task_struct *t;
 
-	do {
+	for_each_thread(p, t) {
 		task_lock(t);
 		if (likely(t->mm))
 			return t;
 		task_unlock(t);
-	} while_each_thread(p, t);
+	}
 
 	return NULL;
 }
@@ -301,7 +301,7 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
 	unsigned long chosen_points = 0;
 
 	rcu_read_lock();
-	do_each_thread(g, p) {
+	for_each_process_thread(g, p) {
 		unsigned int points;
 
 		switch (oom_scan_process_thread(p, totalpages, nodemask,
@@ -323,7 +323,7 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
 			chosen = p;
 			chosen_points = points;
 		}
-	} while_each_thread(g, p);
+	}
 	if (chosen)
 		get_task_struct(chosen);
 	rcu_read_unlock();
@@ -406,7 +406,7 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
 {
 	struct task_struct *victim = p;
 	struct task_struct *child;
-	struct task_struct *t = p;
+	struct task_struct *t;
 	struct mm_struct *mm;
 	unsigned int victim_points = 0;
 	static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL,
@@ -437,7 +437,7 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
 	 * still freeing memory.
 	 */
 	read_lock(&tasklist_lock);
-	do {
+	for_each_thread(p, t) {
 		list_for_each_entry(child, &t->children, sibling) {
 			unsigned int child_points;
 
@@ -455,7 +455,7 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
 				get_task_struct(victim);
 			}
 		}
-	} while_each_thread(p, t);
+	}
 	read_unlock(&tasklist_lock);
 
 	rcu_read_lock();
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 003/146] oom_kill: has_intersects_mems_allowed() needs rcu_read_lock()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
  2014-06-09  8:48 ` [PATCH 3.12 001/146] introduce for_each_thread() to replace the buggy while_each_thread() Jiri Slaby
  2014-06-09  8:48 ` [PATCH 3.12 002/146] oom_kill: change oom_kill.c to use for_each_thread() Jiri Slaby
@ 2014-06-09  8:48 ` Jiri Slaby
  2014-06-09  8:48 ` [PATCH 3.12 004/146] oom_kill: add rcu_read_lock() into find_lock_task_mm() Jiri Slaby
                   ` (144 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:48 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Oleg Nesterov, Eric W. Biederman,
	Frederic Weisbecker, Mandeep Singh Baines, Ma, Xindong, Tu,
	Xiaobing, Andrew Morton, Linus Torvalds, Jiri Slaby

From: Oleg Nesterov <oleg@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit ad96244179fbd55b40c00f10f399bc04739b8e1f upstream.

At least out_of_memory() calls has_intersects_mems_allowed() without
even rcu_read_lock(), this is obviously buggy.

Add the necessary rcu_read_lock().  This means that we can not simply
return from the loop, we need "bool ret" and "break".

While at it, swap the names of task_struct's (the argument and the
local).  This cleans up the code a little bit and avoids the unnecessary
initialization.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Sergey Dyasly <dserrg@gmail.com>
Tested-by: Sergey Dyasly <dserrg@gmail.com>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mandeep Singh Baines <msb@chromium.org>
Cc: "Ma, Xindong" <xindong.ma@intel.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: "Tu, Xiaobing" <xiaobing.tu@intel.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/oom_kill.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index cae791c15c51..7cdd05e685dc 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -47,18 +47,20 @@ static DEFINE_SPINLOCK(zone_scan_lock);
 #ifdef CONFIG_NUMA
 /**
  * has_intersects_mems_allowed() - check task eligiblity for kill
- * @tsk: task struct of which task to consider
+ * @start: task struct of which task to consider
  * @mask: nodemask passed to page allocator for mempolicy ooms
  *
  * Task eligibility is determined by whether or not a candidate task, @tsk,
  * shares the same mempolicy nodes as current if it is bound by such a policy
  * and whether or not it has the same set of allowed cpuset nodes.
  */
-static bool has_intersects_mems_allowed(struct task_struct *tsk,
+static bool has_intersects_mems_allowed(struct task_struct *start,
 					const nodemask_t *mask)
 {
-	struct task_struct *start = tsk;
+	struct task_struct *tsk;
+	bool ret = false;
 
+	rcu_read_lock();
 	for_each_thread(start, tsk) {
 		if (mask) {
 			/*
@@ -67,19 +69,20 @@ static bool has_intersects_mems_allowed(struct task_struct *tsk,
 			 * mempolicy intersects current, otherwise it may be
 			 * needlessly killed.
 			 */
-			if (mempolicy_nodemask_intersects(tsk, mask))
-				return true;
+			ret = mempolicy_nodemask_intersects(tsk, mask);
 		} else {
 			/*
 			 * This is not a mempolicy constrained oom, so only
 			 * check the mems of tsk's cpuset.
 			 */
-			if (cpuset_mems_allowed_intersects(current, tsk))
-				return true;
+			ret = cpuset_mems_allowed_intersects(current, tsk);
 		}
+		if (ret)
+			break;
 	}
+	rcu_read_unlock();
 
-	return false;
+	return ret;
 }
 #else
 static bool has_intersects_mems_allowed(struct task_struct *tsk,
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 004/146] oom_kill: add rcu_read_lock() into find_lock_task_mm()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (2 preceding siblings ...)
  2014-06-09  8:48 ` [PATCH 3.12 003/146] oom_kill: has_intersects_mems_allowed() needs rcu_read_lock() Jiri Slaby
@ 2014-06-09  8:48 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 005/146] mm, oom: prefer thread group leaders for display purposes Jiri Slaby
                   ` (143 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:48 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Oleg Nesterov, Sergey Dyasly, Sameer Nanda,
	Eric W. Biederman, Frederic Weisbecker, Mandeep Singh Baines, Ma,
	Xindong, Tu, Xiaobing, Andrew Morton, Linus Torvalds, Jiri Slaby

From: Oleg Nesterov <oleg@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 4d4048be8a93769350efa31d2482a038b7de73d0 upstream.

find_lock_task_mm() expects it is called under rcu or tasklist lock, but
it seems that at least oom_unkillable_task()->task_in_mem_cgroup() and
mem_cgroup_out_of_memory()->oom_badness() can call it lockless.

Perhaps we could fix the callers, but this patch simply adds rcu lock
into find_lock_task_mm().  This also allows to simplify a bit one of its
callers, oom_kill_process().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Sergey Dyasly <dserrg@gmail.com>
Cc: Sameer Nanda <snanda@chromium.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mandeep Singh Baines <msb@chromium.org>
Cc: "Ma, Xindong" <xindong.ma@intel.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: "Tu, Xiaobing" <xiaobing.tu@intel.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/oom_kill.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 7cdd05e685dc..f5bed7f17463 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -102,14 +102,19 @@ struct task_struct *find_lock_task_mm(struct task_struct *p)
 {
 	struct task_struct *t;
 
+	rcu_read_lock();
+
 	for_each_thread(p, t) {
 		task_lock(t);
 		if (likely(t->mm))
-			return t;
+			goto found;
 		task_unlock(t);
 	}
+	t = NULL;
+found:
+	rcu_read_unlock();
 
-	return NULL;
+	return t;
 }
 
 /* return true if the task is not adequate as candidate victim task. */
@@ -461,10 +466,8 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
 	}
 	read_unlock(&tasklist_lock);
 
-	rcu_read_lock();
 	p = find_lock_task_mm(victim);
 	if (!p) {
-		rcu_read_unlock();
 		put_task_struct(victim);
 		return;
 	} else if (victim != p) {
@@ -490,6 +493,7 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
 	 * That thread will now get access to memory reserves since it has a
 	 * pending fatal signal.
 	 */
+	rcu_read_lock();
 	for_each_process(p)
 		if (p->mm == mm && !same_thread_group(p, victim) &&
 		    !(p->flags & PF_KTHREAD)) {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 005/146] mm, oom: prefer thread group leaders for display purposes
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (3 preceding siblings ...)
  2014-06-09  8:48 ` [PATCH 3.12 004/146] oom_kill: add rcu_read_lock() into find_lock_task_mm() Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 006/146] mac80211: fix on-channel remain-on-channel Jiri Slaby
                   ` (142 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, David Rientjes, Johannes Weiner, Michal Hocko,
	KAMEZAWA Hiroyuki, Greg Thelen, Andrew Morton, Linus Torvalds,
	Jiri Slaby

From: David Rientjes <rientjes@google.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit d49ad9355420c743c736bfd1dee9eaa5b1a7722a upstream.

When two threads have the same badness score, it's preferable to kill
the thread group leader so that the actual process name is printed to
the kernel log rather than the thread group name which may be shared
amongst several processes.

This was the behavior when select_bad_process() used to do
for_each_process(), but it now iterates threads instead and leads to
ambiguity.

Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Greg Thelen <gthelen@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/memcontrol.c | 19 ++++++++++++-------
 mm/oom_kill.c   | 12 ++++++++----
 2 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 15429b92ff98..213d1b4aafd7 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1820,13 +1820,18 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
 				break;
 			};
 			points = oom_badness(task, memcg, NULL, totalpages);
-			if (points > chosen_points) {
-				if (chosen)
-					put_task_struct(chosen);
-				chosen = task;
-				chosen_points = points;
-				get_task_struct(chosen);
-			}
+			if (!points || points < chosen_points)
+				continue;
+			/* Prefer thread group leaders for display purposes */
+			if (points == chosen_points &&
+			    thread_group_leader(chosen))
+				continue;
+
+			if (chosen)
+				put_task_struct(chosen);
+			chosen = task;
+			chosen_points = points;
+			get_task_struct(chosen);
 		}
 		css_task_iter_end(&it);
 	}
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index f5bed7f17463..a9b5b7ffc476 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -327,10 +327,14 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
 			break;
 		};
 		points = oom_badness(p, NULL, nodemask, totalpages);
-		if (points > chosen_points) {
-			chosen = p;
-			chosen_points = points;
-		}
+		if (!points || points < chosen_points)
+			continue;
+		/* Prefer thread group leaders for display purposes */
+		if (points == chosen_points && thread_group_leader(chosen))
+			continue;
+
+		chosen = p;
+		chosen_points = points;
 	}
 	if (chosen)
 		get_task_struct(chosen);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 006/146] mac80211: fix on-channel remain-on-channel
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (4 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 005/146] mm, oom: prefer thread group leaders for display purposes Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 007/146] netfilter: Fix potential use after free in ip6_route_me_harder() Jiri Slaby
                   ` (141 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Johannes Berg, Jiri Slaby

From: Johannes Berg <johannes.berg@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit b4b177a5556a686909e643f1e9b6434c10de079f upstream.

Jouni reported that if a remain-on-channel was active on the
same channel as the current operating channel, then the ROC
would start, but any frames transmitted using mgmt-tx on the
same channel would get delayed until after the ROC.

The reason for this is that the ROC starts, but doesn't have
any handling for "remain on the same channel", so it stops
the interface queues. The later mgmt-tx then puts the frame
on the interface queues (since it's on the current operating
channel) and thus they get delayed until after the ROC.

To fix this, add some logic to handle remaining on the same
channel specially and not stop the queues etc. in this case.
This not only fixes the bug but also improves behaviour in
this case as data frames etc. can continue to flow.

Cc: stable@vger.kernel.org
Reported-by: Jouni Malinen <j@w1.fi>
Tested-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/mac80211/ieee80211_i.h |  1 +
 net/mac80211/offchannel.c  | 27 ++++++++++++++++++++-------
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ab0fbb458c11..23c13165ce83 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -311,6 +311,7 @@ struct ieee80211_roc_work {
 
 	bool started, abort, hw_begun, notified;
 	bool to_be_freed;
+	bool on_channel;
 
 	unsigned long hw_start_time;
 
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 6fb38558a5e6..7a17decd27f9 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -333,7 +333,7 @@ void ieee80211_sw_roc_work(struct work_struct *work)
 		container_of(work, struct ieee80211_roc_work, work.work);
 	struct ieee80211_sub_if_data *sdata = roc->sdata;
 	struct ieee80211_local *local = sdata->local;
-	bool started;
+	bool started, on_channel;
 
 	mutex_lock(&local->mtx);
 
@@ -354,14 +354,26 @@ void ieee80211_sw_roc_work(struct work_struct *work)
 	if (!roc->started) {
 		struct ieee80211_roc_work *dep;
 
-		/* start this ROC */
-		ieee80211_offchannel_stop_vifs(local);
+		WARN_ON(local->use_chanctx);
+
+		/* If actually operating on the desired channel (with at least
+		 * 20 MHz channel width) don't stop all the operations but still
+		 * treat it as though the ROC operation started properly, so
+		 * other ROC operations won't interfere with this one.
+		 */
+		roc->on_channel = roc->chan == local->_oper_chandef.chan &&
+				  local->_oper_chandef.width != NL80211_CHAN_WIDTH_5 &&
+				  local->_oper_chandef.width != NL80211_CHAN_WIDTH_10;
 
-		/* switch channel etc */
+		/* start this ROC */
 		ieee80211_recalc_idle(local);
 
-		local->tmp_channel = roc->chan;
-		ieee80211_hw_config(local, 0);
+		if (!roc->on_channel) {
+			ieee80211_offchannel_stop_vifs(local);
+
+			local->tmp_channel = roc->chan;
+			ieee80211_hw_config(local, 0);
+		}
 
 		/* tell userspace or send frame */
 		ieee80211_handle_roc_started(roc);
@@ -380,9 +392,10 @@ void ieee80211_sw_roc_work(struct work_struct *work)
  finish:
 		list_del(&roc->list);
 		started = roc->started;
+		on_channel = roc->on_channel;
 		ieee80211_roc_notify_destroy(roc, !roc->abort);
 
-		if (started) {
+		if (started && !on_channel) {
 			ieee80211_flush_queues(local, NULL);
 
 			local->tmp_channel = NULL;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 007/146] netfilter: Fix potential use after free in ip6_route_me_harder()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (5 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 006/146] mac80211: fix on-channel remain-on-channel Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49   ` Jiri Slaby
                   ` (140 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Sergey Popovich, Pablo Neira Ayuso, Jiri Slaby

From: Sergey Popovich <popovich_sergei@mail.ru>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit a8951d5814e1373807a94f79f7ccec7041325470 upstream.

Dst is released one line before we access it again with dst->error.

Fixes: 58e35d147128 netfilter: ipv6: propagate routing errors from
ip6_route_me_harder()

Signed-off-by: Sergey Popovich <popovich_sergei@mail.ru>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/ipv6/netfilter.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c
index 95f3f1da0d7f..d38e6a8d8b9f 100644
--- a/net/ipv6/netfilter.c
+++ b/net/ipv6/netfilter.c
@@ -30,13 +30,15 @@ int ip6_route_me_harder(struct sk_buff *skb)
 		.daddr = iph->daddr,
 		.saddr = iph->saddr,
 	};
+	int err;
 
 	dst = ip6_route_output(net, skb->sk, &fl6);
-	if (dst->error) {
+	err = dst->error;
+	if (err) {
 		IP6_INC_STATS(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES);
 		LIMIT_NETDEBUG(KERN_DEBUG "ip6_route_me_harder: No more route.\n");
 		dst_release(dst);
-		return dst->error;
+		return err;
 	}
 
 	/* Drop old route. */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 008/146] usb: qcserial: add a number of Dell devices
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
@ 2014-06-09  8:49   ` Jiri Slaby
  2014-06-09  8:48 ` [PATCH 3.12 002/146] oom_kill: change oom_kill.c to use for_each_thread() Jiri Slaby
                     ` (146 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Bjørn Mork, Greg Kroah-Hartman, Jiri Slaby

From: Bjørn Mork <bjorn@mork.no>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 4d7c0136a54f62501f8a34c4d08a5e0258d3d3ca upstream.

Dan writes:

"The Dell drivers use the same configuration for PIDs:

81A2: Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card
81A3: Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card
81A4: Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card
81A8: Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card
81A9: Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card

These devices are all clearly Sierra devices, but are also definitely
Gobi-based.  The A8 might be the MC7700/7710 and A9 is likely a MC7750.

>From DellGobi5kSetup.exe from the Dell drivers:

usbif0: serial/firmware loader?
usbif2: nmea
usbif3: modem/ppp
usbif8: net/QMI"

Cc: <stable@vger.kernel.org>
Reported-by: AceLan Kao <acelan.kao@canonical.com>
Reported-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/serial/qcserial.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index 7ed681a714a5..6c0a542e8ec1 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -151,6 +151,21 @@ static const struct usb_device_id id_table[] = {
 	{USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 0)},	/* Netgear AirCard 340U Device Management */
 	{USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 2)},	/* Netgear AirCard 340U NMEA */
 	{USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 3)},	/* Netgear AirCard 340U Modem */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a2, 0)},	/* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card Device Management */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a2, 2)},	/* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card NMEA */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a2, 3)},	/* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card Modem */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a3, 0)},	/* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card Device Management */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a3, 2)},	/* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card NMEA */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a3, 3)},	/* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card Modem */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a4, 0)},	/* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card Device Management */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a4, 2)},	/* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card NMEA */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a4, 3)},	/* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card Modem */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a8, 0)},	/* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card Device Management */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a8, 2)},	/* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card NMEA */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a8, 3)},	/* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card Modem */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a9, 0)},	/* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card Device Management */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a9, 2)},	/* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card NMEA */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a9, 3)},	/* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card Modem */
 
 	{ }				/* Terminating entry */
 };
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 008/146] usb: qcserial: add a number of Dell devices
@ 2014-06-09  8:49   ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Bjørn Mork, Greg Kroah-Hartman, Jiri Slaby

From: Bjørn Mork <bjorn@mork.no>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 4d7c0136a54f62501f8a34c4d08a5e0258d3d3ca upstream.

Dan writes:

"The Dell drivers use the same configuration for PIDs:

81A2: Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card
81A3: Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card
81A4: Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card
81A8: Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card
81A9: Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card

These devices are all clearly Sierra devices, but are also definitely
Gobi-based.  The A8 might be the MC7700/7710 and A9 is likely a MC7750.

>>From DellGobi5kSetup.exe from the Dell drivers:

usbif0: serial/firmware loader?
usbif2: nmea
usbif3: modem/ppp
usbif8: net/QMI"

Cc: <stable@vger.kernel.org>
Reported-by: AceLan Kao <acelan.kao@canonical.com>
Reported-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/serial/qcserial.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index 7ed681a714a5..6c0a542e8ec1 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -151,6 +151,21 @@ static const struct usb_device_id id_table[] = {
 	{USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 0)},	/* Netgear AirCard 340U Device Management */
 	{USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 2)},	/* Netgear AirCard 340U NMEA */
 	{USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 3)},	/* Netgear AirCard 340U Modem */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a2, 0)},	/* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card Device Management */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a2, 2)},	/* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card NMEA */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a2, 3)},	/* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card Modem */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a3, 0)},	/* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card Device Management */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a3, 2)},	/* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card NMEA */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a3, 3)},	/* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card Modem */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a4, 0)},	/* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card Device Management */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a4, 2)},	/* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card NMEA */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a4, 3)},	/* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card Modem */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a8, 0)},	/* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card Device Management */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a8, 2)},	/* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card NMEA */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a8, 3)},	/* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card Modem */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a9, 0)},	/* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card Device Management */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a9, 2)},	/* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card NMEA */
+	{USB_DEVICE_INTERFACE_NUMBER(0x413c, 0x81a9, 3)},	/* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card Modem */
 
 	{ }				/* Terminating entry */
 };
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 009/146] clk: tegra: use pll_ref as the pll_e parent
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (7 preceding siblings ...)
  2014-06-09  8:49   ` Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 010/146] ACPI / video: Fix initial level validity test Jiri Slaby
                   ` (138 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Peter De Schrijver, Jiri Slaby

From: Peter De Schrijver <pdeschrijver@nvidia.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 8e9cc80aa348938078c3c1a7ab55efb3c40990e3 upstream.

Use pll_ref instead of pll_re_vco as the pll_e parent on Tegra114. Also
add a 12Mhz pll_ref table entry for pll_e for Tegra114. This prevents
the system from crashing at bootup because of an unsupported pll_re_vco
rate.

Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/clk/tegra/clk-pll.c      | 8 +++++---
 drivers/clk/tegra/clk-tegra114.c | 3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
index 197074a57754..e09f09ce44f8 100644
--- a/drivers/clk/tegra/clk-pll.c
+++ b/drivers/clk/tegra/clk-pll.c
@@ -1587,11 +1587,13 @@ struct clk *tegra_clk_register_plle_tegra114(const char *name,
 	val_aux = pll_readl(pll_params->aux_reg, pll);
 
 	if (val & PLL_BASE_ENABLE) {
-		if (!(val_aux & PLLE_AUX_PLLRE_SEL))
+		if ((val_aux & PLLE_AUX_PLLRE_SEL) ||
+			(val_aux & PLLE_AUX_PLLP_SEL))
 			WARN(1, "pll_e enabled with unsupported parent %s\n",
-			  (val & PLLE_AUX_PLLP_SEL) ? "pllp_out0" : "pll_ref");
+			  (val_aux & PLLE_AUX_PLLP_SEL) ? "pllp_out0" :
+					"pll_re_vco");
 	} else {
-		val_aux |= PLLE_AUX_PLLRE_SEL;
+		val_aux &= ~(PLLE_AUX_PLLRE_SEL | PLLE_AUX_PLLP_SEL);
 		pll_writel(val, pll_params->aux_reg, pll);
 	}
 
diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
index 9467da7dee49..406929d4ce2f 100644
--- a/drivers/clk/tegra/clk-tegra114.c
+++ b/drivers/clk/tegra/clk-tegra114.c
@@ -673,6 +673,7 @@ static struct tegra_clk_pll_freq_table pll_e_freq_table[] = {
 	/* PLLE special case: use cpcon field to store cml divider value */
 	{336000000, 100000000, 100, 21, 16, 11},
 	{312000000, 100000000, 200, 26, 24, 13},
+	{12000000, 100000000, 200,  1,  24, 13},
 	{0, 0, 0, 0, 0, 0},
 };
 
@@ -1501,7 +1502,7 @@ static void __init tegra114_pll_init(void __iomem *clk_base,
 	clks[pll_re_out] = clk;
 
 	/* PLLE */
-	clk = tegra_clk_register_plle_tegra114("pll_e_out0", "pll_re_vco",
+	clk = tegra_clk_register_plle_tegra114("pll_e_out0", "pll_ref",
 				      clk_base, 0, 100000000, &pll_e_params,
 				      pll_e_freq_table, NULL);
 	clk_register_clkdev(clk, "pll_e_out0", NULL);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 010/146] ACPI / video: Fix initial level validity test
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (8 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 009/146] clk: tegra: use pll_ref as the pll_e parent Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 011/146] futex: Add another early deadlock detection check Jiri Slaby
                   ` (137 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Aaron Lu, Rafael J. Wysocki, Jiri Slaby

From: Aaron Lu <aaron.lu@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 9efa5e50598c5568b0678bb411b239a0b6e9a328 upstream.

When testing if the firmware's initial value is valid, we should use
the corrected level value instead of the raw value returned from
firmware.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/acpi/video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 5708e44376fe..d2e069044a0f 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -836,7 +836,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)
 		 * or an index). Set the backlight to max_level in this case.
 		 */
 		for (i = 2; i < br->count; i++)
-			if (level_old == br->levels[i])
+			if (level == br->levels[i])
 				break;
 		if (i == br->count || !level)
 			level = max_level;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 011/146] futex: Add another early deadlock detection check
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (9 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 010/146] ACPI / video: Fix initial level validity test Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 012/146] futex: Prevent attaching to kernel threads Jiri Slaby
                   ` (136 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Thomas Gleixner, Dave Jones, Linus Torvalds,
	Peter Zijlstra, Darren Hart, Davidlohr Bueso, Steven Rostedt,
	Clark Williams, Paul McKenney, Lai Jiangshan, Roland McGrath,
	Carlos ODonell, Jakub Jelinek, Michael Kerrisk,
	Sebastian Andrzej Siewior, Jiri Slaby

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 866293ee54227584ffcb4a42f69c1f365974ba7f upstream.

Dave Jones trinity syscall fuzzer exposed an issue in the deadlock
detection code of rtmutex:
  http://lkml.kernel.org/r/20140429151655.GA14277@redhat.com

That underlying issue has been fixed with a patch to the rtmutex code,
but the futex code must not call into rtmutex in that case because
    - it can detect that issue early
    - it avoids a different and more complex fixup for backing out

If the user space variable got manipulated to 0x80000000 which means
no lock holder, but the waiters bit set and an active pi_state in the
kernel is found we can figure out the recursive locking issue by
looking at the pi_state owner. If that is the current task, then we
can safely return -EDEADLK.

The check should have been added in commit 59fa62451 (futex: Handle
futex_pi OWNER_DIED take over correctly) already, but I did not see
the above issue caused by user space manipulation back then.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Jones <davej@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Darren Hart <darren@dvhart.com>
Cc: Davidlohr Bueso <davidlohr@hp.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Clark Williams <williams@redhat.com>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Carlos ODonell <carlos@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: http://lkml.kernel.org/r/20140512201701.097349971@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/futex.c | 47 ++++++++++++++++++++++++++++++++++-------------
 1 file changed, 34 insertions(+), 13 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index d8347b7a064f..470729dfe192 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -596,7 +596,8 @@ void exit_pi_state_list(struct task_struct *curr)
 
 static int
 lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
-		union futex_key *key, struct futex_pi_state **ps)
+		union futex_key *key, struct futex_pi_state **ps,
+		struct task_struct *task)
 {
 	struct futex_pi_state *pi_state = NULL;
 	struct futex_q *this, *next;
@@ -640,6 +641,16 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
 					return -EINVAL;
 			}
 
+			/*
+			 * Protect against a corrupted uval. If uval
+			 * is 0x80000000 then pid is 0 and the waiter
+			 * bit is set. So the deadlock check in the
+			 * calling code has failed and we did not fall
+			 * into the check above due to !pid.
+			 */
+			if (task && pi_state->owner == task)
+				return -EDEADLK;
+
 			atomic_inc(&pi_state->refcount);
 			*ps = pi_state;
 
@@ -789,7 +800,7 @@ retry:
 	 * We dont have the lock. Look up the PI state (or create it if
 	 * we are the first waiter):
 	 */
-	ret = lookup_pi_state(uval, hb, key, ps);
+	ret = lookup_pi_state(uval, hb, key, ps, task);
 
 	if (unlikely(ret)) {
 		switch (ret) {
@@ -1199,7 +1210,7 @@ void requeue_pi_wake_futex(struct futex_q *q, union futex_key *key,
  *
  * Return:
  *  0 - failed to acquire the lock atomically;
- *  1 - acquired the lock;
+ * >0 - acquired the lock, return value is vpid of the top_waiter
  * <0 - error
  */
 static int futex_proxy_trylock_atomic(u32 __user *pifutex,
@@ -1210,7 +1221,7 @@ static int futex_proxy_trylock_atomic(u32 __user *pifutex,
 {
 	struct futex_q *top_waiter = NULL;
 	u32 curval;
-	int ret;
+	int ret, vpid;
 
 	if (get_futex_value_locked(&curval, pifutex))
 		return -EFAULT;
@@ -1238,11 +1249,13 @@ static int futex_proxy_trylock_atomic(u32 __user *pifutex,
 	 * the contended case or if set_waiters is 1.  The pi_state is returned
 	 * in ps in contended cases.
 	 */
+	vpid = task_pid_vnr(top_waiter->task);
 	ret = futex_lock_pi_atomic(pifutex, hb2, key2, ps, top_waiter->task,
 				   set_waiters);
-	if (ret == 1)
+	if (ret == 1) {
 		requeue_pi_wake_futex(top_waiter, key2, hb2);
-
+		return vpid;
+	}
 	return ret;
 }
 
@@ -1274,7 +1287,6 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags,
 	struct futex_hash_bucket *hb1, *hb2;
 	struct plist_head *head1;
 	struct futex_q *this, *next;
-	u32 curval2;
 
 	if (requeue_pi) {
 		/*
@@ -1360,16 +1372,25 @@ retry_private:
 		 * At this point the top_waiter has either taken uaddr2 or is
 		 * waiting on it.  If the former, then the pi_state will not
 		 * exist yet, look it up one more time to ensure we have a
-		 * reference to it.
+		 * reference to it. If the lock was taken, ret contains the
+		 * vpid of the top waiter task.
 		 */
-		if (ret == 1) {
+		if (ret > 0) {
 			WARN_ON(pi_state);
 			drop_count++;
 			task_count++;
-			ret = get_futex_value_locked(&curval2, uaddr2);
-			if (!ret)
-				ret = lookup_pi_state(curval2, hb2, &key2,
-						      &pi_state);
+			/*
+			 * If we acquired the lock, then the user
+			 * space value of uaddr2 should be vpid. It
+			 * cannot be changed by the top waiter as it
+			 * is blocked on hb2 lock if it tries to do
+			 * so. If something fiddled with it behind our
+			 * back the pi state lookup might unearth
+			 * it. So we rather use the known value than
+			 * rereading and handing potential crap to
+			 * lookup_pi_state.
+			 */
+			ret = lookup_pi_state(ret, hb2, &key2, &pi_state, NULL);
 		}
 
 		switch (ret) {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 012/146] futex: Prevent attaching to kernel threads
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (10 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 011/146] futex: Add another early deadlock detection check Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 013/146] mips: dts: Fix missing device_type="memory" property in memory nodes Jiri Slaby
                   ` (135 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Thomas Gleixner, Dave Jones, Linus Torvalds,
	Peter Zijlstra, Darren Hart, Davidlohr Bueso, Steven Rostedt,
	Clark Williams, Paul McKenney, Lai Jiangshan, Roland McGrath,
	Carlos ODonell, Jakub Jelinek, Michael Kerrisk,
	Sebastian Andrzej Siewior, Jiri Slaby

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit f0d71b3dcb8332f7971b5f2363632573e6d9486a upstream.

We happily allow userspace to declare a random kernel thread to be the
owner of a user space PI futex.

Found while analysing the fallout of Dave Jones syscall fuzzer.

We also should validate the thread group for private futexes and find
some fast way to validate whether the "alleged" owner has RW access on
the file which backs the SHM, but that's a separate issue.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Jones <davej@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Darren Hart <darren@dvhart.com>
Cc: Davidlohr Bueso <davidlohr@hp.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Clark Williams <williams@redhat.com>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Carlos ODonell <carlos@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: http://lkml.kernel.org/r/20140512201701.194824402@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/futex.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/futex.c b/kernel/futex.c
index 470729dfe192..6c7975b3f291 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -668,6 +668,11 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
 	if (!p)
 		return -ESRCH;
 
+	if (!p->mm) {
+		put_task_struct(p);
+		return -EPERM;
+	}
+
 	/*
 	 * We need to look at the task state flags to figure out,
 	 * whether the task is exiting. To protect against the do_exit
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 013/146] mips: dts: Fix missing device_type="memory" property in memory nodes
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (11 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 012/146] futex: Prevent attaching to kernel threads Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 014/146] ftrace/module: Hardcode ftrace_module_init() call into load_module() Jiri Slaby
                   ` (134 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Leif Lindholm, linux-mips, devicetree,
	Mark Rutland, Grant Likely, Jiri Slaby

From: Leif Lindholm <leif.lindholm@linaro.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit dfc44f8030653b345fc6fb337558c3a07536823f upstream.

A few platforms lack a 'device_type = "memory"' for their memory
nodes, relying on an old ppc quirk in order to discover its memory.
Add the missing data so that all parsing code can find memory nodes
correctly.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Cc: linux-mips@linux-mips.org
Cc: devicetree@vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>
Acked-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/mips/lantiq/dts/easy50712.dts    | 1 +
 arch/mips/ralink/dts/mt7620a_eval.dts | 1 +
 arch/mips/ralink/dts/rt2880_eval.dts  | 1 +
 arch/mips/ralink/dts/rt3052_eval.dts  | 1 +
 arch/mips/ralink/dts/rt3883_eval.dts  | 1 +
 5 files changed, 5 insertions(+)

diff --git a/arch/mips/lantiq/dts/easy50712.dts b/arch/mips/lantiq/dts/easy50712.dts
index fac1f5b178eb..143b8a37b5e4 100644
--- a/arch/mips/lantiq/dts/easy50712.dts
+++ b/arch/mips/lantiq/dts/easy50712.dts
@@ -8,6 +8,7 @@
 	};
 
 	memory@0 {
+		device_type = "memory";
 		reg = <0x0 0x2000000>;
 	};
 
diff --git a/arch/mips/ralink/dts/mt7620a_eval.dts b/arch/mips/ralink/dts/mt7620a_eval.dts
index 35eb874ab7f1..709f58132f5c 100644
--- a/arch/mips/ralink/dts/mt7620a_eval.dts
+++ b/arch/mips/ralink/dts/mt7620a_eval.dts
@@ -7,6 +7,7 @@
 	model = "Ralink MT7620A evaluation board";
 
 	memory@0 {
+		device_type = "memory";
 		reg = <0x0 0x2000000>;
 	};
 
diff --git a/arch/mips/ralink/dts/rt2880_eval.dts b/arch/mips/ralink/dts/rt2880_eval.dts
index 322d7002595b..0a685db093d4 100644
--- a/arch/mips/ralink/dts/rt2880_eval.dts
+++ b/arch/mips/ralink/dts/rt2880_eval.dts
@@ -7,6 +7,7 @@
 	model = "Ralink RT2880 evaluation board";
 
 	memory@0 {
+		device_type = "memory";
 		reg = <0x8000000 0x2000000>;
 	};
 
diff --git a/arch/mips/ralink/dts/rt3052_eval.dts b/arch/mips/ralink/dts/rt3052_eval.dts
index 0ac73ea28198..ec9e9a035541 100644
--- a/arch/mips/ralink/dts/rt3052_eval.dts
+++ b/arch/mips/ralink/dts/rt3052_eval.dts
@@ -7,6 +7,7 @@
 	model = "Ralink RT3052 evaluation board";
 
 	memory@0 {
+		device_type = "memory";
 		reg = <0x0 0x2000000>;
 	};
 
diff --git a/arch/mips/ralink/dts/rt3883_eval.dts b/arch/mips/ralink/dts/rt3883_eval.dts
index 2fa6b330bf4f..e8df21a5d10d 100644
--- a/arch/mips/ralink/dts/rt3883_eval.dts
+++ b/arch/mips/ralink/dts/rt3883_eval.dts
@@ -7,6 +7,7 @@
 	model = "Ralink RT3883 evaluation board";
 
 	memory@0 {
+		device_type = "memory";
 		reg = <0x0 0x2000000>;
 	};
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 014/146] ftrace/module: Hardcode ftrace_module_init() call into load_module()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (12 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 013/146] mips: dts: Fix missing device_type="memory" property in memory nodes Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49   ` Jiri Slaby
                   ` (133 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Steven Rostedt (Red Hat), Jiri Slaby

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit a949ae560a511fe4e3adf48fa44fefded93e5c2b upstream.

A race exists between module loading and enabling of function tracer.

	CPU 1				CPU 2
	-----				-----
  load_module()
   module->state = MODULE_STATE_COMING

				register_ftrace_function()
				 mutex_lock(&ftrace_lock);
				 ftrace_startup()
				  update_ftrace_function();
				   ftrace_arch_code_modify_prepare()
				    set_all_module_text_rw();
				   <enables-ftrace>
				    ftrace_arch_code_modify_post_process()
				     set_all_module_text_ro();

				[ here all module text is set to RO,
				  including the module that is
				  loading!! ]

   blocking_notifier_call_chain(MODULE_STATE_COMING);
    ftrace_init_module()

     [ tries to modify code, but it's RO, and fails!
       ftrace_bug() is called]

When this race happens, ftrace_bug() will produces a nasty warning and
all of the function tracing features will be disabled until reboot.

The simple solution is to treate module load the same way the core
kernel is treated at boot. To hardcode the ftrace function modification
of converting calls to mcount into nops. This is done in init/main.c
there's no reason it could not be done in load_module(). This gives
a better control of the changes and doesn't tie the state of the
module to its notifiers as much. Ftrace is special, it needs to be
treated as such.

The reason this would work, is that the ftrace_module_init() would be
called while the module is in MODULE_STATE_UNFORMED, which is ignored
by the set_all_module_text_ro() call.

Link: http://lkml.kernel.org/r/1395637826-3312-1-git-send-email-indou.takao@jp.fujitsu.com

Reported-by: Takao Indoh <indou.takao@jp.fujitsu.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/linux/ftrace.h |  2 ++
 kernel/module.c        |  3 +++
 kernel/trace/ftrace.c  | 27 ++++-----------------------
 3 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 9f15c0064c50..e68db4d534cb 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -524,6 +524,7 @@ static inline int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_a
 extern int ftrace_arch_read_dyn_info(char *buf, int size);
 
 extern int skip_trace(unsigned long ip);
+extern void ftrace_module_init(struct module *mod);
 
 extern void ftrace_disable_daemon(void);
 extern void ftrace_enable_daemon(void);
@@ -533,6 +534,7 @@ static inline int ftrace_force_update(void) { return 0; }
 static inline void ftrace_disable_daemon(void) { }
 static inline void ftrace_enable_daemon(void) { }
 static inline void ftrace_release_mod(struct module *mod) {}
+static inline void ftrace_module_init(struct module *mod) {}
 static inline int register_ftrace_command(struct ftrace_func_command *cmd)
 {
 	return -EINVAL;
diff --git a/kernel/module.c b/kernel/module.c
index dc582749fa13..7b15ff67c5aa 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3296,6 +3296,9 @@ static int load_module(struct load_info *info, const char __user *uargs,
 
 	dynamic_debug_setup(info->debug, info->num_debug);
 
+	/* Ftrace init must be called in the MODULE_STATE_UNFORMED state */
+	ftrace_module_init(mod);
+
 	/* Finally it's fully formed, ready to start executing. */
 	err = complete_formation(mod, info);
 	if (err)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index e66411fb55b3..a8642bac843e 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -4252,16 +4252,11 @@ static void ftrace_init_module(struct module *mod,
 	ftrace_process_locs(mod, start, end);
 }
 
-static int ftrace_module_notify_enter(struct notifier_block *self,
-				      unsigned long val, void *data)
+void ftrace_module_init(struct module *mod)
 {
-	struct module *mod = data;
-
-	if (val == MODULE_STATE_COMING)
-		ftrace_init_module(mod, mod->ftrace_callsites,
-				   mod->ftrace_callsites +
-				   mod->num_ftrace_callsites);
-	return 0;
+	ftrace_init_module(mod, mod->ftrace_callsites,
+			   mod->ftrace_callsites +
+			   mod->num_ftrace_callsites);
 }
 
 static int ftrace_module_notify_exit(struct notifier_block *self,
@@ -4275,11 +4270,6 @@ static int ftrace_module_notify_exit(struct notifier_block *self,
 	return 0;
 }
 #else
-static int ftrace_module_notify_enter(struct notifier_block *self,
-				      unsigned long val, void *data)
-{
-	return 0;
-}
 static int ftrace_module_notify_exit(struct notifier_block *self,
 				     unsigned long val, void *data)
 {
@@ -4287,11 +4277,6 @@ static int ftrace_module_notify_exit(struct notifier_block *self,
 }
 #endif /* CONFIG_MODULES */
 
-struct notifier_block ftrace_module_enter_nb = {
-	.notifier_call = ftrace_module_notify_enter,
-	.priority = INT_MAX,	/* Run before anything that can use kprobes */
-};
-
 struct notifier_block ftrace_module_exit_nb = {
 	.notifier_call = ftrace_module_notify_exit,
 	.priority = INT_MIN,	/* Run after anything that can remove kprobes */
@@ -4328,10 +4313,6 @@ void __init ftrace_init(void)
 				  __start_mcount_loc,
 				  __stop_mcount_loc);
 
-	ret = register_module_notifier(&ftrace_module_enter_nb);
-	if (ret)
-		pr_warning("Failed to register trace ftrace module enter notifier\n");
-
 	ret = register_module_notifier(&ftrace_module_exit_nb);
 	if (ret)
 		pr_warning("Failed to register trace ftrace module exit notifier\n");
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 015/146] irqchip: Gic: Support forced affinity setting
  2014-06-09  8:48 ` [PATCH 3.12 001/146] introduce for_each_thread() to replace the buggy while_each_thread() Jiri Slaby
@ 2014-06-09  8:49   ` Jiri Slaby
  -1 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Thomas Gleixner, Kyungmin Park, Marek Szyprowski,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Daniel Lezcano,
	Kukjin Kim, linux-arm-kernel, Jiri Slaby

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit ffde1de64012c406dfdda8690918248b472f24e4 upstream.

To support the affinity setting of per cpu timers in the early startup
of a not yet online cpu, implement the force logic, which disables the
cpu online check.

Tagged for stable to allow a simple fix of the affected SoC clock
event drivers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>,
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
Link: http://lkml.kernel.org/r/20140416143315.916984416@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/irqchip/irq-gic.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index d0e948084eaf..86df97f6fd27 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -246,10 +246,14 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 			    bool force)
 {
 	void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
-	unsigned int shift = (gic_irq(d) % 4) * 8;
-	unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
+	unsigned int cpu, shift = (gic_irq(d) % 4) * 8;
 	u32 val, mask, bit;
 
+	if (!force)
+		cpu = cpumask_any_and(mask_val, cpu_online_mask);
+	else
+		cpu = cpumask_first(mask_val);
+
 	if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
 		return -EINVAL;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 015/146] irqchip: Gic: Support forced affinity setting
@ 2014-06-09  8:49   ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit ffde1de64012c406dfdda8690918248b472f24e4 upstream.

To support the affinity setting of per cpu timers in the early startup
of a not yet online cpu, implement the force logic, which disables the
cpu online check.

Tagged for stable to allow a simple fix of the affected SoC clock
event drivers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>,
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org,
Link: http://lkml.kernel.org/r/20140416143315.916984416 at linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/irqchip/irq-gic.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index d0e948084eaf..86df97f6fd27 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -246,10 +246,14 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 			    bool force)
 {
 	void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
-	unsigned int shift = (gic_irq(d) % 4) * 8;
-	unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
+	unsigned int cpu, shift = (gic_irq(d) % 4) * 8;
 	u32 val, mask, bit;
 
+	if (!force)
+		cpu = cpumask_any_and(mask_val, cpu_online_mask);
+	else
+		cpu = cpumask_first(mask_val);
+
 	if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
 		return -EINVAL;
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 016/146] genirq: Allow forcing cpu affinity of interrupts
  2014-06-09  8:48 ` [PATCH 3.12 001/146] introduce for_each_thread() to replace the buggy while_each_thread() Jiri Slaby
@ 2014-06-09  8:49   ` Jiri Slaby
  -1 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Thomas Gleixner, Kyungmin Park, Marek Szyprowski,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Daniel Lezcano,
	Kukjin Kim, linux-arm-kernel, Jiri Slaby

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 01f8fa4f01d8362358eb90e412bd7ae18a3ec1ad upstream.

The current implementation of irq_set_affinity() refuses rightfully to
route an interrupt to an offline cpu.

But there is a special case, where this is actually desired. Some of
the ARM SoCs have per cpu timers which require setting the affinity
during cpu startup where the cpu is not yet in the online mask.

If we can't do that, then the local timer interrupt for the about to
become online cpu is routed to some random online cpu.

The developers of the affected machines tried to work around that
issue, but that results in a massive mess in that timer code.

We have a yet unused argument in the set_affinity callbacks of the irq
chips, which I added back then for a similar reason. It was never
required so it got not used. But I'm happy that I never removed it.

That allows us to implement a sane handling of the above scenario. So
the affected SoC drivers can add the required force handling to their
interrupt chip, switch the timer code to irq_force_affinity() and
things just work.

This does not affect any existing user of irq_set_affinity().

Tagged for stable to allow a simple fix of the affected SoC clock
event drivers.

Reported-and-tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>,
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
Link: http://lkml.kernel.org/r/20140416143315.717251504@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/mips/cavium-octeon/octeon-irq.c |  2 +-
 include/linux/interrupt.h            | 35 ++++++++++++++++++++++++++++++++++-
 include/linux/irq.h                  |  3 ++-
 kernel/irq/manage.c                  | 17 ++++++-----------
 4 files changed, 43 insertions(+), 14 deletions(-)

diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index 25fbfae06c1f..ab7dc01ad8c3 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -635,7 +635,7 @@ static void octeon_irq_cpu_offline_ciu(struct irq_data *data)
 		cpumask_clear(&new_affinity);
 		cpumask_set_cpu(cpumask_first(cpu_online_mask), &new_affinity);
 	}
-	__irq_set_affinity_locked(data, &new_affinity);
+	irq_set_affinity_locked(data, &new_affinity, false);
 }
 
 static int octeon_irq_ciu_set_affinity(struct irq_data *data,
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 5e865b554940..e7777c940972 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -198,7 +198,40 @@ static inline int check_wakeup_irqs(void) { return 0; }
 
 extern cpumask_var_t irq_default_affinity;
 
-extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask);
+/* Internal implementation. Use the helpers below */
+extern int __irq_set_affinity(unsigned int irq, const struct cpumask *cpumask,
+			      bool force);
+
+/**
+ * irq_set_affinity - Set the irq affinity of a given irq
+ * @irq:	Interrupt to set affinity
+ * @mask:	cpumask
+ *
+ * Fails if cpumask does not contain an online CPU
+ */
+static inline int
+irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
+{
+	return __irq_set_affinity(irq, cpumask, false);
+}
+
+/**
+ * irq_force_affinity - Force the irq affinity of a given irq
+ * @irq:	Interrupt to set affinity
+ * @mask:	cpumask
+ *
+ * Same as irq_set_affinity, but without checking the mask against
+ * online cpus.
+ *
+ * Solely for low level cpu hotplug code, where we need to make per
+ * cpu interrupts affine before the cpu becomes online.
+ */
+static inline int
+irq_force_affinity(unsigned int irq, const struct cpumask *cpumask)
+{
+	return __irq_set_affinity(irq, cpumask, true);
+}
+
 extern int irq_can_set_affinity(unsigned int irq);
 extern int irq_select_affinity(unsigned int irq);
 
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 56bb0dc8b7d4..896824eeacf1 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -380,7 +380,8 @@ extern void remove_percpu_irq(unsigned int irq, struct irqaction *act);
 
 extern void irq_cpu_online(void);
 extern void irq_cpu_offline(void);
-extern int __irq_set_affinity_locked(struct irq_data *data,  const struct cpumask *cpumask);
+extern int irq_set_affinity_locked(struct irq_data *data,
+				   const struct cpumask *cpumask, bool force);
 
 #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ)
 void irq_move_irq(struct irq_data *data);
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 4c84746a840b..9e31fa71908d 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -150,7 +150,7 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
 	struct irq_chip *chip = irq_data_get_irq_chip(data);
 	int ret;
 
-	ret = chip->irq_set_affinity(data, mask, false);
+	ret = chip->irq_set_affinity(data, mask, force);
 	switch (ret) {
 	case IRQ_SET_MASK_OK:
 		cpumask_copy(data->affinity, mask);
@@ -162,7 +162,8 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
 	return ret;
 }
 
-int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask)
+int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask,
+			    bool force)
 {
 	struct irq_chip *chip = irq_data_get_irq_chip(data);
 	struct irq_desc *desc = irq_data_to_desc(data);
@@ -172,7 +173,7 @@ int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask)
 		return -EINVAL;
 
 	if (irq_can_move_pcntxt(data)) {
-		ret = irq_do_set_affinity(data, mask, false);
+		ret = irq_do_set_affinity(data, mask, force);
 	} else {
 		irqd_set_move_pending(data);
 		irq_copy_pending(desc, mask);
@@ -187,13 +188,7 @@ int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask)
 	return ret;
 }
 
-/**
- *	irq_set_affinity - Set the irq affinity of a given irq
- *	@irq:		Interrupt to set affinity
- *	@mask:		cpumask
- *
- */
-int irq_set_affinity(unsigned int irq, const struct cpumask *mask)
+int __irq_set_affinity(unsigned int irq, const struct cpumask *mask, bool force)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
 	unsigned long flags;
@@ -203,7 +198,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *mask)
 		return -EINVAL;
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
-	ret =  __irq_set_affinity_locked(irq_desc_get_irq_data(desc), mask);
+	ret = irq_set_affinity_locked(irq_desc_get_irq_data(desc), mask, force);
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 	return ret;
 }
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 016/146] genirq: Allow forcing cpu affinity of interrupts
@ 2014-06-09  8:49   ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 01f8fa4f01d8362358eb90e412bd7ae18a3ec1ad upstream.

The current implementation of irq_set_affinity() refuses rightfully to
route an interrupt to an offline cpu.

But there is a special case, where this is actually desired. Some of
the ARM SoCs have per cpu timers which require setting the affinity
during cpu startup where the cpu is not yet in the online mask.

If we can't do that, then the local timer interrupt for the about to
become online cpu is routed to some random online cpu.

The developers of the affected machines tried to work around that
issue, but that results in a massive mess in that timer code.

We have a yet unused argument in the set_affinity callbacks of the irq
chips, which I added back then for a similar reason. It was never
required so it got not used. But I'm happy that I never removed it.

That allows us to implement a sane handling of the above scenario. So
the affected SoC drivers can add the required force handling to their
interrupt chip, switch the timer code to irq_force_affinity() and
things just work.

This does not affect any existing user of irq_set_affinity().

Tagged for stable to allow a simple fix of the affected SoC clock
event drivers.

Reported-and-tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>,
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org,
Link: http://lkml.kernel.org/r/20140416143315.717251504 at linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/mips/cavium-octeon/octeon-irq.c |  2 +-
 include/linux/interrupt.h            | 35 ++++++++++++++++++++++++++++++++++-
 include/linux/irq.h                  |  3 ++-
 kernel/irq/manage.c                  | 17 ++++++-----------
 4 files changed, 43 insertions(+), 14 deletions(-)

diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index 25fbfae06c1f..ab7dc01ad8c3 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -635,7 +635,7 @@ static void octeon_irq_cpu_offline_ciu(struct irq_data *data)
 		cpumask_clear(&new_affinity);
 		cpumask_set_cpu(cpumask_first(cpu_online_mask), &new_affinity);
 	}
-	__irq_set_affinity_locked(data, &new_affinity);
+	irq_set_affinity_locked(data, &new_affinity, false);
 }
 
 static int octeon_irq_ciu_set_affinity(struct irq_data *data,
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 5e865b554940..e7777c940972 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -198,7 +198,40 @@ static inline int check_wakeup_irqs(void) { return 0; }
 
 extern cpumask_var_t irq_default_affinity;
 
-extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask);
+/* Internal implementation. Use the helpers below */
+extern int __irq_set_affinity(unsigned int irq, const struct cpumask *cpumask,
+			      bool force);
+
+/**
+ * irq_set_affinity - Set the irq affinity of a given irq
+ * @irq:	Interrupt to set affinity
+ * @mask:	cpumask
+ *
+ * Fails if cpumask does not contain an online CPU
+ */
+static inline int
+irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
+{
+	return __irq_set_affinity(irq, cpumask, false);
+}
+
+/**
+ * irq_force_affinity - Force the irq affinity of a given irq
+ * @irq:	Interrupt to set affinity
+ * @mask:	cpumask
+ *
+ * Same as irq_set_affinity, but without checking the mask against
+ * online cpus.
+ *
+ * Solely for low level cpu hotplug code, where we need to make per
+ * cpu interrupts affine before the cpu becomes online.
+ */
+static inline int
+irq_force_affinity(unsigned int irq, const struct cpumask *cpumask)
+{
+	return __irq_set_affinity(irq, cpumask, true);
+}
+
 extern int irq_can_set_affinity(unsigned int irq);
 extern int irq_select_affinity(unsigned int irq);
 
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 56bb0dc8b7d4..896824eeacf1 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -380,7 +380,8 @@ extern void remove_percpu_irq(unsigned int irq, struct irqaction *act);
 
 extern void irq_cpu_online(void);
 extern void irq_cpu_offline(void);
-extern int __irq_set_affinity_locked(struct irq_data *data,  const struct cpumask *cpumask);
+extern int irq_set_affinity_locked(struct irq_data *data,
+				   const struct cpumask *cpumask, bool force);
 
 #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ)
 void irq_move_irq(struct irq_data *data);
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 4c84746a840b..9e31fa71908d 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -150,7 +150,7 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
 	struct irq_chip *chip = irq_data_get_irq_chip(data);
 	int ret;
 
-	ret = chip->irq_set_affinity(data, mask, false);
+	ret = chip->irq_set_affinity(data, mask, force);
 	switch (ret) {
 	case IRQ_SET_MASK_OK:
 		cpumask_copy(data->affinity, mask);
@@ -162,7 +162,8 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
 	return ret;
 }
 
-int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask)
+int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask,
+			    bool force)
 {
 	struct irq_chip *chip = irq_data_get_irq_chip(data);
 	struct irq_desc *desc = irq_data_to_desc(data);
@@ -172,7 +173,7 @@ int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask)
 		return -EINVAL;
 
 	if (irq_can_move_pcntxt(data)) {
-		ret = irq_do_set_affinity(data, mask, false);
+		ret = irq_do_set_affinity(data, mask, force);
 	} else {
 		irqd_set_move_pending(data);
 		irq_copy_pending(desc, mask);
@@ -187,13 +188,7 @@ int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask)
 	return ret;
 }
 
-/**
- *	irq_set_affinity - Set the irq affinity of a given irq
- *	@irq:		Interrupt to set affinity
- *	@mask:		cpumask
- *
- */
-int irq_set_affinity(unsigned int irq, const struct cpumask *mask)
+int __irq_set_affinity(unsigned int irq, const struct cpumask *mask, bool force)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
 	unsigned long flags;
@@ -203,7 +198,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *mask)
 		return -EINVAL;
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
-	ret =  __irq_set_affinity_locked(irq_desc_get_irq_data(desc), mask);
+	ret = irq_set_affinity_locked(irq_desc_get_irq_data(desc), mask, force);
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 	return ret;
 }
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 017/146] clocksource: Exynos_mct: Use irq_force_affinity() in cpu bringup
  2014-06-09  8:48 ` [PATCH 3.12 001/146] introduce for_each_thread() to replace the buggy while_each_thread() Jiri Slaby
@ 2014-06-09  8:49   ` Jiri Slaby
  -1 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Thomas Gleixner, Kyungmin Park, Marek Szyprowski,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Daniel Lezcano,
	Kukjin Kim, linux-arm-kernel, Jiri Slaby

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 30ccf03b4a6a2102a2219058bdc6d779dc637dd7 upstream.

The starting cpu is not yet in the online mask so irq_set_affinity()
fails which results in per cpu timers for this cpu ending up on some
other online cpu, ususally cpu 0.

Use irq_force_affinity() which disables the online mask check and
makes things work.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>,
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
Link: http://lkml.kernel.org/r/20140416143316.106665251@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/clocksource/exynos_mct.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 62b0de6a1837..b17b3e0981f0 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -428,6 +428,7 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt)
 				evt->irq);
 			return -EIO;
 		}
+		irq_force_affinity(mct_irqs[MCT_L0_IRQ + cpu], cpumask_of(cpu));
 	} else {
 		enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0);
 	}
@@ -448,7 +449,6 @@ static int exynos4_mct_cpu_notify(struct notifier_block *self,
 					   unsigned long action, void *hcpu)
 {
 	struct mct_clock_event_device *mevt;
-	unsigned int cpu;
 
 	/*
 	 * Grab cpu pointer in each case to avoid spurious
@@ -459,12 +459,6 @@ static int exynos4_mct_cpu_notify(struct notifier_block *self,
 		mevt = this_cpu_ptr(&percpu_mct_tick);
 		exynos4_local_timer_setup(&mevt->evt);
 		break;
-	case CPU_ONLINE:
-		cpu = (unsigned long)hcpu;
-		if (mct_int_type == MCT_INT_SPI)
-			irq_set_affinity(mct_irqs[MCT_L0_IRQ + cpu],
-						cpumask_of(cpu));
-		break;
 	case CPU_DYING:
 		mevt = this_cpu_ptr(&percpu_mct_tick);
 		exynos4_local_timer_stop(&mevt->evt);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 017/146] clocksource: Exynos_mct: Use irq_force_affinity() in cpu bringup
@ 2014-06-09  8:49   ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 30ccf03b4a6a2102a2219058bdc6d779dc637dd7 upstream.

The starting cpu is not yet in the online mask so irq_set_affinity()
fails which results in per cpu timers for this cpu ending up on some
other online cpu, ususally cpu 0.

Use irq_force_affinity() which disables the online mask check and
makes things work.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>,
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org,
Link: http://lkml.kernel.org/r/20140416143316.106665251 at linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/clocksource/exynos_mct.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 62b0de6a1837..b17b3e0981f0 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -428,6 +428,7 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt)
 				evt->irq);
 			return -EIO;
 		}
+		irq_force_affinity(mct_irqs[MCT_L0_IRQ + cpu], cpumask_of(cpu));
 	} else {
 		enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0);
 	}
@@ -448,7 +449,6 @@ static int exynos4_mct_cpu_notify(struct notifier_block *self,
 					   unsigned long action, void *hcpu)
 {
 	struct mct_clock_event_device *mevt;
-	unsigned int cpu;
 
 	/*
 	 * Grab cpu pointer in each case to avoid spurious
@@ -459,12 +459,6 @@ static int exynos4_mct_cpu_notify(struct notifier_block *self,
 		mevt = this_cpu_ptr(&percpu_mct_tick);
 		exynos4_local_timer_setup(&mevt->evt);
 		break;
-	case CPU_ONLINE:
-		cpu = (unsigned long)hcpu;
-		if (mct_int_type == MCT_INT_SPI)
-			irq_set_affinity(mct_irqs[MCT_L0_IRQ + cpu],
-						cpumask_of(cpu));
-		break;
 	case CPU_DYING:
 		mevt = this_cpu_ptr(&percpu_mct_tick);
 		exynos4_local_timer_stop(&mevt->evt);
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 018/146] clocksource: Exynos_mct: Register clock event after request_irq()
  2014-06-09  8:48 ` [PATCH 3.12 001/146] introduce for_each_thread() to replace the buggy while_each_thread() Jiri Slaby
@ 2014-06-09  8:49   ` Jiri Slaby
  -1 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Krzysztof Kozlowski, Thomas Gleixner,
	Kyungmin Park, Marek Szyprowski, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Daniel Lezcano, Kukjin Kim, linux-arm-kernel,
	Jiri Slaby

From: Krzysztof Kozlowski <k.kozlowski@samsung.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 8db6e5104b77de5d0b7002b95069da0992a34be9 upstream.

After hotplugging CPU1 the first call of interrupt handler for CPU1
oneshot timer was called on CPU0 because it fired before setting IRQ
affinity. Affected are SoCs where Multi Core Timer interrupts are
shared (SPI), e.g. Exynos 4210.

During setup of the MCT timers the clock event device should be
registered after setting the affinity for interrupt. This will prevent
starting the timer too early.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>,
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
Link: http://lkml.kernel.org/r/20140416143316.299247848@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/clocksource/exynos_mct.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index b17b3e0981f0..70f3a597ec57 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -414,8 +414,6 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt)
 	evt->set_mode = exynos4_tick_set_mode;
 	evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
 	evt->rating = 450;
-	clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1),
-					0xf, 0x7fffffff);
 
 	exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
 
@@ -432,6 +430,8 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt)
 	} else {
 		enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0);
 	}
+	clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1),
+					0xf, 0x7fffffff);
 
 	return 0;
 }
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 018/146] clocksource: Exynos_mct: Register clock event after request_irq()
@ 2014-06-09  8:49   ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Krzysztof Kozlowski <k.kozlowski@samsung.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 8db6e5104b77de5d0b7002b95069da0992a34be9 upstream.

After hotplugging CPU1 the first call of interrupt handler for CPU1
oneshot timer was called on CPU0 because it fired before setting IRQ
affinity. Affected are SoCs where Multi Core Timer interrupts are
shared (SPI), e.g. Exynos 4210.

During setup of the MCT timers the clock event device should be
registered after setting the affinity for interrupt. This will prevent
starting the timer too early.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>,
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel at lists.infradead.org,
Link: http://lkml.kernel.org/r/20140416143316.299247848 at linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/clocksource/exynos_mct.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index b17b3e0981f0..70f3a597ec57 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -414,8 +414,6 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt)
 	evt->set_mode = exynos4_tick_set_mode;
 	evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
 	evt->rating = 450;
-	clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1),
-					0xf, 0x7fffffff);
 
 	exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
 
@@ -432,6 +430,8 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt)
 	} else {
 		enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0);
 	}
+	clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1),
+					0xf, 0x7fffffff);
 
 	return 0;
 }
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 019/146] pata_at91: fix ata_host_activate() failure handling
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (17 preceding siblings ...)
  2014-06-09  8:49   ` Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 020/146] coredump: fix va_list corruption Jiri Slaby
                   ` (128 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Bartlomiej Zolnierkiewicz, Andrew Victor,
	Nicolas Ferre, Jean-Christophe Plagniol-Villard, Sergei Shtylyov,
	Tejun Heo, Jiri Slaby

From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 27aa64b9d1bd0d23fd692c91763a48309b694311 upstream.

Add missing clk_put() call to ata_host_activate() failure path.

Sergei says,

  "Hm, I have once fixed that (see that *if* (!ret)) but looks like a
   later commit 477c87e90853d136b188c50c0e4a93d01cad872e (ARM:
   at91/pata: use gpio_is_valid to check the gpio) broke it again. :-(
   Would be good if the changelog did mention that..."

Cc: Andrew Victor <linux@maxim.org.za>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/ata/pata_at91.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/pata_at91.c b/drivers/ata/pata_at91.c
index d63ee8f41a4f..e3a49df958a3 100644
--- a/drivers/ata/pata_at91.c
+++ b/drivers/ata/pata_at91.c
@@ -408,12 +408,13 @@ static int pata_at91_probe(struct platform_device *pdev)
 
 	host->private_data = info;
 
-	return ata_host_activate(host, gpio_is_valid(irq) ? gpio_to_irq(irq) : 0,
-			gpio_is_valid(irq) ? ata_sff_interrupt : NULL,
-			irq_flags, &pata_at91_sht);
+	ret = ata_host_activate(host, gpio_is_valid(irq) ? gpio_to_irq(irq) : 0,
+				gpio_is_valid(irq) ? ata_sff_interrupt : NULL,
+				irq_flags, &pata_at91_sht);
+	if (ret)
+		goto err_put;
 
-	if (!ret)
-		return 0;
+	return 0;
 
 err_put:
 	clk_put(info->mck);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 020/146] coredump: fix va_list corruption
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (18 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 019/146] pata_at91: fix ata_host_activate() failure handling Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 021/146] mm: make fixup_user_fault() check the vma access rights too Jiri Slaby
                   ` (127 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Eric Dumazet, Neil Horman, Andrew Morton,
	Linus Torvalds, Jiri Slaby

From: Eric Dumazet <edumazet@google.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 404ca80eb5c2727d78cd517d12108b040c522e12 upstream.

A va_list needs to be copied in case it needs to be used twice.

Thanks to Hugh for debugging this issue, leading to various panics.

Tested:

  lpq84:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern

'produce_core' is simply : main() { *(int *)0 = 1;}

  lpq84:~# ./produce_core
  Segmentation fault (core dumped)
  lpq84:~# dmesg | tail -1
  [  614.352947] Core dump to |/foobar12345 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 (null) pipe failed

Notice the last argument was replaced by a NULL (we were lucky enough to
not crash, but do not try this on your production machine !)

After fix :

  lpq83:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern
  lpq83:~# ./produce_core
  Segmentation fault
  lpq83:~# dmesg | tail -1
  [  740.800441] Core dump to |/foobar12345 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 pipe failed

Fixes: 5fe9d8ca21cc ("coredump: cn_vprintf() has no reason to call vsnprintf() twice")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Diagnosed-by: Hugh Dickins <hughd@google.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/coredump.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/coredump.c b/fs/coredump.c
index 9bdeca12ae0e..02db009d1531 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -74,10 +74,15 @@ static int expand_corename(struct core_name *cn, int size)
 static int cn_vprintf(struct core_name *cn, const char *fmt, va_list arg)
 {
 	int free, need;
+	va_list arg_copy;
 
 again:
 	free = cn->size - cn->used;
-	need = vsnprintf(cn->corename + cn->used, free, fmt, arg);
+
+	va_copy(arg_copy, arg);
+	need = vsnprintf(cn->corename + cn->used, free, fmt, arg_copy);
+	va_end(arg_copy);
+
 	if (need < free) {
 		cn->used += need;
 		return 0;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 021/146] mm: make fixup_user_fault() check the vma access rights too
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (19 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 020/146] coredump: fix va_list corruption Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 022/146] serial: 8250: Fix thread unsafe __dma_tx_complete function Jiri Slaby
                   ` (126 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Linus Torvalds, Jiri Slaby

From: Linus Torvalds <torvalds@linux-foundation.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 1b17844b29ae042576bea588164f2f1e9590a8bc upstream.

fixup_user_fault() is used by the futex code when the direct user access
fails, and the futex code wants it to either map in the page in a usable
form or return an error.  It relied on handle_mm_fault() to map the
page, and correctly checked the error return from that, but while that
does map the page, it doesn't actually guarantee that the page will be
mapped with sufficient permissions to be then accessed.

So do the appropriate tests of the vma access rights by hand.

[ Side note: arguably handle_mm_fault() could just do that itself, but
  we have traditionally done it in the caller, because some callers -
  notably get_user_pages() - have been able to access pages even when
  they are mapped with PROT_NONE.  Maybe we should re-visit that design
  decision, but in the meantime this is the minimal patch. ]

Found by Dave Jones running his trinity tool.

Reported-by: Dave Jones <davej@redhat.com>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/memory.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mm/memory.c b/mm/memory.c
index 22e67a2c955b..99fe3aa1035c 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1929,12 +1929,17 @@ int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
 		     unsigned long address, unsigned int fault_flags)
 {
 	struct vm_area_struct *vma;
+	vm_flags_t vm_flags;
 	int ret;
 
 	vma = find_extend_vma(mm, address);
 	if (!vma || address < vma->vm_start)
 		return -EFAULT;
 
+	vm_flags = (fault_flags & FAULT_FLAG_WRITE) ? VM_WRITE : VM_READ;
+	if (!(vm_flags & vma->vm_flags))
+		return -EFAULT;
+
 	ret = handle_mm_fault(mm, vma, address, fault_flags);
 	if (ret & VM_FAULT_ERROR) {
 		if (ret & VM_FAULT_OOM)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 022/146] serial: 8250: Fix thread unsafe __dma_tx_complete function
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (20 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 021/146] mm: make fixup_user_fault() check the vma access rights too Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 023/146] 8250_core: Fix unwanted TX chars write Jiri Slaby
                   ` (125 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Loic Poulain, Jiri Slaby

From: Loic Poulain <loic.poulain@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit f8fd1b0350d3a4581125f5eda6528f5a2c5f9183 upstream.

__dma_tx_complete is not protected against concurrent
call of serial8250_tx_dma. it can lead to circular tail
index corruption or parallel call of serial_tx_dma on the
same data portion.

This patch fixes this issue by holding the port lock.

Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/serial/8250/8250_dma.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c
index 7046769608d4..ab9096dc3849 100644
--- a/drivers/tty/serial/8250/8250_dma.c
+++ b/drivers/tty/serial/8250/8250_dma.c
@@ -20,12 +20,15 @@ static void __dma_tx_complete(void *param)
 	struct uart_8250_port	*p = param;
 	struct uart_8250_dma	*dma = p->dma;
 	struct circ_buf		*xmit = &p->port.state->xmit;
-
-	dma->tx_running = 0;
+	unsigned long	flags;
 
 	dma_sync_single_for_cpu(dma->txchan->device->dev, dma->tx_addr,
 				UART_XMIT_SIZE, DMA_TO_DEVICE);
 
+	spin_lock_irqsave(&p->port.lock, flags);
+
+	dma->tx_running = 0;
+
 	xmit->tail += dma->tx_size;
 	xmit->tail &= UART_XMIT_SIZE - 1;
 	p->port.icount.tx += dma->tx_size;
@@ -35,6 +38,8 @@ static void __dma_tx_complete(void *param)
 
 	if (!uart_circ_empty(xmit) && !uart_tx_stopped(&p->port))
 		serial8250_tx_dma(p);
+
+	spin_unlock_irqrestore(&p->port.lock, flags);
 }
 
 static void __dma_rx_complete(void *param)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 023/146] 8250_core: Fix unwanted TX chars write
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (21 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 022/146] serial: 8250: Fix thread unsafe __dma_tx_complete function Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 024/146] gpu: host1x: handle the correct # of syncpt regs Jiri Slaby
                   ` (124 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Loic Poulain, Jiri Slaby

From: Loic Poulain <loic.poulain@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit b08c9c317e3f7764a91d522cd031639ba42b98cc upstream.

On transmit-hold-register empty, serial8250_tx_chars
should be called only if we don't use DMA.
DMA has its own tx cycle.

Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/serial/8250/8250_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index aa6db8f4ee18..bf9d2ac9c9ed 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1520,7 +1520,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
 			status = serial8250_rx_chars(up, status);
 	}
 	serial8250_modem_status(up);
-	if (status & UART_LSR_THRE)
+	if (!up->dma && (status & UART_LSR_THRE))
 		serial8250_tx_chars(up);
 
 	spin_unlock_irqrestore(&port->lock, flags);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 024/146] gpu: host1x: handle the correct # of syncpt regs
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (22 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 023/146] 8250_core: Fix unwanted TX chars write Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 025/146] timer: Prevent overflow in apply_slack Jiri Slaby
                   ` (123 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Stephen Warren, Thierry Reding, Jiri Slaby

From: Stephen Warren <swarren@nvidia.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 22bbd5d949dc7fdd72a4e78e767fa09d8e54b446 upstream.

BIT_WORD() truncates rather than rounds, so the loops in
syncpt_thresh_isr() and _host1x_intr_disable_all_syncpt_intrs() use <=
rather than < in an attempt to process the correct number of registers
when rounding of the conversion of count of bits to count of words is
necessary. However, when rounding isn't necessary because the value is
already a multiple of the divisor (as is the case for all values of
nb_pts the code actually sees), this causes one too many registers to
be processed.

Solve this by using and explicit DIV_ROUND_UP() call, rather than
BIT_WORD(), and comparing with < rather than <=.

Fixes: 7ede0b0bf3e2 ("gpu: host1x: Add syncpoint wait and interrupts")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-By: Terje Bergstrom <tbergstrom@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/host1x/hw/intr_hw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/host1x/hw/intr_hw.c b/drivers/gpu/host1x/hw/intr_hw.c
index b592eef1efcb..b083509325e4 100644
--- a/drivers/gpu/host1x/hw/intr_hw.c
+++ b/drivers/gpu/host1x/hw/intr_hw.c
@@ -48,7 +48,7 @@ static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id)
 	unsigned long reg;
 	int i, id;
 
-	for (i = 0; i <= BIT_WORD(host->info->nb_pts); i++) {
+	for (i = 0; i < DIV_ROUND_UP(host->info->nb_pts, 32); i++) {
 		reg = host1x_sync_readl(host,
 			HOST1X_SYNC_SYNCPT_THRESH_CPU0_INT_STATUS(i));
 		for_each_set_bit(id, &reg, BITS_PER_LONG) {
@@ -65,7 +65,7 @@ static void _host1x_intr_disable_all_syncpt_intrs(struct host1x *host)
 {
 	u32 i;
 
-	for (i = 0; i <= BIT_WORD(host->info->nb_pts); ++i) {
+	for (i = 0; i < DIV_ROUND_UP(host->info->nb_pts, 32); ++i) {
 		host1x_sync_writel(host, 0xffffffffu,
 			HOST1X_SYNC_SYNCPT_THRESH_INT_DISABLE(i));
 		host1x_sync_writel(host, 0xffffffffu,
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 025/146] timer: Prevent overflow in apply_slack
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (23 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 024/146] gpu: host1x: handle the correct # of syncpt regs Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 026/146] ipmi: Reset the KCS timeout when starting error recovery Jiri Slaby
                   ` (122 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jiri Bohac, Thomas Gleixner, Jiri Slaby

From: Jiri Bohac <jbohac@suse.cz>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 98a01e779f3c66b0b11cd7e64d531c0e41c95762 upstream.

On architectures with sizeof(int) < sizeof (long), the
computation of mask inside apply_slack() can be undefined if the
computed bit is > 32.

E.g. with: expires = 0xffffe6f5 and slack = 25, we get:

expires_limit = 0x20000000e
bit = 33
mask = (1 << 33) - 1  /* undefined */

On x86, mask becomes 1 and and the slack is not applied properly.
On s390, mask is -1, expires is set to 0 and the timer fires immediately.

Use 1UL << bit to solve that issue.

Suggested-by: Deborah Townsend <dstownse@us.ibm.com>
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Link: http://lkml.kernel.org/r/20140418152310.GA13654@midget.suse.cz
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index 4296d13db3d1..4addfa27f67d 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -822,7 +822,7 @@ unsigned long apply_slack(struct timer_list *timer, unsigned long expires)
 
 	bit = find_last_bit(&mask, BITS_PER_LONG);
 
-	mask = (1 << bit) - 1;
+	mask = (1UL << bit) - 1;
 
 	expires_limit = expires_limit & ~(mask);
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 026/146] ipmi: Reset the KCS timeout when starting error recovery
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (24 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 025/146] timer: Prevent overflow in apply_slack Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 027/146] cfg80211: free sme on connection failures Jiri Slaby
                   ` (121 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Corey Minyard, Linus Torvalds, Jiri Slaby

From: Corey Minyard <cminyard@mvista.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit eb6d78ec213e6938559b801421d64714dafcf4b2 upstream.

The OBF timer in KCS was not reset in one situation when error recovery
was started, resulting in an immediate timeout.

Reported-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/char/ipmi/ipmi_kcs_sm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_kcs_sm.c b/drivers/char/ipmi/ipmi_kcs_sm.c
index e53fc24c6af3..e1ddcf938519 100644
--- a/drivers/char/ipmi/ipmi_kcs_sm.c
+++ b/drivers/char/ipmi/ipmi_kcs_sm.c
@@ -251,8 +251,9 @@ static inline int check_obf(struct si_sm_data *kcs, unsigned char status,
 	if (!GET_STATUS_OBF(status)) {
 		kcs->obf_timeout -= time;
 		if (kcs->obf_timeout < 0) {
-		    start_error_recovery(kcs, "OBF not ready in time");
-		    return 1;
+			kcs->obf_timeout = OBF_RETRY_TIMEOUT;
+			start_error_recovery(kcs, "OBF not ready in time");
+			return 1;
 		}
 		return 0;
 	}
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 027/146] cfg80211: free sme on connection failures
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (25 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 026/146] ipmi: Reset the KCS timeout when starting error recovery Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 028/146] mac80211: fix suspend vs. association race Jiri Slaby
                   ` (120 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Eliad Peller, Eliad Peller, Johannes Berg, Jiri Slaby

From: Eliad Peller <eliad@wizery.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit c1fbb258846dfc425507a093922d2d001e54c3ea upstream.

cfg80211 is notified about connection failures by
__cfg80211_connect_result() call. However, this
function currently does not free cfg80211 sme.

This results in hanging connection attempts in some cases

e.g. when mac80211 authentication attempt is denied,
we have this function call:
ieee80211_rx_mgmt_auth() -> cfg80211_rx_mlme_mgmt() ->
cfg80211_process_auth() -> cfg80211_sme_rx_auth() ->
__cfg80211_connect_result()

but cfg80211_sme_free() is never get called.

Fixes: ceca7b712 ("cfg80211: separate internal SME implementation")
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/wireless/sme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 20e86a95dc4e..2f844eec9c6d 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -242,7 +242,6 @@ void cfg80211_conn_work(struct work_struct *work)
 					NULL, 0, NULL, 0,
 					WLAN_STATUS_UNSPECIFIED_FAILURE,
 					false, NULL);
-			cfg80211_sme_free(wdev);
 		}
 		wdev_unlock(wdev);
 	}
@@ -646,6 +645,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
 			cfg80211_unhold_bss(bss_from_pub(bss));
 			cfg80211_put_bss(wdev->wiphy, bss);
 		}
+		cfg80211_sme_free(wdev);
 		return;
 	}
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 028/146] mac80211: fix suspend vs. association race
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (26 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 027/146] cfg80211: free sme on connection failures Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 029/146] mm, thp: close race between mremap() and split_huge_page() Jiri Slaby
                   ` (119 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Emmanuel Grumbach, Johannes Berg, Jiri Slaby

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit c52666aef9f2dff39276eb53f15d99e2e229870f upstream.

If the association is in progress while we suspend, the
stack will be in a messed up state. Clean it before we
suspend.

This patch completes Johannes's patch:

1a1cb744de160ee70086a77afff605bbc275d291
Author: Johannes Berg <johannes.berg@intel.com>

    mac80211: fix suspend vs. authentication race

Fixes: 12e7f517029d ("mac80211: cleanup generic suspend/resume procedures")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/mac80211/mlme.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index e41c477c6d9f..cd8d55c99ceb 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3691,18 +3691,24 @@ void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata)
 
 	sdata_lock(sdata);
 
-	if (ifmgd->auth_data) {
+	if (ifmgd->auth_data || ifmgd->assoc_data) {
+		const u8 *bssid = ifmgd->auth_data ?
+				ifmgd->auth_data->bss->bssid :
+				ifmgd->assoc_data->bss->bssid;
+
 		/*
-		 * If we are trying to authenticate while suspending, cfg80211
-		 * won't know and won't actually abort those attempts, thus we
-		 * need to do that ourselves.
+		 * If we are trying to authenticate / associate while suspending,
+		 * cfg80211 won't know and won't actually abort those attempts,
+		 * thus we need to do that ourselves.
 		 */
-		ieee80211_send_deauth_disassoc(sdata,
-					       ifmgd->auth_data->bss->bssid,
+		ieee80211_send_deauth_disassoc(sdata, bssid,
 					       IEEE80211_STYPE_DEAUTH,
 					       WLAN_REASON_DEAUTH_LEAVING,
 					       false, frame_buf);
-		ieee80211_destroy_auth_data(sdata, false);
+		if (ifmgd->assoc_data)
+			ieee80211_destroy_assoc_data(sdata, false);
+		if (ifmgd->auth_data)
+			ieee80211_destroy_auth_data(sdata, false);
 		cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,
 				      IEEE80211_DEAUTH_FRAME_LEN);
 	}
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 029/146] mm, thp: close race between mremap() and split_huge_page()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (27 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 028/146] mac80211: fix suspend vs. association race Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 030/146] x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow() Jiri Slaby
                   ` (118 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Kirill A. Shutemov, Rik van Riel, Dave Jones,
	David Miller, Andrew Morton, Linus Torvalds, Jiri Slaby

From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit dd18dbc2d42af75fffa60c77e0f02220bc329829 upstream.

It's critical for split_huge_page() (and migration) to catch and freeze
all PMDs on rmap walk.  It gets tricky if there's concurrent fork() or
mremap() since usually we copy/move page table entries on dup_mm() or
move_page_tables() without rmap lock taken.  To get it work we rely on
rmap walk order to not miss any entry.  We expect to see destination VMA
after source one to work correctly.

But after switching rmap implementation to interval tree it's not always
possible to preserve expected walk order.

It works fine for dup_mm() since new VMA has the same vma_start_pgoff()
/ vma_last_pgoff() and explicitly insert dst VMA after src one with
vma_interval_tree_insert_after().

But on move_vma() destination VMA can be merged into adjacent one and as
result shifted left in interval tree.  Fortunately, we can detect the
situation and prevent race with rmap walk by moving page table entries
under rmap lock.  See commit 38a76013ad80.

Problem is that we miss the lock when we move transhuge PMD.  Most
likely this bug caused the crash[1].

[1] http://thread.gmane.org/gmane.linux.kernel.mm/96473

Fixes: 108d6642ad81 ("mm anon rmap: remove anon_vma_moveto_tail")

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Acked-by: Michel Lespinasse <walken@google.com>
Cc: Dave Jones <davej@redhat.com>
Cc: David Miller <davem@davemloft.net>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/mremap.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/mm/mremap.c b/mm/mremap.c
index 0843feb66f3d..05f1180e9f21 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -194,10 +194,17 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
 			break;
 		if (pmd_trans_huge(*old_pmd)) {
 			int err = 0;
-			if (extent == HPAGE_PMD_SIZE)
+			if (extent == HPAGE_PMD_SIZE) {
+				VM_BUG_ON(vma->vm_file || !vma->anon_vma);
+				/* See comment in move_ptes() */
+				if (need_rmap_locks)
+					anon_vma_lock_write(vma->anon_vma);
 				err = move_huge_pmd(vma, new_vma, old_addr,
 						    new_addr, old_end,
 						    old_pmd, new_pmd);
+				if (need_rmap_locks)
+					anon_vma_unlock_write(vma->anon_vma);
+			}
 			if (err > 0) {
 				need_flush = true;
 				continue;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 030/146] x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (28 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 029/146] mm, thp: close race between mremap() and split_huge_page() Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 031/146] arm64: fix pud_huge() for 2-level pagetables Jiri Slaby
                   ` (117 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Anthony Iliopoulos, H. Peter Anvin, Jiri Slaby

From: Anthony Iliopoulos <anthony.iliopoulos@huawei.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 9844f5462392b53824e8b86726e7c33b5ecbb676 upstream.

The invalidation is required in order to maintain proper semantics
under CoW conditions. In scenarios where a process clones several
threads, a thread operating on a core whose DTLB entry for a
particular hugepage has not been invalidated, will be reading from
the hugepage that belongs to the forked child process, even after
hugetlb_cow().

The thread will not see the updated page as long as the stale DTLB
entry remains cached, the thread attempts to write into the page,
the child process exits, or the thread gets migrated to a different
processor.

Signed-off-by: Anthony Iliopoulos <anthony.iliopoulos@huawei.com>
Link: http://lkml.kernel.org/r/20140514092948.GA17391@server-36.huawei.corp
Suggested-by: Shay Goikhman <shay.goikhman@huawei.com>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/include/asm/hugetlb.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
index a8091216963b..68c05398bba9 100644
--- a/arch/x86/include/asm/hugetlb.h
+++ b/arch/x86/include/asm/hugetlb.h
@@ -52,6 +52,7 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
 static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
 					 unsigned long addr, pte_t *ptep)
 {
+	ptep_clear_flush(vma, addr, ptep);
 }
 
 static inline int huge_pte_none(pte_t pte)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 031/146] arm64: fix pud_huge() for 2-level pagetables
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (29 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 030/146] x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow() Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 032/146] hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage Jiri Slaby
                   ` (116 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Mark Salter, Catalin Marinas, Jiri Slaby

From: Mark Salter <msalter@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 4797ec2dc83a43be35bad56037d1b53db9e2b5d5 upstream.

The following happens when trying to run a kvm guest on a kernel
configured for 64k pages. This doesn't happen with 4k pages:

  BUG: failure at include/linux/mm.h:297/put_page_testzero()!
  Kernel panic - not syncing: BUG!
  CPU: 2 PID: 4228 Comm: qemu-system-aar Tainted: GF            3.13.0-0.rc7.31.sa2.k32v1.aarch64.debug #1
  Call trace:
  [<fffffe0000096034>] dump_backtrace+0x0/0x16c
  [<fffffe00000961b4>] show_stack+0x14/0x1c
  [<fffffe000066e648>] dump_stack+0x84/0xb0
  [<fffffe0000668678>] panic+0xf4/0x220
  [<fffffe000018ec78>] free_reserved_area+0x0/0x110
  [<fffffe000018edd8>] free_pages+0x50/0x88
  [<fffffe00000a759c>] kvm_free_stage2_pgd+0x30/0x40
  [<fffffe00000a5354>] kvm_arch_destroy_vm+0x18/0x44
  [<fffffe00000a1854>] kvm_put_kvm+0xf0/0x184
  [<fffffe00000a1938>] kvm_vm_release+0x10/0x1c
  [<fffffe00001edc1c>] __fput+0xb0/0x288
  [<fffffe00001ede4c>] ____fput+0xc/0x14
  [<fffffe00000d5a2c>] task_work_run+0xa8/0x11c
  [<fffffe0000095c14>] do_notify_resume+0x54/0x58

In arch/arm/kvm/mmu.c:unmap_range(), we end up doing an extra put_page()
on the stage2 pgd which leads to the BUG in put_page_testzero(). This
happens because a pud_huge() test in unmap_range() returns true when it
should always be false with 2-level pages tables used by 64k pages.
This patch removes support for huge puds if 2-level pagetables are
being used.

Signed-off-by: Mark Salter <msalter@redhat.com>
[catalin.marinas@arm.com: removed #ifndef around PUD_SIZE check]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm64/mm/hugetlbpage.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index 5e9aec358306..31eb959e9aa8 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -51,7 +51,11 @@ int pmd_huge(pmd_t pmd)
 
 int pud_huge(pud_t pud)
 {
+#ifndef __PAGETABLE_PMD_FOLDED
 	return !(pud_val(pud) & PUD_TABLE_BIT);
+#else
+	return 0;
+#endif
 }
 
 int pmd_huge_support(void)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 032/146] hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (30 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 031/146] arm64: fix pud_huge() for 2-level pagetables Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 033/146] aio: fix potential leak in aio_run_iocb() Jiri Slaby
                   ` (115 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Chen Yucong, Andrew Morton, Linus Torvalds, Jiri Slaby

From: Chen Yucong <slaoub@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit b985194c8c0a130ed155b71662e39f7eaea4876f upstream.

For handling a free hugepage in memory failure, the race will happen if
another thread hwpoisoned this hugepage concurrently.  So we need to
check PageHWPoison instead of !PageHWPoison.

If hwpoison_filter(p) returns true or a race happens, then we need to
unlock_page(hpage).

Signed-off-by: Chen Yucong <slaoub@gmail.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Tested-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/memory-failure.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 5ea3cf734138..9f1b0ff6cb65 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1085,15 +1085,16 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
 			return 0;
 		} else if (PageHuge(hpage)) {
 			/*
-			 * Check "just unpoisoned", "filter hit", and
-			 * "race with other subpage."
+			 * Check "filter hit" and "race with other subpage."
 			 */
 			lock_page(hpage);
-			if (!PageHWPoison(hpage)
-			    || (hwpoison_filter(p) && TestClearPageHWPoison(p))
-			    || (p != hpage && TestSetPageHWPoison(hpage))) {
-				atomic_long_sub(nr_pages, &num_poisoned_pages);
-				return 0;
+			if (PageHWPoison(hpage)) {
+				if ((hwpoison_filter(p) && TestClearPageHWPoison(p))
+				    || (p != hpage && TestSetPageHWPoison(hpage))) {
+					atomic_long_sub(nr_pages, &num_poisoned_pages);
+					unlock_page(hpage);
+					return 0;
+				}
 			}
 			set_page_hwpoison_huge_page(hpage);
 			res = dequeue_hwpoisoned_huge_page(hpage);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 033/146] aio: fix potential leak in aio_run_iocb().
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (31 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 032/146] hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 034/146] hwmon: (emc1403) fix inverted store_hyst() Jiri Slaby
                   ` (114 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Leon Yu, Benjamin LaHaise, Jiri Slaby

From: Leon Yu <chianglungyu@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 754320d6e166d3a12cb4810a452bde00afbd4e9a upstream.

iovec should be reclaimed whenever caller of rw_copy_check_uvector() returns,
but it doesn't hold when failure happens right after aio_setup_vectored_rw().

Fix that in a such way to avoid hairy goto.

Signed-off-by: Leon Yu <chianglungyu@gmail.com>
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/aio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 12a3de0ee6da..04cd7686555d 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1299,10 +1299,8 @@ rw_common:
 						&iovec, compat)
 			: aio_setup_single_vector(req, rw, buf, &nr_segs,
 						  iovec);
-		if (ret)
-			return ret;
-
-		ret = rw_verify_area(rw, file, &req->ki_pos, req->ki_nbytes);
+		if (!ret)
+			ret = rw_verify_area(rw, file, &req->ki_pos, req->ki_nbytes);
 		if (ret < 0) {
 			if (iovec != &inline_vec)
 				kfree(iovec);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 034/146] hwmon: (emc1403) fix inverted store_hyst()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (32 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 033/146] aio: fix potential leak in aio_run_iocb() Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 035/146] hwmon: (emc1403) Support full range of known chip revision numbers Jiri Slaby
                   ` (113 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Josef Gajdusek, Guenter Roeck, Jiri Slaby

From: Josef Gajdusek <atx@atx.name>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 17c048fc4bd95efea208a1920f169547d8588f1f upstream.

Attempts to set the hysteresis value to a temperature below the target
limit fails with "write error: Numerical result out of range" due to
an inverted comparison.

Signed-off-by: Josef Gajdusek <atx@atx.name>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
[Guenter Roeck: Updated headline and description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/emc1403.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
index 142e1cb8dea7..62fba71ef3c5 100644
--- a/drivers/hwmon/emc1403.c
+++ b/drivers/hwmon/emc1403.c
@@ -162,7 +162,7 @@ static ssize_t store_hyst(struct device *dev,
 	if (retval < 0)
 		goto fail;
 
-	hyst = val - retval * 1000;
+	hyst = retval * 1000 - val;
 	hyst = DIV_ROUND_CLOSEST(hyst, 1000);
 	if (hyst < 0 || hyst > 255) {
 		retval = -ERANGE;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 035/146] hwmon: (emc1403) Support full range of known chip revision numbers
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (33 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 034/146] hwmon: (emc1403) fix inverted store_hyst() Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 036/146] drivercore: deferral race condition fix Jiri Slaby
                   ` (112 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Josef Gajdusek, Guenter Roeck, Jiri Slaby

From: Josef Gajdusek <atx@atx.name>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 3a18e1398fc2dc9c32bbdc50664da3a77959a8d1 upstream.

The datasheet for EMC1413/EMC1414, which is fully compatible to
EMC1403/1404 and uses the same chip identification, references revision
numbers 0x01, 0x03, and 0x04. Accept the full range of revision numbers
from 0x01 to 0x04 to make sure none are missed.

Signed-off-by: Josef Gajdusek <atx@atx.name>
[Guenter Roeck: Updated headline and description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/hwmon/emc1403.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
index 62fba71ef3c5..361f50b221bd 100644
--- a/drivers/hwmon/emc1403.c
+++ b/drivers/hwmon/emc1403.c
@@ -295,7 +295,7 @@ static int emc1403_detect(struct i2c_client *client,
 	}
 
 	id = i2c_smbus_read_byte_data(client, THERMAL_REVISION_REG);
-	if (id != 0x01)
+	if (id < 0x01 || id > 0x04)
 		return -ENODEV;
 
 	return 0;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 036/146] drivercore: deferral race condition fix
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (34 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 035/146] hwmon: (emc1403) Support full range of known chip revision numbers Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 037/146] hrtimer: Prevent all reprogramming if hang detected Jiri Slaby
                   ` (111 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Grant Likely, Mark Brown, Jiri Slaby

From: Grant Likely <grant.likely@linaro.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 58b116bce13612e5aa6fcd49ecbd4cf8bb59e835 upstream.

When the kernel is built with CONFIG_PREEMPT it is possible to reach a state
when all modules loaded but some driver still stuck in the deferred list
and there is a need for external event to kick the deferred queue to probe
these drivers.

The issue has been observed on embedded systems with CONFIG_PREEMPT enabled,
audio support built as modules and using nfsroot for root filesystem.

The following log fragment shows such sequence when all audio modules
were loaded but the sound card is not present since the machine driver has
failed to probe due to missing dependency during it's probe.
The board is am335x-evmsk (McASP<->tlv320aic3106 codec) with davinci-evm
machine driver:

...
[   12.615118] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: ENTER
[   12.719969] davinci_evm sound.3: davinci_evm_probe: ENTER
[   12.725753] davinci_evm sound.3: davinci_evm_probe: snd_soc_register_card
[   12.753846] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: snd_soc_register_component
[   12.922051] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: snd_soc_register_component DONE
[   12.950839] davinci_evm sound.3: ASoC: platform (null) not registered
[   12.957898] davinci_evm sound.3: davinci_evm_probe: snd_soc_register_card DONE (-517)
[   13.099026] davinci-mcasp 4803c000.mcasp: Kicking the deferred list
[   13.177838] davinci-mcasp 4803c000.mcasp: really_probe: probe_count = 2
[   13.194130] davinci_evm sound.3: snd_soc_register_card failed (-517)
[   13.346755] davinci_mcasp_driver_init: LEAVE
[   13.377446] platform sound.3: Driver davinci_evm requests probe deferral
[   13.592527] platform sound.3: really_probe: probe_count = 0

In the log the machine driver enters it's probe at 12.719969 (this point it
has been removed from the deferred lists). McASP driver already executing
it's probing (since 12.615118).
The machine driver tries to construct the sound card (12.950839) but did
not found one of the components so it fails. After this McASP driver
registers all the ASoC components (the machine driver still in it's probe
function after it failed to construct the card) and the deferred work is
prepared at 13.099026 (note that this time the machine driver is not in the
lists so it is not going to be handled when the work is executing).
Lastly the machine driver exit from it's probe and the core places it to
the deferred list but there will be no other driver going to load and the
deferred queue is not going to be kicked again - till we have external event
like connecting USB stick, etc.

The proposed solution is to try the deferred queue once more when the last
driver is asking for deferring and we had drivers loaded while this last
driver was probing.

This way we can avoid drivers stuck in the deferred queue.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/base/dd.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 06051767393f..8a8d611f2021 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -52,6 +52,7 @@ static DEFINE_MUTEX(deferred_probe_mutex);
 static LIST_HEAD(deferred_probe_pending_list);
 static LIST_HEAD(deferred_probe_active_list);
 static struct workqueue_struct *deferred_wq;
+static atomic_t deferred_trigger_count = ATOMIC_INIT(0);
 
 /**
  * deferred_probe_work_func() - Retry probing devices in the active list.
@@ -135,6 +136,17 @@ static bool driver_deferred_probe_enable = false;
  * This functions moves all devices from the pending list to the active
  * list and schedules the deferred probe workqueue to process them.  It
  * should be called anytime a driver is successfully bound to a device.
+ *
+ * Note, there is a race condition in multi-threaded probe. In the case where
+ * more than one device is probing at the same time, it is possible for one
+ * probe to complete successfully while another is about to defer. If the second
+ * depends on the first, then it will get put on the pending list after the
+ * trigger event has already occured and will be stuck there.
+ *
+ * The atomic 'deferred_trigger_count' is used to determine if a successful
+ * trigger has occurred in the midst of probing a driver. If the trigger count
+ * changes in the midst of a probe, then deferred processing should be triggered
+ * again.
  */
 static void driver_deferred_probe_trigger(void)
 {
@@ -147,6 +159,7 @@ static void driver_deferred_probe_trigger(void)
 	 * into the active list so they can be retried by the workqueue
 	 */
 	mutex_lock(&deferred_probe_mutex);
+	atomic_inc(&deferred_trigger_count);
 	list_splice_tail_init(&deferred_probe_pending_list,
 			      &deferred_probe_active_list);
 	mutex_unlock(&deferred_probe_mutex);
@@ -265,6 +278,7 @@ static DECLARE_WAIT_QUEUE_HEAD(probe_waitqueue);
 static int really_probe(struct device *dev, struct device_driver *drv)
 {
 	int ret = 0;
+	int local_trigger_count = atomic_read(&deferred_trigger_count);
 
 	atomic_inc(&probe_count);
 	pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
@@ -310,6 +324,9 @@ probe_failed:
 		/* Driver requested deferred probing */
 		dev_info(dev, "Driver %s requests probe deferral\n", drv->name);
 		driver_deferred_probe_add(dev);
+		/* Did a trigger occur while probing? Need to re-trigger if yes */
+		if (local_trigger_count != atomic_read(&deferred_trigger_count))
+			driver_deferred_probe_trigger();
 	} else if (ret != -ENODEV && ret != -ENXIO) {
 		/* driver matched but the probe failed */
 		printk(KERN_WARNING
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 037/146] hrtimer: Prevent all reprogramming if hang detected
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (35 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 036/146] drivercore: deferral race condition fix Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 038/146] hrtimer: Prevent remote enqueue of leftmost timers Jiri Slaby
                   ` (110 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Stuart Hayes, Thomas Gleixner, Jiri Slaby

From: Stuart Hayes <stuart.w.hayes@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 6c6c0d5a1c949d2e084706f9e5fb1fccc175b265 upstream.

If the last hrtimer interrupt detected a hang it sets hang_detected=1
and programs the clock event device with a delay to let the system
make progress.

If hang_detected == 1, we prevent reprogramming of the clock event
device in hrtimer_reprogram() but not in hrtimer_force_reprogram().

This can lead to the following situation:

hrtimer_interrupt()
   hang_detected = 1;
   program ce device to Xms from now (hang delay)

We have two timers pending:
   T1 expires 50ms from now
   T2 expires 5s from now

Now T1 gets canceled, which causes hrtimer_force_reprogram() to be
invoked, which in turn programs the clock event device to T2 (5
seconds from now).

Any hrtimer_start after that will not reprogram the hardware due to
hang_detected still being set. So we effectivly block all timers until
the T2 event fires and cleans up the hang situation.

Add a check for hang_detected to hrtimer_force_reprogram() which
prevents the reprogramming of the hang delay in the hardware
timer. The subsequent hrtimer_interrupt will resolve all outstanding
issues.

[ tglx: Rewrote subject and changelog and fixed up the comment in
  	hrtimer_force_reprogram() ]

Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
Link: http://lkml.kernel.org/r/53602DC6.2060101@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/hrtimer.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 383319bae3f7..0d6df7b8cf46 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -581,6 +581,23 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal)
 
 	cpu_base->expires_next.tv64 = expires_next.tv64;
 
+	/*
+	 * If a hang was detected in the last timer interrupt then we
+	 * leave the hang delay active in the hardware. We want the
+	 * system to make progress. That also prevents the following
+	 * scenario:
+	 * T1 expires 50ms from now
+	 * T2 expires 5s from now
+	 *
+	 * T1 is removed, so this code is called and would reprogram
+	 * the hardware to 5s from now. Any hrtimer_start after that
+	 * will not reprogram the hardware due to hang_detected being
+	 * set. So we'd effectivly block all timers until the T2 event
+	 * fires.
+	 */
+	if (cpu_base->hang_detected)
+		return;
+
 	if (cpu_base->expires_next.tv64 != KTIME_MAX)
 		tick_program_event(cpu_base->expires_next, 1);
 }
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 038/146] hrtimer: Prevent remote enqueue of leftmost timers
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (36 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 037/146] hrtimer: Prevent all reprogramming if hang detected Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 039/146] hrtimer: Set expiry time before switch_hrtimer_base() Jiri Slaby
                   ` (109 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Leon Ma, Thomas Gleixner, Jiri Slaby

From: Leon Ma <xindong.ma@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 012a45e3f4af68e86d85cce060c6c2fed56498b2 upstream.

If a cpu is idle and starts an hrtimer which is not pinned on that
same cpu, the nohz code might target the timer to a different cpu.

In the case that we switch the cpu base of the timer we already have a
sanity check in place, which determines whether the timer is earlier
than the current leftmost timer on the target cpu. In that case we
enqueue the timer on the current cpu because we cannot reprogram the
clock event device on the target.

If the timers base is already the target CPU we do not have this
sanity check in place so we enqueue the timer as the leftmost timer in
the target cpus rb tree, but we cannot reprogram the clock event
device on the target cpu. So the timer expires late and subsequently
prevents the reprogramming of the target cpu clock event device until
the previously programmed event fires or a timer with an earlier
expiry time gets enqueued on the target cpu itself.

Add the same target check as we have for the switch base case and
start the timer on the current cpu if it would become the leftmost
timer on the target.

[ tglx: Rewrote subject and changelog ]

Signed-off-by: Leon Ma <xindong.ma@intel.com>
Link: http://lkml.kernel.org/r/1398847391-5994-1-git-send-email-xindong.ma@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/hrtimer.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 0d6df7b8cf46..6de65d8a70e2 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -246,6 +246,11 @@ again:
 			goto again;
 		}
 		timer->base = new_base;
+	} else {
+		if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) {
+			cpu = this_cpu;
+			goto again;
+		}
 	}
 	return new_base;
 }
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 039/146] hrtimer: Set expiry time before switch_hrtimer_base()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (37 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 038/146] hrtimer: Prevent remote enqueue of leftmost timers Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 040/146] md: avoid possible spinning md thread at shutdown Jiri Slaby
                   ` (108 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Viresh Kumar, linaro-kernel, linaro-networking,
	fweisbec, arvind.chauhan, Thomas Gleixner, Jiri Slaby

From: Viresh Kumar <viresh.kumar@linaro.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 84ea7fe37908254c3bd90910921f6e1045c1747a upstream.

switch_hrtimer_base() calls hrtimer_check_target() which ensures that
we do not migrate a timer to a remote cpu if the timer expires before
the current programmed expiry time on that remote cpu.

But __hrtimer_start_range_ns() calls switch_hrtimer_base() before the
new expiry time is set. So the sanity check in hrtimer_check_target()
is operating on stale or even uninitialized data.

Update expiry time before calling switch_hrtimer_base().

[ tglx: Rewrote changelog once again ]

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org
Cc: linaro-networking@linaro.org
Cc: fweisbec@gmail.com
Cc: arvind.chauhan@arm.com
Link: http://lkml.kernel.org/r/81999e148745fc51bbcd0615823fbab9b2e87e23.1399882253.git.viresh.kumar@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/hrtimer.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 6de65d8a70e2..aa149222cd8e 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1002,11 +1002,8 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
 	/* Remove an active timer from the queue: */
 	ret = remove_hrtimer(timer, base);
 
-	/* Switch the timer base, if necessary: */
-	new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);
-
 	if (mode & HRTIMER_MODE_REL) {
-		tim = ktime_add_safe(tim, new_base->get_time());
+		tim = ktime_add_safe(tim, base->get_time());
 		/*
 		 * CONFIG_TIME_LOW_RES is a temporary way for architectures
 		 * to signal that they simply return xtime in
@@ -1021,6 +1018,9 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
 
 	hrtimer_set_expires_range_ns(timer, tim, delta_ns);
 
+	/* Switch the timer base, if necessary: */
+	new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);
+
 	timer_stats_hrtimer_set_start_info(timer);
 
 	leftmost = enqueue_hrtimer(timer, new_base);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 040/146] md: avoid possible spinning md thread at shutdown.
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (38 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 039/146] hrtimer: Set expiry time before switch_hrtimer_base() Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 041/146] drm/i915: Don't check gmch state on inherited configs Jiri Slaby
                   ` (107 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, NeilBrown, Jiri Slaby

From: NeilBrown <neilb@suse.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 0f62fb220aa4ebabe8547d3a9ce4a16d3c045f21 upstream.

If an md array with externally managed metadata (e.g. DDF or IMSM)
is in use, then we should not set safemode==2 at shutdown because:

1/ this is ineffective: user-space need to be involved in any 'safemode' handling,
2/ The safemode management code doesn't cope with safemode==2 on external metadata
   and md_check_recover enters an infinite loop.

Even at shutdown, an infinite-looping process can be problematic, so this
could cause shutdown to hang.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/md/md.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 015bc455cf1c..0ed6daf3b1e4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8520,7 +8520,8 @@ static int md_notify_reboot(struct notifier_block *this,
 		if (mddev_trylock(mddev)) {
 			if (mddev->pers)
 				__md_stop_writes(mddev);
-			mddev->safemode = 2;
+			if (mddev->persistent)
+				mddev->safemode = 2;
 			mddev_unlock(mddev);
 		}
 		need_delay = 1;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 041/146] drm/i915: Don't check gmch state on inherited configs
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (39 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 040/146] md: avoid possible spinning md thread at shutdown Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 042/146] drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc() Jiri Slaby
                   ` (106 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Daniel Vetter, Alan Stern, Jani Nikula, Jiri Slaby

From: Daniel Vetter <daniel.vetter@ffwll.ch>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 9953599bc02dbc1d3330e6a0bfc6c50e9dffcac6 upstream.

... our current modeset code isn't good enough yet to handle this. The
scenario is:

1. BIOS sets up a cloned config with lvds+external screen on the same
pipe, e.g. pipe B.

2. We read out that state for pipe B and assign the gmch_pfit state to
it.

3. The initial modeset switches the lvds to pipe A but due to lack of
atomic modeset we don't recompute the config of pipe B.

-> both pipes now claim (in the sw pipe config structure) to use the
gmch_pfit, which just won't work.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74081
Tested-by: max <manikulin@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/i915/intel_display.c | 23 ++++++++++++++++++-----
 drivers/gpu/drm/i915/intel_drv.h     |  3 ++-
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5aa836e6e190..48a4faf5e63a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8688,11 +8688,22 @@ intel_pipe_config_compare(struct drm_device *dev,
 	PIPE_CONF_CHECK_I(requested_mode.hdisplay);
 	PIPE_CONF_CHECK_I(requested_mode.vdisplay);
 
-	PIPE_CONF_CHECK_I(gmch_pfit.control);
-	/* pfit ratios are autocomputed by the hw on gen4+ */
-	if (INTEL_INFO(dev)->gen < 4)
-		PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios);
-	PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits);
+	/*
+	 * FIXME: BIOS likes to set up a cloned config with lvds+external
+	 * screen. Since we don't yet re-compute the pipe config when moving
+	 * just the lvds port away to another pipe the sw tracking won't match.
+	 *
+	 * Proper atomic modesets with recomputed global state will fix this.
+	 * Until then just don't check gmch state for inherited modes.
+	 */
+	if (!PIPE_CONF_QUIRK(PIPE_CONFIG_QUIRK_INHERITED_MODE)) {
+		PIPE_CONF_CHECK_I(gmch_pfit.control);
+		/* pfit ratios are autocomputed by the hw on gen4+ */
+		if (INTEL_INFO(dev)->gen < 4)
+			PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios);
+		PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits);
+	}
+
 	PIPE_CONF_CHECK_I(pch_pfit.enabled);
 	if (current_config->pch_pfit.enabled) {
 		PIPE_CONF_CHECK_I(pch_pfit.pos);
@@ -10443,6 +10454,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 			    base.head) {
 		memset(&crtc->config, 0, sizeof(crtc->config));
 
+		crtc->config.quirks |= PIPE_CONFIG_QUIRK_INHERITED_MODE;
+
 		crtc->active = dev_priv->display.get_pipe_config(crtc,
 								 &crtc->config);
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 7f2b384ac939..569c0c5ca450 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -204,7 +204,8 @@ struct intel_crtc_config {
 	 * tracked with quirk flags so that fastboot and state checker can act
 	 * accordingly.
 	 */
-#define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */
+#define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS	(1<<0) /* unreliable sync mode.flags */
+#define PIPE_CONFIG_QUIRK_INHERITED_MODE	(1<<1) /* mode inherited from firmware */
 	unsigned long quirks;
 
 	struct drm_display_mode requested_mode;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 042/146] drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (40 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 041/146] drm/i915: Don't check gmch state on inherited configs Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 043/146] drm/radeon: disable mclk dpm on R7 260X Jiri Slaby
                   ` (105 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Egbert Eich, Jani Nikula, Jani Nikula, Jiri Slaby

From: Egbert Eich <eich@suse.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 7f1950fbb989e8fc5463b307e062b4529d51c862 upstream.

Depending on the SDVO output_flags SDVO may have multiple connectors
linking to the same encoder (in intel_connector->encoder->base).
Only one of those connectors should be active (ie link to the encoder
thru drm_connector->encoder).
If intel_connector_break_all_links() is called from intel_sanitize_crtc()
we may break the crtc connection of an encoder thru an inactive connector
in which case intel_connector_break_all_links() will not be called again
for the active connector if this happens to come later in the list due to:
    if (connector->encoder->base.crtc != &crtc->base)
                                 continue;
in intel_sanitize_crtc().
This will however leave the drm_connector->encoder linkage for this
active connector in place. Subsequently this will cause multiple
warnings in intel_connector_check_state() to trigger and the driver
will eventually die in drm_encoder_crtc_ok() (because of crtc == NULL).

To avoid this remove intel_connector_break_all_links() and move its
code to its two calling functions: intel_sanitize_crtc() and
intel_sanitize_encoder().
This allows to implement the link breaking more flexibly matching
the surrounding code: ie. in intel_sanitize_crtc() we can break the
crtc link separatly after the links to the encoders have been
broken which avoids above problem.

This regression has been introduced in:

commit 24929352481f085c5f85d4d4cbc919ddf106d381
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Jul 2 20:28:59 2012 +0200

    drm/i915: read out the modeset hw state at load and resume time

so goes back to the very beginning of the modeset rework.

v2: This patch takes care of the concernes voiced by Chris Wilson
and Daniel Vetter that only breaking links if the drm_connector
is linked to an encoder may miss some links.
v3: move all encoder handling to encoder loop as suggested by
Daniel Vetter.

Signed-off-by: Egbert Eich <eich@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/i915/intel_display.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 48a4faf5e63a..c74bf330d290 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10239,15 +10239,6 @@ void intel_modeset_init(struct drm_device *dev)
 	intel_disable_fbc(dev);
 }
 
-static void
-intel_connector_break_all_links(struct intel_connector *connector)
-{
-	connector->base.dpms = DRM_MODE_DPMS_OFF;
-	connector->base.encoder = NULL;
-	connector->encoder->connectors_active = false;
-	connector->encoder->base.crtc = NULL;
-}
-
 static void intel_enable_pipe_a(struct drm_device *dev)
 {
 	struct intel_connector *connector;
@@ -10329,8 +10320,17 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
 			if (connector->encoder->base.crtc != &crtc->base)
 				continue;
 
-			intel_connector_break_all_links(connector);
+			connector->base.dpms = DRM_MODE_DPMS_OFF;
+			connector->base.encoder = NULL;
 		}
+		/* multiple connectors may have the same encoder:
+		 *  handle them and break crtc link separately */
+		list_for_each_entry(connector, &dev->mode_config.connector_list,
+				    base.head)
+			if (connector->encoder->base.crtc == &crtc->base) {
+				connector->encoder->base.crtc = NULL;
+				connector->encoder->connectors_active = false;
+			}
 
 		WARN_ON(crtc->active);
 		crtc->base.enabled = false;
@@ -10401,6 +10401,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
 				      drm_get_encoder_name(&encoder->base));
 			encoder->disable(encoder);
 		}
+		encoder->base.crtc = NULL;
+		encoder->connectors_active = false;
 
 		/* Inconsistent output/port/pipe state happens presumably due to
 		 * a bug in one of the get_hw_state functions. Or someplace else
@@ -10411,8 +10413,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
 				    base.head) {
 			if (connector->encoder != encoder)
 				continue;
-
-			intel_connector_break_all_links(connector);
+			connector->base.dpms = DRM_MODE_DPMS_OFF;
+			connector->base.encoder = NULL;
 		}
 	}
 	/* Enabled encoders without active connectors will be fixed in
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 043/146] drm/radeon: disable mclk dpm on R7 260X
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (41 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 042/146] drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc() Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 044/146] drm/radeon: add support for newer mc ucode on SI (v2) Jiri Slaby
                   ` (104 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alex Deucher, Alex Deucher, Jiri Slaby

From: Alex Deucher <alexdeucher@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 57700ad1f2f21d5d7ab7ee0e58d11b5954852434 upstream.

Setting higher mclks seems to cause stability issues
on some R7 260X boards.  Disable it for now for stability
until we find a proper fix.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=75992

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/ci_dpm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index 51e947a97edf..79682ff51b63 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -5098,6 +5098,10 @@ int ci_dpm_init(struct radeon_device *rdev)
 	pi->mclk_dpm_key_disabled = 0;
 	pi->pcie_dpm_key_disabled = 0;
 
+	/* mclk dpm is unstable on some R7 260X cards */
+	if (rdev->pdev->device == 0x6658)
+		pi->mclk_dpm_key_disabled = 1;
+
 	pi->caps_sclk_ds = true;
 
 	pi->mclk_strobe_mode_threshold = 40000;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 044/146] drm/radeon: add support for newer mc ucode on SI (v2)
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (42 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 043/146] drm/radeon: disable mclk dpm on R7 260X Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 045/146] drm/radeon/si: make sure mc ucode is loaded before checking the size Jiri Slaby
                   ` (103 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alex Deucher, Alex Deucher, Jiri Slaby

From: Alex Deucher <alexdeucher@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 1ebe92802eaf0569784dce843bc28a78842d236c upstream.

May fix stability issues with some newer cards.

v2: print out mc firmware version used and size

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/radeon_ucode.h |  3 +++
 drivers/gpu/drm/radeon/si.c           | 35 ++++++++++++++++++++++-------------
 2 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_ucode.h b/drivers/gpu/drm/radeon/radeon_ucode.h
index 33858364fe89..7e48c359b04c 100644
--- a/drivers/gpu/drm/radeon/radeon_ucode.h
+++ b/drivers/gpu/drm/radeon/radeon_ucode.h
@@ -57,6 +57,9 @@
 #define BTC_MC_UCODE_SIZE            6024
 #define CAYMAN_MC_UCODE_SIZE         6037
 #define SI_MC_UCODE_SIZE             7769
+#define TAHITI_MC_UCODE_SIZE         7808
+#define PITCAIRN_MC_UCODE_SIZE       7775
+#define VERDE_MC_UCODE_SIZE          7875
 #define OLAND_MC_UCODE_SIZE          7863
 #define CIK_MC_UCODE_SIZE            7866
 
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 873e0a608948..de0c2bfcc7fc 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -39,30 +39,35 @@ MODULE_FIRMWARE("radeon/TAHITI_pfp.bin");
 MODULE_FIRMWARE("radeon/TAHITI_me.bin");
 MODULE_FIRMWARE("radeon/TAHITI_ce.bin");
 MODULE_FIRMWARE("radeon/TAHITI_mc.bin");
+MODULE_FIRMWARE("radeon/TAHITI_mc2.bin");
 MODULE_FIRMWARE("radeon/TAHITI_rlc.bin");
 MODULE_FIRMWARE("radeon/TAHITI_smc.bin");
 MODULE_FIRMWARE("radeon/PITCAIRN_pfp.bin");
 MODULE_FIRMWARE("radeon/PITCAIRN_me.bin");
 MODULE_FIRMWARE("radeon/PITCAIRN_ce.bin");
 MODULE_FIRMWARE("radeon/PITCAIRN_mc.bin");
+MODULE_FIRMWARE("radeon/PITCAIRN_mc2.bin");
 MODULE_FIRMWARE("radeon/PITCAIRN_rlc.bin");
 MODULE_FIRMWARE("radeon/PITCAIRN_smc.bin");
 MODULE_FIRMWARE("radeon/VERDE_pfp.bin");
 MODULE_FIRMWARE("radeon/VERDE_me.bin");
 MODULE_FIRMWARE("radeon/VERDE_ce.bin");
 MODULE_FIRMWARE("radeon/VERDE_mc.bin");
+MODULE_FIRMWARE("radeon/VERDE_mc2.bin");
 MODULE_FIRMWARE("radeon/VERDE_rlc.bin");
 MODULE_FIRMWARE("radeon/VERDE_smc.bin");
 MODULE_FIRMWARE("radeon/OLAND_pfp.bin");
 MODULE_FIRMWARE("radeon/OLAND_me.bin");
 MODULE_FIRMWARE("radeon/OLAND_ce.bin");
 MODULE_FIRMWARE("radeon/OLAND_mc.bin");
+MODULE_FIRMWARE("radeon/OLAND_mc2.bin");
 MODULE_FIRMWARE("radeon/OLAND_rlc.bin");
 MODULE_FIRMWARE("radeon/OLAND_smc.bin");
 MODULE_FIRMWARE("radeon/HAINAN_pfp.bin");
 MODULE_FIRMWARE("radeon/HAINAN_me.bin");
 MODULE_FIRMWARE("radeon/HAINAN_ce.bin");
 MODULE_FIRMWARE("radeon/HAINAN_mc.bin");
+MODULE_FIRMWARE("radeon/HAINAN_mc2.bin");
 MODULE_FIRMWARE("radeon/HAINAN_rlc.bin");
 MODULE_FIRMWARE("radeon/HAINAN_smc.bin");
 
@@ -1470,7 +1475,7 @@ static int si_mc_load_microcode(struct radeon_device *rdev)
 	const __be32 *fw_data;
 	u32 running, blackout = 0;
 	u32 *io_mc_regs;
-	int i, ucode_size, regs_size;
+	int i, regs_size, ucode_size = rdev->mc_fw->size / 4;
 
 	if (!rdev->mc_fw)
 		return -EINVAL;
@@ -1478,28 +1483,23 @@ static int si_mc_load_microcode(struct radeon_device *rdev)
 	switch (rdev->family) {
 	case CHIP_TAHITI:
 		io_mc_regs = (u32 *)&tahiti_io_mc_regs;
-		ucode_size = SI_MC_UCODE_SIZE;
 		regs_size = TAHITI_IO_MC_REGS_SIZE;
 		break;
 	case CHIP_PITCAIRN:
 		io_mc_regs = (u32 *)&pitcairn_io_mc_regs;
-		ucode_size = SI_MC_UCODE_SIZE;
 		regs_size = TAHITI_IO_MC_REGS_SIZE;
 		break;
 	case CHIP_VERDE:
 	default:
 		io_mc_regs = (u32 *)&verde_io_mc_regs;
-		ucode_size = SI_MC_UCODE_SIZE;
 		regs_size = TAHITI_IO_MC_REGS_SIZE;
 		break;
 	case CHIP_OLAND:
 		io_mc_regs = (u32 *)&oland_io_mc_regs;
-		ucode_size = OLAND_MC_UCODE_SIZE;
 		regs_size = TAHITI_IO_MC_REGS_SIZE;
 		break;
 	case CHIP_HAINAN:
 		io_mc_regs = (u32 *)&hainan_io_mc_regs;
-		ucode_size = OLAND_MC_UCODE_SIZE;
 		regs_size = TAHITI_IO_MC_REGS_SIZE;
 		break;
 	}
@@ -1555,7 +1555,7 @@ static int si_init_microcode(struct radeon_device *rdev)
 	const char *chip_name;
 	const char *rlc_chip_name;
 	size_t pfp_req_size, me_req_size, ce_req_size, rlc_req_size, mc_req_size;
-	size_t smc_req_size;
+	size_t smc_req_size, mc2_req_size;
 	char fw_name[30];
 	int err;
 
@@ -1570,6 +1570,7 @@ static int si_init_microcode(struct radeon_device *rdev)
 		ce_req_size = SI_CE_UCODE_SIZE * 4;
 		rlc_req_size = SI_RLC_UCODE_SIZE * 4;
 		mc_req_size = SI_MC_UCODE_SIZE * 4;
+		mc2_req_size = TAHITI_MC_UCODE_SIZE * 4;
 		smc_req_size = ALIGN(TAHITI_SMC_UCODE_SIZE, 4);
 		break;
 	case CHIP_PITCAIRN:
@@ -1580,6 +1581,7 @@ static int si_init_microcode(struct radeon_device *rdev)
 		ce_req_size = SI_CE_UCODE_SIZE * 4;
 		rlc_req_size = SI_RLC_UCODE_SIZE * 4;
 		mc_req_size = SI_MC_UCODE_SIZE * 4;
+		mc2_req_size = PITCAIRN_MC_UCODE_SIZE * 4;
 		smc_req_size = ALIGN(PITCAIRN_SMC_UCODE_SIZE, 4);
 		break;
 	case CHIP_VERDE:
@@ -1590,6 +1592,7 @@ static int si_init_microcode(struct radeon_device *rdev)
 		ce_req_size = SI_CE_UCODE_SIZE * 4;
 		rlc_req_size = SI_RLC_UCODE_SIZE * 4;
 		mc_req_size = SI_MC_UCODE_SIZE * 4;
+		mc2_req_size = VERDE_MC_UCODE_SIZE * 4;
 		smc_req_size = ALIGN(VERDE_SMC_UCODE_SIZE, 4);
 		break;
 	case CHIP_OLAND:
@@ -1599,7 +1602,7 @@ static int si_init_microcode(struct radeon_device *rdev)
 		me_req_size = SI_PM4_UCODE_SIZE * 4;
 		ce_req_size = SI_CE_UCODE_SIZE * 4;
 		rlc_req_size = SI_RLC_UCODE_SIZE * 4;
-		mc_req_size = OLAND_MC_UCODE_SIZE * 4;
+		mc_req_size = mc2_req_size = OLAND_MC_UCODE_SIZE * 4;
 		smc_req_size = ALIGN(OLAND_SMC_UCODE_SIZE, 4);
 		break;
 	case CHIP_HAINAN:
@@ -1609,7 +1612,7 @@ static int si_init_microcode(struct radeon_device *rdev)
 		me_req_size = SI_PM4_UCODE_SIZE * 4;
 		ce_req_size = SI_CE_UCODE_SIZE * 4;
 		rlc_req_size = SI_RLC_UCODE_SIZE * 4;
-		mc_req_size = OLAND_MC_UCODE_SIZE * 4;
+		mc_req_size = mc2_req_size = OLAND_MC_UCODE_SIZE * 4;
 		smc_req_size = ALIGN(HAINAN_SMC_UCODE_SIZE, 4);
 		break;
 	default: BUG();
@@ -1662,16 +1665,22 @@ static int si_init_microcode(struct radeon_device *rdev)
 		err = -EINVAL;
 	}
 
-	snprintf(fw_name, sizeof(fw_name), "radeon/%s_mc.bin", chip_name);
+	snprintf(fw_name, sizeof(fw_name), "radeon/%s_mc2.bin", chip_name);
 	err = request_firmware(&rdev->mc_fw, fw_name, rdev->dev);
-	if (err)
-		goto out;
-	if (rdev->mc_fw->size != mc_req_size) {
+	if (err) {
+		snprintf(fw_name, sizeof(fw_name), "radeon/%s_mc.bin", chip_name);
+		err = request_firmware(&rdev->mc_fw, fw_name, rdev->dev);
+		if (err)
+			goto out;
+	}
+	if ((rdev->mc_fw->size != mc_req_size) &&
+	    (rdev->mc_fw->size != mc2_req_size)) {
 		printk(KERN_ERR
 		       "si_mc: Bogus length %zu in firmware \"%s\"\n",
 		       rdev->mc_fw->size, fw_name);
 		err = -EINVAL;
 	}
+	DRM_INFO("%s: %zu bytes\n", fw_name, rdev->mc_fw->size);
 
 	snprintf(fw_name, sizeof(fw_name), "radeon/%s_smc.bin", chip_name);
 	err = request_firmware(&rdev->smc_fw, fw_name, rdev->dev);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 045/146] drm/radeon/si: make sure mc ucode is loaded before checking the size
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (43 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 044/146] drm/radeon: add support for newer mc ucode on SI (v2) Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 046/146] drm/radeon: fix ATPX detection on non-VGA GPUs Jiri Slaby
                   ` (102 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alex Deucher, Alex Deucher, Jiri Slaby

From: Alex Deucher <alexdeucher@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 8c79bae6a30f606b7a4e17c994bc5f72f8fdaf11 upstream.

Avoid a possible segfault.

Noticed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/si.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index de0c2bfcc7fc..bbd83f5aa75d 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -1475,11 +1475,13 @@ static int si_mc_load_microcode(struct radeon_device *rdev)
 	const __be32 *fw_data;
 	u32 running, blackout = 0;
 	u32 *io_mc_regs;
-	int i, regs_size, ucode_size = rdev->mc_fw->size / 4;
+	int i, regs_size, ucode_size;
 
 	if (!rdev->mc_fw)
 		return -EINVAL;
 
+	ucode_size = rdev->mc_fw->size / 4;
+
 	switch (rdev->family) {
 	case CHIP_TAHITI:
 		io_mc_regs = (u32 *)&tahiti_io_mc_regs;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 046/146] drm/radeon: fix ATPX detection on non-VGA GPUs
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (44 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 045/146] drm/radeon/si: make sure mc ucode is loaded before checking the size Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 047/146] drm/radeon/pm: don't walk the crtc list before it has been initialized (v2) Jiri Slaby
                   ` (101 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alex Deucher, Alex Deucher, airlied, Jiri Slaby

From: Alex Deucher <alexdeucher@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit e9a4099a59cc598a44006059dd775c25e422b772 upstream.

Some newer PX laptops have the pci device class
set to DISPLAY_OTHER rather than DISPLAY_VGA.  This
properly detects ATPX on those laptops.

Based on a patch from: Pali Rohár <pali.rohar@gmail.com>

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: airlied@gmail.com
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/radeon_atpx_handler.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
index b8db0d7b5089..7c6e3fd70e65 100644
--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c
+++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
@@ -525,6 +525,13 @@ static bool radeon_atpx_detect(void)
 		has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);
 	}
 
+	/* some newer PX laptops mark the dGPU as a non-VGA display device */
+	while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) {
+		vga_count++;
+
+		has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);
+	}
+
 	if (has_atpx && vga_count == 2) {
 		acpi_get_name(radeon_atpx_priv.atpx.handle, ACPI_FULL_PATHNAME, &buffer);
 		printk(KERN_INFO "VGA switcheroo: detected switching method %s handle\n",
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 047/146] drm/radeon/pm: don't walk the crtc list before it has been initialized (v2)
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (45 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 046/146] drm/radeon: fix ATPX detection on non-VGA GPUs Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 048/146] drm/radeon: fix count in cik_sdma_ring_test() Jiri Slaby
                   ` (100 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alex Deucher, Alex Deucher, Jiri Slaby

From: Alex Deucher <alexdeucher@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 3ed9a335cfc64b2c83545f341cdddf2347b12b97 upstream.

Avoids a crash in certain cases when thermal irqs are generated
before the display structures have been initialized.

v2: fix the vblank and vrefresh helpers as well

bug:
https://bugzilla.kernel.org/show_bug.cgi?id=73931

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/r600_dpm.c  | 35 +++++++++++++++++++----------------
 drivers/gpu/drm/radeon/radeon_pm.c | 28 ++++++++++++++++------------
 2 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c
index 5513d8f06252..2df683aab9e9 100644
--- a/drivers/gpu/drm/radeon/r600_dpm.c
+++ b/drivers/gpu/drm/radeon/r600_dpm.c
@@ -158,16 +158,18 @@ u32 r600_dpm_get_vblank_time(struct radeon_device *rdev)
 	u32 line_time_us, vblank_lines;
 	u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */
 
-	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
-		radeon_crtc = to_radeon_crtc(crtc);
-		if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
-			line_time_us = (radeon_crtc->hw_mode.crtc_htotal * 1000) /
-				radeon_crtc->hw_mode.clock;
-			vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end -
-				radeon_crtc->hw_mode.crtc_vdisplay +
-				(radeon_crtc->v_border * 2);
-			vblank_time_us = vblank_lines * line_time_us;
-			break;
+	if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {
+		list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+			radeon_crtc = to_radeon_crtc(crtc);
+			if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
+				line_time_us = (radeon_crtc->hw_mode.crtc_htotal * 1000) /
+					radeon_crtc->hw_mode.clock;
+				vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end -
+					radeon_crtc->hw_mode.crtc_vdisplay +
+					(radeon_crtc->v_border * 2);
+				vblank_time_us = vblank_lines * line_time_us;
+				break;
+			}
 		}
 	}
 
@@ -181,14 +183,15 @@ u32 r600_dpm_get_vrefresh(struct radeon_device *rdev)
 	struct radeon_crtc *radeon_crtc;
 	u32 vrefresh = 0;
 
-	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
-		radeon_crtc = to_radeon_crtc(crtc);
-		if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
-			vrefresh = radeon_crtc->hw_mode.vrefresh;
-			break;
+	if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {
+		list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+			radeon_crtc = to_radeon_crtc(crtc);
+			if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
+				vrefresh = radeon_crtc->hw_mode.vrefresh;
+				break;
+			}
 		}
 	}
-
 	return vrefresh;
 }
 
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index a0ec4bb9d896..10fc97749a81 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1362,12 +1362,14 @@ static void radeon_pm_compute_clocks_old(struct radeon_device *rdev)
 
 	rdev->pm.active_crtcs = 0;
 	rdev->pm.active_crtc_count = 0;
-	list_for_each_entry(crtc,
-		&ddev->mode_config.crtc_list, head) {
-		radeon_crtc = to_radeon_crtc(crtc);
-		if (radeon_crtc->enabled) {
-			rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id);
-			rdev->pm.active_crtc_count++;
+	if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {
+		list_for_each_entry(crtc,
+				    &ddev->mode_config.crtc_list, head) {
+			radeon_crtc = to_radeon_crtc(crtc);
+			if (radeon_crtc->enabled) {
+				rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id);
+				rdev->pm.active_crtc_count++;
+			}
 		}
 	}
 
@@ -1431,12 +1433,14 @@ static void radeon_pm_compute_clocks_dpm(struct radeon_device *rdev)
 	/* update active crtc counts */
 	rdev->pm.dpm.new_active_crtcs = 0;
 	rdev->pm.dpm.new_active_crtc_count = 0;
-	list_for_each_entry(crtc,
-		&ddev->mode_config.crtc_list, head) {
-		radeon_crtc = to_radeon_crtc(crtc);
-		if (crtc->enabled) {
-			rdev->pm.dpm.new_active_crtcs |= (1 << radeon_crtc->crtc_id);
-			rdev->pm.dpm.new_active_crtc_count++;
+	if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {
+		list_for_each_entry(crtc,
+				    &ddev->mode_config.crtc_list, head) {
+			radeon_crtc = to_radeon_crtc(crtc);
+			if (crtc->enabled) {
+				rdev->pm.dpm.new_active_crtcs |= (1 << radeon_crtc->crtc_id);
+				rdev->pm.dpm.new_active_crtc_count++;
+			}
 		}
 	}
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 048/146] drm/radeon: fix count in cik_sdma_ring_test()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (46 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 047/146] drm/radeon/pm: don't walk the crtc list before it has been initialized (v2) Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 049/146] drm/radeon/uvd: use lower clocks on old UVD to boot v2 Jiri Slaby
                   ` (99 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Alex Deucher, Alex Deucher, Christian König,
	Jiri Slaby

From: Alex Deucher <alexdeucher@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 7e95cfb0b797678cd3493ca0322ef2675547a0bc upstream.

Should be 5 rather than 4.

Noticed-by: Mathias Fröhlich <Mathias.Froehlich@gmx.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/cik_sdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/cik_sdma.c b/drivers/gpu/drm/radeon/cik_sdma.c
index d565f4076a23..0c6784f52410 100644
--- a/drivers/gpu/drm/radeon/cik_sdma.c
+++ b/drivers/gpu/drm/radeon/cik_sdma.c
@@ -512,7 +512,7 @@ int cik_sdma_ring_test(struct radeon_device *rdev,
 	tmp = 0xCAFEDEAD;
 	writel(tmp, ptr);
 
-	r = radeon_ring_lock(rdev, ring, 4);
+	r = radeon_ring_lock(rdev, ring, 5);
 	if (r) {
 		DRM_ERROR("radeon: dma failed to lock ring %d (%d).\n", ring->idx, r);
 		return r;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 049/146] drm/radeon/uvd: use lower clocks on old UVD to boot v2
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (47 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 048/146] drm/radeon: fix count in cik_sdma_ring_test() Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 050/146] drm/radeon: use pflip irq on R600+ v2 Jiri Slaby
                   ` (98 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Christian König, Jiri Slaby

From: Christian König <christian.koenig@amd.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit e45187620f9fc103edf68fa5ea78e73033e1668c upstream.

Some RV7xx generation hardware crashes after you
raise the UVD clocks for the first time. Try to
avoid this by using the lower clocks to boot these.

Workaround for: https://bugzilla.kernel.org/show_bug.cgi?id=71891

v2: lower clocks on IB test as well

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/uvd_v1_0.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/uvd_v1_0.c b/drivers/gpu/drm/radeon/uvd_v1_0.c
index 7266805d9786..f680f5ffbdeb 100644
--- a/drivers/gpu/drm/radeon/uvd_v1_0.c
+++ b/drivers/gpu/drm/radeon/uvd_v1_0.c
@@ -83,7 +83,10 @@ int uvd_v1_0_init(struct radeon_device *rdev)
 	int r;
 
 	/* raise clocks while booting up the VCPU */
-	radeon_set_uvd_clocks(rdev, 53300, 40000);
+	if (rdev->family < CHIP_RV740)
+		radeon_set_uvd_clocks(rdev, 10000, 10000);
+	else
+		radeon_set_uvd_clocks(rdev, 53300, 40000);
 
 	r = uvd_v1_0_start(rdev);
 	if (r)
@@ -405,7 +408,10 @@ int uvd_v1_0_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
 	struct radeon_fence *fence = NULL;
 	int r;
 
-	r = radeon_set_uvd_clocks(rdev, 53300, 40000);
+	if (rdev->family < CHIP_RV740)
+		r = radeon_set_uvd_clocks(rdev, 10000, 10000);
+	else
+		r = radeon_set_uvd_clocks(rdev, 53300, 40000);
 	if (r) {
 		DRM_ERROR("radeon: failed to raise UVD clocks (%d).\n", r);
 		return r;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 050/146] drm/radeon: use pflip irq on R600+ v2
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (48 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 049/146] drm/radeon/uvd: use lower clocks on old UVD to boot v2 Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 051/146] drm/radeon: check buffer relocation offset Jiri Slaby
                   ` (97 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Christian König, Jiri Slaby

From: Christian König <christian.koenig@amd.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit f5d636d2a74b755879feec35e14a259de52ccc07 upstream.

Testing the update pending bit directly after issuing an
update is nonsense cause depending on the pixel clock the
CRTC needs a bit of time to execute the flip even when we
are in the VBLANK period.

This is just a non invasive patch to solve the problem at
hand, a more complete and cleaner solution should follow
in the next merge window.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=76564

v2: fix source IDs for CRTC2-6

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/cik.c            | 76 +++++++++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/cikd.h           |  9 ++++
 drivers/gpu/drm/radeon/evergreen.c      | 28 +++++++++---
 drivers/gpu/drm/radeon/r600.c           | 13 ++++--
 drivers/gpu/drm/radeon/radeon.h         |  6 +++
 drivers/gpu/drm/radeon/radeon_display.c |  4 ++
 drivers/gpu/drm/radeon/si.c             | 28 +++++++++---
 7 files changed, 147 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index bcefa1de3e97..bb7f2ae7683d 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -5956,6 +5956,19 @@ static void cik_disable_interrupt_state(struct radeon_device *rdev)
 		WREG32(LB_INTERRUPT_MASK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0);
 		WREG32(LB_INTERRUPT_MASK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0);
 	}
+	/* pflip */
+	if (rdev->num_crtc >= 2) {
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
+	}
+	if (rdev->num_crtc >= 4) {
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, 0);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, 0);
+	}
+	if (rdev->num_crtc >= 6) {
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, 0);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, 0);
+	}
 
 	/* dac hotplug */
 	WREG32(DAC_AUTODETECT_INT_CONTROL, 0);
@@ -6312,6 +6325,25 @@ int cik_irq_set(struct radeon_device *rdev)
 		WREG32(LB_INTERRUPT_MASK + EVERGREEN_CRTC5_REGISTER_OFFSET, crtc6);
 	}
 
+	if (rdev->num_crtc >= 2) {
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+	}
+	if (rdev->num_crtc >= 4) {
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+	}
+	if (rdev->num_crtc >= 6) {
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+	}
+
 	WREG32(DC_HPD1_INT_CONTROL, hpd1);
 	WREG32(DC_HPD2_INT_CONTROL, hpd2);
 	WREG32(DC_HPD3_INT_CONTROL, hpd3);
@@ -6348,6 +6380,29 @@ static inline void cik_irq_ack(struct radeon_device *rdev)
 	rdev->irq.stat_regs.cik.disp_int_cont5 = RREG32(DISP_INTERRUPT_STATUS_CONTINUE5);
 	rdev->irq.stat_regs.cik.disp_int_cont6 = RREG32(DISP_INTERRUPT_STATUS_CONTINUE6);
 
+	rdev->irq.stat_regs.cik.d1grph_int = RREG32(GRPH_INT_STATUS +
+		EVERGREEN_CRTC0_REGISTER_OFFSET);
+	rdev->irq.stat_regs.cik.d2grph_int = RREG32(GRPH_INT_STATUS +
+		EVERGREEN_CRTC1_REGISTER_OFFSET);
+	if (rdev->num_crtc >= 4) {
+		rdev->irq.stat_regs.cik.d3grph_int = RREG32(GRPH_INT_STATUS +
+			EVERGREEN_CRTC2_REGISTER_OFFSET);
+		rdev->irq.stat_regs.cik.d4grph_int = RREG32(GRPH_INT_STATUS +
+			EVERGREEN_CRTC3_REGISTER_OFFSET);
+	}
+	if (rdev->num_crtc >= 6) {
+		rdev->irq.stat_regs.cik.d5grph_int = RREG32(GRPH_INT_STATUS +
+			EVERGREEN_CRTC4_REGISTER_OFFSET);
+		rdev->irq.stat_regs.cik.d6grph_int = RREG32(GRPH_INT_STATUS +
+			EVERGREEN_CRTC5_REGISTER_OFFSET);
+	}
+
+	if (rdev->irq.stat_regs.cik.d1grph_int & GRPH_PFLIP_INT_OCCURRED)
+		WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_CLEAR);
+	if (rdev->irq.stat_regs.cik.d2grph_int & GRPH_PFLIP_INT_OCCURRED)
+		WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_CLEAR);
 	if (rdev->irq.stat_regs.cik.disp_int & LB_D1_VBLANK_INTERRUPT)
 		WREG32(LB_VBLANK_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET, VBLANK_ACK);
 	if (rdev->irq.stat_regs.cik.disp_int & LB_D1_VLINE_INTERRUPT)
@@ -6358,6 +6413,12 @@ static inline void cik_irq_ack(struct radeon_device *rdev)
 		WREG32(LB_VLINE_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET, VLINE_ACK);
 
 	if (rdev->num_crtc >= 4) {
+		if (rdev->irq.stat_regs.cik.d3grph_int & GRPH_PFLIP_INT_OCCURRED)
+			WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET,
+			       GRPH_PFLIP_INT_CLEAR);
+		if (rdev->irq.stat_regs.cik.d4grph_int & GRPH_PFLIP_INT_OCCURRED)
+			WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET,
+			       GRPH_PFLIP_INT_CLEAR);
 		if (rdev->irq.stat_regs.cik.disp_int_cont2 & LB_D3_VBLANK_INTERRUPT)
 			WREG32(LB_VBLANK_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, VBLANK_ACK);
 		if (rdev->irq.stat_regs.cik.disp_int_cont2 & LB_D3_VLINE_INTERRUPT)
@@ -6369,6 +6430,12 @@ static inline void cik_irq_ack(struct radeon_device *rdev)
 	}
 
 	if (rdev->num_crtc >= 6) {
+		if (rdev->irq.stat_regs.cik.d5grph_int & GRPH_PFLIP_INT_OCCURRED)
+			WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET,
+			       GRPH_PFLIP_INT_CLEAR);
+		if (rdev->irq.stat_regs.cik.d6grph_int & GRPH_PFLIP_INT_OCCURRED)
+			WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET,
+			       GRPH_PFLIP_INT_CLEAR);
 		if (rdev->irq.stat_regs.cik.disp_int_cont4 & LB_D5_VBLANK_INTERRUPT)
 			WREG32(LB_VBLANK_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, VBLANK_ACK);
 		if (rdev->irq.stat_regs.cik.disp_int_cont4 & LB_D5_VLINE_INTERRUPT)
@@ -6720,6 +6787,15 @@ restart_ih:
 				break;
 			}
 			break;
+		case 8: /* D1 page flip */
+		case 10: /* D2 page flip */
+		case 12: /* D3 page flip */
+		case 14: /* D4 page flip */
+		case 16: /* D5 page flip */
+		case 18: /* D6 page flip */
+			DRM_DEBUG("IH: D%d flip\n", ((src_id - 8) >> 1) + 1);
+			radeon_crtc_handle_flip(rdev, (src_id - 8) >> 1);
+			break;
 		case 42: /* HPD hotplug */
 			switch (src_data) {
 			case 0:
diff --git a/drivers/gpu/drm/radeon/cikd.h b/drivers/gpu/drm/radeon/cikd.h
index 203d2a09a1f5..70e88498a1fd 100644
--- a/drivers/gpu/drm/radeon/cikd.h
+++ b/drivers/gpu/drm/radeon/cikd.h
@@ -868,6 +868,15 @@
 #       define DC_HPD6_RX_INTERRUPT                     (1 << 18)
 #define DISP_INTERRUPT_STATUS_CONTINUE6                 0x6780
 
+/* 0x6858, 0x7458, 0x10058, 0x10c58, 0x11858, 0x12458 */
+#define GRPH_INT_STATUS                                 0x6858
+#       define GRPH_PFLIP_INT_OCCURRED                  (1 << 0)
+#       define GRPH_PFLIP_INT_CLEAR                     (1 << 8)
+/* 0x685c, 0x745c, 0x1005c, 0x10c5c, 0x1185c, 0x1245c */
+#define GRPH_INT_CONTROL                                0x685c
+#       define GRPH_PFLIP_INT_MASK                      (1 << 0)
+#       define GRPH_PFLIP_INT_TYPE                      (1 << 8)
+
 #define	DAC_AUTODETECT_INT_CONTROL			0x67c8
 
 #define DC_HPD1_INT_STATUS                              0x601c
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index c429bb9b17b6..e1b2470d3443 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -4276,7 +4276,6 @@ int evergreen_irq_set(struct radeon_device *rdev)
 	u32 crtc1 = 0, crtc2 = 0, crtc3 = 0, crtc4 = 0, crtc5 = 0, crtc6 = 0;
 	u32 hpd1, hpd2, hpd3, hpd4, hpd5, hpd6;
 	u32 grbm_int_cntl = 0;
-	u32 grph1 = 0, grph2 = 0, grph3 = 0, grph4 = 0, grph5 = 0, grph6 = 0;
 	u32 afmt1 = 0, afmt2 = 0, afmt3 = 0, afmt4 = 0, afmt5 = 0, afmt6 = 0;
 	u32 dma_cntl, dma_cntl1 = 0;
 	u32 thermal_int = 0;
@@ -4459,15 +4458,21 @@ int evergreen_irq_set(struct radeon_device *rdev)
 		WREG32(INT_MASK + EVERGREEN_CRTC5_REGISTER_OFFSET, crtc6);
 	}
 
-	WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, grph1);
-	WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, grph2);
+	WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET,
+	       GRPH_PFLIP_INT_MASK);
+	WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET,
+	       GRPH_PFLIP_INT_MASK);
 	if (rdev->num_crtc >= 4) {
-		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, grph3);
-		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, grph4);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
 	}
 	if (rdev->num_crtc >= 6) {
-		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, grph5);
-		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, grph6);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
 	}
 
 	WREG32(DC_HPD1_INT_CONTROL, hpd1);
@@ -4856,6 +4861,15 @@ restart_ih:
 				break;
 			}
 			break;
+		case 8: /* D1 page flip */
+		case 10: /* D2 page flip */
+		case 12: /* D3 page flip */
+		case 14: /* D4 page flip */
+		case 16: /* D5 page flip */
+		case 18: /* D6 page flip */
+			DRM_DEBUG("IH: D%d flip\n", ((src_id - 8) >> 1) + 1);
+			radeon_crtc_handle_flip(rdev, (src_id - 8) >> 1);
+			break;
 		case 42: /* HPD hotplug */
 			switch (src_data) {
 			case 0:
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 5af2729f2055..2c2b91f16ecf 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -3371,7 +3371,6 @@ int r600_irq_set(struct radeon_device *rdev)
 	u32 hpd1, hpd2, hpd3, hpd4 = 0, hpd5 = 0, hpd6 = 0;
 	u32 grbm_int_cntl = 0;
 	u32 hdmi0, hdmi1;
-	u32 d1grph = 0, d2grph = 0;
 	u32 dma_cntl;
 	u32 thermal_int = 0;
 
@@ -3480,8 +3479,8 @@ int r600_irq_set(struct radeon_device *rdev)
 	WREG32(CP_INT_CNTL, cp_int_cntl);
 	WREG32(DMA_CNTL, dma_cntl);
 	WREG32(DxMODE_INT_MASK, mode_int);
-	WREG32(D1GRPH_INTERRUPT_CONTROL, d1grph);
-	WREG32(D2GRPH_INTERRUPT_CONTROL, d2grph);
+	WREG32(D1GRPH_INTERRUPT_CONTROL, DxGRPH_PFLIP_INT_MASK);
+	WREG32(D2GRPH_INTERRUPT_CONTROL, DxGRPH_PFLIP_INT_MASK);
 	WREG32(GRBM_INT_CNTL, grbm_int_cntl);
 	if (ASIC_IS_DCE3(rdev)) {
 		WREG32(DC_HPD1_INT_CONTROL, hpd1);
@@ -3784,6 +3783,14 @@ restart_ih:
 				break;
 			}
 			break;
+		case 9: /* D1 pflip */
+			DRM_DEBUG("IH: D1 flip\n");
+			radeon_crtc_handle_flip(rdev, 0);
+			break;
+		case 11: /* D2 pflip */
+			DRM_DEBUG("IH: D2 flip\n");
+			radeon_crtc_handle_flip(rdev, 1);
+			break;
 		case 19: /* HPD/DAC hotplug */
 			switch (src_data) {
 			case 0:
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index b11433f75578..5c903a884bb8 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -715,6 +715,12 @@ struct cik_irq_stat_regs {
 	u32 disp_int_cont4;
 	u32 disp_int_cont5;
 	u32 disp_int_cont6;
+	u32 d1grph_int;
+	u32 d2grph_int;
+	u32 d3grph_int;
+	u32 d4grph_int;
+	u32 d5grph_int;
+	u32 d6grph_int;
 };
 
 union radeon_irq_stat_regs {
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 2f7fd3ff12c0..0254a7596a55 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -281,6 +281,10 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
 	u32 update_pending;
 	int vpos, hpos;
 
+	/* can happen during initialization */
+	if (radeon_crtc == NULL)
+		return;
+
 	spin_lock_irqsave(&rdev->ddev->event_lock, flags);
 	work = radeon_crtc->unpin_work;
 	if (work == NULL ||
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index bbd83f5aa75d..c9f9c07f888d 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -5731,7 +5731,6 @@ int si_irq_set(struct radeon_device *rdev)
 	u32 crtc1 = 0, crtc2 = 0, crtc3 = 0, crtc4 = 0, crtc5 = 0, crtc6 = 0;
 	u32 hpd1 = 0, hpd2 = 0, hpd3 = 0, hpd4 = 0, hpd5 = 0, hpd6 = 0;
 	u32 grbm_int_cntl = 0;
-	u32 grph1 = 0, grph2 = 0, grph3 = 0, grph4 = 0, grph5 = 0, grph6 = 0;
 	u32 dma_cntl, dma_cntl1;
 	u32 thermal_int = 0;
 
@@ -5870,16 +5869,22 @@ int si_irq_set(struct radeon_device *rdev)
 	}
 
 	if (rdev->num_crtc >= 2) {
-		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, grph1);
-		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, grph2);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
 	}
 	if (rdev->num_crtc >= 4) {
-		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, grph3);
-		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, grph4);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
 	}
 	if (rdev->num_crtc >= 6) {
-		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, grph5);
-		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, grph6);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
+		WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET,
+		       GRPH_PFLIP_INT_MASK);
 	}
 
 	if (!ASIC_IS_NODCE(rdev)) {
@@ -6243,6 +6248,15 @@ restart_ih:
 				break;
 			}
 			break;
+		case 8: /* D1 page flip */
+		case 10: /* D2 page flip */
+		case 12: /* D3 page flip */
+		case 14: /* D4 page flip */
+		case 16: /* D5 page flip */
+		case 18: /* D6 page flip */
+			DRM_DEBUG("IH: D%d flip\n", ((src_id - 8) >> 1) + 1);
+			radeon_crtc_handle_flip(rdev, (src_id - 8) >> 1);
+			break;
 		case 42: /* HPD hotplug */
 			switch (src_data) {
 			case 0:
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 051/146] drm/radeon: check buffer relocation offset
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (49 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 050/146] drm/radeon: use pflip irq on R600+ v2 Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 052/146] drm/tegra: Remove gratuitous pad field Jiri Slaby
                   ` (96 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Leo Liu, Christian König, Jiri Slaby

From: Leo Liu <leo.liu@amd.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 695daf1a8e731a4b5b89de89a61f32a4d7ad7094 upstream.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/radeon/radeon_uvd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
index 83936473f8e4..a656b1a7e10a 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -464,6 +464,10 @@ static int radeon_uvd_cs_reloc(struct radeon_cs_parser *p,
 	cmd = radeon_get_ib_value(p, p->idx) >> 1;
 
 	if (cmd < 0x4) {
+		if (end <= start) {
+			DRM_ERROR("invalid reloc offset %X!\n", offset);
+			return -EINVAL;
+		}
 		if ((end - start) < buf_sizes[cmd]) {
 			DRM_ERROR("buffer (%d) to small (%d / %d)!\n", cmd,
 				  (unsigned)(end - start), buf_sizes[cmd]);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 052/146] drm/tegra: Remove gratuitous pad field
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (50 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 051/146] drm/radeon: check buffer relocation offset Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 053/146] clk: tegra: Fix wrong value written to PLLE_AUX Jiri Slaby
                   ` (95 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Thierry Reding, Jiri Slaby

From: Thierry Reding <treding@nvidia.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit cbfbbabb89b37f6bad05f478d906a385149f288d upstream.

The version of the drm_tegra_submit structure that was merged all the
way back in 3.10 contains a pad field that was originally intended to
properly pad the following __u64 field. Unfortunately it seems like a
different field was dropped during review that caused this padding to
become unnecessary, but the pad field wasn't removed at that time.

One possible side-effect of this is that since the __u64 following the
pad is now no longer properly aligned, the compiler may (or may not)
introduce padding itself, which results in no predictable ABI.

Rectify this by removing the pad field so that all fields are again
naturally aligned. Technically this is breaking existing userspace ABI,
but given that there aren't any (released) userspace drivers that make
use of this yet, the fallout should be minimal.

Fixes: d43f81cbaf43 ("drm/tegra: Add gr2d device")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/uapi/drm/tegra_drm.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h
index 73bde4eaf16c..da106879b021 100644
--- a/include/uapi/drm/tegra_drm.h
+++ b/include/uapi/drm/tegra_drm.h
@@ -105,7 +105,6 @@ struct drm_tegra_submit {
 	__u32 num_waitchks;
 	__u32 waitchk_mask;
 	__u32 timeout;
-	__u32 pad;
 	__u64 syncpts;
 	__u64 cmdbufs;
 	__u64 relocs;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 053/146] clk: tegra: Fix wrong value written to PLLE_AUX
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (51 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 052/146] drm/tegra: Remove gratuitous pad field Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 054/146] iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference Jiri Slaby
                   ` (94 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Tuomas Tynkkynen, Mike Turquette, Jiri Slaby

From: Tuomas Tynkkynen <ttynkkynen@nvidia.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit d2c834abe2b39a2d5a6c38ef44de87c97cbb34b4 upstream.

The value written to PLLE_AUX was incorrect due to a wrong variable
being used. Without this fix SATA does not work.

Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Tested-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
[mturquette@linaro.org: improved changelog]
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/clk/tegra/clk-pll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
index e09f09ce44f8..4c1d9bbe3191 100644
--- a/drivers/clk/tegra/clk-pll.c
+++ b/drivers/clk/tegra/clk-pll.c
@@ -1594,7 +1594,7 @@ struct clk *tegra_clk_register_plle_tegra114(const char *name,
 					"pll_re_vco");
 	} else {
 		val_aux &= ~(PLLE_AUX_PLLRE_SEL | PLLE_AUX_PLLP_SEL);
-		pll_writel(val, pll_params->aux_reg, pll);
+		pll_writel(val_aux, pll_params->aux_reg, pll);
 	}
 
 	clk = _tegra_clk_register_pll(pll, name, parent_name, flags,
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 054/146] iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (52 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 053/146] clk: tegra: Fix wrong value written to PLLE_AUX Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 055/146] fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6 Jiri Slaby
                   ` (93 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Atilla Filiz, Jonathan Cameron, Jiri Slaby

From: Atilla Filiz <atilla.filiz@essensium.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit b9b3a41893c3f1be67b5aacfa525969914bea0e9 upstream.

The driver segfaults when the kernel boots with device tree as the
platform data is then not present and the pointer is deferenced without
checking it is not null.  This patch introduces such a check avoiding the
crash.

Signed-off-by: Atilla Filiz <atilla.filiz@essensium.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index df7f1e1157ae..27a91768cc72 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -661,6 +661,7 @@ static int inv_mpu_probe(struct i2c_client *client,
 {
 	struct inv_mpu6050_state *st;
 	struct iio_dev *indio_dev;
+	struct inv_mpu6050_platform_data *pdata;
 	int result;
 
 	if (!i2c_check_functionality(client->adapter,
@@ -673,8 +674,10 @@ static int inv_mpu_probe(struct i2c_client *client,
 
 	st = iio_priv(indio_dev);
 	st->client = client;
-	st->plat_data = *(struct inv_mpu6050_platform_data
-				*)dev_get_platdata(&client->dev);
+	pdata = (struct inv_mpu6050_platform_data
+			*)dev_get_platdata(&client->dev);
+	if (pdata)
+		st->plat_data = *pdata;
 	/* power is turned on inside check chip type*/
 	result = inv_check_and_setup_chip(st, id);
 	if (result)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 055/146] fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (53 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 054/146] iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 056/146] usb: gadget: at91-udc: fix irq and iomem resource retrieval Jiri Slaby
                   ` (92 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Nikita Yushchenko, Jiri Slaby

From: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit d183c81929beeba842b74422f754446ef2b8b49c upstream.

Per reference manuals of Freescale P1020 and P2020 SoCs, USB controller
present in these SoCs has bit 17 of USBx_CONTROL register marked as
Reserved - there is no PHY_CLK_VALID bit there.

Testing for this bit in ehci_fsl_setup_phy() behaves differently on two
P1020RDB boards available here - on one board test passes and fsl-usb
init succeeds, but on other board test fails, causing fsl-usb init to
fail.

This patch changes ehci_fsl_setup_phy() not to test PHY_CLK_VALID on
controller version 1.6 that (per manual) does not have this bit.

Signed-off-by: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/host/ehci-fsl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index f2407b2e8a99..ce65c4ec6550 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -261,7 +261,8 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
 		break;
 	}
 
-	if (pdata->have_sysif_regs && pdata->controller_ver &&
+	if (pdata->have_sysif_regs &&
+	    pdata->controller_ver > FSL_USB_VER_1_6 &&
 	    (phy_mode == FSL_USB2_PHY_ULPI)) {
 		/* check PHY_CLK_VALID to get phy clk valid */
 		if (!(spin_event_timeout(in_be32(non_ehci + FSL_SOC_USB_CTRL) &
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 056/146] usb: gadget: at91-udc: fix irq and iomem resource retrieval
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (54 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 055/146] fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6 Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 057/146] USB: OHCI: fix problem with global suspend on ATI controllers Jiri Slaby
                   ` (91 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jean-Jacques Hiblot, Felipe Balbi, Jiri Slaby

From: Jean-Jacques Hiblot <jjhiblot@traphandler.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 886c7c426d465732ec9d1b2bbdda5642fc2e7e05 upstream.

When using dt resources retrieval (interrupts and reg properties) there is
no predefined order for these resources in the platform dev resource
table. Also don't expect the number of resource to be always 2.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Acked-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/gadget/at91_udc.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 4cc4fd6d1473..dfd29438a11e 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1710,16 +1710,6 @@ static int at91udc_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	if (pdev->num_resources != 2) {
-		DBG("invalid num_resources\n");
-		return -ENODEV;
-	}
-	if ((pdev->resource[0].flags != IORESOURCE_MEM)
-			|| (pdev->resource[1].flags != IORESOURCE_IRQ)) {
-		DBG("invalid resource type\n");
-		return -ENODEV;
-	}
-
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
 		return -ENXIO;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 057/146] USB: OHCI: fix problem with global suspend on ATI controllers
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (55 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 056/146] usb: gadget: at91-udc: fix irq and iomem resource retrieval Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 058/146] usb: storage: shuttle_usbat: fix discs being detected twice Jiri Slaby
                   ` (90 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alan Stern, Jiri Slaby

From: Alan Stern <stern@rowland.harvard.edu>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit c1db30a2a79eb59997b13b8cabf2a50bea9f04e1 upstream.

Some OHCI controllers from ATI/AMD seem to have difficulty with
"global" USB suspend, that is, suspending an entire USB bus without
setting the suspend feature for each port connected to a device.  When
we try to resume the child devices, the controller gives timeout
errors on the unsuspended ports, requiring resets, and can even cause
ohci-hcd to hang; see

	http://marc.info/?l=linux-usb&m=139514332820398&w=2

and the following messages.

This patch fixes the problem by adding a new quirk flag to ohci-hcd.
The flag causes the ohci_rh_suspend() routine to suspend each
unsuspended, enabled port before suspending the root hub.  This
effectively converts the "global" suspend to an ordinary root-hub
suspend.  There is no need to unsuspend these ports when the root hub
is resumed, because the child devices will be resumed anyway in the
course of a normal system resume ("global" suspend is never used for
runtime PM).

This patch should be applied to all stable kernels which include
commit 0aa2832dd0d9 (USB: use "global suspend" for system sleep on
USB-2 buses) or a backported version thereof.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Peter Münster <pmlists@free.fr>
Tested-by: Peter Münster <pmlists@free.fr>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/host/ohci-hub.c | 18 ++++++++++++++++++
 drivers/usb/host/ohci-pci.c |  1 +
 drivers/usb/host/ohci.h     |  2 ++
 3 files changed, 21 insertions(+)

diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 2347ab83f046..dcf570862502 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -90,6 +90,24 @@ __acquires(ohci->lock)
 	dl_done_list (ohci);
 	finish_unlinks (ohci, ohci_frame_no(ohci));
 
+	/*
+	 * Some controllers don't handle "global" suspend properly if
+	 * there are unsuspended ports.  For these controllers, put all
+	 * the enabled ports into suspend before suspending the root hub.
+	 */
+	if (ohci->flags & OHCI_QUIRK_GLOBAL_SUSPEND) {
+		__hc32 __iomem	*portstat = ohci->regs->roothub.portstatus;
+		int		i;
+		unsigned	temp;
+
+		for (i = 0; i < ohci->num_ports; (++i, ++portstat)) {
+			temp = ohci_readl(ohci, portstat);
+			if ((temp & (RH_PS_PES | RH_PS_PSS)) ==
+					RH_PS_PES)
+				ohci_writel(ohci, RH_PS_PSS, portstat);
+		}
+	}
+
 	/* maybe resume can wake root hub */
 	if (ohci_to_hcd(ohci)->self.root_hub->do_remote_wakeup || autostop) {
 		ohci->hc_control |= OHCI_CTRL_RWE;
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index 659cde1ed1ea..fd9f77bcd499 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -160,6 +160,7 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd)
 		ohci_dbg(ohci, "enabled AMD prefetch quirk\n");
 	}
 
+	ohci->flags |= OHCI_QUIRK_GLOBAL_SUSPEND;
 	return 0;
 }
 
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index e2e5faa5a402..0b2e58c2dfef 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -405,6 +405,8 @@ struct ohci_hcd {
 #define	OHCI_QUIRK_HUB_POWER	0x100			/* distrust firmware power/oc setup */
 #define	OHCI_QUIRK_AMD_PLL	0x200			/* AMD PLL quirk*/
 #define	OHCI_QUIRK_AMD_PREFETCH	0x400			/* pre-fetch for ISO transfer */
+#define	OHCI_QUIRK_GLOBAL_SUSPEND	0x800		/* must suspend ports */
+
 	// there are also chip quirks/bugs in init logic
 
 	struct work_struct	nec_work;	/* Worker for NEC quirk */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 058/146] usb: storage: shuttle_usbat: fix discs being detected twice
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (56 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 057/146] USB: OHCI: fix problem with global suspend on ATI controllers Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 059/146] USB: Nokia 305 should be treated as unusual dev Jiri Slaby
                   ` (89 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Daniele Forsi, Jiri Slaby

From: Daniele Forsi <dforsi@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit df602c2d2358f02c6e49cffc5b49b9daa16db033 upstream.

Even if the USB-to-ATAPI converter supported multiple LUNs, this
driver would always detect the same physical device or media because
it doesn't use srb->device->lun in any way.
Tested with an Hewlett-Packard CD-Writer Plus 8200e.

Signed-off-by: Daniele Forsi <dforsi@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/storage/shuttle_usbat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c
index 4ef2a80728f7..008d805c3d21 100644
--- a/drivers/usb/storage/shuttle_usbat.c
+++ b/drivers/usb/storage/shuttle_usbat.c
@@ -1851,7 +1851,7 @@ static int usbat_probe(struct usb_interface *intf,
 	us->transport_name = "Shuttle USBAT";
 	us->transport = usbat_flash_transport;
 	us->transport_reset = usb_stor_CB_reset;
-	us->max_lun = 1;
+	us->max_lun = 0;
 
 	result = usb_stor_probe2(us);
 	return result;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 059/146] USB: Nokia 305 should be treated as unusual dev
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (57 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 058/146] usb: storage: shuttle_usbat: fix discs being detected twice Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 060/146] USB: Nokia 5300 " Jiri Slaby
                   ` (88 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Victor A. Santos, Jiri Slaby

From: "Victor A. Santos" <victoraur.santos@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit f0ef5d41792a46a1085dead9dfb0bdb2c574638e upstream.

Signed-off-by: Victor A. Santos <victoraur.santos@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/storage/unusual_devs.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index adbeb255616a..1010341792a2 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -234,6 +234,13 @@ UNUSUAL_DEV(  0x0421, 0x0495, 0x0370, 0x0370,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_MAX_SECTORS_64 ),
 
+/* Patch submitted by Victor A. Santos <victoraur.santos@gmail.com> */
+UNUSUAL_DEV(  0x0421, 0x05af, 0x0742, 0x0742,
+		"Nokia",
+		"305",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_MAX_SECTORS_64),
+
 /* Patch submitted by Mikhail Zolotaryov <lebon@lebon.org.ua> */
 UNUSUAL_DEV(  0x0421, 0x06aa, 0x1110, 0x1110,
 		"Nokia",
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 060/146] USB: Nokia 5300 should be treated as unusual dev
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (58 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 059/146] USB: Nokia 305 should be treated as unusual dev Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 061/146] rt2x00: fix beaconing on USB Jiri Slaby
                   ` (87 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Daniele Forsi, Jiri Slaby

From: Daniele Forsi <dforsi@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 6ed07d45d09bc2aa60e27b845543db9972e22a38 upstream.

Signed-off-by: Daniele Forsi <dforsi@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/storage/unusual_devs.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 1010341792a2..042c83b01046 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -234,6 +234,13 @@ UNUSUAL_DEV(  0x0421, 0x0495, 0x0370, 0x0370,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_MAX_SECTORS_64 ),
 
+/* Reported by Daniele Forsi <dforsi@gmail.com> */
+UNUSUAL_DEV(  0x0421, 0x04b9, 0x0350, 0x0350,
+		"Nokia",
+		"5300",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_MAX_SECTORS_64 ),
+
 /* Patch submitted by Victor A. Santos <victoraur.santos@gmail.com> */
 UNUSUAL_DEV(  0x0421, 0x05af, 0x0742, 0x0742,
 		"Nokia",
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 061/146] rt2x00: fix beaconing on USB
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (59 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 060/146] USB: Nokia 5300 " Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 062/146] ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data Jiri Slaby
                   ` (86 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Stanislaw Gruszka, John W. Linville, Jiri Slaby

From: Stanislaw Gruszka <sgruszka@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 8834d3608cc516f13e2e510f4057c263f3d2ce42 upstream.

When disable beaconing we clear register with beacon and newer set it
back, what make we stop send beacons infinitely.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/net/wireless/rt2x00/rt2x00mac.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index f8cff1f0b6b7..2b724fc4e306 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -623,20 +623,18 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
 				      bss_conf->bssid);
 
 	/*
-	 * Update the beacon. This is only required on USB devices. PCI
-	 * devices fetch beacons periodically.
-	 */
-	if (changes & BSS_CHANGED_BEACON && rt2x00_is_usb(rt2x00dev))
-		rt2x00queue_update_beacon(rt2x00dev, vif);
-
-	/*
 	 * Start/stop beaconing.
 	 */
 	if (changes & BSS_CHANGED_BEACON_ENABLED) {
 		if (!bss_conf->enable_beacon && intf->enable_beacon) {
-			rt2x00queue_clear_beacon(rt2x00dev, vif);
 			rt2x00dev->intf_beaconing--;
 			intf->enable_beacon = false;
+			/*
+			 * Clear beacon in the H/W for this vif. This is needed
+			 * to disable beaconing on this particular interface
+			 * and keep it running on other interfaces.
+			 */
+			rt2x00queue_clear_beacon(rt2x00dev, vif);
 
 			if (rt2x00dev->intf_beaconing == 0) {
 				/*
@@ -647,11 +645,15 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
 				rt2x00queue_stop_queue(rt2x00dev->bcn);
 				mutex_unlock(&intf->beacon_skb_mutex);
 			}
-
-
 		} else if (bss_conf->enable_beacon && !intf->enable_beacon) {
 			rt2x00dev->intf_beaconing++;
 			intf->enable_beacon = true;
+			/*
+			 * Upload beacon to the H/W. This is only required on
+			 * USB devices. PCI devices fetch beacons periodically.
+			 */
+			if (rt2x00_is_usb(rt2x00dev))
+				rt2x00queue_update_beacon(rt2x00dev, vif);
 
 			if (rt2x00dev->intf_beaconing == 1) {
 				/*
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 062/146] ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (60 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 061/146] rt2x00: fix beaconing on USB Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 063/146] Bluetooth: Fix triggering BR/EDR L2CAP Connect too early Jiri Slaby
                   ` (85 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Clemens Ladisch, Takashi Iwai, Jiri Slaby

From: Clemens Ladisch <clemens@ladisch.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 7040b6d1febfdbd9c1595efb751d492cd2503f96 upstream.

The TEAC UD-H01 firmware sends wrong feedback frequency values, thus
causing the PC to send the samples at a wrong rate, which results in
clicks and crackles in the output.

Add a workaround to detect and fix the corruption.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
[mick37@gmx.de: use sender->udh01_fb_quirk rather than
 ep->udh01_fb_quirk in snd_usb_handle_sync_urb()]
Reported-and-tested-by: Mick <mick37@gmx.de>
Reported-and-tested-by: Andrea Messa <andr.messa@tiscali.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/usb/card.h     |  1 +
 sound/usb/endpoint.c | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/sound/usb/card.h b/sound/usb/card.h
index 5ecacaa90b53..2d30a9e6aaed 100644
--- a/sound/usb/card.h
+++ b/sound/usb/card.h
@@ -91,6 +91,7 @@ struct snd_usb_endpoint {
 	unsigned int curframesize;      /* current packet size in frames (for capture) */
 	unsigned int syncmaxsize;	/* sync endpoint packet size */
 	unsigned int fill_max:1;	/* fill max packet size always */
+	unsigned int udh01_fb_quirk:1;	/* corrupted feedback data */
 	unsigned int datainterval;      /* log_2 of data packet interval */
 	unsigned int syncinterval;	/* P for adaptive mode, 0 otherwise */
 	unsigned char silence_value;
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 93e970f2b3c0..ba106c6c2d3a 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -470,6 +470,10 @@ struct snd_usb_endpoint *snd_usb_add_endpoint(struct snd_usb_audio *chip,
 			ep->syncinterval = 3;
 
 		ep->syncmaxsize = le16_to_cpu(get_endpoint(alts, 1)->wMaxPacketSize);
+
+		if (chip->usb_id == USB_ID(0x0644, 0x8038) /* TEAC UD-H01 */ &&
+		    ep->syncmaxsize == 4)
+			ep->udh01_fb_quirk = 1;
 	}
 
 	list_add_tail(&ep->list, &chip->ep_list);
@@ -1078,7 +1082,16 @@ void snd_usb_handle_sync_urb(struct snd_usb_endpoint *ep,
 	if (f == 0)
 		return;
 
-	if (unlikely(ep->freqshift == INT_MIN)) {
+	if (unlikely(sender->udh01_fb_quirk)) {
+		/*
+		 * The TEAC UD-H01 firmware sometimes changes the feedback value
+		 * by +/- 0x1.0000.
+		 */
+		if (f < ep->freqn - 0x8000)
+			f += 0x10000;
+		else if (f > ep->freqn + 0x8000)
+			f -= 0x10000;
+	} else if (unlikely(ep->freqshift == INT_MIN)) {
 		/*
 		 * The first time we see a feedback value, determine its format
 		 * by shifting it left or right until it matches the nominal
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 063/146] Bluetooth: Fix triggering BR/EDR L2CAP Connect too early
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (61 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 062/146] ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09  8:49 ` [PATCH 3.12 064/146] Bluetooth: Fix redundant encryption request for reauthentication Jiri Slaby
                   ` (84 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Johan Hedberg, Marcel Holtmann, Jiri Slaby

From: Johan Hedberg <johan.hedberg@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 9eb1fbfa0a737fd4d3a6d12d71c5ea9af622b887 upstream.

Commit 1c2e004183178 introduced an event handler for the encryption key
refresh complete event with the intent of fixing some LE/SMP cases.
However, this event is shared with BR/EDR and there we actually want to
act only on the auth_complete event (which comes after the key refresh).

If we do not do this we may trigger an L2CAP Connect Request too early
and cause the remote side to return a security block error.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/bluetooth/hci_event.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index a3af2b750e96..2eeb6643d78a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2993,6 +2993,12 @@ static void hci_key_refresh_complete_evt(struct hci_dev *hdev,
 	if (!conn)
 		goto unlock;
 
+	/* For BR/EDR the necessary steps are taken through the
+	 * auth_complete event.
+	 */
+	if (conn->type != LE_LINK)
+		goto unlock;
+
 	if (!ev->status)
 		conn->sec_level = conn->pending_sec_level;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 064/146] Bluetooth: Fix redundant encryption request for reauthentication
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (62 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 063/146] Bluetooth: Fix triggering BR/EDR L2CAP Connect too early Jiri Slaby
@ 2014-06-09  8:49 ` Jiri Slaby
  2014-06-09 13:33   ` Johan Hedberg
  2014-06-09  8:50 ` [PATCH 3.12 065/146] Bluetooth: Add support for Lite-on [04ca:3007] Jiri Slaby
                   ` (83 subsequent siblings)
  147 siblings, 1 reply; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:49 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Johan Hedberg, Marcel Holtmann, Jiri Slaby

From: Johan Hedberg <johan.hedberg@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 09da1f3463eb81d59685df723b1c5950b7570340 upstream.

When we're performing reauthentication (in order to elevate the
security level from an unauthenticated key to an authenticated one) we
do not need to issue any encryption command once authentication
completes. Since the trigger for the encryption HCI command is the
ENCRYPT_PEND flag this flag should not be set in this scenario.
Instead, the REAUTH_PEND flag takes care of all necessary steps for
reauthentication.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/bluetooth/hci_conn.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index f0817121ec5e..312915c23930 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -690,14 +690,17 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
 	if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) {
 		struct hci_cp_auth_requested cp;
 
-		/* encrypt must be pending if auth is also pending */
-		set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
-
 		cp.handle = cpu_to_le16(conn->handle);
 		hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
 			     sizeof(cp), &cp);
+
+		/* If we're already encrypted set the REAUTH_PEND flag,
+		 * otherwise set the ENCRYPT_PEND.
+		 */
 		if (conn->key_type != 0xff)
 			set_bit(HCI_CONN_REAUTH_PEND, &conn->flags);
+		else
+			set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
 	}
 
 	return 0;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 065/146] Bluetooth: Add support for Lite-on [04ca:3007]
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (63 preceding siblings ...)
  2014-06-09  8:49 ` [PATCH 3.12 064/146] Bluetooth: Fix redundant encryption request for reauthentication Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 066/146] posix_acl: handle NULL ACL in posix_acl_equiv_mode Jiri Slaby
                   ` (82 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Mohammed Habibulla, Gustavo Padovan, Jiri Slaby

From: Mohammed Habibulla <moch@chromium.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 1fb4e09a7e780b915dbd172592ae7e2a4c071065 upstream.

Add support for the AR9462 chip

T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=03 Dev#=  3 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=04ca ProdID=3007 Rev= 0.01
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/bluetooth/ath3k.c | 2 ++
 drivers/bluetooth/btusb.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 0a327f4154a2..2acabdaecec8 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -82,6 +82,7 @@ static struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x04CA, 0x3004) },
 	{ USB_DEVICE(0x04CA, 0x3005) },
 	{ USB_DEVICE(0x04CA, 0x3006) },
+	{ USB_DEVICE(0x04CA, 0x3007) },
 	{ USB_DEVICE(0x04CA, 0x3008) },
 	{ USB_DEVICE(0x13d3, 0x3362) },
 	{ USB_DEVICE(0x0CF3, 0xE004) },
@@ -124,6 +125,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
 	{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x04ca, 0x3007), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 6e30356d3e42..6e6740b9521b 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -149,6 +149,7 @@ static struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x04ca, 0x3007), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 066/146] posix_acl: handle NULL ACL in posix_acl_equiv_mode
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (64 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 065/146] Bluetooth: Add support for Lite-on [04ca:3007] Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 067/146] mm/page-writeback.c: fix divide by zero in pos_ratio_polynom Jiri Slaby
                   ` (81 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Christoph Hellwig, Chuck Lever, Al Viro, Jiri Slaby

From: Christoph Hellwig <hch@lst.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 50c6e282bdf5e8dabf8d7cf7b162545a55645fd9 upstream.

Various filesystems don't bother checking for a NULL ACL in
posix_acl_equiv_mode, and thus can dereference a NULL pointer when it
gets passed one. This usually happens from the NFS server, as the ACL tools
never pass a NULL ACL, but instead of one representing the mode bits.

Instead of adding boilerplat to all filesystems put this check into one place,
which will allow us to remove the check from other filesystems as well later
on.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Ben Greear <greearb@candelatech.com>
Reported-by: Marco Munderloh <munderl@tnt.uni-hannover.de>,
Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/posix_acl.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 8bd2135b7f82..3542f1f814e2 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -158,6 +158,12 @@ posix_acl_equiv_mode(const struct posix_acl *acl, umode_t *mode_p)
 	umode_t mode = 0;
 	int not_equiv = 0;
 
+	/*
+	 * A null ACL can always be presented as mode bits.
+	 */
+	if (!acl)
+		return 0;
+
 	FOREACH_ACL_ENTRY(pa, acl, pe) {
 		switch (pa->e_tag) {
 			case ACL_USER_OBJ:
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 067/146] mm/page-writeback.c: fix divide by zero in pos_ratio_polynom
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (65 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 066/146] posix_acl: handle NULL ACL in posix_acl_equiv_mode Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 068/146] revert "mm: vmscan: do not swap anon pages just because free+file is low" Jiri Slaby
                   ` (80 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Rik van Riel, Aneesh Kumar K.V, Mel Gorman,
	Nishanth Aravamudan, Luiz Capitulino, Masayoshi Mizuma,
	Andrew Morton, Linus Torvalds, Jiri Slaby

From: Rik van Riel <riel@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit d5c9fde3dae750889168807038243ff36431d276 upstream.

It is possible for "limit - setpoint + 1" to equal zero, after getting
truncated to a 32 bit variable, and resulting in a divide by zero error.

Using the fully 64 bit divide functions avoids this problem.  It also
will cause pos_ratio_polynom() to return the correct value when
(setpoint - limit) exceeds 2^32.

Also uninline pos_ratio_polynom, at Andrew's request.

Signed-off-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/page-writeback.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 7106cb1aca8e..8f6daa62206d 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -593,14 +593,14 @@ unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, unsigned long dirty)
  * (5) the closer to setpoint, the smaller |df/dx| (and the reverse)
  *     => fast response on large errors; small oscillation near setpoint
  */
-static inline long long pos_ratio_polynom(unsigned long setpoint,
+static long long pos_ratio_polynom(unsigned long setpoint,
 					  unsigned long dirty,
 					  unsigned long limit)
 {
 	long long pos_ratio;
 	long x;
 
-	x = div_s64(((s64)setpoint - (s64)dirty) << RATELIMIT_CALC_SHIFT,
+	x = div64_s64(((s64)setpoint - (s64)dirty) << RATELIMIT_CALC_SHIFT,
 		    limit - setpoint + 1);
 	pos_ratio = x;
 	pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT;
@@ -842,7 +842,7 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi,
 	x_intercept = bdi_setpoint + span;
 
 	if (bdi_dirty < x_intercept - span / 4) {
-		pos_ratio = div_u64(pos_ratio * (x_intercept - bdi_dirty),
+		pos_ratio = div64_u64(pos_ratio * (x_intercept - bdi_dirty),
 				    x_intercept - bdi_setpoint + 1);
 	} else
 		pos_ratio /= 4;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 068/146] revert "mm: vmscan: do not swap anon pages just because free+file is low"
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (66 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 067/146] mm/page-writeback.c: fix divide by zero in pos_ratio_polynom Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09 13:35   ` Johannes Weiner
  2014-06-09  8:50 ` [PATCH 3.12 069/146] ARM: orion5x: fix target ID for crypto SRAM window Jiri Slaby
                   ` (79 subsequent siblings)
  147 siblings, 1 reply; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Johannes Weiner, Rik van Riel, Andrew Morton,
	Linus Torvalds, Jiri Slaby

From: Johannes Weiner <hannes@cmpxchg.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 623762517e2370be3b3f95f4fe08d6c063a49b06 upstream.

This reverts commit 0bf1457f0cfc ("mm: vmscan: do not swap anon pages
just because free+file is low") because it introduced a regression in
mostly-anonymous workloads, where reclaim would become ineffective and
trap every allocating task in direct reclaim.

The problem is that there is a runaway feedback loop in the scan balance
between file and anon, where the balance tips heavily towards a tiny
thrashing file LRU and anonymous pages are no longer being looked at.
The commit in question removed the safe guard that would detect such
situations and respond with forced anonymous reclaim.

This commit was part of a series to fix premature swapping in loads with
relatively little cache, and while it made a small difference, the cure
is obviously worse than the disease.  Revert it.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Rafael Aquini <aquini@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/vmscan.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 05e6095159dc..09c730718e23 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1898,6 +1898,24 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
 	}
 
 	/*
+	 * Prevent the reclaimer from falling into the cache trap: as
+	 * cache pages start out inactive, every cache fault will tip
+	 * the scan balance towards the file LRU.  And as the file LRU
+	 * shrinks, so does the window for rotation from references.
+	 * This means we have a runaway feedback loop where a tiny
+	 * thrashing file LRU becomes infinitely more attractive than
+	 * anon pages.  Try to detect this based on file LRU size.
+	 */
+	if (global_reclaim(sc)) {
+		unsigned long free = zone_page_state(zone, NR_FREE_PAGES);
+
+		if (unlikely(file + free <= high_wmark_pages(zone))) {
+			scan_balance = SCAN_ANON;
+			goto out;
+		}
+	}
+
+	/*
 	 * There is enough inactive page cache, do not reclaim
 	 * anything from the anonymous working set right now.
 	 */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 069/146] ARM: orion5x: fix target ID for crypto SRAM window
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (67 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 068/146] revert "mm: vmscan: do not swap anon pages just because free+file is low" Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 070/146] ARM: dts: kirkwood: fix mislocated pcie-controller nodes Jiri Slaby
                   ` (78 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Thomas Petazzoni, Jason Cooper, Jiri Slaby

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 1cc9d48145b81e307fab94a5cf6ee66ec2f0de60 upstream.

In commit 4ca2c04085a1caa903e92a5fc0da25362150aac2 ('ARM: orion5x:
Move to ID based window creation'), the mach-orion5x code was changed
to use the new mvebu-mbus API. However, in the process, a mistake was
made on the crypto SRAM window target ID: it should have been 0x9
(verified in the datasheet) and not 0x0.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Link: https://lkml.kernel.org/r/1397400006-4315-2-git-send-email-thomas.petazzoni@free-electrons.com
Fixes: 4ca2c04085a1 ('ARM: orion5x: Move to ID based window creation')
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/mach-orion5x/common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index f565f9944af2..7548db2bfb8a 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -21,7 +21,7 @@ struct mv_sata_platform_data;
 #define ORION_MBUS_DEVBUS_BOOT_ATTR   0x0f
 #define ORION_MBUS_DEVBUS_TARGET(cs)  0x01
 #define ORION_MBUS_DEVBUS_ATTR(cs)    (~(1 << cs))
-#define ORION_MBUS_SRAM_TARGET        0x00
+#define ORION_MBUS_SRAM_TARGET        0x09
 #define ORION_MBUS_SRAM_ATTR          0x00
 
 /*
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 070/146] ARM: dts: kirkwood: fix mislocated pcie-controller nodes
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (68 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 069/146] ARM: orion5x: fix target ID for crypto SRAM window Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 071/146] ARM: dts: i.MX53: Fix ipu register space size Jiri Slaby
                   ` (77 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Sebastian Hesselbarth, Jason Cooper, Jiri Slaby

From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 788296b2d19d16ec33aba0a5ad1544d50bb58601 upstream.

Commit 54397d85349f
 ("ARM: kirkwood: Relocate PCIe device tree nodes")

moved the pcie-controller nodes for the Kirkwood SoCs to the mbus
bus node. For some reason, two boards were not properly converted
and have their pci-controller nodes still in the ocp bus node.

As the corresponding SoC pcie-controller does not exist anymore,
it is likely that pcie is broken on those boards since above commit.
Fix it by moving the pcie related nodes to the correct location.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Fixes: 54397d85349f ("ARM: kirkwood: Relocate PCIe device tree nodes")
Acked-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lkml.kernel.org/r/1398862602-29595-2-git-send-email-sebastian.hesselbarth@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts | 18 ++++++++++--------
 arch/arm/boot/dts/kirkwood-nsa310-common.dtsi  | 18 ++++++++++--------
 2 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
index 6317e1d088b3..e650e35d120c 100644
--- a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
+++ b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
@@ -30,6 +30,16 @@
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
 
+	mbus {
+		pcie-controller {
+			status = "okay";
+
+			pcie@1,0 {
+				status = "okay";
+			};
+		};
+        };
+
 	ocp@f1000000 {
 		pinctrl@10000 {
 			pmx_usb_led: pmx-usb-led {
@@ -73,14 +83,6 @@
 		ehci@50000 {
 			status = "okay";
 		};
-
-		pcie-controller {
-			status = "okay";
-
-			pcie@1,0 {
-				status = "okay";
-			};
-		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-nsa310-common.dtsi b/arch/arm/boot/dts/kirkwood-nsa310-common.dtsi
index 06267a91de38..7c3f4bc4b7e4 100644
--- a/arch/arm/boot/dts/kirkwood-nsa310-common.dtsi
+++ b/arch/arm/boot/dts/kirkwood-nsa310-common.dtsi
@@ -4,6 +4,16 @@
 / {
 	model = "ZyXEL NSA310";
 
+	mbus {
+		pcie-controller {
+			status = "okay";
+
+			pcie@1,0 {
+				status = "okay";
+			};
+		};
+	};
+
 	ocp@f1000000 {
 		pinctrl: pinctrl@10000 {
 
@@ -69,14 +79,6 @@
 				reg = <0x5040000 0x2fc0000>;
 			};
 		};
-
-		pcie-controller {
-			status = "okay";
-
-			pcie@1,0 {
-				status = "okay";
-			};
-		};
 	};
 
 	gpio_poweroff {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 071/146] ARM: dts: i.MX53: Fix ipu register space size
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (69 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 070/146] ARM: dts: kirkwood: fix mislocated pcie-controller nodes Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 072/146] ARM: mvebu: fix NOR bus-width in Armada XP GP Device Tree Jiri Slaby
                   ` (76 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Sascha Hauer, Olof Johansson, Jiri Slaby

From: Sascha Hauer <s.hauer@pengutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 6d66da89bf4422c0a0693627fb3e25f74af50f92 upstream.

The IPU register space is 128MB, not 2GB.

Fixes: abed9a6bf2bb 'ARM i.MX53: Add IPU support'
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/boot/dts/imx53.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index 4307e80b2d2e..dc72353de0b3 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -87,7 +87,7 @@
 		ipu: ipu@18000000 {
 			#crtc-cells = <1>;
 			compatible = "fsl,imx53-ipu";
-			reg = <0x18000000 0x080000000>;
+			reg = <0x18000000 0x08000000>;
 			interrupts = <11 10>;
 			clocks = <&clks 59>, <&clks 110>, <&clks 61>;
 			clock-names = "bus", "di0", "di1";
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 072/146] ARM: mvebu: fix NOR bus-width in Armada XP GP Device Tree
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (70 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 071/146] ARM: dts: i.MX53: Fix ipu register space size Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 073/146] ARM: mvebu: fix NOR bus-width in Armada XP DB " Jiri Slaby
                   ` (75 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Thomas Petazzoni, Jason Cooper, Jiri Slaby

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 1a88f809ccb5db1509a7514b187c00b3a995fc82 upstream.

The mvebu-devbus driver had a serious bug, which lead to a 8 bits bus
width declared in the Device Tree being considered as a 16 bits bus
width when configuring the hardware.

This bug in mvebu-devbus driver was compensated by a symetric mistake
in the Armada XP GP Device Tree: a 8 bits bus width was declared, even
though the hardware actually has a 16 bits bus width connection with
the NOR flash.

Now that we have fixed the mvebu-devbus driver to behave according to
its Device Tree binding, this commit fixes the problematic Device Tree
files as well.

This bug was introduced in commit
da8d1b38356853c37116f9afa29f15648d7fb159 ('ARM: mvebu: Add support for
NOR flash device on Armada XP-GP board') which was merged in v3.10.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397489361-5833-3-git-send-email-thomas.petazzoni@free-electrons.com
Fixes: da8d1b383568 ('ARM: mvebu: Add support for NOR flash device on Armada XP-GP board')
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/boot/dts/armada-xp-gp.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/armada-xp-gp.dts b/arch/arm/boot/dts/armada-xp-gp.dts
index 2298e4a910e2..e325e62909f9 100644
--- a/arch/arm/boot/dts/armada-xp-gp.dts
+++ b/arch/arm/boot/dts/armada-xp-gp.dts
@@ -49,7 +49,7 @@
 			/* Device Bus parameters are required */
 
 			/* Read parameters */
-			devbus,bus-width    = <8>;
+			devbus,bus-width    = <16>;
 			devbus,turn-off-ps  = <60000>;
 			devbus,badr-skew-ps = <0>;
 			devbus,acc-first-ps = <124000>;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 073/146] ARM: mvebu: fix NOR bus-width in Armada XP DB Device Tree
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (71 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 072/146] ARM: mvebu: fix NOR bus-width in Armada XP GP Device Tree Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 074/146] ARM: mvebu: fix NOR bus-width in Armada XP OpenBlocks AX3 " Jiri Slaby
                   ` (74 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Thomas Petazzoni, Jason Cooper, Jiri Slaby

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit f3aec8f3f05025e7b450102dae0759375346706e upstream.

The mvebu-devbus driver had a serious bug, which lead to a 8 bits bus
width declared in the Device Tree being considered as a 16 bits bus
width when configuring the hardware.

This bug in mvebu-devbus driver was compensated by a symetric mistake
in the Armada XP DB Device Tree: a 8 bits bus width was declared, even
though the hardware actually has a 16 bits bus width connection with
the NOR flash.

Now that we have fixed the mvebu-devbus driver to behave according to
its Device Tree binding, this commit fixes the problematic Device Tree
files as well.

This bug was introduced in commit
b484ff42df475c5087d614c4d477273e1906bcb9 ('ARM: mvebu: Add support for
NOR flash device on Armada XP-DB board') which was merged in v3.11.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397489361-5833-4-git-send-email-thomas.petazzoni@free-electrons.com
Fixes: b484ff42df47 ('ARM: mvebu: Add support for NOR flash device on Armada XP-DB board')
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/boot/dts/armada-xp-db.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts
index bcf6d79a57ec..8c2fe44e4dfe 100644
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@ -40,7 +40,7 @@
 			/* Device Bus parameters are required */
 
 			/* Read parameters */
-			devbus,bus-width    = <8>;
+			devbus,bus-width    = <16>;
 			devbus,turn-off-ps  = <60000>;
 			devbus,badr-skew-ps = <0>;
 			devbus,acc-first-ps = <124000>;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 074/146] ARM: mvebu: fix NOR bus-width in Armada XP OpenBlocks AX3 Device Tree
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (72 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 073/146] ARM: mvebu: fix NOR bus-width in Armada XP DB " Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50   ` Jiri Slaby
                   ` (73 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Thomas Petazzoni, Jason Cooper, Jiri Slaby

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 6e20bae8a39c40d4e03698e4160bad2d2629062b upstream.

The mvebu-devbus driver had a serious bug, which lead to a 8 bits bus
width declared in the Device Tree being considered as a 16 bits bus
width when configuring the hardware.

This bug in mvebu-devbus driver was compensated by a symetric mistake
in the Armada XP OpenBlocks AX3 Device Tree: a 8 bits bus width was
declared, even though the hardware actually has a 16 bits bus width
connection with the NOR flash.

Now that we have fixed the mvebu-devbus driver to behave according to
its Device Tree binding, this commit fixes the problematic Device Tree
files as well.

This bug was introduced in commit
a7d4f81821f7eec3175f8e23dd6949c71ab2da43 ('ARM: mvebu: Add support for
NOR flash device on Openblocks AX3 board') which was merged in v3.10.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397489361-5833-5-git-send-email-thomas.petazzoni@free-electrons.com
Fixes: a7d4f81821f7 ('ARM: mvebu: Add support for NOR flash device on Openblocks AX3 board')
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
index 5695afcc04bf..d6cce8aa8c68 100644
--- a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
+++ b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
@@ -37,7 +37,7 @@
 			/* Device Bus parameters are required */
 
 			/* Read parameters */
-			devbus,bus-width    = <8>;
+			devbus,bus-width    = <16>;
 			devbus,turn-off-ps  = <60000>;
 			devbus,badr-skew-ps = <0>;
 			devbus,acc-first-ps = <124000>;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 075/146] arm: dts: Fix missing device_type="memory" for ste-ccu8540
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
  2014-06-09  8:48 ` [PATCH 3.12 001/146] introduce for_each_thread() to replace the buggy while_each_thread() Jiri Slaby
@ 2014-06-09  8:50   ` Jiri Slaby
  2014-06-09  8:48 ` [PATCH 3.12 003/146] oom_kill: has_intersects_mems_allowed() needs rcu_read_lock() Jiri Slaby
                     ` (145 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Leif Lindholm, linux-arm-kernel, devicetree,
	Mark Rutland, Grant Likely, Jiri Slaby

From: Leif Lindholm <leif.lindholm@linaro.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit bfaed5abad998bfc88a66e6e71c7b08dcf82f04e upstream.

The current .dts for ste-ccu8540 lacks a 'device_type = "memory"' for
its memory node, relying on an old ppc quirk in order to discover its
memory. Fix the data so that all parsing code can handle it correctly.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: devicetree@vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/boot/dts/ste-ccu8540.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/ste-ccu8540.dts b/arch/arm/boot/dts/ste-ccu8540.dts
index 7f3baf51a3a9..32dd55e5f4e6 100644
--- a/arch/arm/boot/dts/ste-ccu8540.dts
+++ b/arch/arm/boot/dts/ste-ccu8540.dts
@@ -18,6 +18,7 @@
 	compatible = "st-ericsson,ccu8540", "st-ericsson,u8540";
 
 	memory@0 {
+		device_type = "memory";
 		reg = <0x20000000 0x1f000000>, <0xc0000000 0x3f000000>;
 	};
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 075/146] arm: dts: Fix missing device_type="memory" for ste-ccu8540
@ 2014-06-09  8:50   ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: Mark Rutland, devicetree, linux-kernel, Leif Lindholm,
	Grant Likely, Jiri Slaby, linux-arm-kernel

From: Leif Lindholm <leif.lindholm@linaro.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit bfaed5abad998bfc88a66e6e71c7b08dcf82f04e upstream.

The current .dts for ste-ccu8540 lacks a 'device_type = "memory"' for
its memory node, relying on an old ppc quirk in order to discover its
memory. Fix the data so that all parsing code can handle it correctly.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: devicetree@vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/boot/dts/ste-ccu8540.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/ste-ccu8540.dts b/arch/arm/boot/dts/ste-ccu8540.dts
index 7f3baf51a3a9..32dd55e5f4e6 100644
--- a/arch/arm/boot/dts/ste-ccu8540.dts
+++ b/arch/arm/boot/dts/ste-ccu8540.dts
@@ -18,6 +18,7 @@
 	compatible = "st-ericsson,ccu8540", "st-ericsson,u8540";
 
 	memory@0 {
+		device_type = "memory";
 		reg = <0x20000000 0x1f000000>, <0xc0000000 0x3f000000>;
 	};
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 075/146] arm: dts: Fix missing device_type="memory" for ste-ccu8540
@ 2014-06-09  8:50   ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: linux-arm-kernel

From: Leif Lindholm <leif.lindholm@linaro.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit bfaed5abad998bfc88a66e6e71c7b08dcf82f04e upstream.

The current .dts for ste-ccu8540 lacks a 'device_type = "memory"' for
its memory node, relying on an old ppc quirk in order to discover its
memory. Fix the data so that all parsing code can handle it correctly.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel at lists.infradead.org
Cc: devicetree at vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/boot/dts/ste-ccu8540.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/ste-ccu8540.dts b/arch/arm/boot/dts/ste-ccu8540.dts
index 7f3baf51a3a9..32dd55e5f4e6 100644
--- a/arch/arm/boot/dts/ste-ccu8540.dts
+++ b/arch/arm/boot/dts/ste-ccu8540.dts
@@ -18,6 +18,7 @@
 	compatible = "st-ericsson,ccu8540", "st-ericsson,u8540";
 
 	memory at 0 {
+		device_type = "memory";
 		reg = <0x20000000 0x1f000000>, <0xc0000000 0x3f000000>;
 	};
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 076/146] ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (74 preceding siblings ...)
  2014-06-09  8:50   ` Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 077/146] rtl8192cu: Fix unbalanced irq enable in error path of rtl92cu_hw_init() Jiri Slaby
                   ` (71 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Liu Hua, Russell King, Jiri Slaby

From: Liu Hua <sdu.liu@huawei.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 8fad87bca7ac9737e413ba5f1656f1114a8c314d upstream.

When we configure CONFIG_ARM_LPAE=y, pfn << PAGE_SHIFT will
overflow if pfn >= 0x100000 in copy_oldmem_page.
So use __pfn_to_phys for converting.

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/arm/kernel/crash_dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/crash_dump.c b/arch/arm/kernel/crash_dump.c
index 90c50d4b43f7..5d1286d51154 100644
--- a/arch/arm/kernel/crash_dump.c
+++ b/arch/arm/kernel/crash_dump.c
@@ -39,7 +39,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
 	if (!csize)
 		return 0;
 
-	vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
+	vaddr = ioremap(__pfn_to_phys(pfn), PAGE_SIZE);
 	if (!vaddr)
 		return -ENOMEM;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 077/146] rtl8192cu: Fix unbalanced irq enable in error path of rtl92cu_hw_init()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (75 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 076/146] ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 078/146] drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi Jiri Slaby
                   ` (70 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Ben Hutchings, John W. Linville, Jiri Slaby

From: Ben Hutchings <ben@decadent.org.uk>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 3234f5b06fc3094176a86772cc64baf3decc98fc upstream.

Fixes: a53268be0cb9 ('rtlwifi: rtl8192cu: Fix too long disable of IRQs')
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
index 324aa581938e..c3f2b55501ae 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -1001,7 +1001,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
 	err = _rtl92cu_init_mac(hw);
 	if (err) {
 		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "init mac failed!\n");
-		return err;
+		goto exit;
 	}
 	err = rtl92c_download_fw(hw);
 	if (err) {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 078/146] drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (76 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 077/146] rtl8192cu: Fix unbalanced irq enable in error path of rtl92cu_hw_init() Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 079/146] drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip Jiri Slaby
                   ` (69 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Ilia Mirkin, Ben Skeggs, Jiri Slaby

From: Ilia Mirkin <imirkin@alum.mit.edu>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit a3d0b1218d351c6e6f3cea36abe22236a08cb246 upstream.

There appear to be a crop of new hardware where the vbios is not
available from PROM/PRAMIN, but there is a valid _ROM method in ACPI.
The data read from PCIROM almost invariably contains invalid
instructions (still has the x86 opcodes), which makes this a low-risk
way to try to obtain a valid vbios image.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76475
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index 200e8564c59d..efdb689024e3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -419,9 +419,6 @@ bool nouveau_acpi_rom_supported(struct pci_dev *pdev)
 	acpi_status status;
 	acpi_handle dhandle, rom_handle;
 
-	if (!nouveau_dsm_priv.dsm_detected && !nouveau_dsm_priv.optimus_detected)
-		return false;
-
 	dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
 	if (!dhandle)
 		return false;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 079/146] drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (77 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 078/146] drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 080/146] drm/i915/vlv: reset VLV media force wake request register Jiri Slaby
                   ` (68 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Maarten Lankhorst, Ben Skeggs, Jiri Slaby

From: Maarten Lankhorst <maarten.lankhorst@canonical.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 806cbc5026933a781b66adecf6d1658fde9138e6 upstream.

Fixes a regression introduced by 060810d7abaabca "drm/nouveau: fix locking
issues in page flipping paths".  chan->cli->mutex is unlocked a second time
in the fail_unreserve path, fix this by moving mutex_unlock down.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/nouveau/nouveau_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 7848590f5568..fb072e6a361d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -586,9 +586,9 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
 	}
 
 	ret = nouveau_page_flip_emit(chan, old_bo, new_bo, s, &fence);
-	mutex_unlock(&chan->cli->mutex);
 	if (ret)
 		goto fail_unreserve;
+	mutex_unlock(&chan->cli->mutex);
 
 	/* Update the crtc struct and cleanup */
 	crtc->fb = fb;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 080/146] drm/i915/vlv: reset VLV media force wake request register
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (78 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 079/146] drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 081/146] drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling Jiri Slaby
                   ` (67 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jani Nikula, Jiri Slaby

From: Jani Nikula <jani.nikula@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 05adaf1f101f25f40f12c29403e6488f0e45f6b6 upstream.

Media force wake get hangs the machine when the system is booted without
displays attached. The assumption is that (at least some versions of)
the firmware has skipped some initialization in that case.

Empirical evidence suggests we need to reset the media force wake
request register in addition to the render one to avoid hangs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75895
Reported-by: Imre Deak <imre.deak@intel.com>
Reported-by: Darren Hart <dvhart@linux.intel.com>
Tested-by: Darren Hart <dvhart@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/i915/intel_uncore.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index ee7d6491f8cd..a9a015428b8b 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -166,6 +166,8 @@ static void vlv_force_wake_reset(struct drm_i915_private *dev_priv)
 {
 	__raw_i915_write32(dev_priv, FORCEWAKE_VLV,
 			   _MASKED_BIT_DISABLE(0xffff));
+	__raw_i915_write32(dev_priv, FORCEWAKE_MEDIA_VLV,
+			   _MASKED_BIT_DISABLE(0xffff));
 	/* something from same cacheline, but !FORCEWAKE_VLV */
 	__raw_posting_read(dev_priv, FORCEWAKE_ACK_VLV);
 }
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 081/146] drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (79 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 080/146] drm/i915/vlv: reset VLV media force wake request register Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 082/146] leds: leds-pwm: properly clean up after probe failure Jiri Slaby
                   ` (66 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Martin Peres, Martin Peres, Ben Skeggs, Jiri Slaby

From: Martin Peres <martin.peres@labri.fr>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 61679fe153b2b9ea5b5e2ab93305419e85e99a9d upstream.

This should fix a deadlock that has been reported to us where fan_update()
would hold the fan lock and try to grab the alarm_program_lock to reschedule
an update. On an other CPU, the alarm_program_lock would have been taken
before calling fan_update(), leading to a deadlock.

We should Cc: <stable@vger.kernel.org> # 3.9+

Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Tested-by: Timothée Ravier <tim@siosm.fr>
Tested-by: Boris Fersing (IRC nick fersingb, no public email address)
Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/nouveau/core/subdev/therm/fan.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c b/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c
index 39f47b950ad1..c14cb093a64e 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c
@@ -54,8 +54,10 @@ nouveau_fan_update(struct nouveau_fan *fan, bool immediate, int target)
 
 	/* check that we're not already at the target duty cycle */
 	duty = fan->get(therm);
-	if (duty == target)
-		goto done;
+	if (duty == target) {
+		spin_unlock_irqrestore(&fan->lock, flags);
+		return 0;
+	}
 
 	/* smooth out the fanspeed increase/decrease */
 	if (!immediate && duty >= 0) {
@@ -73,8 +75,15 @@ nouveau_fan_update(struct nouveau_fan *fan, bool immediate, int target)
 
 	nv_debug(therm, "FAN update: %d\n", duty);
 	ret = fan->set(therm, duty);
-	if (ret)
-		goto done;
+	if (ret) {
+		spin_unlock_irqrestore(&fan->lock, flags);
+		return ret;
+	}
+
+	/* fan speed updated, drop the fan lock before grabbing the
+	 * alarm-scheduling lock and risking a deadlock
+	 */
+	spin_unlock_irqrestore(&fan->lock, flags);
 
 	/* schedule next fan update, if not at target speed already */
 	if (list_empty(&fan->alarm.head) && target != duty) {
@@ -92,8 +101,6 @@ nouveau_fan_update(struct nouveau_fan *fan, bool immediate, int target)
 		ptimer->alarm(ptimer, delay * 1000 * 1000, &fan->alarm);
 	}
 
-done:
-	spin_unlock_irqrestore(&fan->lock, flags);
 	return ret;
 }
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 082/146] leds: leds-pwm: properly clean up after probe failure
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (80 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 081/146] drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 083/146] Documentation: Update stable address in Chinese and Japanese translations Jiri Slaby
                   ` (65 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Russell King, Bryan Wu, Jiri Slaby

From: Russell King <rmk+kernel@arm.linux.org.uk>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 392369019eb96e914234ea21eda806cb51a1073e upstream.

When probing with DT, we add each LED one at a time.  If we find a LED
without a PWM device (because it is not available yet) we fail the
initialisation, unregister previous LEDs, and then by way of managed
resources, we free the structure.

The problem with this is we may have a scheduled and active work_struct
in this structure, and this results in a nasty kernel oops.

We need to cancel this work_struct properly upon cleanup - and the
cleanup we require is the same cleanup as we do when the LED platform
device is removed.  Rather than writing this same code three times,
move it into a separate function and use it in all three places.

Fixes: c971ff185f64 ("leds: leds-pwm: Defer led_pwm_set() if PWM can sleep")
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/leds/leds-pwm.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index bb6f94898541..305e88a6f625 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -82,6 +82,15 @@ static inline size_t sizeof_pwm_leds_priv(int num_leds)
 		      (sizeof(struct led_pwm_data) * num_leds);
 }
 
+static void led_pwm_cleanup(struct led_pwm_priv *priv)
+{
+	while (priv->num_leds--) {
+		led_classdev_unregister(&priv->leds[priv->num_leds].cdev);
+		if (priv->leds[priv->num_leds].can_sleep)
+			cancel_work_sync(&priv->leds[priv->num_leds].work);
+	}
+}
+
 static struct led_pwm_priv *led_pwm_create_of(struct platform_device *pdev)
 {
 	struct device_node *node = pdev->dev.of_node;
@@ -139,8 +148,7 @@ static struct led_pwm_priv *led_pwm_create_of(struct platform_device *pdev)
 
 	return priv;
 err:
-	while (priv->num_leds--)
-		led_classdev_unregister(&priv->leds[priv->num_leds].cdev);
+	led_pwm_cleanup(priv);
 
 	return NULL;
 }
@@ -200,8 +208,8 @@ static int led_pwm_probe(struct platform_device *pdev)
 	return 0;
 
 err:
-	while (i--)
-		led_classdev_unregister(&priv->leds[i].cdev);
+	priv->num_leds = i;
+	led_pwm_cleanup(priv);
 
 	return ret;
 }
@@ -209,13 +217,8 @@ err:
 static int led_pwm_remove(struct platform_device *pdev)
 {
 	struct led_pwm_priv *priv = platform_get_drvdata(pdev);
-	int i;
 
-	for (i = 0; i < priv->num_leds; i++) {
-		led_classdev_unregister(&priv->leds[i].cdev);
-		if (priv->leds[i].can_sleep)
-			cancel_work_sync(&priv->leds[i].work);
-	}
+	led_pwm_cleanup(priv);
 
 	return 0;
 }
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 083/146] Documentation: Update stable address in Chinese and Japanese translations
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (81 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 082/146] leds: leds-pwm: properly clean up after probe failure Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 084/146] device_cgroup: rework device access check and exception checking Jiri Slaby
                   ` (64 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Geert Uytterhoeven, Jiri Slaby

From: Geert Uytterhoeven <geert+renesas@glider.be>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 98b0f811aade1b7c6e7806c86aa0befd5919d65f upstream.

The English and Korean translations were updated, the Chinese and Japanese
weren't.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 Documentation/ja_JP/HOWTO                   | 2 +-
 Documentation/ja_JP/stable_kernel_rules.txt | 6 +++---
 Documentation/zh_CN/HOWTO                   | 2 +-
 Documentation/zh_CN/stable_kernel_rules.txt | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/ja_JP/HOWTO b/Documentation/ja_JP/HOWTO
index 8148a47fc70e..52cf2752a53d 100644
--- a/Documentation/ja_JP/HOWTO
+++ b/Documentation/ja_JP/HOWTO
@@ -315,7 +315,7 @@ Andrew Morton が Linux-kernel メーリングリストにカーネルリリー
 もし、3.x.y カーネルが存在しない場合には、番号が一番大きい 3.x が
 最新の安定版カーネルです。
 
-3.x.y は "stable" チーム <stable@kernel.org> でメンテされており、必
+3.x.y は "stable" チーム <stable@vger.kernel.org> でメンテされており、必
 要に応じてリリースされます。通常のリリース期間は 2週間毎ですが、差し迫っ
 た問題がなければもう少し長くなることもあります。セキュリティ関連の問題
 の場合はこれに対してだいたいの場合、すぐにリリースがされます。
diff --git a/Documentation/ja_JP/stable_kernel_rules.txt b/Documentation/ja_JP/stable_kernel_rules.txt
index 14265837c4ce..9dbda9b5d21e 100644
--- a/Documentation/ja_JP/stable_kernel_rules.txt
+++ b/Documentation/ja_JP/stable_kernel_rules.txt
@@ -50,16 +50,16 @@ linux-2.6.29/Documentation/stable_kernel_rules.txt
 
 -stable ツリーにパッチを送付する手続き-
 
- - 上記の規則に従っているかを確認した後に、stable@kernel.org にパッチ
+ - 上記の規則に従っているかを確認した後に、stable@vger.kernel.org にパッチ
    を送る。
  - 送信者はパッチがキューに受け付けられた際には ACK を、却下された場合
    には NAK を受け取る。この反応は開発者たちのスケジュールによって、数
    日かかる場合がある。
  - もし受け取られたら、パッチは他の開発者たちと関連するサブシステムの
    メンテナーによるレビューのために -stable キューに追加される。
- - パッチに stable@kernel.org のアドレスが付加されているときには、それ
+ - パッチに stable@vger.kernel.org のアドレスが付加されているときには、それ
    が Linus のツリーに入る時に自動的に stable チームに email される。
- - セキュリティパッチはこのエイリアス (stable@kernel.org) に送られるべ
+ - セキュリティパッチはこのエイリアス (stable@vger.kernel.org) に送られるべ
    きではなく、代わりに security@kernel.org のアドレスに送られる。
 
 レビューサイクル-
diff --git a/Documentation/zh_CN/HOWTO b/Documentation/zh_CN/HOWTO
index 7fba5aab9ef9..7599eb38b764 100644
--- a/Documentation/zh_CN/HOWTO
+++ b/Documentation/zh_CN/HOWTO
@@ -237,7 +237,7 @@ kernel.org网站的pub/linux/kernel/v2.6/目录下找到它。它的开发遵循
 如果没有2.6.x.y版本内核存在,那么最新的2.6.x版本内核就相当于是当前的稳定
 版内核。
 
-2.6.x.y版本由“稳定版”小组(邮件地址<stable@kernel.org>)维护,一般隔周发
+2.6.x.y版本由“稳定版”小组(邮件地址<stable@vger.kernel.org>)维护,一般隔周发
 布新版本。
 
 内核源码中的Documentation/stable_kernel_rules.txt文件具体描述了可被稳定
diff --git a/Documentation/zh_CN/stable_kernel_rules.txt b/Documentation/zh_CN/stable_kernel_rules.txt
index b5b9b0ab02fd..26ea5ed7cd9c 100644
--- a/Documentation/zh_CN/stable_kernel_rules.txt
+++ b/Documentation/zh_CN/stable_kernel_rules.txt
@@ -42,7 +42,7 @@ Documentation/stable_kernel_rules.txt 的中文翻译
 
 向稳定版代码树提交补丁的过程:
 
-  - 在确认了补丁符合以上的规则后,将补丁发送到stable@kernel.org。
+  - 在确认了补丁符合以上的规则后,将补丁发送到stable@vger.kernel.org。
   - 如果补丁被接受到队列里,发送者会收到一个ACK回复,如果没有被接受,收
     到的是NAK回复。回复需要几天的时间,这取决于开发者的时间安排。
   - 被接受的补丁会被加到稳定版本队列里,等待其他开发者的审查。
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 084/146] device_cgroup: rework device access check and exception checking
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (82 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 083/146] Documentation: Update stable address in Chinese and Japanese translations Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50   ` Jiri Slaby
                   ` (63 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Aristeu Rozanski, cgroups, Tejun Heo, Serge Hallyn,
	Li Zefan, Aristeu Rozanski, Jiri Slaby

From: Aristeu Rozanski <aris@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 79d719749d23234e9b725098aa49133f3ef7299d upstream.

Whenever a device file is opened and checked against current device
cgroup rules, it uses the same function (may_access()) as when a new
exception rule is added by writing devices.{allow,deny}. And in both
cases, the algorithm is the same, doesn't matter the behavior.

First problem is having device access to be considered the same as rule
checking. Consider the following structure:

	A	(default behavior: allow, exceptions disallow access)
	 \
	  B	(default behavior: allow, exceptions disallow access)

A new exception is added to B by writing devices.deny:

	c 12:34 rw

When checking if that exception is allowed in may_access():

	if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) {
		if (behavior == DEVCG_DEFAULT_ALLOW) {
			/* the exception will deny access to certain devices */
			return true;

Which is ok, since B is not getting more privileges than A, it doesn't
matter and the rule is accepted

Now, consider it's a device file open check and the process belongs to
cgroup B. The access will be generated as:

	behavior: allow
	exception: c 12:34 rw

The very same chunk of code will allow it, even if there's an explicit
exception telling to do otherwise.

A simple test case:

	# mkdir new_group
	# cd new_group
	# echo $$ >tasks
	# echo "c 1:3 w" >devices.deny
	# echo >/dev/null
	# echo $?
	0

This is a serious bug and was introduced on

	c39a2a3018f8 devcg: prepare may_access() for hierarchy support

To solve this problem, the device file open function was split from the
new exception check.

Second problem is how exceptions are processed by may_access(). The
first part of the said function tries to match fully with an existing
exception:

	list_for_each_entry_rcu(ex, &dev_cgroup->exceptions, list) {
		if ((refex->type & DEV_BLOCK) && !(ex->type & DEV_BLOCK))
			continue;
		if ((refex->type & DEV_CHAR) && !(ex->type & DEV_CHAR))
			continue;
		if (ex->major != ~0 && ex->major != refex->major)
			continue;
		if (ex->minor != ~0 && ex->minor != refex->minor)
			continue;
		if (refex->access & (~ex->access))
			continue;
		match = true;
		break;
	}

That means the new exception should be contained into an existing one to
be considered a match:

	New exception		Existing	match?	notes
	b 12:34 rwm		b 12:34 rwm	yes
	b 12:34 r		b *:34 rw	yes
	b 12:34 rw		b 12:34 w	no	extra "r"
	b *:34 rw		b 12:34 rw	no	too broad "*"
	b *:34 rw		b *:34 rwm	yes

Which is fine in some cases. Consider:

	A	(default behavior: deny, exceptions allow access)
	 \
	  B	(default behavior: deny, exceptions allow access)

In this case the full match makes sense, the new exception cannot add
more access than the parent allows

But this doesn't always work, consider:

	A	(default behavior: allow, exceptions disallow access)
	 \
	  B	(default behavior: deny, exceptions allow access)

In this case, a new exception in B shouldn't match any of the exceptions
in A, after all you can't allow something that was forbidden by A. But
consider this scenario:

	New exception	Existing in A	match?	outcome
	b 12:34 rw	b 12:34 r	no	exception is accepted

Because the new exception has "w" as extra, it doesn't match, so it'll
be added to B's exception list.

The same problem can happen during a file access check. Consider a
cgroup with allow as default behavior:

	Access		Exception	match?
	b 12:34 rw	b 12:34 r	no

In this case, the access didn't match any of the exceptions in the
cgroup, which is required since exceptions will disallow access.

To solve this problem, two new functions were created to match an
exception either fully or partially. In the example above, a partial
check will be performed and it'll produce a match since at least
"b 12:34 r" from "b 12:34 rw" access matches.

Cc: cgroups@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Cc: Li Zefan <lizefan@huawei.com>
Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 security/device_cgroup.c | 162 +++++++++++++++++++++++++++++++++++------------
 1 file changed, 122 insertions(+), 40 deletions(-)

diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index c123628d3f84..70a76321fc4f 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -319,57 +319,139 @@ static int devcgroup_seq_read(struct cgroup_subsys_state *css,
 }
 
 /**
- * may_access - verifies if a new exception is part of what is allowed
- *		by a dev cgroup based on the default policy +
- *		exceptions. This is used to make sure a child cgroup
- *		won't have more privileges than its parent or to
- *		verify if a certain access is allowed.
- * @dev_cgroup: dev cgroup to be tested against
- * @refex: new exception
- * @behavior: behavior of the exception
+ * match_exception	- iterates the exception list trying to match a rule
+ * 			  based on type, major, minor and access type. It is
+ * 			  considered a match if an exception is found that
+ * 			  will contain the entire range of provided parameters.
+ * @exceptions: list of exceptions
+ * @type: device type (DEV_BLOCK or DEV_CHAR)
+ * @major: device file major number, ~0 to match all
+ * @minor: device file minor number, ~0 to match all
+ * @access: permission mask (ACC_READ, ACC_WRITE, ACC_MKNOD)
+ *
+ * returns: true in case it matches an exception completely
  */
-static bool may_access(struct dev_cgroup *dev_cgroup,
-		       struct dev_exception_item *refex,
-		       enum devcg_behavior behavior)
+static bool match_exception(struct list_head *exceptions, short type,
+			    u32 major, u32 minor, short access)
 {
 	struct dev_exception_item *ex;
-	bool match = false;
 
-	rcu_lockdep_assert(rcu_read_lock_held() ||
-			   lockdep_is_held(&devcgroup_mutex),
-			   "device_cgroup::may_access() called without proper synchronization");
+	list_for_each_entry_rcu(ex, exceptions, list) {
+		if ((type & DEV_BLOCK) && !(ex->type & DEV_BLOCK))
+			continue;
+		if ((type & DEV_CHAR) && !(ex->type & DEV_CHAR))
+			continue;
+		if (ex->major != ~0 && ex->major != major)
+			continue;
+		if (ex->minor != ~0 && ex->minor != minor)
+			continue;
+		/* provided access cannot have more than the exception rule */
+		if (access & (~ex->access))
+			continue;
+		return true;
+	}
+	return false;
+}
+
+/**
+ * match_exception_partial - iterates the exception list trying to match a rule
+ * 			     based on type, major, minor and access type. It is
+ * 			     considered a match if an exception's range is
+ * 			     found to contain *any* of the devices specified by
+ * 			     provided parameters. This is used to make sure no
+ * 			     extra access is being granted that is forbidden by
+ * 			     any of the exception list.
+ * @exceptions: list of exceptions
+ * @type: device type (DEV_BLOCK or DEV_CHAR)
+ * @major: device file major number, ~0 to match all
+ * @minor: device file minor number, ~0 to match all
+ * @access: permission mask (ACC_READ, ACC_WRITE, ACC_MKNOD)
+ *
+ * returns: true in case the provided range mat matches an exception completely
+ */
+static bool match_exception_partial(struct list_head *exceptions, short type,
+				    u32 major, u32 minor, short access)
+{
+	struct dev_exception_item *ex;
 
-	list_for_each_entry_rcu(ex, &dev_cgroup->exceptions, list) {
-		if ((refex->type & DEV_BLOCK) && !(ex->type & DEV_BLOCK))
+	list_for_each_entry_rcu(ex, exceptions, list) {
+		if ((type & DEV_BLOCK) && !(ex->type & DEV_BLOCK))
 			continue;
-		if ((refex->type & DEV_CHAR) && !(ex->type & DEV_CHAR))
+		if ((type & DEV_CHAR) && !(ex->type & DEV_CHAR))
 			continue;
-		if (ex->major != ~0 && ex->major != refex->major)
+		/*
+		 * We must be sure that both the exception and the provided
+		 * range aren't masking all devices
+		 */
+		if (ex->major != ~0 && major != ~0 && ex->major != major)
 			continue;
-		if (ex->minor != ~0 && ex->minor != refex->minor)
+		if (ex->minor != ~0 && minor != ~0 && ex->minor != minor)
 			continue;
-		if (refex->access & (~ex->access))
+		/*
+		 * In order to make sure the provided range isn't matching
+		 * an exception, all its access bits shouldn't match the
+		 * exception's access bits
+		 */
+		if (!(access & ex->access))
 			continue;
-		match = true;
-		break;
+		return true;
 	}
+	return false;
+}
+
+/**
+ * verify_new_ex - verifies if a new exception is part of what is allowed
+ *		   by a dev cgroup based on the default policy +
+ *		   exceptions. This is used to make sure a child cgroup
+ *		   won't have more privileges than its parent
+ * @dev_cgroup: dev cgroup to be tested against
+ * @refex: new exception
+ * @behavior: behavior of the exception's dev_cgroup
+ */
+static bool verify_new_ex(struct dev_cgroup *dev_cgroup,
+		          struct dev_exception_item *refex,
+		          enum devcg_behavior behavior)
+{
+	bool match = false;
+
+	rcu_lockdep_assert(rcu_read_lock_held() ||
+			   lockdep_is_held(&devcgroup_mutex),
+			   "device_cgroup:verify_new_ex called without proper synchronization");
 
 	if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) {
 		if (behavior == DEVCG_DEFAULT_ALLOW) {
-			/* the exception will deny access to certain devices */
+			/*
+			 * new exception in the child doesn't matter, only
+			 * adding extra restrictions
+			 */
 			return true;
 		} else {
-			/* the exception will allow access to certain devices */
+			/*
+			 * new exception in the child will add more devices
+			 * that can be acessed, so it can't match any of
+			 * parent's exceptions, even slightly
+			 */
+			match = match_exception_partial(&dev_cgroup->exceptions,
+							refex->type,
+							refex->major,
+							refex->minor,
+							refex->access);
+
 			if (match)
-				/*
-				 * a new exception allowing access shouldn't
-				 * match an parent's exception
-				 */
 				return false;
 			return true;
 		}
 	} else {
-		/* only behavior == DEVCG_DEFAULT_DENY allowed here */
+		/*
+		 * Only behavior == DEVCG_DEFAULT_DENY allowed here, therefore
+		 * the new exception will add access to more devices and must
+		 * be contained completely in an parent's exception to be
+		 * allowed
+		 */
+		match = match_exception(&dev_cgroup->exceptions, refex->type,
+					refex->major, refex->minor,
+					refex->access);
+
 		if (match)
 			/* parent has an exception that matches the proposed */
 			return true;
@@ -391,7 +473,7 @@ static int parent_has_perm(struct dev_cgroup *childcg,
 
 	if (!parent)
 		return 1;
-	return may_access(parent, ex, childcg->behavior);
+	return verify_new_ex(parent, ex, childcg->behavior);
 }
 
 /**
@@ -720,18 +802,18 @@ static int __devcgroup_check_permission(short type, u32 major, u32 minor,
 				        short access)
 {
 	struct dev_cgroup *dev_cgroup;
-	struct dev_exception_item ex;
-	int rc;
-
-	memset(&ex, 0, sizeof(ex));
-	ex.type = type;
-	ex.major = major;
-	ex.minor = minor;
-	ex.access = access;
+	bool rc;
 
 	rcu_read_lock();
 	dev_cgroup = task_devcgroup(current);
-	rc = may_access(dev_cgroup, &ex, dev_cgroup->behavior);
+	if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW)
+		/* Can't match any of the exceptions, even partially */
+		rc = !match_exception_partial(&dev_cgroup->exceptions,
+					      type, major, minor, access);
+	else
+		/* Need to match completely one exception to be allowed */
+		rc = match_exception(&dev_cgroup->exceptions, type, major,
+				     minor, access);
 	rcu_read_unlock();
 
 	if (!rc)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 085/146] device_cgroup: check if exception removal is allowed
@ 2014-06-09  8:50   ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Aristeu Rozanski, cgroups, Li Zefan,
	Aristeu Rozanski, Tejun Heo, Jiri Slaby

From: Aristeu Rozanski <aris@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit d2c2b11cfa134f4fbdcc34088824da26a084d8de upstream.

[PATCH v3 1/2] device_cgroup: check if exception removal is allowed

When the device cgroup hierarchy was introduced in
	bd2953ebbb53 - devcg: propagate local changes down the hierarchy

a specific case was overlooked. Consider the hierarchy bellow:

	A	default policy: ALLOW, exceptions will deny access
	 \
	  B	default policy: ALLOW, exceptions will deny access

There's no need to verify when an new exception is added to B because
in this case exceptions will deny access to further devices, which is
always fine. Hierarchy in device cgroup only makes sure B won't have
more access than A.

But when an exception is removed (by writing devices.allow), it isn't
checked if the user is in fact removing an inherited exception from A,
thus giving more access to B.

Example:

	# echo 'a' >A/devices.allow
	# echo 'c 1:3 rw' >A/devices.deny
	# echo $$ >A/B/tasks
	# echo >/dev/null
	-bash: /dev/null: Operation not permitted
	# echo 'c 1:3 w' >A/B/devices.allow
	# echo >/dev/null
	#

This shouldn't be allowed and this patch fixes it by making sure to never allow
exceptions in this case to be removed if the exception is partially or fully
present on the parent.

v3: missing '*' in function description
v2: improved log message and formatting fixes

Cc: cgroups@vger.kernel.org
Cc: Li Zefan <lizefan@huawei.com>
Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 security/device_cgroup.c | 41 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index 70a76321fc4f..e34818192c8d 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -477,6 +477,37 @@ static int parent_has_perm(struct dev_cgroup *childcg,
 }
 
 /**
+ * parent_allows_removal - verify if it's ok to remove an exception
+ * @childcg: child cgroup from where the exception will be removed
+ * @ex: exception being removed
+ *
+ * When removing an exception in cgroups with default ALLOW policy, it must
+ * be checked if removing it will give the child cgroup more access than the
+ * parent.
+ *
+ * Return: true if it's ok to remove exception, false otherwise
+ */
+static bool parent_allows_removal(struct dev_cgroup *childcg,
+				  struct dev_exception_item *ex)
+{
+	struct dev_cgroup *parent = css_to_devcgroup(css_parent(&childcg->css));
+
+	if (!parent)
+		return true;
+
+	/* It's always allowed to remove access to devices */
+	if (childcg->behavior == DEVCG_DEFAULT_DENY)
+		return true;
+
+	/*
+	 * Make sure you're not removing part or a whole exception existing in
+	 * the parent cgroup
+	 */
+	return !match_exception_partial(&parent->exceptions, ex->type,
+					ex->major, ex->minor, ex->access);
+}
+
+/**
  * may_allow_all - checks if it's possible to change the behavior to
  *		   allow based on parent's rules.
  * @parent: device cgroup's parent
@@ -711,17 +742,21 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup,
 
 	switch (filetype) {
 	case DEVCG_ALLOW:
-		if (!parent_has_perm(devcgroup, &ex))
-			return -EPERM;
 		/*
 		 * If the default policy is to allow by default, try to remove
 		 * an matching exception instead. And be silent about it: we
 		 * don't want to break compatibility
 		 */
 		if (devcgroup->behavior == DEVCG_DEFAULT_ALLOW) {
+			/* Check if the parent allows removing it first */
+			if (!parent_allows_removal(devcgroup, &ex))
+				return -EPERM;
 			dev_exception_rm(devcgroup, &ex);
-			return 0;
+			break;
 		}
+
+		if (!parent_has_perm(devcgroup, &ex))
+			return -EPERM;
 		rc = dev_exception_add(devcgroup, &ex);
 		break;
 	case DEVCG_DENY:
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 085/146] device_cgroup: check if exception removal is allowed
@ 2014-06-09  8:50   ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Aristeu Rozanski,
	cgroups-u79uwXL29TY76Z2rM5mHXA, Li Zefan, Aristeu Rozanski,
	Tejun Heo, Jiri Slaby

From: Aristeu Rozanski <aris-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit d2c2b11cfa134f4fbdcc34088824da26a084d8de upstream.

[PATCH v3 1/2] device_cgroup: check if exception removal is allowed

When the device cgroup hierarchy was introduced in
	bd2953ebbb53 - devcg: propagate local changes down the hierarchy

a specific case was overlooked. Consider the hierarchy bellow:

	A	default policy: ALLOW, exceptions will deny access
	 \
	  B	default policy: ALLOW, exceptions will deny access

There's no need to verify when an new exception is added to B because
in this case exceptions will deny access to further devices, which is
always fine. Hierarchy in device cgroup only makes sure B won't have
more access than A.

But when an exception is removed (by writing devices.allow), it isn't
checked if the user is in fact removing an inherited exception from A,
thus giving more access to B.

Example:

	# echo 'a' >A/devices.allow
	# echo 'c 1:3 rw' >A/devices.deny
	# echo $$ >A/B/tasks
	# echo >/dev/null
	-bash: /dev/null: Operation not permitted
	# echo 'c 1:3 w' >A/B/devices.allow
	# echo >/dev/null
	#

This shouldn't be allowed and this patch fixes it by making sure to never allow
exceptions in this case to be removed if the exception is partially or fully
present on the parent.

v3: missing '*' in function description
v2: improved log message and formatting fixes

Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Aristeu Rozanski <arozansk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Jiri Slaby <jslaby-AlSwsSmVLrQ@public.gmane.org>
---
 security/device_cgroup.c | 41 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index 70a76321fc4f..e34818192c8d 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -477,6 +477,37 @@ static int parent_has_perm(struct dev_cgroup *childcg,
 }
 
 /**
+ * parent_allows_removal - verify if it's ok to remove an exception
+ * @childcg: child cgroup from where the exception will be removed
+ * @ex: exception being removed
+ *
+ * When removing an exception in cgroups with default ALLOW policy, it must
+ * be checked if removing it will give the child cgroup more access than the
+ * parent.
+ *
+ * Return: true if it's ok to remove exception, false otherwise
+ */
+static bool parent_allows_removal(struct dev_cgroup *childcg,
+				  struct dev_exception_item *ex)
+{
+	struct dev_cgroup *parent = css_to_devcgroup(css_parent(&childcg->css));
+
+	if (!parent)
+		return true;
+
+	/* It's always allowed to remove access to devices */
+	if (childcg->behavior == DEVCG_DEFAULT_DENY)
+		return true;
+
+	/*
+	 * Make sure you're not removing part or a whole exception existing in
+	 * the parent cgroup
+	 */
+	return !match_exception_partial(&parent->exceptions, ex->type,
+					ex->major, ex->minor, ex->access);
+}
+
+/**
  * may_allow_all - checks if it's possible to change the behavior to
  *		   allow based on parent's rules.
  * @parent: device cgroup's parent
@@ -711,17 +742,21 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup,
 
 	switch (filetype) {
 	case DEVCG_ALLOW:
-		if (!parent_has_perm(devcgroup, &ex))
-			return -EPERM;
 		/*
 		 * If the default policy is to allow by default, try to remove
 		 * an matching exception instead. And be silent about it: we
 		 * don't want to break compatibility
 		 */
 		if (devcgroup->behavior == DEVCG_DEFAULT_ALLOW) {
+			/* Check if the parent allows removing it first */
+			if (!parent_allows_removal(devcgroup, &ex))
+				return -EPERM;
 			dev_exception_rm(devcgroup, &ex);
-			return 0;
+			break;
 		}
+
+		if (!parent_has_perm(devcgroup, &ex))
+			return -EPERM;
 		rc = dev_exception_add(devcgroup, &ex);
 		break;
 	case DEVCG_DENY:
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 086/146] crypto: crypto_wq - Fix late crypto work queue initialization
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (84 preceding siblings ...)
  2014-06-09  8:50   ` Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 087/146] clk: vexpress: NULL dereference on error path Jiri Slaby
                   ` (61 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Tim Chen, Herbert Xu, Jiri Slaby

From: Tim Chen <tim.c.chen@linux.intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 130fa5bc81b44b6cc1fbdea3abf6db0da22964e0 upstream.

The crypto algorithm modules utilizing the crypto daemon could
be used early when the system start up.  Using module_init
does not guarantee that the daemon's work queue is initialized
when the cypto alorithm depending on crypto_wq starts.  It is necessary
to initialize the crypto work queue earlier at the subsystem
init time to make sure that it is initialized
when used.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 crypto/crypto_wq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/crypto_wq.c b/crypto/crypto_wq.c
index adad92a44ba2..2f1b8d12952a 100644
--- a/crypto/crypto_wq.c
+++ b/crypto/crypto_wq.c
@@ -33,7 +33,7 @@ static void __exit crypto_wq_exit(void)
 	destroy_workqueue(kcrypto_wq);
 }
 
-module_init(crypto_wq_init);
+subsys_initcall(crypto_wq_init);
 module_exit(crypto_wq_exit);
 
 MODULE_LICENSE("GPL");
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 087/146] clk: vexpress: NULL dereference on error path
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (85 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 086/146] crypto: crypto_wq - Fix late crypto work queue initialization Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 088/146] media: media-device: fix infoleak in ioctl media_enum_entities() Jiri Slaby
                   ` (60 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Dan Carpenter, Pawel Moll, Jiri Slaby

From: Dan Carpenter <dan.carpenter@oracle.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 6b4ed8b00e93bd31f24a25f59ed8d1b808d0cc00 upstream.

If the allocation fails then we dereference the NULL in the error path.
Just return directly.

Fixes: ed27ff1db869 ('clk: Versatile Express clock generators ("osc") driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/clk/versatile/clk-vexpress-osc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
index 2dc8b41a339d..a535c7bf8574 100644
--- a/drivers/clk/versatile/clk-vexpress-osc.c
+++ b/drivers/clk/versatile/clk-vexpress-osc.c
@@ -102,7 +102,7 @@ void __init vexpress_osc_of_setup(struct device_node *node)
 
 	osc = kzalloc(sizeof(*osc), GFP_KERNEL);
 	if (!osc)
-		goto error;
+		return;
 
 	osc->func = vexpress_config_func_get_by_node(node);
 	if (!osc->func) {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 088/146] media: media-device: fix infoleak in ioctl media_enum_entities()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (86 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 087/146] clk: vexpress: NULL dereference on error path Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 089/146] autofs: fix lockref lookup Jiri Slaby
                   ` (59 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Salva Peiró, Mauro Carvalho Chehab, Jiri Slaby

From: Salva Peiró <speiro@ai2.upv.es>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit e6a623460e5fc960ac3ee9f946d3106233fd28d8 upstream.

This fixes CVE-2014-1739.

Signed-off-by: Salva Peiró <speiro@ai2.upv.es>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/media/media-device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index d5a7a135f75d..703560fa5e73 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -93,6 +93,7 @@ static long media_device_enum_entities(struct media_device *mdev,
 	struct media_entity *ent;
 	struct media_entity_desc u_ent;
 
+	memset(&u_ent, 0, sizeof(u_ent));
 	if (copy_from_user(&u_ent.id, &uent->id, sizeof(u_ent.id)))
 		return -EFAULT;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 089/146] autofs: fix lockref lookup
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (87 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 088/146] media: media-device: fix infoleak in ioctl media_enum_entities() Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 090/146] trace: module: Maintain a valid user count Jiri Slaby
                   ` (58 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Ian Kent, Al Viro, Linus Torvalds, Andrew Morton,
	Jiri Slaby

From: Ian Kent <raven@themaw.net>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 6b6751f7feba68d8f5c72b72cc69a1c5a625529c upstream.

autofs needs to be able to see private data dentry flags for its dentrys
that are being created but not yet hashed and for its dentrys that have
been rmdir()ed but not yet freed.  It needs to do this so it can block
processes in these states until a status has been returned to indicate
the given operation is complete.

It does this by keeping two lists, active and expring, of dentrys in
this state and uses ->d_release() to keep them stable while it checks
the reference count to determine if they should be used.

But with the recent lockref changes dentrys being freed sometimes don't
transition to a reference count of 0 before being freed so autofs can
occassionally use a dentry that is invalid which can lead to a panic.

Signed-off-by: Ian Kent <raven@themaw.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/autofs4/root.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 92ef341ba0cf..2a69bde8c61d 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -179,7 +179,7 @@ static struct dentry *autofs4_lookup_active(struct dentry *dentry)
 		spin_lock(&active->d_lock);
 
 		/* Already gone? */
-		if (!d_count(active))
+		if ((int) d_count(active) <= 0)
 			goto next;
 
 		qstr = &active->d_name;
@@ -230,7 +230,7 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry)
 
 		spin_lock(&expiring->d_lock);
 
-		/* Bad luck, we've already been dentry_iput */
+		/* We've already been dentry_iput or unlinked */
 		if (!expiring->d_inode)
 			goto next;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 090/146] trace: module: Maintain a valid user count
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (88 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 089/146] autofs: fix lockref lookup Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 091/146] Input: atkbd - fix keyboard not working on some LG laptops Jiri Slaby
                   ` (57 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Romain Izard, Rusty Russell, Frederic Weisbecker,
	Steven Rostedt, Jiri Slaby

From: Romain Izard <romain.izard.pro@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 098507ae3ec2331476fb52e85d4040c1cc6d0ef4 upstream.

The replacement of the 'count' variable by two variables 'incs' and
'decs' to resolve some race conditions during module unloading was done
in parallel with some cleanup in the trace subsystem, and was integrated
as a merge.

Unfortunately, the formula for this replacement was wrong in the tracing
code, and the refcount in the traces was not usable as a result.

Use 'count = incs - decs' to compute the user count.

Link: http://lkml.kernel.org/p/1393924179-9147-1-git-send-email-romain.izard.pro@gmail.com

Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Fixes: c1ab9cab7509 "merge conflict resolution"
Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/trace/events/module.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/trace/events/module.h b/include/trace/events/module.h
index 161932737416..ca298c7157ae 100644
--- a/include/trace/events/module.h
+++ b/include/trace/events/module.h
@@ -78,7 +78,7 @@ DECLARE_EVENT_CLASS(module_refcnt,
 
 	TP_fast_assign(
 		__entry->ip	= ip;
-		__entry->refcnt	= __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs);
+		__entry->refcnt	= __this_cpu_read(mod->refptr->incs) - __this_cpu_read(mod->refptr->decs);
 		__assign_str(name, mod->name);
 	),
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 091/146] Input: atkbd - fix keyboard not working on some LG laptops
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (89 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 090/146] trace: module: Maintain a valid user count Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 092/146] Input: elantech - fix touchpad initialization on Gigabyte U2442 Jiri Slaby
                   ` (56 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Sheng-Liang Song, Dmitry Torokhov, Jiri Slaby

From: Sheng-Liang Song <ssl@chromium.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 3d725caa9dcc78c3dc9e7ea0c04f626468edd9c9 upstream.

After issuing ATKBD_CMD_RESET_DIS, keyboard on some LG laptops stops
working. The workaround is to stop issuing ATKBD_CMD_RESET_DIS commands.

In order to keep changes in atkbd driver to the minimum we check DMI
signature and only skip ATKBD_CMD_RESET_DIS if we are running on LG
LW25-B7HV or P1-J273B.

Signed-off-by: Sheng-Liang Song <ssl@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/input/keyboard/atkbd.c | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 2626773ff29b..2dd1d0dd4f7d 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -243,6 +243,12 @@ static void (*atkbd_platform_fixup)(struct atkbd *, const void *data);
 static void *atkbd_platform_fixup_data;
 static unsigned int (*atkbd_platform_scancode_fixup)(struct atkbd *, unsigned int);
 
+/*
+ * Certain keyboards to not like ATKBD_CMD_RESET_DIS and stop responding
+ * to many commands until full reset (ATKBD_CMD_RESET_BAT) is performed.
+ */
+static bool atkbd_skip_deactivate;
+
 static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf,
 				ssize_t (*handler)(struct atkbd *, char *));
 static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t count,
@@ -768,7 +774,8 @@ static int atkbd_probe(struct atkbd *atkbd)
  * Make sure nothing is coming from the keyboard and disturbs our
  * internal state.
  */
-	atkbd_deactivate(atkbd);
+	if (!atkbd_skip_deactivate)
+		atkbd_deactivate(atkbd);
 
 	return 0;
 }
@@ -1638,6 +1645,12 @@ static int __init atkbd_setup_scancode_fixup(const struct dmi_system_id *id)
 	return 1;
 }
 
+static int __init atkbd_deactivate_fixup(const struct dmi_system_id *id)
+{
+	atkbd_skip_deactivate = true;
+	return 1;
+}
+
 static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		.matches = {
@@ -1775,6 +1788,20 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 		.callback = atkbd_setup_scancode_fixup,
 		.driver_data = atkbd_oqo_01plus_scancode_fixup,
 	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "LW25-B7HV"),
+		},
+		.callback = atkbd_deactivate_fixup,
+	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "P1-J273B"),
+		},
+		.callback = atkbd_deactivate_fixup,
+	},
 	{ }
 };
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 092/146] Input: elantech - fix touchpad initialization on Gigabyte U2442
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (90 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 091/146] Input: atkbd - fix keyboard not working on some LG laptops Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 093/146] Input: synaptics - add min/max quirk for the ThinkPad W540 Jiri Slaby
                   ` (55 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Hans de Goede, Dmitry Torokhov, Jiri Slaby

From: Hans de Goede <hdegoede@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 36189cc3cd57ab0f1cd75241f93fe01de928ac06 upstream.

The hw_version 3 Elantech touchpad on the Gigabyte U2442 does not accept
0x0b as initialization value for r10, this stand-alone version of the
driver: http://planet76.com/drivers/elantech/psmouse-elantech-v6.tar.bz2

Uses 0x03 which does work, so this means not setting bit 3 of r10 which
sets: "Enable Real H/W Resolution In Absolute mode"

Which will result in half the x and y resolution we get with that bit set,
so simply not setting it everywhere is not a solution. We've been unable to
find a way to identify touchpads where setting the bit will fail, so this
patch uses a dmi based blacklist for this.

https://bugzilla.kernel.org/show_bug.cgi?id=61151

Reported-by: Philipp Wolfer <ph.wolfer@gmail.com>
Tested-by: Philipp Wolfer <ph.wolfer@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 Documentation/input/elantech.txt |  5 ++++-
 drivers/input/mouse/elantech.c   | 26 +++++++++++++++++++++++++-
 drivers/input/mouse/elantech.h   |  1 +
 3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/Documentation/input/elantech.txt b/Documentation/input/elantech.txt
index 5602eb71ad5d..e1ae127ed099 100644
--- a/Documentation/input/elantech.txt
+++ b/Documentation/input/elantech.txt
@@ -504,9 +504,12 @@ byte 5:
 * reg_10
 
    bit   7   6   5   4   3   2   1   0
-         0   0   0   0   0   0   0   A
+         0   0   0   0   R   F   T   A
 
          A: 1 = enable absolute tracking
+         T: 1 = enable two finger mode auto correct
+         F: 1 = disable ABS Position Filter
+         R: 1 = enable real hardware resolution
 
 6.2 Native absolute mode 6 byte packet format
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index ef1cf52f8bb9..230cdcf8e6fe 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -11,6 +11,7 @@
  */
 
 #include <linux/delay.h>
+#include <linux/dmi.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/input.h>
@@ -831,7 +832,11 @@ static int elantech_set_absolute_mode(struct psmouse *psmouse)
 		break;
 
 	case 3:
-		etd->reg_10 = 0x0b;
+		if (etd->set_hw_resolution)
+			etd->reg_10 = 0x0b;
+		else
+			etd->reg_10 = 0x03;
+
 		if (elantech_write_reg(psmouse, 0x10, etd->reg_10))
 			rc = -1;
 
@@ -1331,6 +1336,22 @@ static int elantech_reconnect(struct psmouse *psmouse)
 }
 
 /*
+ * Some hw_version 3 models go into error state when we try to set bit 3 of r10
+ */
+static const struct dmi_system_id no_hw_res_dmi_table[] = {
+#if defined(CONFIG_DMI) && defined(CONFIG_X86)
+	{
+		/* Gigabyte U2442 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "U2442"),
+		},
+	},
+#endif
+	{ }
+};
+
+/*
  * determine hardware version and set some properties according to it.
  */
 static int elantech_set_properties(struct elantech_data *etd)
@@ -1389,6 +1410,9 @@ static int elantech_set_properties(struct elantech_data *etd)
 	 */
 	etd->crc_enabled = ((etd->fw_version & 0x4000) == 0x4000);
 
+	/* Enable real hardware resolution on hw_version 3 ? */
+	etd->set_hw_resolution = !dmi_check_system(no_hw_res_dmi_table);
+
 	return 0;
 }
 
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
index 036a04abaef7..9e0e2a1f340d 100644
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -130,6 +130,7 @@ struct elantech_data {
 	bool jumpy_cursor;
 	bool reports_pressure;
 	bool crc_enabled;
+	bool set_hw_resolution;
 	unsigned char hw_version;
 	unsigned int fw_version;
 	unsigned int single_finger_reports;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 093/146] Input: synaptics - add min/max quirk for the ThinkPad W540
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (91 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 092/146] Input: elantech - fix touchpad initialization on Gigabyte U2442 Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 094/146] Input: synaptics - T540p - unify with other LEN0034 models Jiri Slaby
                   ` (54 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Hans de Goede, Dmitry Torokhov, Jiri Slaby

From: Hans de Goede <hdegoede@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 0b5fe736fe923f1f5e05413878d5990e92ffbdf5 upstream.

https://bugzilla.redhat.com/show_bug.cgi?id=1096436

Tested-and-reported-by: ajayr@bigfoot.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/input/mouse/synaptics.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 3c511c4adaca..fa1dee55d208 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1563,6 +1563,14 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = {
 		.driver_data = (int []){1024, 5112, 2024, 4832},
 	},
 	{
+		/* Lenovo ThinkPad W540 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W540"),
+		},
+		.driver_data = (int []){1024, 5112, 2024, 4832},
+	},
+	{
 		/* Lenovo Yoga S1 */
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 094/146] Input: synaptics - T540p - unify with other LEN0034 models
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (92 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 093/146] Input: synaptics - add min/max quirk for the ThinkPad W540 Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 095/146] ALSA: hda - hdmi: Set converter channel count even without sink Jiri Slaby
                   ` (53 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Hans de Goede, Dmitry Torokhov, Jiri Slaby

From: Hans de Goede <hdegoede@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 6d396ede224dc596d92d7cab433713536e68916c upstream.

The T540p has a touchpad with pnp-id LEN0034, all the models with this
pnp-id have the same min/max values, except the T540p where the values are
slightly off. Fix them to be identical.

This is a preparation patch for simplifying the quirk table.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/input/mouse/synaptics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index fa1dee55d208..f6fbba53f5d5 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1552,7 +1552,7 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = {
 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
 			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T540"),
 		},
-		.driver_data = (int []){1024, 5056, 2058, 4832},
+		.driver_data = (int []){1024, 5112, 2024, 4832},
 	},
 	{
 		/* Lenovo ThinkPad L540 */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 095/146] ALSA: hda - hdmi: Set converter channel count even without sink
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (93 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 094/146] Input: synaptics - T540p - unify with other LEN0034 models Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 096/146] ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets Jiri Slaby
                   ` (52 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Anssi Hannula, Takashi Iwai, Jiri Slaby

From: Anssi Hannula <anssi.hannula@iki.fi>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit f06ab794af7055d0949b09885f79f8b493deec64 upstream.

Since commit 1df5a06a ("ALSA: hda - hdmi: Fix programmed active channel
count") channel count is no longer being set if monitor_present is 0.
This is because setting the count was moved after the CA value is
determined, which is only after the monitor_present check in
hdmi_setup_audio_infoframe().

Unfortunately, in some cases, such as with a non-spec-compliant codec or
with a problematic video driver, monitor_present is always 0. As a
specific example, this seems to happen with gen1 ATV (SiI1390 codec),
causing left-channel-only stereo playback (multi-channel playback has
apparently never worked with this codec despite it reporting 8 channels,
reason unknown).

Simply setting converter channel count without setting the pin infoframe
and channel mapping as well does not theoretically make much sense as
this will just mean they are out-of-sync and multichannel playback will
have a wrong channel mapping.

However, adding back just setting the converter channel count even in
no-monitor case is the safest change which at least fixes the stereo
playback regression on SiI1390 codec. Do that.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Reported-by: Stephan Raue <stephan@openelec.tv>
Tested-by: Stephan Raue <stephan@openelec.tv>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/pci/hda/patch_hdmi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 23e0bc6d6568..2949c8d34d33 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1023,8 +1023,10 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
 					    AMP_OUT_UNMUTE);
 
 	eld = &per_pin->sink_eld;
-	if (!eld->monitor_present)
+	if (!eld->monitor_present) {
+		hdmi_set_channel_count(codec, per_pin->cvt_nid, channels);
 		return;
+	}
 
 	if (!non_pcm && per_pin->chmap_set)
 		ca = hdmi_manual_channel_allocation(channels, per_pin->chmap);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 096/146] ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (94 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 095/146] ALSA: hda - hdmi: Set converter channel count even without sink Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 097/146] NFSd: Move default initialisers from create_client() to alloc_client() Jiri Slaby
                   ` (51 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Takashi Iwai, Jiri Slaby

From: Takashi Iwai <tiwai@suse.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 77f07800cb456bed6e5c345e6e4e83e8eda62437 upstream.

The recent Intel H97/Z97 chipsets need the similar setups like other
Intel chipsets for snooping, etc.  Especially without snooping, the
audio playback stutters or gets corrupted.  This fix patch just adds
the corresponding PCI ID entry with the proper flags.

Reported-and-tested-by: Arthur Borsboom <arthurborsboom@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/pci/hda/hda_intel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index b5c4c2e4360b..ee1a6ff120a2 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -3986,6 +3986,9 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
 	/* Lynx Point */
 	{ PCI_DEVICE(0x8086, 0x8c20),
 	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
+	/* 9 Series */
+	{ PCI_DEVICE(0x8086, 0x8ca0),
+	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
 	/* Wellsburg */
 	{ PCI_DEVICE(0x8086, 0x8d20),
 	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 097/146] NFSd: Move default initialisers from create_client() to alloc_client()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (95 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 096/146] ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 098/146] NFSd: call rpc_destroy_wait_queue() from free_client() Jiri Slaby
                   ` (50 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Trond Myklebust, J. Bruce Fields, Jiri Slaby

From: Trond Myklebust <trond.myklebust@primarydata.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 5694c93e6c4954fa9424c215f75eeb919bddad64 upstream.

Aside from making it clearer what is non-trivial in create_client(), it
also fixes a bug whereby we can call free_client() before idr_init()
has been called.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/nfsd/nfs4state.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 5cbdf38ffc66..7a32d576ed7e 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1071,6 +1071,18 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name)
 		return NULL;
 	}
 	clp->cl_name.len = name.len;
+	INIT_LIST_HEAD(&clp->cl_sessions);
+	idr_init(&clp->cl_stateids);
+	atomic_set(&clp->cl_refcount, 0);
+	clp->cl_cb_state = NFSD4_CB_UNKNOWN;
+	INIT_LIST_HEAD(&clp->cl_idhash);
+	INIT_LIST_HEAD(&clp->cl_openowners);
+	INIT_LIST_HEAD(&clp->cl_delegations);
+	INIT_LIST_HEAD(&clp->cl_lru);
+	INIT_LIST_HEAD(&clp->cl_callbacks);
+	INIT_LIST_HEAD(&clp->cl_revoked);
+	spin_lock_init(&clp->cl_lock);
+	rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table");
 	return clp;
 }
 
@@ -1335,7 +1347,6 @@ static struct nfs4_client *create_client(struct xdr_netobj name,
 	if (clp == NULL)
 		return NULL;
 
-	INIT_LIST_HEAD(&clp->cl_sessions);
 	ret = copy_cred(&clp->cl_cred, &rqstp->rq_cred);
 	if (ret) {
 		spin_lock(&nn->client_lock);
@@ -1343,20 +1354,9 @@ static struct nfs4_client *create_client(struct xdr_netobj name,
 		spin_unlock(&nn->client_lock);
 		return NULL;
 	}
-	idr_init(&clp->cl_stateids);
-	atomic_set(&clp->cl_refcount, 0);
-	clp->cl_cb_state = NFSD4_CB_UNKNOWN;
-	INIT_LIST_HEAD(&clp->cl_idhash);
-	INIT_LIST_HEAD(&clp->cl_openowners);
-	INIT_LIST_HEAD(&clp->cl_delegations);
-	INIT_LIST_HEAD(&clp->cl_lru);
-	INIT_LIST_HEAD(&clp->cl_callbacks);
-	INIT_LIST_HEAD(&clp->cl_revoked);
-	spin_lock_init(&clp->cl_lock);
 	nfsd4_init_callback(&clp->cl_cb_null);
 	clp->cl_time = get_seconds();
 	clear_bit(0, &clp->cl_cb_slot_busy);
-	rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table");
 	copy_verf(clp, verf);
 	rpc_copy_addr((struct sockaddr *) &clp->cl_addr, sa);
 	gen_confirm(clp);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 098/146] NFSd: call rpc_destroy_wait_queue() from free_client()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (96 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 097/146] NFSd: Move default initialisers from create_client() to alloc_client() Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 099/146] NFSD: Call ->set_acl with a NULL ACL structure if no entries Jiri Slaby
                   ` (49 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Trond Myklebust, J. Bruce Fields, Jiri Slaby

From: Trond Myklebust <trond.myklebust@primarydata.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 4cb57e3032d4e4bf5e97780e9907da7282b02b0c upstream.

Mainly to ensure that we don't leave any hanging timers.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/nfsd/nfs4state.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 7a32d576ed7e..b21ed5e5b369 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1100,6 +1100,7 @@ free_client(struct nfs4_client *clp)
 		WARN_ON_ONCE(atomic_read(&ses->se_ref));
 		free_session(ses);
 	}
+	rpc_destroy_wait_queue(&clp->cl_cb_waitq);
 	free_svc_cred(&clp->cl_cred);
 	kfree(clp->cl_name.data);
 	idr_destroy(&clp->cl_stateids);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 099/146] NFSD: Call ->set_acl with a NULL ACL structure if no entries
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (97 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 098/146] NFSd: call rpc_destroy_wait_queue() from free_client() Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 100/146] nfsd4: warn on finding lockowner without stateid's Jiri Slaby
                   ` (48 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Kinglong Mee, J. Bruce Fields, Jiri Slaby

From: Kinglong Mee <kinglongmee@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit aa07c713ecfc0522916f3cd57ac628ea6127c0ec upstream.

After setting ACL for directory, I got two problems that caused
by the cached zero-length default posix acl.

This patch make sure nfsd4_set_nfs4_acl calls ->set_acl
with a NULL ACL structure if there are no entries.

Thanks for Christoph Hellwig's advice.

First problem:
............ hang ...........

Second problem:
[ 1610.167668] ------------[ cut here ]------------
[ 1610.168320] kernel BUG at /root/nfs/linux/fs/nfsd/nfs4acl.c:239!
[ 1610.168320] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
[ 1610.168320] Modules linked in: nfsv4(OE) nfs(OE) nfsd(OE)
rpcsec_gss_krb5 fscache ip6t_rpfilter ip6t_REJECT cfg80211 xt_conntrack
rfkill ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables
ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6
ip6table_mangle ip6table_security ip6table_raw ip6table_filter
ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4
nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw
auth_rpcgss nfs_acl snd_intel8x0 ppdev lockd snd_ac97_codec ac97_bus
snd_pcm snd_timer e1000 pcspkr parport_pc snd parport serio_raw joydev
i2c_piix4 sunrpc(OE) microcode soundcore i2c_core ata_generic pata_acpi
[last unloaded: nfsd]
[ 1610.168320] CPU: 0 PID: 27397 Comm: nfsd Tainted: G           OE
3.15.0-rc1+ #15
[ 1610.168320] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
VirtualBox 12/01/2006
[ 1610.168320] task: ffff88005ab653d0 ti: ffff88005a944000 task.ti:
ffff88005a944000
[ 1610.168320] RIP: 0010:[<ffffffffa034d5ed>]  [<ffffffffa034d5ed>]
_posix_to_nfsv4_one+0x3cd/0x3d0 [nfsd]
[ 1610.168320] RSP: 0018:ffff88005a945b00  EFLAGS: 00010293
[ 1610.168320] RAX: 0000000000000001 RBX: ffff88006700bac0 RCX:
0000000000000000
[ 1610.168320] RDX: 0000000000000000 RSI: ffff880067c83f00 RDI:
ffff880068233300
[ 1610.168320] RBP: ffff88005a945b48 R08: ffffffff81c64830 R09:
0000000000000000
[ 1610.168320] R10: ffff88004ea85be0 R11: 000000000000f475 R12:
ffff880068233300
[ 1610.168320] R13: 0000000000000003 R14: 0000000000000002 R15:
ffff880068233300
[ 1610.168320] FS:  0000000000000000(0000) GS:ffff880077800000(0000)
knlGS:0000000000000000
[ 1610.168320] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 1610.168320] CR2: 00007f5bcbd3b0b9 CR3: 0000000001c0f000 CR4:
00000000000006f0
[ 1610.168320] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[ 1610.168320] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7:
0000000000000400
[ 1610.168320] Stack:
[ 1610.168320]  ffffffff00000000 0000000b67c83500 000000076700bac0
0000000000000000
[ 1610.168320]  ffff88006700bac0 ffff880068233300 ffff88005a945c08
0000000000000002
[ 1610.168320]  0000000000000000 ffff88005a945b88 ffffffffa034e2d5
000000065a945b68
[ 1610.168320] Call Trace:
[ 1610.168320]  [<ffffffffa034e2d5>] nfsd4_get_nfs4_acl+0x95/0x150 [nfsd]
[ 1610.168320]  [<ffffffffa03400d6>] nfsd4_encode_fattr+0x646/0x1e70 [nfsd]
[ 1610.168320]  [<ffffffff816a6e6e>] ? kmemleak_alloc+0x4e/0xb0
[ 1610.168320]  [<ffffffffa0327962>] ?
nfsd_setuser_and_check_port+0x52/0x80 [nfsd]
[ 1610.168320]  [<ffffffff812cd4bb>] ? selinux_cred_prepare+0x1b/0x30
[ 1610.168320]  [<ffffffffa0341caa>] nfsd4_encode_getattr+0x5a/0x60 [nfsd]
[ 1610.168320]  [<ffffffffa0341e07>] nfsd4_encode_operation+0x67/0x110
[nfsd]
[ 1610.168320]  [<ffffffffa033844d>] nfsd4_proc_compound+0x21d/0x810 [nfsd]
[ 1610.168320]  [<ffffffffa0324d9b>] nfsd_dispatch+0xbb/0x200 [nfsd]
[ 1610.168320]  [<ffffffffa00850cd>] svc_process_common+0x46d/0x6d0 [sunrpc]
[ 1610.168320]  [<ffffffffa0085433>] svc_process+0x103/0x170 [sunrpc]
[ 1610.168320]  [<ffffffffa032472f>] nfsd+0xbf/0x130 [nfsd]
[ 1610.168320]  [<ffffffffa0324670>] ? nfsd_destroy+0x80/0x80 [nfsd]
[ 1610.168320]  [<ffffffff810a5202>] kthread+0xd2/0xf0
[ 1610.168320]  [<ffffffff810a5130>] ? insert_kthread_work+0x40/0x40
[ 1610.168320]  [<ffffffff816c1ebc>] ret_from_fork+0x7c/0xb0
[ 1610.168320]  [<ffffffff810a5130>] ? insert_kthread_work+0x40/0x40
[ 1610.168320] Code: 78 02 e9 e7 fc ff ff 31 c0 31 d2 31 c9 66 89 45 ce
41 8b 04 24 66 89 55 d0 66 89 4d d2 48 8d 04 80 49 8d 5c 84 04 e9 37 fd
ff ff <0f> 0b 90 0f 1f 44 00 00 55 8b 56 08 c7 07 00 00 00 00 8b 46 0c
[ 1610.168320] RIP  [<ffffffffa034d5ed>] _posix_to_nfsv4_one+0x3cd/0x3d0
[nfsd]
[ 1610.168320]  RSP <ffff88005a945b00>
[ 1610.257313] ---[ end trace 838254e3e352285b ]---

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/nfsd/nfs4acl.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index 8a50b3c18093..e15bcbd5043c 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -385,8 +385,10 @@ sort_pacl(struct posix_acl *pacl)
 	 * by uid/gid. */
 	int i, j;
 
-	if (pacl->a_count <= 4)
-		return; /* no users or groups */
+	/* no users or groups */
+	if (!pacl || pacl->a_count <= 4)
+		return;
+
 	i = 1;
 	while (pacl->a_entries[i].e_tag == ACL_USER)
 		i++;
@@ -513,13 +515,12 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags)
 
 	/*
 	 * ACLs with no ACEs are treated differently in the inheritable
-	 * and effective cases: when there are no inheritable ACEs, we
-	 * set a zero-length default posix acl:
+	 * and effective cases: when there are no inheritable ACEs,
+	 * calls ->set_acl with a NULL ACL structure.
 	 */
-	if (state->empty && (flags & NFS4_ACL_TYPE_DEFAULT)) {
-		pacl = posix_acl_alloc(0, GFP_KERNEL);
-		return pacl ? pacl : ERR_PTR(-ENOMEM);
-	}
+	if (state->empty && (flags & NFS4_ACL_TYPE_DEFAULT))
+		return NULL;
+
 	/*
 	 * When there are no effective ACEs, the following will end
 	 * up setting a 3-element effective posix ACL with all
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 100/146] nfsd4: warn on finding lockowner without stateid's
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (98 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 099/146] NFSD: Call ->set_acl with a NULL ACL structure if no entries Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 101/146] nfsd4: remove lockowner when removing lock stateid Jiri Slaby
                   ` (47 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, J. Bruce Fields, Jiri Slaby

From: "J. Bruce Fields" <bfields@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 27b11428b7de097c42f205beabb1764f4365443b upstream.

The current code assumes a one-to-one lockowner<->lock stateid
correspondance.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/nfsd/nfs4state.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index b21ed5e5b369..6f1250c14606 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4142,6 +4142,10 @@ static bool same_lockowner_ino(struct nfs4_lockowner *lo, struct inode *inode, c
 
 	if (!same_owner_str(&lo->lo_owner, owner, clid))
 		return false;
+	if (list_empty(&lo->lo_owner.so_stateids)) {
+		WARN_ON_ONCE(1);
+		return false;
+	}
 	lst = list_first_entry(&lo->lo_owner.so_stateids,
 			       struct nfs4_ol_stateid, st_perstateowner);
 	return lst->st_file->fi_inode == inode;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 101/146] nfsd4: remove lockowner when removing lock stateid
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (99 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 100/146] nfsd4: warn on finding lockowner without stateid's Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 102/146] workqueue: fix bugs in wq_update_unbound_numa() failure path Jiri Slaby
                   ` (46 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, J. Bruce Fields, Jiri Slaby

From: "J. Bruce Fields" <bfields@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit a1b8ff4c97b4375d21b6d6c45d75877303f61b3b upstream.

The nfsv4 state code has always assumed a one-to-one correspondance
between lock stateid's and lockowners even if it appears not to in some
places.

We may actually change that, but for now when FREE_STATEID releases a
lock stateid it also needs to release the parent lockowner.

Symptoms were a subsequent LOCK crashing in find_lockowner_str when it
calls same_lockowner_ino on a lockowner that unexpectedly has an empty
so_stateids list.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 fs/nfsd/nfs4state.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 6f1250c14606..ded7af3c45e1 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3696,9 +3696,16 @@ out:
 static __be32
 nfsd4_free_lock_stateid(struct nfs4_ol_stateid *stp)
 {
-	if (check_for_locks(stp->st_file, lockowner(stp->st_stateowner)))
+	struct nfs4_lockowner *lo = lockowner(stp->st_stateowner);
+
+	if (check_for_locks(stp->st_file, lo))
 		return nfserr_locks_held;
-	release_lock_stateid(stp);
+	/*
+	 * Currently there's a 1-1 lock stateid<->lockowner
+	 * correspondance, and we have to delete the lockowner when we
+	 * delete the lock stateid:
+	 */
+	unhash_lockowner(lo);
 	return nfs_ok;
 }
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 102/146] workqueue: fix bugs in wq_update_unbound_numa() failure path
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (100 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 101/146] nfsd4: remove lockowner when removing lock stateid Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 103/146] workqueue: fix a possible race condition between rescuer and pwq-release Jiri Slaby
                   ` (45 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Daeseok Youn, Tejun Heo, Jiri Slaby

From: Daeseok Youn <daeseok.youn@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 77f300b198f93328c26191b52655ce1b62e202cf upstream.

wq_update_unbound_numa() failure path has the following two bugs.

- alloc_unbound_pwq() is called without holding wq->mutex; however, if
  the allocation fails, it jumps to out_unlock which tries to unlock
  wq->mutex.

- The function should switch to dfl_pwq on failure but didn't do so
  after alloc_unbound_pwq() failure.

Fix it by regrabbing wq->mutex and jumping to use_dfl_pwq on
alloc_unbound_pwq() failure.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Acked-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 4c16bd327c74 ("workqueue: implement NUMA affinity for unbound workqueues")
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/workqueue.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 60fee69c37be..9ae0693ca520 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4090,7 +4090,8 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu,
 	if (!pwq) {
 		pr_warning("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n",
 			   wq->name);
-		goto out_unlock;
+		mutex_lock(&wq->mutex);
+		goto use_dfl_pwq;
 	}
 
 	/*
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 103/146] workqueue: fix a possible race condition between rescuer and pwq-release
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (101 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 102/146] workqueue: fix bugs in wq_update_unbound_numa() failure path Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 104/146] workqueue: make rescuer_thread() empty wq->maydays list before exiting Jiri Slaby
                   ` (44 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Lai Jiangshan, Tejun Heo, Jiri Slaby

From: Lai Jiangshan <laijs@cn.fujitsu.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 77668c8b559e4fe2acf2a0749c7c83cde49a5025 upstream.

There is a race condition between rescuer_thread() and
pwq_unbound_release_workfn().

Even after a pwq is scheduled for rescue, the associated work items
may be consumed by any worker.  If all of them are consumed before the
rescuer gets to them and the pwq's base ref was put due to attribute
change, the pwq may be released while still being linked on
@wq->maydays list making the rescuer dereference already freed pwq
later.

Make send_mayday() pin the target pwq until the rescuer is done with
it.

tj: Updated comment and patch description.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/workqueue.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 9ae0693ca520..c0b6eb1e0b83 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1901,6 +1901,12 @@ static void send_mayday(struct work_struct *work)
 
 	/* mayday mayday mayday */
 	if (list_empty(&pwq->mayday_node)) {
+		/*
+		 * If @pwq is for an unbound wq, its base ref may be put at
+		 * any time due to an attribute change.  Pin @pwq until the
+		 * rescuer is done with it.
+		 */
+		get_pwq(pwq);
 		list_add_tail(&pwq->mayday_node, &wq->maydays);
 		wake_up_process(wq->rescuer->task);
 	}
@@ -2430,6 +2436,12 @@ repeat:
 		process_scheduled_works(rescuer);
 
 		/*
+		 * Put the reference grabbed by send_mayday().  @pool won't
+		 * go away while we're holding its lock.
+		 */
+		put_pwq(pwq);
+
+		/*
 		 * Leave this pool.  If keep_working() is %true, notify a
 		 * regular worker; otherwise, we end up with 0 concurrency
 		 * and stalling the execution.
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 104/146] workqueue: make rescuer_thread() empty wq->maydays list before exiting
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (102 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 103/146] workqueue: fix a possible race condition between rescuer and pwq-release Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 105/146] memory: mvebu-devbus: fix the conversion of the bus width Jiri Slaby
                   ` (43 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Lai Jiangshan, Tejun Heo, Jiri Slaby

From: Lai Jiangshan <laijs@cn.fujitsu.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 4d595b866d2c653dc90a492b9973a834eabfa354 upstream.

After a @pwq is scheduled for emergency execution, other workers may
consume the affectd work items before the rescuer gets to them.  This
means that a workqueue many have pwqs queued on @wq->maydays list
while not having any work item pending or in-flight.  If
destroy_workqueue() executes in such condition, the rescuer may exit
without emptying @wq->maydays.

This currently doesn't cause any actual harm.  destroy_workqueue() can
safely destroy all the involved data structures whether @wq->maydays
is populated or not as nobody access the list once the rescuer exits.

However, this is nasty and makes future development difficult.  Let's
update rescuer_thread() so that it empties @wq->maydays after seeing
should_stop to guarantee that the list is empty on rescuer exit.

tj: Updated comment and patch description.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/workqueue.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index c0b6eb1e0b83..cea58300f650 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2389,6 +2389,7 @@ static int rescuer_thread(void *__rescuer)
 	struct worker *rescuer = __rescuer;
 	struct workqueue_struct *wq = rescuer->rescue_wq;
 	struct list_head *scheduled = &rescuer->scheduled;
+	bool should_stop;
 
 	set_user_nice(current, RESCUER_NICE_LEVEL);
 
@@ -2400,11 +2401,15 @@ static int rescuer_thread(void *__rescuer)
 repeat:
 	set_current_state(TASK_INTERRUPTIBLE);
 
-	if (kthread_should_stop()) {
-		__set_current_state(TASK_RUNNING);
-		rescuer->task->flags &= ~PF_WQ_WORKER;
-		return 0;
-	}
+	/*
+	 * By the time the rescuer is requested to stop, the workqueue
+	 * shouldn't have any work pending, but @wq->maydays may still have
+	 * pwq(s) queued.  This can happen by non-rescuer workers consuming
+	 * all the work items before the rescuer got to them.  Go through
+	 * @wq->maydays processing before acting on should_stop so that the
+	 * list is always empty on exit.
+	 */
+	should_stop = kthread_should_stop();
 
 	/* see whether any pwq is asking for help */
 	spin_lock_irq(&wq_mayday_lock);
@@ -2456,6 +2461,12 @@ repeat:
 
 	spin_unlock_irq(&wq_mayday_lock);
 
+	if (should_stop) {
+		__set_current_state(TASK_RUNNING);
+		rescuer->task->flags &= ~PF_WQ_WORKER;
+		return 0;
+	}
+
 	/* rescuers should never participate in concurrency management */
 	WARN_ON_ONCE(!(rescuer->flags & WORKER_NOT_RUNNING));
 	schedule();
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 105/146] memory: mvebu-devbus: fix the conversion of the bus width
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (103 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 104/146] workqueue: make rescuer_thread() empty wq->maydays list before exiting Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 106/146] PCI: mvebu: fix off-by-one in the computed size of the mbus windows Jiri Slaby
                   ` (42 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Thomas Petazzoni, Jason Cooper, Jiri Slaby

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit ce965c3d2e68c5325dd5624eb101d70423022fef upstream.

According to the Armada 370 and Armada XP datasheets, the part of the
Device Bus register that configure the bus width should contain 0 for
a 8 bits bus width, and 1 for a 16 bits bus width (other values are
unsupported/reserved).

However, the current conversion done in the driver to convert from a
bus width in bits to the value expected by the register leads to
setting the register to 1 for a 8 bits bus, and 2 for a 16 bits bus.

This mistake was compensated by a mistake in the existing Device Tree
files for Armada 370/XP platforms: they were declaring a 8 bits bus
width, while the hardware in fact uses a 16 bits bus width.

This commit fixes that by adjusting the conversion logic.

This patch fixes a bug that was introduced in
3edad321b1bd2e6c8b5f38146c115c8982438f06 ('drivers: memory: Introduce
Marvell EBU Device Bus driver'), which was merged in v3.11.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397489361-5833-2-git-send-email-thomas.petazzoni@free-electrons.com
Fixes: 3edad321b1bd ('drivers: memory: Introduce Marvell EBU Device Bus driver')
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/memory/mvebu-devbus.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/memory/mvebu-devbus.c b/drivers/memory/mvebu-devbus.c
index 110c03627051..b59a17fb7c3e 100644
--- a/drivers/memory/mvebu-devbus.c
+++ b/drivers/memory/mvebu-devbus.c
@@ -108,8 +108,19 @@ static int devbus_set_timing_params(struct devbus *devbus,
 			node->full_name);
 		return err;
 	}
-	/* Convert bit width to byte width */
-	r.bus_width /= 8;
+
+	/*
+	 * The bus width is encoded into the register as 0 for 8 bits,
+	 * and 1 for 16 bits, so we do the necessary conversion here.
+	 */
+	if (r.bus_width == 8)
+		r.bus_width = 0;
+	else if (r.bus_width == 16)
+		r.bus_width = 1;
+	else {
+		dev_err(devbus->dev, "invalid bus width %d\n", r.bus_width);
+		return -EINVAL;
+	}
 
 	err = get_timing_param_ps(devbus, node, "devbus,badr-skew-ps",
 				 &r.badr_skew);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 106/146] PCI: mvebu: fix off-by-one in the computed size of the mbus windows
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (104 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 105/146] memory: mvebu-devbus: fix the conversion of the bus width Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 107/146] bus: mvebu-mbus: allow several windows with the same target/attribute Jiri Slaby
                   ` (41 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Willy Tarreau, Thomas Petazzoni, Jason Cooper, Jiri Slaby

From: Willy Tarreau <w@1wt.eu>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit b6d07e0273d3296cfbdc88145b8a00ddbefb310a upstream.

mvebu_pcie_handle_membase_change() and
mvebu_pcie_handle_iobase_change() do not correctly compute the window
size. PCI uses an inclusive start/end address pair, which requires a
+1 when converting to size.

This only worked because a bug in the mbus driver allowed it to
silently accept and round up bogus sizes.

Fix this by adding one to the computed size.

Fixes: 45361a4fe446 ('PCIe driver for Marvell Armada 370/XP systems')
Signed-off-by: Willy Tarreau <w@1wt.eu>
Reviewed-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397823593-1932-5-git-send-email-thomas.petazzoni@free-electrons.com
Tested-by: Neil Greatorex <neil@fatboyfat.co.uk>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/pci/host/pci-mvebu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index b4214cba58b7..fdd81f24a9cf 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -297,7 +297,7 @@ static void mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
 	port->iowin_base = port->pcie->io.start + iobase;
 	port->iowin_size = ((0xFFF | ((port->bridge.iolimit & 0xF0) << 8) |
 			    (port->bridge.iolimitupper << 16)) -
-			    iobase);
+			    iobase) + 1;
 
 	mvebu_mbus_add_window_remap_by_id(port->io_target, port->io_attr,
 					  port->iowin_base, port->iowin_size,
@@ -331,7 +331,7 @@ static void mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
 	port->memwin_base  = ((port->bridge.membase & 0xFFF0) << 16);
 	port->memwin_size  =
 		(((port->bridge.memlimit & 0xFFF0) << 16) | 0xFFFFF) -
-		port->memwin_base;
+		port->memwin_base + 1;
 
 	mvebu_mbus_add_window_by_id(port->mem_target, port->mem_attr,
 				    port->memwin_base, port->memwin_size);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 107/146] bus: mvebu-mbus: allow several windows with the same target/attribute
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (105 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 106/146] PCI: mvebu: fix off-by-one in the computed size of the mbus windows Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 108/146] percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree() Jiri Slaby
                   ` (40 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Thomas Petazzoni, Jason Cooper, Jiri Slaby

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit b566e782be32145664d96ada3e389f17d32742e5 upstream.

Having multiple windows with the same target and attribute is actually
legal, and can be useful for PCIe windows, when PCIe BARs have a size
that isn't a power of two, and we therefore need to create several
MBus windows to cover the PCIe BAR for a given PCIe interface.

Fixes: fddddb52a6c4 ('bus: introduce an Marvell EBU MBus driver')
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397823593-1932-7-git-send-email-thomas.petazzoni@free-electrons.com
Tested-by: Neil Greatorex <neil@fatboyfat.co.uk>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/bus/mvebu-mbus.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 2394e9753ef5..b4bd72b6fdc8 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -222,12 +222,6 @@ static int mvebu_mbus_window_conflicts(struct mvebu_mbus_state *mbus,
 		 */
 		if ((u64)base < wend && end > wbase)
 			return 0;
-
-		/*
-		 * Check if target/attribute conflicts
-		 */
-		if (target == wtarget && attr == wattr)
-			return 0;
 	}
 
 	return 1;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 108/146] percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (106 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 107/146] bus: mvebu-mbus: allow several windows with the same target/attribute Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 109/146] ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile Jiri Slaby
                   ` (39 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jianyu Zhan, Tejun Heo, Jiri Slaby

From: Jianyu Zhan <nasa4836@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 5a838c3b60e3a36ade764cf7751b8f17d7c9c2da upstream.

pcpu_chunk_struct_size = sizeof(struct pcpu_chunk) +
	BITS_TO_LONGS(pcpu_unit_pages) * sizeof(unsigned long)

It hardly could be ever bigger than PAGE_SIZE even for large-scale machine,
but for consistency with its couterpart pcpu_mem_zalloc(),
use pcpu_mem_free() instead.

Commit b4916cb17c26 ("percpu: make pcpu_free_chunk() use
pcpu_mem_free() instead of kfree()") addressed this problem, but
missed this one.

tj: commit message updated

Signed-off-by: Jianyu Zhan <nasa4836@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 099a19d91ca4 ("percpu: allow limited allocation before slab is online)
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 mm/percpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/percpu.c b/mm/percpu.c
index 8c8e08f3a692..25e2ea52db82 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -612,7 +612,7 @@ static struct pcpu_chunk *pcpu_alloc_chunk(void)
 	chunk->map = pcpu_mem_zalloc(PCPU_DFL_MAP_ALLOC *
 						sizeof(chunk->map[0]));
 	if (!chunk->map) {
-		kfree(chunk);
+		pcpu_mem_free(chunk, pcpu_chunk_struct_size);
 		return NULL;
 	}
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 109/146] ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (107 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 108/146] percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree() Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 110/146] metag: fix memory barriers Jiri Slaby
                   ` (38 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Charles Keepax, Mark Brown, Jiri Slaby

From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 44330ab516c15dda8a1e660eeaf0003f84e43e3f upstream.

The register CLASS_D_CONTROL_1 is marked as volatile because it contains
a bit, DAC_MUTE, which is also mirrored in the ADC_DAC_CONTROL_1
register. This causes problems for the "Speaker Switch" control, which
will report an error if the CODEC is suspended because it relies on a
volatile register.

To resolve this issue mark CLASS_D_CONTROL_1 as non-volatile and
manually keep the register cache in sync by updating both bits when
changing the mute status.

Reported-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 sound/soc/codecs/wm8962.c | 15 ++++++++++++---
 sound/soc/codecs/wm8962.h |  4 ++++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 871f8518626f..ea16dc456352 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -154,6 +154,7 @@ static struct reg_default wm8962_reg[] = {
 	{ 40, 0x0000 },   /* R40    - SPKOUTL volume */
 	{ 41, 0x0000 },   /* R41    - SPKOUTR volume */
 
+	{ 49, 0x0010 },   /* R49    - Class D Control 1 */
 	{ 51, 0x0003 },   /* R51    - Class D Control 2 */
 
 	{ 56, 0x0506 },   /* R56    - Clocking 4 */
@@ -795,7 +796,6 @@ static bool wm8962_volatile_register(struct device *dev, unsigned int reg)
 	case WM8962_ALC2:
 	case WM8962_THERMAL_SHUTDOWN_STATUS:
 	case WM8962_ADDITIONAL_CONTROL_4:
-	case WM8962_CLASS_D_CONTROL_1:
 	case WM8962_DC_SERVO_6:
 	case WM8962_INTERRUPT_STATUS_1:
 	case WM8962_INTERRUPT_STATUS_2:
@@ -2901,13 +2901,22 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
 static int wm8962_mute(struct snd_soc_dai *dai, int mute)
 {
 	struct snd_soc_codec *codec = dai->codec;
-	int val;
+	int val, ret;
 
 	if (mute)
-		val = WM8962_DAC_MUTE;
+		val = WM8962_DAC_MUTE | WM8962_DAC_MUTE_ALT;
 	else
 		val = 0;
 
+	/**
+	 * The DAC mute bit is mirrored in two registers, update both to keep
+	 * the register cache consistent.
+	 */
+	ret = snd_soc_update_bits(codec, WM8962_CLASS_D_CONTROL_1,
+				  WM8962_DAC_MUTE_ALT, val);
+	if (ret < 0)
+		return ret;
+
 	return snd_soc_update_bits(codec, WM8962_ADC_DAC_CONTROL_1,
 				   WM8962_DAC_MUTE, val);
 }
diff --git a/sound/soc/codecs/wm8962.h b/sound/soc/codecs/wm8962.h
index a1a5d5294c19..910aafd09d21 100644
--- a/sound/soc/codecs/wm8962.h
+++ b/sound/soc/codecs/wm8962.h
@@ -1954,6 +1954,10 @@
 #define WM8962_SPKOUTL_ENA_MASK                 0x0040  /* SPKOUTL_ENA */
 #define WM8962_SPKOUTL_ENA_SHIFT                     6  /* SPKOUTL_ENA */
 #define WM8962_SPKOUTL_ENA_WIDTH                     1  /* SPKOUTL_ENA */
+#define WM8962_DAC_MUTE_ALT                     0x0010  /* DAC_MUTE */
+#define WM8962_DAC_MUTE_ALT_MASK                0x0010  /* DAC_MUTE */
+#define WM8962_DAC_MUTE_ALT_SHIFT                    4  /* DAC_MUTE */
+#define WM8962_DAC_MUTE_ALT_WIDTH                    1  /* DAC_MUTE */
 #define WM8962_SPKOUTL_PGA_MUTE                 0x0002  /* SPKOUTL_PGA_MUTE */
 #define WM8962_SPKOUTL_PGA_MUTE_MASK            0x0002  /* SPKOUTL_PGA_MUTE */
 #define WM8962_SPKOUTL_PGA_MUTE_SHIFT                1  /* SPKOUTL_PGA_MUTE */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 110/146] metag: fix memory barriers
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (108 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 109/146] ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 111/146] metag: Reduce maximum stack size to 256MB Jiri Slaby
                   ` (37 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Mikulas Patocka, James Hogan, Jiri Slaby

From: Mikulas Patocka <mpatocka@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 2425ce84026c385b73ae72039f90d042d49e0394 upstream.

Volatile access doesn't really imply the compiler barrier. Volatile access
is only ordered with respect to other volatile accesses, it isn't ordered
with respect to general memory accesses. Gcc may reorder memory accesses
around volatile access, as we can see in this simple example (if we
compile it with optimization, both increments of *b will be collapsed to
just one):

void fn(volatile int *a, long *b)
{
	(*b)++;
	*a = 10;
	(*b)++;
}

Consequently, we need the compiler barrier after a write to the volatile
variable, to make sure that the compiler doesn't reorder the volatile
write with something else.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/metag/include/asm/barrier.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/metag/include/asm/barrier.h b/arch/metag/include/asm/barrier.h
index c90bfc6bf648..e355a4c10968 100644
--- a/arch/metag/include/asm/barrier.h
+++ b/arch/metag/include/asm/barrier.h
@@ -15,6 +15,7 @@ static inline void wr_fence(void)
 	volatile int *flushptr = (volatile int *) LINSYSEVENT_WR_FENCE;
 	barrier();
 	*flushptr = 0;
+	barrier();
 }
 
 #else /* CONFIG_METAG_META21 */
@@ -35,6 +36,7 @@ static inline void wr_fence(void)
 	*flushptr = 0;
 	*flushptr = 0;
 	*flushptr = 0;
+	barrier();
 }
 
 #endif /* !CONFIG_METAG_META21 */
@@ -68,6 +70,7 @@ static inline void fence(void)
 	volatile int *flushptr = (volatile int *) LINSYSEVENT_WR_ATOMIC_UNLOCK;
 	barrier();
 	*flushptr = 0;
+	barrier();
 }
 #define smp_mb()        fence()
 #define smp_rmb()       fence()
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 111/146] metag: Reduce maximum stack size to 256MB
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (109 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 110/146] metag: fix memory barriers Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 112/146] x86-64, modify_ldt: Make support for 16-bit segments a runtime option Jiri Slaby
                   ` (36 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, James Hogan, Helge Deller, James E.J. Bottomley,
	linux-parisc, linux-metag, John David Anglin, Jiri Slaby

From: James Hogan <james.hogan@imgtec.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit d71f290b4e98a39f49f2595a13be3b4d5ce8e1f1 upstream.

Specify the maximum stack size for arches where the stack grows upward
(parisc and metag) in asm/processor.h rather than hard coding in
fs/exec.c so that metag can specify a smaller value of 256MB rather than
1GB.

This fixes a BUG on metag if the RLIMIT_STACK hard limit is increased
beyond a safe value by root. E.g. when starting a process after running
"ulimit -H -s unlimited" it will then attempt to use a stack size of the
maximum 1GB which is far too big for metag's limited user virtual
address space (stack_top is usually 0x3ffff000):

BUG: failure at fs/exec.c:589/shift_arg_pages()!

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: linux-parisc@vger.kernel.org
Cc: linux-metag@vger.kernel.org
Cc: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/metag/include/asm/processor.h  | 2 ++
 arch/parisc/include/asm/processor.h | 2 ++
 fs/exec.c                           | 6 +++---
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/metag/include/asm/processor.h b/arch/metag/include/asm/processor.h
index f16477d1f571..3be8581af495 100644
--- a/arch/metag/include/asm/processor.h
+++ b/arch/metag/include/asm/processor.h
@@ -22,6 +22,8 @@
 /* Add an extra page of padding at the top of the stack for the guard page. */
 #define STACK_TOP	(TASK_SIZE - PAGE_SIZE)
 #define STACK_TOP_MAX	STACK_TOP
+/* Maximum virtual space for stack */
+#define STACK_SIZE_MAX	(1 << 28)	/* 256 MB */
 
 /* This decides where the kernel will search for a free chunk of vm
  * space during mmap's.
diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
index cc2290a3cace..c6ee86542fec 100644
--- a/arch/parisc/include/asm/processor.h
+++ b/arch/parisc/include/asm/processor.h
@@ -53,6 +53,8 @@
 #define STACK_TOP	TASK_SIZE
 #define STACK_TOP_MAX	DEFAULT_TASK_SIZE
 
+#define STACK_SIZE_MAX	(1 << 30)	/* 1 GB */
+
 #endif
 
 #ifndef __ASSEMBLY__
diff --git a/fs/exec.c b/fs/exec.c
index bb8afc1d1df4..95eef54de2b6 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -657,10 +657,10 @@ int setup_arg_pages(struct linux_binprm *bprm,
 	unsigned long rlim_stack;
 
 #ifdef CONFIG_STACK_GROWSUP
-	/* Limit stack size to 1GB */
+	/* Limit stack size */
 	stack_base = rlimit_max(RLIMIT_STACK);
-	if (stack_base > (1 << 30))
-		stack_base = 1 << 30;
+	if (stack_base > STACK_SIZE_MAX)
+		stack_base = STACK_SIZE_MAX;
 
 	/* Make sure we didn't let the argument array grow too large. */
 	if (vma->vm_end - vma->vm_start > stack_base)
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 112/146] x86-64, modify_ldt: Make support for 16-bit segments a runtime option
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (110 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 111/146] metag: Reduce maximum stack size to 256MB Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 113/146] genirq: Provide irq_force_affinity fallback for non-SMP Jiri Slaby
                   ` (35 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Linus Torvalds, H. Peter Anvin, Jiri Slaby

From: Linus Torvalds <torvalds@linux-foundation.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit fa81511bb0bbb2b1aace3695ce869da9762624ff upstream.

Checkin:

b3b42ac2cbae x86-64, modify_ldt: Ban 16-bit segments on 64-bit kernels

disabled 16-bit segments on 64-bit kernels due to an information
leak.  However, it does seem that people are genuinely using Wine to
run old 16-bit Windows programs on Linux.

A proper fix for this ("espfix64") is coming in the upcoming merge
window, but as a temporary fix, create a sysctl to allow the
administrator to re-enable support for 16-bit segments.

It adds a "/proc/sys/abi/ldt16" sysctl that defaults to zero (off). If
you hit this issue and care about your old Windows program more than
you care about a kernel stack address information leak, you can do

   echo 1 > /proc/sys/abi/ldt16

as root (add it to your startup scripts), and you should be ok.

The sysctl table is only added if you have COMPAT support enabled on
x86-64, but I assume anybody who runs old windows binaries very much
does that ;)

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/r/CA%2B55aFw9BPoD10U1LfHbOMpHWZkvJTkMcfCs9s3urPr1YyWBxw@mail.gmail.com
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/x86/kernel/ldt.c        | 4 +++-
 arch/x86/vdso/vdso32-setup.c | 8 ++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index af1d14a9ebda..dcbbaa165bde 100644
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -20,6 +20,8 @@
 #include <asm/mmu_context.h>
 #include <asm/syscalls.h>
 
+int sysctl_ldt16 = 0;
+
 #ifdef CONFIG_SMP
 static void flush_ldt(void *current_mm)
 {
@@ -234,7 +236,7 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode)
 	 * IRET leaking the high bits of the kernel stack address.
 	 */
 #ifdef CONFIG_X86_64
-	if (!ldt_info.seg_32bit) {
+	if (!ldt_info.seg_32bit && !sysctl_ldt16) {
 		error = -EINVAL;
 		goto out_unlock;
 	}
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index d6bfb876cfb0..f1d633a43f8e 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -41,6 +41,7 @@ enum {
 #ifdef CONFIG_X86_64
 #define vdso_enabled			sysctl_vsyscall32
 #define arch_setup_additional_pages	syscall32_setup_pages
+extern int sysctl_ldt16;
 #endif
 
 /*
@@ -380,6 +381,13 @@ static struct ctl_table abi_table2[] = {
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec
 	},
+	{
+		.procname	= "ldt16",
+		.data		= &sysctl_ldt16,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec
+	},
 	{}
 };
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 113/146] genirq: Provide irq_force_affinity fallback for non-SMP
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (111 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 112/146] x86-64, modify_ldt: Make support for 16-bit segments a runtime option Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 114/146] PCI: shpchp: Check bridge's secondary (not primary) bus speed Jiri Slaby
                   ` (34 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Arnd Bergmann, Krzysztof Kozlowski,
	Thomas Gleixner, Jiri Slaby

From: Arnd Bergmann <arnd@arndb.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 4c88d7f9b0d5fb0588c3386be62115cc2eaa8f9f upstream.

Patch 01f8fa4f01d "genirq: Allow forcing cpu affinity of interrupts" added
an irq_force_affinity() function, and 30ccf03b4a6 "clocksource: Exynos_mct:
Use irq_force_affinity() in cpu bringup" subsequently uses it. However, the
driver can be used with CONFIG_SMP disabled, but the function declaration
is only available for CONFIG_SMP, leading to this build error:

drivers/clocksource/exynos_mct.c:431:3: error: implicit declaration of function 'irq_force_affinity' [-Werror=implicit-function-declaration]
   irq_force_affinity(mct_irqs[MCT_L0_IRQ + cpu], cpumask_of(cpu));

This patch introduces a dummy helper function for the non-SMP case
that always returns success, to get rid of the build error.
Since the patches causing the problem are marked for stable backports,
this one should be as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Link: http://lkml.kernel.org/r/5619084.0zmrrIUZLV@wuerfel
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/linux/interrupt.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index e7777c940972..623ab2d787d9 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -267,6 +267,11 @@ static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
 	return -EINVAL;
 }
 
+static inline int irq_force_affinity(unsigned int irq, const struct cpumask *cpumask)
+{
+	return 0;
+}
+
 static inline int irq_can_set_affinity(unsigned int irq)
 {
 	return 0;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 114/146] PCI: shpchp: Check bridge's secondary (not primary) bus speed
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (112 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 113/146] genirq: Provide irq_force_affinity fallback for non-SMP Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 115/146] Target/iser: Fix wrong connection requests list addition Jiri Slaby
                   ` (33 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Marcel Apfelbaum, Bjorn Helgaas, Jiri Slaby

From: Marcel Apfelbaum <marcel.a@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 93fa9d32670f5592c8e56abc9928fc194e1e72fc upstream.

When a new device is added below a hotplug bridge, the bridge's secondary
bus speed and the device's bus speed must match.  The shpchp driver
previously checked the bridge's *primary* bus speed, not the secondary bus
speed.

This caused hot-add errors like:

  shpchp 0000:00:03.0: Speed of bus ff and adapter 0 mismatch

Check the secondary bus speed instead.

[bhelgaas: changelog]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=75251
Fixes: 3749c51ac6c1 ("PCI: Make current and maximum bus speeds part of the PCI core")
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/pci/hotplug/shpchp_ctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index 58499277903a..6efc2ec5e4db 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -282,8 +282,8 @@ static int board_added(struct slot *p_slot)
 		return WRONG_BUS_FREQUENCY;
 	}
 
-	bsp = ctrl->pci_dev->bus->cur_bus_speed;
-	msp = ctrl->pci_dev->bus->max_bus_speed;
+	bsp = ctrl->pci_dev->subordinate->cur_bus_speed;
+	msp = ctrl->pci_dev->subordinate->max_bus_speed;
 
 	/* Check if there are other slots or devices on the same bus */
 	if (!list_empty(&ctrl->pci_dev->subordinate->devices))
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 115/146] Target/iser: Fix wrong connection requests list addition
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (113 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 114/146] PCI: shpchp: Check bridge's secondary (not primary) bus speed Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 116/146] Target/iser: Fix iscsit_accept_np and rdma_cm racy flow Jiri Slaby
                   ` (32 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Sagi Grimberg, Nicholas Bellinger, Jiri Slaby

From: Sagi Grimberg <sagig@mellanox.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 9fe63c88b1d59f1ce054d6948ccd3096496ecedb upstream.

Should be adding list_add_tail($new, $head) and not
the other way around.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 02e4d2efa208..d62b61cc6175 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -572,7 +572,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 		goto out_conn_dev;
 
 	mutex_lock(&isert_np->np_accept_mutex);
-	list_add_tail(&isert_np->np_accept_list, &isert_conn->conn_accept_node);
+	list_add_tail(&isert_conn->conn_accept_node, &isert_np->np_accept_list);
 	mutex_unlock(&isert_np->np_accept_mutex);
 
 	pr_debug("isert_connect_request() waking up np_accept_wq: %p\n", np);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 116/146] Target/iser: Fix iscsit_accept_np and rdma_cm racy flow
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (114 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 115/146] Target/iser: Fix wrong connection requests list addition Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 117/146] iscsi-target: Change BUG_ON to REJECT in iscsit_process_nop_out Jiri Slaby
                   ` (31 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Sagi Grimberg, Nicholas Bellinger, Jiri Slaby

From: Sagi Grimberg <sagig@mellanox.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 531b7bf4bd795d9a09eac92504322a472c010bc8 upstream.

RDMA CM and iSCSI target flows are asynchronous and completely
uncorrelated. Relying on the fact that iscsi_accept_np will be called
after CM connection request event and will wait for it is a mistake.

When attempting to login to a few targets this flow is racy and
unpredictable, but for parallel login to dozens of targets will
race and hang every time.

The correct synchronizing mechanism in this case is pending on
a semaphore rather than a wait_for_event. We keep the pending
interruptible for iscsi_np cleanup stage.

(Squash patch to remove dead code into parent - nab)

Reported-by: Slava Shwartsman <valyushash@gmail.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 25 ++++++-------------------
 drivers/infiniband/ulp/isert/ib_isert.h |  2 +-
 2 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index d62b61cc6175..e6737607a088 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -27,6 +27,7 @@
 #include <target/target_core_base.h>
 #include <target/target_core_fabric.h>
 #include <target/iscsi/iscsi_transport.h>
+#include <linux/semaphore.h>
 
 #include "isert_proto.h"
 #include "ib_isert.h"
@@ -575,8 +576,8 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 	list_add_tail(&isert_conn->conn_accept_node, &isert_np->np_accept_list);
 	mutex_unlock(&isert_np->np_accept_mutex);
 
-	pr_debug("isert_connect_request() waking up np_accept_wq: %p\n", np);
-	wake_up(&isert_np->np_accept_wq);
+	pr_debug("isert_connect_request() up np_sem np: %p\n", np);
+	up(&isert_np->np_sem);
 	return 0;
 
 out_conn_dev:
@@ -2477,7 +2478,7 @@ isert_setup_np(struct iscsi_np *np,
 		pr_err("Unable to allocate struct isert_np\n");
 		return -ENOMEM;
 	}
-	init_waitqueue_head(&isert_np->np_accept_wq);
+	sema_init(&isert_np->np_sem, 0);
 	mutex_init(&isert_np->np_accept_mutex);
 	INIT_LIST_HEAD(&isert_np->np_accept_list);
 	init_completion(&isert_np->np_login_comp);
@@ -2526,18 +2527,6 @@ out:
 }
 
 static int
-isert_check_accept_queue(struct isert_np *isert_np)
-{
-	int empty;
-
-	mutex_lock(&isert_np->np_accept_mutex);
-	empty = list_empty(&isert_np->np_accept_list);
-	mutex_unlock(&isert_np->np_accept_mutex);
-
-	return empty;
-}
-
-static int
 isert_rdma_accept(struct isert_conn *isert_conn)
 {
 	struct rdma_cm_id *cm_id = isert_conn->conn_cm_id;
@@ -2629,16 +2618,14 @@ isert_accept_np(struct iscsi_np *np, struct iscsi_conn *conn)
 	int max_accept = 0, ret;
 
 accept_wait:
-	ret = wait_event_interruptible(isert_np->np_accept_wq,
-			!isert_check_accept_queue(isert_np) ||
-			np->np_thread_state == ISCSI_NP_THREAD_RESET);
+	ret = down_interruptible(&isert_np->np_sem);
 	if (max_accept > 5)
 		return -ENODEV;
 
 	spin_lock_bh(&np->np_thread_lock);
 	if (np->np_thread_state == ISCSI_NP_THREAD_RESET) {
 		spin_unlock_bh(&np->np_thread_lock);
-		pr_err("ISCSI_NP_THREAD_RESET for isert_accept_np\n");
+		pr_debug("ISCSI_NP_THREAD_RESET for isert_accept_np\n");
 		return -ENODEV;
 	}
 	spin_unlock_bh(&np->np_thread_lock);
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h
index 52f4bf0d1a0f..ba695c33a2df 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.h
+++ b/drivers/infiniband/ulp/isert/ib_isert.h
@@ -154,7 +154,7 @@ struct isert_device {
 };
 
 struct isert_np {
-	wait_queue_head_t	np_accept_wq;
+	struct semaphore	np_sem;
 	struct rdma_cm_id	*np_cm_id;
 	struct mutex		np_accept_mutex;
 	struct list_head	np_accept_list;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 117/146] iscsi-target: Change BUG_ON to REJECT in iscsit_process_nop_out
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (115 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 116/146] Target/iser: Fix iscsit_accept_np and rdma_cm racy flow Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 118/146] target: Don't allow setting WC emulation if device doesn't support Jiri Slaby
                   ` (30 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Nicholas Bellinger, Jiri Slaby

From: Nicholas Bellinger <nab@linux-iscsi.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 7cbfcc953789ff864c2bf8365a82a3fba4869649 upstream.

This patch changes an incorrect use of BUG_ON to instead generate a
REJECT + PROTOCOL_ERROR in iscsit_process_nop_out() code.  This case
can occur with traditional TCP where a flood of zeros in the data
stream can reach this block for what is presumed to be a NOP-OUT with
a solicited reply, but without a valid iscsi_cmd pointer.

This incorrect BUG_ON was introduced during the v3.11-rc timeframe
with the following commit:

commit 778de368964c5b7e8100cde9f549992d521e9c89
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Fri Jun 14 16:07:47 2013 -0700

    iscsi/isert-target: Refactor ISCSI_OP_NOOP RX handling

Reported-by: Arshad Hussain <arshad.hussain@calsoftinc.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/target/iscsi/iscsi_target.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index b47c2be1c427..004e484a71cd 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1579,7 +1579,9 @@ int iscsit_process_nop_out(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
 	 * Initiator is expecting a NopIN ping reply..
 	 */
 	if (hdr->itt != RESERVED_ITT) {
-		BUG_ON(!cmd);
+		if (!cmd)
+			return iscsit_add_reject(conn, ISCSI_REASON_PROTOCOL_ERROR,
+						(unsigned char *)hdr);
 
 		spin_lock_bh(&conn->cmd_lock);
 		list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 118/146] target: Don't allow setting WC emulation if device doesn't support
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (116 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 117/146] iscsi-target: Change BUG_ON to REJECT in iscsit_process_nop_out Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 119/146] target: fix memory leak on XCOPY Jiri Slaby
                   ` (29 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Andy Grover, Nicholas Bellinger, Jiri Slaby

From: Andy Grover <agrover@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 07b8dae38b09bcfede7e726f172e39b5ce8390d9 upstream.

Just like for pSCSI, if the transport sets get_write_cache, then it is
not valid to enable write cache emulation for it. Return an error.

see https://bugzilla.redhat.com/show_bug.cgi?id=1082675

Reviewed-by: Chris Leech <cleech@redhat.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/target/target_core_device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index e5e39658034c..e31ec5cf0c36 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -799,10 +799,10 @@ int se_dev_set_emulate_write_cache(struct se_device *dev, int flag)
 		pr_err("emulate_write_cache not supported for pSCSI\n");
 		return -EINVAL;
 	}
-	if (dev->transport->get_write_cache) {
-		pr_warn("emulate_write_cache cannot be changed when underlying"
-			" HW reports WriteCacheEnabled, ignoring request\n");
-		return 0;
+	if (flag &&
+	    dev->transport->get_write_cache) {
+		pr_err("emulate_write_cache not supported for this device\n");
+		return -EINVAL;
 	}
 
 	dev->dev_attrib.emulate_write_cache = flag;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 119/146] target: fix memory leak on XCOPY
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (117 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 118/146] target: Don't allow setting WC emulation if device doesn't support Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 120/146] drm/i915: Disable self-refresh for untiled fbs on i915gm Jiri Slaby
                   ` (28 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Mikulas Patocka, Nicholas Bellinger, Jiri Slaby

From: Mikulas Patocka <mpatocka@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 1e1110c43b1cda9fe77fc4a04835e460550e6b3c upstream.

On each processed XCOPY command, two "kmalloc-512" memory objects are
leaked. These represent two allocations of struct xcopy_pt_cmd in
target_core_xcopy.c.

The reason for the memory leak is that the cmd_kref field is not
initialized (thus, it is zero because the allocations were done with
kzalloc). When we decrement zero kref in target_put_sess_cmd, the result
is not zero, thus target_release_cmd_kref is not called.

This patch fixes the bug by moving kref initialization from
target_get_sess_cmd to transport_init_se_cmd (this function is called from
target_core_xcopy.c, so it will correctly initialize cmd_kref). It can be
easily verified that all code that calls target_get_sess_cmd also calls
transport_init_se_cmd earlier, thus moving kref_init shouldn't introduce
any new problems.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/target/target_core_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 0b0009b5d4db..179141e03cb3 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1103,6 +1103,7 @@ void transport_init_se_cmd(
 	init_completion(&cmd->cmd_wait_comp);
 	init_completion(&cmd->task_stop_comp);
 	spin_lock_init(&cmd->t_state_lock);
+	kref_init(&cmd->cmd_kref);
 	cmd->transport_state = CMD_T_DEV_ACTIVE;
 
 	cmd->se_tfo = tfo;
@@ -2293,7 +2294,6 @@ int target_get_sess_cmd(struct se_session *se_sess, struct se_cmd *se_cmd,
 	unsigned long flags;
 	int ret = 0;
 
-	kref_init(&se_cmd->cmd_kref);
 	/*
 	 * Add a second kref if the fabric caller is expecting to handle
 	 * fabric acknowledgement that requires two target_put_sess_cmd()
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 120/146] drm/i915: Disable self-refresh for untiled fbs on i915gm
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (118 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 119/146] target: fix memory leak on XCOPY Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 121/146] drm/i915: Fix unsafe loop iteration over vma whilst unbinding them Jiri Slaby
                   ` (27 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Daniel Vetter, Ville Syrjälä,
	Chris Wilson, Krzysztof Mazur, Jani Nikula, Jiri Slaby

From: Daniel Vetter <daniel.vetter@ffwll.ch>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

This is commit 2ab1bc9df01dbc19b55b2271100db7 upstream.

Apparently it doesn't work. X-tiled self-refresh works flawlessly
otoh. Apparently X still works correctly with linear framebuffers, so
might just be an issue with the initial modeset. It's unclear whether
this just borked wm setup from our side or a hw restriction, but just
disabling gets things going.

Note that this regression was only brought to light with

commit 3f2dc5ac05714711fc14f2bf0ee5e42d5c08c581
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Fri Jan 10 14:06:47 2014 +0200

    drm/i915: Fix 915GM self-refresh enable/disable

before that self-refresh for i915GM didn't work at all.

Kudos to Ville for spotting a little bug in the original patch I've
attached to the bug.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76103
Tested-by: Krzysztof Mazur <krzysiek@podlesie.net>
Cc: Krzysztof Mazur <krzysiek@podlesie.net>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[Jani: rebase on top of drm-next with primary plane support.]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/i915/intel_pm.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 26c2ea3e985c..71a831ae73e9 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -1592,6 +1592,16 @@ static void i9xx_update_wm(struct drm_device *dev)
 
 	DRM_DEBUG_KMS("FIFO watermarks - A: %d, B: %d\n", planea_wm, planeb_wm);
 
+	if (IS_I915GM(dev) && enabled) {
+		struct intel_framebuffer *fb;
+
+		fb = to_intel_framebuffer(enabled->fb);
+
+		/* self-refresh seems busted with untiled */
+		if (fb->obj->tiling_mode == I915_TILING_NONE)
+			enabled = NULL;
+	}
+
 	/*
 	 * Overlay gets an aggressive default since video jitter is bad.
 	 */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 121/146] drm/i915: Fix unsafe loop iteration over vma whilst unbinding them
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (119 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 120/146] drm/i915: Disable self-refresh for untiled fbs on i915gm Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 122/146] drm/i915: quirk invert brightness for Acer Aspire 5336 Jiri Slaby
                   ` (26 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Chris Wilson, Ben Widawsky, Daniel Vetter, Jiri Slaby

From: Chris Wilson <chris@chris-wilson.co.uk>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

This is commit df6f783a4ef6790780a67c491897ac upstream.

On non-LLC platforms, when changing the cache level of an object, we may
need to unbind it so that prefetching across page boundaries does not
cross into a different memory domain. This requires us to unbind
conflicting vma, but we did so iterating over the objects vma in an
unsafe manner (as the list was being modified as we iterated).

The regression was introduced in
commit 3089c6f239d7d2c4cb2dd5c353e8984cf79af1d7
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Wed Jul 31 17:00:03 2013 -0700

    drm/i915: make caching operate on all address spaces
apparently as far back as v3.12-rc1, but it has only just begun to
trigger real world bug reports.

Reported-and-tested-by: Nikolay Martynov <mar.kolya@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76384
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/drm/i915/i915_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b00b32c992b0..35066a9b535f 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3419,7 +3419,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
 {
 	struct drm_device *dev = obj->base.dev;
 	drm_i915_private_t *dev_priv = dev->dev_private;
-	struct i915_vma *vma;
+	struct i915_vma *vma, *next;
 	int ret;
 
 	if (obj->cache_level == cache_level)
@@ -3430,7 +3430,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
 		return -EBUSY;
 	}
 
-	list_for_each_entry(vma, &obj->vma_list, vma_link) {
+	list_for_each_entry_safe(vma, next, &obj->vma_list, vma_link) {
 		if (!i915_gem_valid_gtt_space(dev, &vma->node, cache_level)) {
 			ret = i915_vma_unbind(vma);
 			if (ret)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 122/146] drm/i915: quirk invert brightness for Acer Aspire 5336
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (120 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 121/146] drm/i915: Fix unsafe loop iteration over vma whilst unbinding them Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 123/146] dm crypt: fix cpu hotplug crash by removing per-cpu structure Jiri Slaby
                   ` (25 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Jani Nikula, Daniel Vetter

From: Jani Nikula <jani.nikula@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

This is commit 0f540c3a7cfb91c9d7a19eb0c95c24 upstream.

Since
commit ee1452d7458451a7508e0663553ce88d63958157
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Fri Sep 20 15:05:30 2013 +0300

    drm/i915: assume all GM45 Acer laptops use inverted backlight PWM

failed and was later reverted in
commit be505f643925e257087247b996cd8ece787c12af
Author: Alexander van Heukelum <heukelum@fastmail.fm>
Date:   Sat Dec 28 21:00:39 2013 +0100

    Revert "drm/i915: assume all GM45 Acer laptops use inverted backlight PWM"

fix the individual broken machine instead.

Note to backporters:

http://patchwork.freedesktop.org/patch/17837/

is the patch you want for 3.13 and older.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=54171
Reference: http://mid.gmane.org/DUB115-W7628C7C710EA51AA110CD4A5000@phx.gbl
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[danvet: Patch mangling for 3.14 plus adding the link to the original
for 3.13.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c74bf330d290..837cc6cd7472 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10108,6 +10108,9 @@ static struct intel_quirk intel_quirks[] = {
 	/* Acer Aspire 4736Z */
 	{ 0x2a42, 0x1025, 0x0260, quirk_invert_brightness },
 
+	/* Acer Aspire 5336 */
+	{ 0x2a42, 0x1025, 0x048a, quirk_invert_brightness },
+
 	/* Dell XPS13 HD Sandy Bridge */
 	{ 0x0116, 0x1028, 0x052e, quirk_no_pcm_pwm_enable },
 	/* Dell XPS13 HD and XPS13 FHD Ivy Bridge */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 123/146] dm crypt: fix cpu hotplug crash by removing per-cpu structure
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (121 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 122/146] drm/i915: quirk invert brightness for Acer Aspire 5336 Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:50 ` [PATCH 3.12 124/146] dma: mv_xor: Flush descriptors before activating a channel Jiri Slaby
                   ` (24 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Mikulas Patocka, Mike Snitzer, Jiri Slaby

From: Mikulas Patocka <mpatocka@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 610f2de3559c383caf8fbbf91e9968102dff7ca0 upstream.

The DM crypt target used per-cpu structures to hold pointers to a
ablkcipher_request structure.  The code assumed that the work item keeps
executing on a single CPU, so it didn't use synchronization when
accessing this structure.

If a CPU is disabled by writing 0 to /sys/devices/system/cpu/cpu*/online,
the work item could be moved to another CPU.  This causes dm-crypt
crashes, like the following, because the code starts using an incorrect
ablkcipher_request:

 smpboot: CPU 7 is now offline
 BUG: unable to handle kernel NULL pointer dereference at 0000000000000130
 IP: [<ffffffffa1862b3d>] crypt_convert+0x12d/0x3c0 [dm_crypt]
 ...
 Call Trace:
  [<ffffffffa1864415>] ? kcryptd_crypt+0x305/0x470 [dm_crypt]
  [<ffffffff81062060>] ? finish_task_switch+0x40/0xc0
  [<ffffffff81052a28>] ? process_one_work+0x168/0x470
  [<ffffffff8105366b>] ? worker_thread+0x10b/0x390
  [<ffffffff81053560>] ? manage_workers.isra.26+0x290/0x290
  [<ffffffff81058d9f>] ? kthread+0xaf/0xc0
  [<ffffffff81058cf0>] ? kthread_create_on_node+0x120/0x120
  [<ffffffff813464ac>] ? ret_from_fork+0x7c/0xb0
  [<ffffffff81058cf0>] ? kthread_create_on_node+0x120/0x120

Fix this bug by removing the per-cpu definition.  The structure
ablkcipher_request is accessed via a pointer from convert_context.
Consequently, if the work item is rescheduled to a different CPU, the
thread still uses the same ablkcipher_request.

This change may undermine performance improvements intended by commit
c0297721 ("dm crypt: scale to multiple cpus") on select hardware.  In
practice no performance difference was observed on recent hardware.  But
regardless, correctness is more important than performance.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/md/dm-crypt.c | 61 ++++++++++-----------------------------------------
 1 file changed, 12 insertions(+), 49 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 0fce0bc1a957..c513e5e4cde6 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -18,7 +18,6 @@
 #include <linux/crypto.h>
 #include <linux/workqueue.h>
 #include <linux/backing-dev.h>
-#include <linux/percpu.h>
 #include <linux/atomic.h>
 #include <linux/scatterlist.h>
 #include <asm/page.h>
@@ -44,6 +43,7 @@ struct convert_context {
 	unsigned int idx_out;
 	sector_t cc_sector;
 	atomic_t cc_pending;
+	struct ablkcipher_request *req;
 };
 
 /*
@@ -105,15 +105,7 @@ struct iv_lmk_private {
 enum flags { DM_CRYPT_SUSPENDED, DM_CRYPT_KEY_VALID };
 
 /*
- * Duplicated per-CPU state for cipher.
- */
-struct crypt_cpu {
-	struct ablkcipher_request *req;
-};
-
-/*
- * The fields in here must be read only after initialization,
- * changing state should be in crypt_cpu.
+ * The fields in here must be read only after initialization.
  */
 struct crypt_config {
 	struct dm_dev *dev;
@@ -143,12 +135,6 @@ struct crypt_config {
 	sector_t iv_offset;
 	unsigned int iv_size;
 
-	/*
-	 * Duplicated per cpu state. Access through
-	 * per_cpu_ptr() only.
-	 */
-	struct crypt_cpu __percpu *cpu;
-
 	/* ESSIV: struct crypto_cipher *essiv_tfm */
 	void *iv_private;
 	struct crypto_ablkcipher **tfms;
@@ -184,11 +170,6 @@ static void clone_init(struct dm_crypt_io *, struct bio *);
 static void kcryptd_queue_crypt(struct dm_crypt_io *io);
 static u8 *iv_of_dmreq(struct crypt_config *cc, struct dm_crypt_request *dmreq);
 
-static struct crypt_cpu *this_crypt_config(struct crypt_config *cc)
-{
-	return this_cpu_ptr(cc->cpu);
-}
-
 /*
  * Use this to access cipher attributes that are the same for each CPU.
  */
@@ -738,16 +719,15 @@ static void kcryptd_async_done(struct crypto_async_request *async_req,
 static void crypt_alloc_req(struct crypt_config *cc,
 			    struct convert_context *ctx)
 {
-	struct crypt_cpu *this_cc = this_crypt_config(cc);
 	unsigned key_index = ctx->cc_sector & (cc->tfms_count - 1);
 
-	if (!this_cc->req)
-		this_cc->req = mempool_alloc(cc->req_pool, GFP_NOIO);
+	if (!ctx->req)
+		ctx->req = mempool_alloc(cc->req_pool, GFP_NOIO);
 
-	ablkcipher_request_set_tfm(this_cc->req, cc->tfms[key_index]);
-	ablkcipher_request_set_callback(this_cc->req,
+	ablkcipher_request_set_tfm(ctx->req, cc->tfms[key_index]);
+	ablkcipher_request_set_callback(ctx->req,
 	    CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
-	    kcryptd_async_done, dmreq_of_req(cc, this_cc->req));
+	    kcryptd_async_done, dmreq_of_req(cc, ctx->req));
 }
 
 /*
@@ -756,7 +736,6 @@ static void crypt_alloc_req(struct crypt_config *cc,
 static int crypt_convert(struct crypt_config *cc,
 			 struct convert_context *ctx)
 {
-	struct crypt_cpu *this_cc = this_crypt_config(cc);
 	int r;
 
 	atomic_set(&ctx->cc_pending, 1);
@@ -768,7 +747,7 @@ static int crypt_convert(struct crypt_config *cc,
 
 		atomic_inc(&ctx->cc_pending);
 
-		r = crypt_convert_block(cc, ctx, this_cc->req);
+		r = crypt_convert_block(cc, ctx, ctx->req);
 
 		switch (r) {
 		/* async */
@@ -777,7 +756,7 @@ static int crypt_convert(struct crypt_config *cc,
 			INIT_COMPLETION(ctx->restart);
 			/* fall through*/
 		case -EINPROGRESS:
-			this_cc->req = NULL;
+			ctx->req = NULL;
 			ctx->cc_sector++;
 			continue;
 
@@ -876,6 +855,7 @@ static struct dm_crypt_io *crypt_io_alloc(struct crypt_config *cc,
 	io->sector = sector;
 	io->error = 0;
 	io->base_io = NULL;
+	io->ctx.req = NULL;
 	atomic_set(&io->io_pending, 0);
 
 	return io;
@@ -901,6 +881,8 @@ static void crypt_dec_pending(struct dm_crypt_io *io)
 	if (!atomic_dec_and_test(&io->io_pending))
 		return;
 
+	if (io->ctx.req)
+		mempool_free(io->ctx.req, cc->req_pool);
 	mempool_free(io, cc->io_pool);
 
 	if (likely(!base_io))
@@ -1326,8 +1308,6 @@ static int crypt_wipe_key(struct crypt_config *cc)
 static void crypt_dtr(struct dm_target *ti)
 {
 	struct crypt_config *cc = ti->private;
-	struct crypt_cpu *cpu_cc;
-	int cpu;
 
 	ti->private = NULL;
 
@@ -1339,13 +1319,6 @@ static void crypt_dtr(struct dm_target *ti)
 	if (cc->crypt_queue)
 		destroy_workqueue(cc->crypt_queue);
 
-	if (cc->cpu)
-		for_each_possible_cpu(cpu) {
-			cpu_cc = per_cpu_ptr(cc->cpu, cpu);
-			if (cpu_cc->req)
-				mempool_free(cpu_cc->req, cc->req_pool);
-		}
-
 	crypt_free_tfms(cc);
 
 	if (cc->bs)
@@ -1364,9 +1337,6 @@ static void crypt_dtr(struct dm_target *ti)
 	if (cc->dev)
 		dm_put_device(ti, cc->dev);
 
-	if (cc->cpu)
-		free_percpu(cc->cpu);
-
 	kzfree(cc->cipher);
 	kzfree(cc->cipher_string);
 
@@ -1421,13 +1391,6 @@ static int crypt_ctr_cipher(struct dm_target *ti,
 	if (tmp)
 		DMWARN("Ignoring unexpected additional cipher options");
 
-	cc->cpu = __alloc_percpu(sizeof(*(cc->cpu)),
-				 __alignof__(struct crypt_cpu));
-	if (!cc->cpu) {
-		ti->error = "Cannot allocate per cpu state";
-		goto bad_mem;
-	}
-
 	/*
 	 * For compatibility with the original dm-crypt mapping format, if
 	 * only the cipher name is supplied, use cbc-plain.
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 000/146] 3.12.22-stable review
@ 2014-06-09  8:50 Jiri Slaby
  2014-06-09  8:48 ` [PATCH 3.12 001/146] introduce for_each_thread() to replace the buggy while_each_thread() Jiri Slaby
                   ` (147 more replies)
  0 siblings, 148 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable; +Cc: linux, satoru.takeuchi, shuah.kh, linux-kernel, Jiri Slaby

This is the start of the stable review cycle for the 3.12.22 release.
There are 146 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Wed Jun 11 08:50:21 2014
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.22-rc1.xz
and the diffstat can be found below.

thanks,
js

===============


Aaron Lu (1):
  ACPI / video: Fix initial level validity test

Alan Stern (1):
  USB: OHCI: fix problem with global suspend on ATI controllers

Alex Deucher (6):
  drm/radeon: disable mclk dpm on R7 260X
  drm/radeon: add support for newer mc ucode on SI (v2)
  drm/radeon/si: make sure mc ucode is loaded before checking the size
  drm/radeon: fix ATPX detection on non-VGA GPUs
  drm/radeon/pm: don't walk the crtc list before it has been initialized
    (v2)
  drm/radeon: fix count in cik_sdma_ring_test()

Alex Williamson (1):
  iommu/amd: Fix interrupt remapping for aliased devices

Andy Grover (1):
  target: Don't allow setting WC emulation if device doesn't support

Andy Shevchenko (1):
  dmaengine: dw: went back to plain {request,free}_irq() calls

Anssi Hannula (1):
  ALSA: hda - hdmi: Set converter channel count even without sink

Anthony Iliopoulos (1):
  x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow()

Antti Palosaari (1):
  media: fc2580: fix tuning failure on 32-bit arch

Aristeu Rozanski (2):
  device_cgroup: rework device access check and exception checking
  device_cgroup: check if exception removal is allowed

Arnd Bergmann (1):
  genirq: Provide irq_force_affinity fallback for non-SMP

Atilla Filiz (1):
  iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null
    dereference

Bartlomiej Zolnierkiewicz (1):
  pata_at91: fix ata_host_activate() failure handling

Ben Hutchings (1):
  rtl8192cu: Fix unbalanced irq enable in error path of
    rtl92cu_hw_init()

Bjørn Mork (1):
  usb: qcserial: add a number of Dell devices

Charles Keepax (1):
  ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile

Chen Yucong (1):
  hwpoison, hugetlb: lock_page/unlock_page does not match for handling a
    free hugepage

Chris Wilson (1):
  drm/i915: Fix unsafe loop iteration over vma whilst unbinding them

Christian König (2):
  drm/radeon/uvd: use lower clocks on old UVD to boot v2
  drm/radeon: use pflip irq on R600+ v2

Christoph Hellwig (1):
  posix_acl: handle NULL ACL in posix_acl_equiv_mode

Chunwei Chen (1):
  libceph: fix corruption when using page_count 0 page in rbd

Clemens Ladisch (1):
  ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data

Corey Minyard (1):
  ipmi: Reset the KCS timeout when starting error recovery

Daeseok Youn (1):
  workqueue: fix bugs in wq_update_unbound_numa() failure path

Dan Carpenter (1):
  clk: vexpress: NULL dereference on error path

Daniel Vetter (2):
  drm/i915: Don't check gmch state on inherited configs
  drm/i915: Disable self-refresh for untiled fbs on i915gm

Daniele Forsi (2):
  usb: storage: shuttle_usbat: fix discs being detected twice
  USB: Nokia 5300 should be treated as unusual dev

David Rientjes (1):
  mm, oom: prefer thread group leaders for display purposes

Du, Wenkai (1):
  i2c: designware: Mask all interrupts during i2c controller enable

Edward Lin (1):
  ACPI: blacklist win8 OSI for Dell Inspiron 7737

Egbert Eich (1):
  drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc()

Eliad Peller (1):
  cfg80211: free sme on connection failures

Emmanuel Grumbach (1):
  mac80211: fix suspend vs. association race

Eric Dumazet (1):
  coredump: fix va_list corruption

Ezequiel Garcia (1):
  dma: mv_xor: Flush descriptors before activating a channel

Gavin Shan (1):
  powerpc/powernv: Reset root port in firmware

Geert Uytterhoeven (2):
  Documentation: Update stable address in Chinese and Japanese
    translations
  spi: core: Ignore unsupported Dual/Quad Transfer Mode bits

Grant Likely (1):
  drivercore: deferral race condition fix

Guennadi Liakhovetski (2):
  media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel
    from user-space
  media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode

Guenter Roeck (1):
  powerpc: Fix 64 bit builds with binutils 2.24

Hans de Goede (4):
  Input: elantech - fix touchpad initialization on Gigabyte U2442
  Input: synaptics - add min/max quirk for the ThinkPad W540
  Input: synaptics - T540p - unify with other LEN0034 models
  ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC
    1015PX

Horia Geanta (1):
  crypto: caam - add allocation failure handling in SPRINTFCAT macro

Ian Kent (1):
  autofs: fix lockref lookup

Igor Mammedov (1):
  ACPI / processor: do not mark present at boot but not onlined CPU as
    onlined

Ilia Mirkin (1):
  drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi

J. Bruce Fields (2):
  nfsd4: warn on finding lockowner without stateid's
  nfsd4: remove lockowner when removing lock stateid

James Hogan (1):
  metag: Reduce maximum stack size to 256MB

Jani Nikula (2):
  drm/i915/vlv: reset VLV media force wake request register
  drm/i915: quirk invert brightness for Acer Aspire 5336

Jean-Jacques Hiblot (1):
  usb: gadget: at91-udc: fix irq and iomem resource retrieval

Jianyu Zhan (1):
  percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree()

Jiri Bohac (1):
  timer: Prevent overflow in apply_slack

Johan Hedberg (2):
  Bluetooth: Fix triggering BR/EDR L2CAP Connect too early
  Bluetooth: Fix redundant encryption request for reauthentication

Johannes Berg (1):
  mac80211: fix on-channel remain-on-channel

Johannes Weiner (1):
  revert "mm: vmscan: do not swap anon pages just because free+file is
    low"

Josef Gajdusek (2):
  hwmon: (emc1403) fix inverted store_hyst()
  hwmon: (emc1403) Support full range of known chip revision numbers

Kinglong Mee (1):
  NFSD: Call ->set_acl with a NULL ACL structure if no entries

Kirill A. Shutemov (1):
  mm, thp: close race between mremap() and split_huge_page()

Krzysztof Kozlowski (1):
  clocksource: Exynos_mct: Register clock event after request_irq()

Lai Jiangshan (2):
  workqueue: fix a possible race condition between rescuer and
    pwq-release
  workqueue: make rescuer_thread() empty wq->maydays list before exiting

Leif Lindholm (2):
  mips: dts: Fix missing device_type="memory" property in memory nodes
  arm: dts: Fix missing device_type="memory" for ste-ccu8540

Leo Liu (1):
  drm/radeon: check buffer relocation offset

Leon Ma (1):
  hrtimer: Prevent remote enqueue of leftmost timers

Leon Yu (1):
  aio: fix potential leak in aio_run_iocb().

Levente Kurusa (1):
  libata: clean up ZPODD when a port is detached

Linus Torvalds (2):
  mm: make fixup_user_fault() check the vma access rights too
  x86-64, modify_ldt: Make support for 16-bit segments a runtime option

Liu Hua (1):
  ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr

Loic Poulain (2):
  serial: 8250: Fix thread unsafe __dma_tx_complete function
  8250_core: Fix unwanted TX chars write

Maarten Lankhorst (1):
  drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip

Marcel Apfelbaum (1):
  PCI: shpchp: Check bridge's secondary (not primary) bus speed

Mark Salter (1):
  arm64: fix pud_huge() for 2-level pagetables

Martin Peres (1):
  drm/nouveau/pm/fan: drop the fan lock in fan_update() before
    rescheduling

Mikulas Patocka (3):
  metag: fix memory barriers
  target: fix memory leak on XCOPY
  dm crypt: fix cpu hotplug crash by removing per-cpu structure

Mohammed Habibulla (1):
  Bluetooth: Add support for Lite-on [04ca:3007]

NeilBrown (1):
  md: avoid possible spinning md thread at shutdown.

Nicholas Bellinger (1):
  iscsi-target: Change BUG_ON to REJECT in iscsit_process_nop_out

Nikita Yushchenko (1):
  fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6

Oleg Nesterov (4):
  introduce for_each_thread() to replace the buggy while_each_thread()
  oom_kill: change oom_kill.c to use for_each_thread()
  oom_kill: has_intersects_mems_allowed() needs rcu_read_lock()
  oom_kill: add rcu_read_lock() into find_lock_task_mm()

Olof Johansson (1):
  i2c: s3c2410: resume race fix

Peter De Schrijver (1):
  clk: tegra: use pll_ref as the pll_e parent

Rik van Riel (1):
  mm/page-writeback.c: fix divide by zero in pos_ratio_polynom

Romain Izard (1):
  trace: module: Maintain a valid user count

Russell King (1):
  leds: leds-pwm: properly clean up after probe failure

Sagi Grimberg (2):
  Target/iser: Fix wrong connection requests list addition
  Target/iser: Fix iscsit_accept_np and rdma_cm racy flow

Salva Peiró (1):
  media: media-device: fix infoleak in ioctl media_enum_entities()

Sascha Hauer (1):
  ARM: dts: i.MX53: Fix ipu register space size

Sebastian Hesselbarth (1):
  ARM: dts: kirkwood: fix mislocated pcie-controller nodes

Sergey Popovich (1):
  netfilter: Fix potential use after free in ip6_route_me_harder()

Sheng-Liang Song (1):
  Input: atkbd - fix keyboard not working on some LG laptops

Srivatsa S. Bhat (1):
  powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST
    mode

Stanislaw Gruszka (1):
  rt2x00: fix beaconing on USB

Stephen Warren (1):
  gpu: host1x: handle the correct # of syncpt regs

Steven Rostedt (Red Hat) (1):
  ftrace/module: Hardcode ftrace_module_init() call into load_module()

Stuart Hayes (1):
  hrtimer: Prevent all reprogramming if hang detected

Takashi Iwai (1):
  ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets

Thierry Reding (1):
  drm/tegra: Remove gratuitous pad field

Thomas Gleixner (9):
  futex: Add another early deadlock detection check
  futex: Prevent attaching to kernel threads
  irqchip: Gic: Support forced affinity setting
  genirq: Allow forcing cpu affinity of interrupts
  clocksource: Exynos_mct: Use irq_force_affinity() in cpu bringup
  futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr ==
    uaddr2 in futex_requeue(..., requeue_pi=1)
  futex: Validate atomic acquisition in futex_lock_pi_atomic()
  futex: Always cleanup owner tid in unlock_pi
  futex: Make lookup_pi_state more robust

Thomas Petazzoni (6):
  ARM: orion5x: fix target ID for crypto SRAM window
  ARM: mvebu: fix NOR bus-width in Armada XP GP Device Tree
  ARM: mvebu: fix NOR bus-width in Armada XP DB Device Tree
  ARM: mvebu: fix NOR bus-width in Armada XP OpenBlocks AX3 Device Tree
  memory: mvebu-devbus: fix the conversion of the bus width
  bus: mvebu-mbus: allow several windows with the same target/attribute

Tim Chen (1):
  crypto: crypto_wq - Fix late crypto work queue initialization

Trond Myklebust (2):
  NFSd: Move default initialisers from create_client() to alloc_client()
  NFSd: call rpc_destroy_wait_queue() from free_client()

Tuomas Tynkkynen (1):
  clk: tegra: Fix wrong value written to PLLE_AUX

Victor A. Santos (1):
  USB: Nokia 305 should be treated as unusual dev

Viresh Kumar (1):
  hrtimer: Set expiry time before switch_hrtimer_base()

Willy Tarreau (1):
  PCI: mvebu: fix off-by-one in the computed size of the mbus windows

Wolfram Sang (1):
  i2c: rcar: bail out on zero length transfers

 Documentation/input/elantech.txt                 |   5 +-
 Documentation/ja_JP/HOWTO                        |   2 +-
 Documentation/ja_JP/stable_kernel_rules.txt      |   6 +-
 Documentation/zh_CN/HOWTO                        |   2 +-
 Documentation/zh_CN/stable_kernel_rules.txt      |   2 +-
 arch/arm/boot/dts/armada-xp-db.dts               |   2 +-
 arch/arm/boot/dts/armada-xp-gp.dts               |   2 +-
 arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts |   2 +-
 arch/arm/boot/dts/imx53.dtsi                     |   2 +-
 arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts   |  18 +-
 arch/arm/boot/dts/kirkwood-nsa310-common.dtsi    |  18 +-
 arch/arm/boot/dts/ste-ccu8540.dts                |   1 +
 arch/arm/kernel/crash_dump.c                     |   2 +-
 arch/arm/mach-orion5x/common.h                   |   2 +-
 arch/arm64/mm/hugetlbpage.c                      |   4 +
 arch/metag/include/asm/barrier.h                 |   3 +
 arch/metag/include/asm/processor.h               |   2 +
 arch/mips/cavium-octeon/octeon-irq.c             |   2 +-
 arch/mips/lantiq/dts/easy50712.dts               |   1 +
 arch/mips/ralink/dts/mt7620a_eval.dts            |   1 +
 arch/mips/ralink/dts/rt2880_eval.dts             |   1 +
 arch/mips/ralink/dts/rt3052_eval.dts             |   1 +
 arch/mips/ralink/dts/rt3883_eval.dts             |   1 +
 arch/parisc/include/asm/processor.h              |   2 +
 arch/powerpc/Makefile                            |   4 +-
 arch/powerpc/include/asm/ppc_asm.h               |   7 +-
 arch/powerpc/kernel/machine_kexec_64.c           |   2 +-
 arch/powerpc/platforms/powernv/eeh-ioda.c        |   3 +-
 arch/x86/include/asm/hugetlb.h                   |   1 +
 arch/x86/kernel/ldt.c                            |   4 +-
 arch/x86/vdso/vdso32-setup.c                     |   8 +
 crypto/crypto_wq.c                               |   2 +-
 drivers/acpi/acpi_processor.c                    |   1 -
 drivers/acpi/blacklist.c                         |  21 ++
 drivers/acpi/video.c                             |   2 +-
 drivers/ata/libata-core.c                        |   9 +
 drivers/ata/pata_at91.c                          |  11 +-
 drivers/base/dd.c                                |  17 ++
 drivers/bluetooth/ath3k.c                        |   2 +
 drivers/bluetooth/btusb.c                        |   1 +
 drivers/bus/mvebu-mbus.c                         |   6 -
 drivers/char/ipmi/ipmi_kcs_sm.c                  |   5 +-
 drivers/clk/tegra/clk-pll.c                      |  10 +-
 drivers/clk/tegra/clk-tegra114.c                 |   3 +-
 drivers/clk/versatile/clk-vexpress-osc.c         |   2 +-
 drivers/clocksource/exynos_mct.c                 |  12 +-
 drivers/crypto/caam/error.c                      |  10 +-
 drivers/dma/dw/core.c                            |  11 +-
 drivers/dma/mv_xor.c                             |   8 +-
 drivers/gpu/drm/i915/i915_gem.c                  |   4 +-
 drivers/gpu/drm/i915/intel_display.c             |  52 +++--
 drivers/gpu/drm/i915/intel_drv.h                 |   3 +-
 drivers/gpu/drm/i915/intel_pm.c                  |  10 +
 drivers/gpu/drm/i915/intel_uncore.c              |   2 +
 drivers/gpu/drm/nouveau/core/subdev/therm/fan.c  |  19 +-
 drivers/gpu/drm/nouveau/nouveau_acpi.c           |   3 -
 drivers/gpu/drm/nouveau/nouveau_display.c        |   2 +-
 drivers/gpu/drm/radeon/ci_dpm.c                  |   4 +
 drivers/gpu/drm/radeon/cik.c                     |  76 +++++++
 drivers/gpu/drm/radeon/cik_sdma.c                |   2 +-
 drivers/gpu/drm/radeon/cikd.h                    |   9 +
 drivers/gpu/drm/radeon/evergreen.c               |  28 ++-
 drivers/gpu/drm/radeon/r600.c                    |  13 +-
 drivers/gpu/drm/radeon/r600_dpm.c                |  35 ++--
 drivers/gpu/drm/radeon/radeon.h                  |   6 +
 drivers/gpu/drm/radeon/radeon_atpx_handler.c     |   7 +
 drivers/gpu/drm/radeon/radeon_display.c          |   4 +
 drivers/gpu/drm/radeon/radeon_pm.c               |  28 +--
 drivers/gpu/drm/radeon/radeon_ucode.h            |   3 +
 drivers/gpu/drm/radeon/radeon_uvd.c              |   4 +
 drivers/gpu/drm/radeon/si.c                      |  65 ++++--
 drivers/gpu/drm/radeon/uvd_v1_0.c                |  10 +-
 drivers/gpu/host1x/hw/intr_hw.c                  |   4 +-
 drivers/hwmon/emc1403.c                          |   4 +-
 drivers/i2c/busses/i2c-designware-core.c         |   3 +
 drivers/i2c/busses/i2c-rcar.c                    |   9 +-
 drivers/i2c/busses/i2c-s3c2410.c                 |   2 +-
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c       |   7 +-
 drivers/infiniband/ulp/isert/ib_isert.c          |  27 +--
 drivers/infiniband/ulp/isert/ib_isert.h          |   2 +-
 drivers/input/keyboard/atkbd.c                   |  29 ++-
 drivers/input/mouse/elantech.c                   |  26 ++-
 drivers/input/mouse/elantech.h                   |   1 +
 drivers/input/mouse/synaptics.c                  |  10 +-
 drivers/iommu/amd_iommu.c                        |   2 +-
 drivers/irqchip/irq-gic.c                        |   8 +-
 drivers/leds/leds-pwm.c                          |  23 ++-
 drivers/md/dm-crypt.c                            |  61 ++----
 drivers/md/md.c                                  |   3 +-
 drivers/media/i2c/ov7670.c                       |   2 +-
 drivers/media/media-device.c                     |   1 +
 drivers/media/tuners/fc2580.c                    |   6 +-
 drivers/media/tuners/fc2580_priv.h               |   1 +
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c    |  12 +-
 drivers/memory/mvebu-devbus.c                    |  15 +-
 drivers/net/wireless/rt2x00/rt2x00mac.c          |  22 ++-
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c      |   2 +-
 drivers/pci/host/pci-mvebu.c                     |   4 +-
 drivers/pci/hotplug/shpchp_ctrl.c                |   4 +-
 drivers/spi/spi.c                                |  11 +-
 drivers/target/iscsi/iscsi_target.c              |   4 +-
 drivers/target/target_core_device.c              |   8 +-
 drivers/target/target_core_transport.c           |   2 +-
 drivers/tty/serial/8250/8250_core.c              |   2 +-
 drivers/tty/serial/8250/8250_dma.c               |   9 +-
 drivers/usb/gadget/at91_udc.c                    |  10 -
 drivers/usb/host/ehci-fsl.c                      |   3 +-
 drivers/usb/host/ohci-hub.c                      |  18 ++
 drivers/usb/host/ohci-pci.c                      |   1 +
 drivers/usb/host/ohci.h                          |   2 +
 drivers/usb/serial/qcserial.c                    |  15 ++
 drivers/usb/storage/shuttle_usbat.c              |   2 +-
 drivers/usb/storage/unusual_devs.h               |  14 ++
 fs/aio.c                                         |   6 +-
 fs/autofs4/root.c                                |   4 +-
 fs/coredump.c                                    |   7 +-
 fs/exec.c                                        |   6 +-
 fs/nfsd/nfs4acl.c                                |  17 +-
 fs/nfsd/nfs4state.c                              |  40 ++--
 fs/posix_acl.c                                   |   6 +
 include/linux/ftrace.h                           |   2 +
 include/linux/init_task.h                        |   2 +
 include/linux/interrupt.h                        |  40 +++-
 include/linux/irq.h                              |   3 +-
 include/linux/sched.h                            |  12 ++
 include/trace/events/module.h                    |   2 +-
 include/uapi/drm/tegra_drm.h                     |   1 -
 kernel/exit.c                                    |   1 +
 kernel/fork.c                                    |   7 +
 kernel/futex.c                                   | 239 ++++++++++++++++++-----
 kernel/hrtimer.c                                 |  30 ++-
 kernel/irq/manage.c                              |  17 +-
 kernel/kexec.c                                   |   8 +
 kernel/module.c                                  |   3 +
 kernel/timer.c                                   |   2 +-
 kernel/trace/ftrace.c                            |  27 +--
 kernel/workqueue.c                               |  36 +++-
 mm/memcontrol.c                                  |  19 +-
 mm/memory-failure.c                              |  15 +-
 mm/memory.c                                      |   5 +
 mm/mremap.c                                      |   9 +-
 mm/oom_kill.c                                    |  63 +++---
 mm/page-writeback.c                              |   6 +-
 mm/percpu.c                                      |   2 +-
 mm/vmscan.c                                      |  18 ++
 net/bluetooth/hci_conn.c                         |   9 +-
 net/bluetooth/hci_event.c                        |   6 +
 net/ceph/messenger.c                             |  20 +-
 net/ipv6/netfilter.c                             |   6 +-
 net/mac80211/ieee80211_i.h                       |   1 +
 net/mac80211/mlme.c                              |  20 +-
 net/mac80211/offchannel.c                        |  27 ++-
 net/wireless/sme.c                               |   2 +-
 security/device_cgroup.c                         | 203 +++++++++++++++----
 sound/pci/hda/hda_intel.c                        |   3 +
 sound/pci/hda/patch_hdmi.c                       |   4 +-
 sound/soc/codecs/wm8962.c                        |  15 +-
 sound/soc/codecs/wm8962.h                        |   4 +
 sound/usb/card.h                                 |   1 +
 sound/usb/endpoint.c                             |  15 +-
 160 files changed, 1456 insertions(+), 561 deletions(-)

-- 
1.9.3


^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH 3.12 124/146] dma: mv_xor: Flush descriptors before activating a channel
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (122 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 123/146] dm crypt: fix cpu hotplug crash by removing per-cpu structure Jiri Slaby
@ 2014-06-09  8:50 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 125/146] dmaengine: dw: went back to plain {request,free}_irq() calls Jiri Slaby
                   ` (23 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:50 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Ezequiel Garcia, Lior Amsalem, Dan Williams, Jiri Slaby

From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 5a9a55bf9157d3490b0c8c4c81d4708602c26e07 upstream.

We need to use writel() instead of writel_relaxed() when starting
a channel, to ensure all the descriptors have been flushed before
the activation.

While at it, remove the unneeded read-modify-write and make the
code simpler.

Signed-off-by: Lior Amsalem <alior@marvell.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/dma/mv_xor.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 536dcb8ba5fd..dea771435a19 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -205,12 +205,10 @@ static void mv_set_mode(struct mv_xor_chan *chan,
 
 static void mv_chan_activate(struct mv_xor_chan *chan)
 {
-	u32 activation;
-
 	dev_dbg(mv_chan_to_devp(chan), " activate chan.\n");
-	activation = readl_relaxed(XOR_ACTIVATION(chan));
-	activation |= 0x1;
-	writel_relaxed(activation, XOR_ACTIVATION(chan));
+
+	/* writel ensures all descriptors are flushed before activation */
+	writel(BIT(0), XOR_ACTIVATION(chan));
 }
 
 static char mv_chan_is_busy(struct mv_xor_chan *chan)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 125/146] dmaengine: dw: went back to plain {request,free}_irq() calls
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (123 preceding siblings ...)
  2014-06-09  8:50 ` [PATCH 3.12 124/146] dma: mv_xor: Flush descriptors before activating a channel Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 126/146] libata: clean up ZPODD when a port is detached Jiri Slaby
                   ` (22 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Andy Shevchenko, Vinod Koul, Jiri Slaby

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 97977f7576a89cb9436c000ae703c0d515e748ac upstream.

The commit dbde5c29 "dw_dmac: use devm_* functions to simplify code" turns
probe function to use devm_* helpers and simultaneously brings a regression. We
need to ensure irq is disabled, followed by ensuring that don't schedule any
more tasklets and then its safe to use tasklet_kill().

The free_irq() will ensure that the irq is disabled and also wait till all
scheduled interrupts are executed by invoking synchronize_irq(). So we need to
only do tasklet_kill() after invoking free_irq().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/dma/dw/core.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index 89eb89f22284..da87adf85f03 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1569,11 +1569,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
 	/* Disable BLOCK interrupts as well */
 	channel_clear_bit(dw, MASK.BLOCK, dw->all_chan_mask);
 
-	err = devm_request_irq(chip->dev, chip->irq, dw_dma_interrupt,
-			       IRQF_SHARED, "dw_dmac", dw);
-	if (err)
-		return err;
-
 	/* Create a pool of consistent memory blocks for hardware descriptors */
 	dw->desc_pool = dmam_pool_create("dw_dmac_desc_pool", chip->dev,
 					 sizeof(struct dw_desc), 4, 0);
@@ -1584,6 +1579,11 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
 
 	tasklet_init(&dw->tasklet, dw_dma_tasklet, (unsigned long)dw);
 
+	err = request_irq(chip->irq, dw_dma_interrupt, IRQF_SHARED,
+			  "dw_dmac", dw);
+	if (err)
+		return err;
+
 	INIT_LIST_HEAD(&dw->dma.channels);
 	for (i = 0; i < nr_channels; i++) {
 		struct dw_dma_chan	*dwc = &dw->chan[i];
@@ -1686,6 +1686,7 @@ int dw_dma_remove(struct dw_dma_chip *chip)
 	dw_dma_off(dw);
 	dma_async_device_unregister(&dw->dma);
 
+	free_irq(chip->irq, dw);
 	tasklet_kill(&dw->tasklet);
 
 	list_for_each_entry_safe(dwc, _dwc, &dw->dma.channels,
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 126/146] libata: clean up ZPODD when a port is detached
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (124 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 125/146] dmaengine: dw: went back to plain {request,free}_irq() calls Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 127/146] ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC 1015PX Jiri Slaby
                   ` (21 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Levente Kurusa, Tejun Heo, Jiri Slaby

From: Levente Kurusa <levex@linux.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit a6f9bf4d2f965b862b95213303d154e02957eed8 upstream.

When a ZPODD device is unbound via sysfs, the ACPI notify handler
is not removed. This causes panics as observed in Bug #74601. The
panic only happens when the wake happens from outside the kernel
(i.e. inserting a media or pressing a button). Add a loop to
ata_port_detach which loops through the port's devices and checks
if zpodd is enabled, if so call zpodd_exit.

Reviewed-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Levente Kurusa <levex@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/ata/libata-core.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 97ae08de4b52..d7f00adbc374 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6329,6 +6329,8 @@ int ata_host_activate(struct ata_host *host, int irq,
 static void ata_port_detach(struct ata_port *ap)
 {
 	unsigned long flags;
+	struct ata_link *link;
+	struct ata_device *dev;
 
 	if (!ap->ops->error_handler)
 		goto skip_eh;
@@ -6348,6 +6350,13 @@ static void ata_port_detach(struct ata_port *ap)
 	cancel_delayed_work_sync(&ap->hotplug_task);
 
  skip_eh:
+	/* clean up zpodd on port removal */
+	ata_for_each_link(link, ap, HOST_FIRST) {
+		ata_for_each_dev(dev, link, ALL) {
+			if (zpodd_dev_enabled(dev))
+				zpodd_exit(dev);
+		}
+	}
 	if (ap->pmp_link) {
 		int i;
 		for (i = 0; i < SATA_PMP_MAX_PORTS; i++)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 127/146] ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC 1015PX
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (125 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 126/146] libata: clean up ZPODD when a port is detached Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 128/146] ACPI / processor: do not mark present at boot but not onlined CPU as onlined Jiri Slaby
                   ` (20 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Hans de Goede, Rafael J. Wysocki, Jiri Slaby

From: Hans de Goede <hdegoede@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit f6e6e1b9fee88c90586787b71dc49bb3ce62bb89 upstream.

Without this this EEE PC exports a non working WMI interface, with this it
exports a working "good old" eeepc_laptop interface, fixing brightness control
not working as well as rfkill being stuck in a permanent wireless blocked
state.

This is not an ideal way to fix this, but various attempts to fix this
otherwise have failed, see:

References: https://bugzilla.redhat.com/show_bug.cgi?id=1067181
Reported-and-tested-by: lou.cardone@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/acpi/blacklist.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index f37dec579712..bf180bbb2bd8 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -405,6 +405,19 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
 		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T500"),
 		},
 	},
+	/*
+	 * Without this this EEEpc exports a non working WMI interface, with
+	 * this it exports a working "good old" eeepc_laptop interface, fixing
+	 * both brightness control, and rfkill not working.
+	 */
+	{
+	.callback = dmi_enable_osi_linux,
+	.ident = "Asus EEE PC 1015PX",
+	.matches = {
+		     DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer INC."),
+		     DMI_MATCH(DMI_PRODUCT_NAME, "1015PX"),
+		},
+	},
 	{}
 };
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 128/146] ACPI / processor: do not mark present at boot but not onlined CPU as onlined
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (126 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 127/146] ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC 1015PX Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 129/146] ACPI: blacklist win8 OSI for Dell Inspiron 7737 Jiri Slaby
                   ` (19 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Igor Mammedov, Rafael J. Wysocki, Jiri Slaby

From: Igor Mammedov <imammedo@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 0b9d46dd7debf8e6dc8614106f1c1909fa8de64d upstream.

acpi_processor_add() assumes that present at boot CPUs
are always onlined, it is not so if a CPU failed to become
onlined. As result acpi_processor_add() will mark such CPU
device as onlined in sysfs and following attempts to
online/offline it using /sys/device/system/cpu/cpuX/online
attribute will fail.

Do not poke into device internals in acpi_processor_add()
and touch "struct device { .offline }" attribute, since
for CPUs onlined at boot it's set by:
  topology_init() -> arch_register_cpu() -> register_cpu()
before ACPI device tree is parsed, and for hotplugged
CPUs it's set when userspace onlines CPU via sysfs.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/acpi/acpi_processor.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index f29e06efa479..f99cb6a15c00 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -410,7 +410,6 @@ static int acpi_processor_add(struct acpi_device *device,
 		goto err;
 
 	pr->dev = dev;
-	dev->offline = pr->flags.need_hotplug_init;
 
 	/* Trigger the processor driver's .probe() if present. */
 	if (device_attach(dev) >= 0)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 129/146] ACPI: blacklist win8 OSI for Dell Inspiron 7737
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (127 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 128/146] ACPI / processor: do not mark present at boot but not onlined CPU as onlined Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 130/146] i2c: rcar: bail out on zero length transfers Jiri Slaby
                   ` (18 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Edward Lin, Rafael J. Wysocki, Jiri Slaby

From: Edward Lin <yidi.lin@canonical.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit b753631b3576bf343151a82513c5d56fcda1e24f upstream.

With win8 capabiltiy, the machine will boot itself immediately after
shutdown command has executed.

Work around this issue by disabling win8 capcability.  This workaround
also makes wireless hotkey work.

Signed-off-by: Edward Lin <yidi.lin@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/acpi/blacklist.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index bf180bbb2bd8..16eb678c0f3d 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -345,6 +345,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
 		     DMI_MATCH(DMI_PRODUCT_VERSION, "2349D15"),
 		},
 	},
+	{
+	.callback = dmi_disable_osi_win8,
+	.ident = "Dell Inspiron 7737",
+	.matches = {
+		    DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+		    DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7737"),
+		},
+	},
 
 	/*
 	 * BIOS invocation of _OSI(Linux) is almost always a BIOS bug.
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 130/146] i2c: rcar: bail out on zero length transfers
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (128 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 129/146] ACPI: blacklist win8 OSI for Dell Inspiron 7737 Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 131/146] i2c: designware: Mask all interrupts during i2c controller enable Jiri Slaby
                   ` (17 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Wolfram Sang, Wolfram Sang, Jiri Slaby

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit d7653964c590ba846aa11a8f6edf409773cbc492 upstream.

This hardware does not support zero length transfers. Instead, the
driver does one (random) byte transfers currently with undefined results
for the slaves. We now bail out.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/i2c/busses/i2c-rcar.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index d2fe11da5e82..c8a42602205b 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -560,6 +560,12 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
 
 	ret = -EINVAL;
 	for (i = 0; i < num; i++) {
+		/* This HW can't send STOP after address phase */
+		if (msgs[i].len == 0) {
+			ret = -EOPNOTSUPP;
+			break;
+		}
+
 		/*-------------- spin lock -----------------*/
 		spin_lock_irqsave(&priv->lock, flags);
 
@@ -624,7 +630,8 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
 
 static u32 rcar_i2c_func(struct i2c_adapter *adap)
 {
-	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+	/* This HW can't do SMBUS_QUICK and NOSTART */
+	return I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK);
 }
 
 static const struct i2c_algorithm rcar_i2c_algo = {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 131/146] i2c: designware: Mask all interrupts during i2c controller enable
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (129 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 130/146] i2c: rcar: bail out on zero length transfers Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 132/146] i2c: s3c2410: resume race fix Jiri Slaby
                   ` (16 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Du, Wenkai, Wolfram Sang, Jiri Slaby

From: "Du, Wenkai" <wenkai.du@intel.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 47bb27e78867997040a228328f2a631c3c7f2c82 upstream.

There have been "i2c_designware 80860F41:00: controller timed out" errors
on a number of Baytrail platforms. The issue is caused by incorrect value in
Interrupt Mask Register (DW_IC_INTR_MASK)  when i2c core is being enabled.
This causes call to __i2c_dw_enable() to immediately start the transfer which
leads to timeout. There are 3 failure modes observed:

1. Failure in S0 to S3 resume path

The default value after reset for DW_IC_INTR_MASK is 0x8ff. When we start
the first transaction after resuming from system sleep, TX_EMPTY interrupt
is already unmasked because of the hardware default.

2. Failure in normal operational path

This failure happens rarely and is hard to reproduce. Debug trace showed that
DW_IC_INTR_MASK had value of 0x254 when failure occurred, which meant
TX_EMPTY was unmasked.

3. Failure in S3 to S0 suspend path

This failure also happens rarely and is hard to reproduce. Adding debug trace
that read DW_IC_INTR_MASK made this failure not reproducible. But from ISR
call trace we could conclude TX_EMPTY was unmasked when problem occurred.

The patch masks all interrupts before the controller is enabled to resolve the
faulty DW_IC_INTR_MASK conditions.

Signed-off-by: Wenkai Du <wenkai.du@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
[wsa: improved the comment and removed typo in commit msg]
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/i2c/busses/i2c-designware-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 5888feef1ac5..a4dd9bdf737b 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -418,6 +418,9 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
 	 */
 	dw_writel(dev, msgs[dev->msg_write_idx].addr | ic_tar, DW_IC_TAR);
 
+	/* enforce disabled interrupts (due to HW issues) */
+	i2c_dw_disable_int(dev);
+
 	/* Enable the adapter */
 	__i2c_dw_enable(dev, true);
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 132/146] i2c: s3c2410: resume race fix
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (130 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 131/146] i2c: designware: Mask all interrupts during i2c controller enable Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 133/146] crypto: caam - add allocation failure handling in SPRINTFCAT macro Jiri Slaby
                   ` (15 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Olof Johansson, Doug Anderson, Wolfram Sang, Jiri Slaby

From: Olof Johansson <olof@lixom.net>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit ce78cc071f5f541480e381cc0241d37590041a9d upstream.

Don't unmark the device as suspended until after it's been re-setup.

The main race would be w.r.t. an i2c driver that gets resumed at the same
time (asyncronously), that is allowed to do a transfer since suspended
is set to 0 before reinit, but really should have seen the -EIO return
instead.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/i2c/busses/i2c-s3c2410.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 3747b9bf67d6..f7d572363f6c 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1200,10 +1200,10 @@ static int s3c24xx_i2c_resume(struct device *dev)
 	struct platform_device *pdev = to_platform_device(dev);
 	struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
 
-	i2c->suspended = 0;
 	clk_prepare_enable(i2c->clk);
 	s3c24xx_i2c_init(i2c);
 	clk_disable_unprepare(i2c->clk);
+	i2c->suspended = 0;
 
 	return 0;
 }
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 133/146] crypto: caam - add allocation failure handling in SPRINTFCAT macro
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (131 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 132/146] i2c: s3c2410: resume race fix Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 134/146] powerpc/powernv: Reset root port in firmware Jiri Slaby
                   ` (14 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Horia Geanta, Kim Phillips, Herbert Xu, Jiri Slaby

From: Horia Geanta <horia.geanta@freescale.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 27c5fb7a84242b66bf1e0b2fe6bf40d19bcc5c04 upstream.

GFP_ATOMIC memory allocation could fail.
In this case, avoid NULL pointer dereference and notify user.

Cc: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/crypto/caam/error.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/caam/error.c b/drivers/crypto/caam/error.c
index 9f25f5296029..0eabd81e1a90 100644
--- a/drivers/crypto/caam/error.c
+++ b/drivers/crypto/caam/error.c
@@ -16,9 +16,13 @@
 	char *tmp;						\
 								\
 	tmp = kmalloc(sizeof(format) + max_alloc, GFP_ATOMIC);	\
-	sprintf(tmp, format, param);				\
-	strcat(str, tmp);					\
-	kfree(tmp);						\
+	if (likely(tmp)) {					\
+		sprintf(tmp, format, param);			\
+		strcat(str, tmp);				\
+		kfree(tmp);					\
+	} else {						\
+		strcat(str, "kmalloc failure in SPRINTFCAT");	\
+	}							\
 }
 
 static void report_jump_idx(u32 status, char *outstr)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 134/146] powerpc/powernv: Reset root port in firmware
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (132 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 133/146] crypto: caam - add allocation failure handling in SPRINTFCAT macro Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 135/146] powerpc: Fix 64 bit builds with binutils 2.24 Jiri Slaby
                   ` (13 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Gavin Shan, Benjamin Herrenschmidt, Jiri Slaby

From: Gavin Shan <gwshan@linux.vnet.ibm.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 372cf1244d7c271806b83b32b09a1c8b1b31b353 upstream.

Resetting root port has more stuff to do than that for PCIe switch
ports and we should have resetting root port done in firmware instead
of the kernel itself. The problem was introduced by commit 5b2e198e
("powerpc/powernv: Rework EEH reset").

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/powerpc/platforms/powernv/eeh-ioda.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index 227c7fe4067f..b91083370bc6 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -493,7 +493,8 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option)
 		ret = ioda_eeh_phb_reset(hose, option);
 	} else {
 		bus = eeh_pe_bus_get(pe);
-		if (pci_is_root_bus(bus))
+		if (pci_is_root_bus(bus) ||
+		    pci_is_root_bus(bus->parent))
 			ret = ioda_eeh_root_reset(hose, option);
 		else
 			ret = ioda_eeh_bridge_reset(hose, bus->self, option);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 135/146] powerpc: Fix 64 bit builds with binutils 2.24
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (133 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 134/146] powerpc/powernv: Reset root port in firmware Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 136/146] powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode Jiri Slaby
                   ` (12 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Guenter Roeck, Benjamin Herrenschmidt, Jiri Slaby

From: Guenter Roeck <linux@roeck-us.net>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 7998eb3dc700aaf499f93f50b3d77da834ef9e1d upstream.

With binutils 2.24, various 64 bit builds fail with relocation errors
such as

arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e':
	(.text+0x165ee): relocation truncated to fit: R_PPC64_ADDR16_HI
	against symbol `interrupt_base_book3e' defined in .text section
	in arch/powerpc/kernel/built-in.o
arch/powerpc/kernel/built-in.o: In function `exc_debug_crit_book3e':
	(.text+0x16602): relocation truncated to fit: R_PPC64_ADDR16_HI
	against symbol `interrupt_end_book3e' defined in .text section
	in arch/powerpc/kernel/built-in.o

The assembler maintainer says:

 I changed the ABI, something that had to be done but unfortunately
 happens to break the booke kernel code.  When building up a 64-bit
 value with lis, ori, shl, oris, ori or similar sequences, you now
 should use @high and @higha in place of @h and @ha.  @h and @ha
 (and their associated relocs R_PPC64_ADDR16_HI and R_PPC64_ADDR16_HA)
 now report overflow if the value is out of 32-bit signed range.
 ie. @h and @ha assume you're building a 32-bit value. This is needed
 to report out-of-range -mcmodel=medium toc pointer offsets in @toc@h
 and @toc@ha expressions, and for consistency I did the same for all
 other @h and @ha relocs.

Replacing @h with @high in one strategic location fixes the relocation
errors. This has to be done conditionally since the assembler either
supports @h or @high but not both.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/powerpc/Makefile              | 4 +++-
 arch/powerpc/include/asm/ppc_asm.h | 7 ++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 51cfb78d4061..994337bb529c 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -114,7 +114,9 @@ endif
 
 CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell)
 
-KBUILD_CPPFLAGS	+= -Iarch/$(ARCH)
+asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)
+
+KBUILD_CPPFLAGS	+= -Iarch/$(ARCH) $(asinstr)
 KBUILD_AFLAGS	+= -Iarch/$(ARCH)
 KBUILD_CFLAGS	+= -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y)
 CPP		= $(CC) -E $(KBUILD_CFLAGS)
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 0d2d0f03163b..e6d03c7a8031 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -378,11 +378,16 @@ n:
  *      ld	rY,ADDROFF(name)(rX)
  */
 #ifdef __powerpc64__
+#ifdef HAVE_AS_ATHIGH
+#define __AS_ATHIGH high
+#else
+#define __AS_ATHIGH h
+#endif
 #define LOAD_REG_IMMEDIATE(reg,expr)		\
 	lis     reg,(expr)@highest;		\
 	ori     reg,reg,(expr)@higher;	\
 	rldicr  reg,reg,32,31;		\
-	oris    reg,reg,(expr)@h;		\
+	oris    reg,reg,(expr)@__AS_ATHIGH;	\
 	ori     reg,reg,(expr)@l;
 
 #define LOAD_REG_ADDR(reg,name)			\
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 136/146] powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (134 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 135/146] powerpc: Fix 64 bit builds with binutils 2.24 Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 137/146] spi: core: Ignore unsupported Dual/Quad Transfer Mode bits Jiri Slaby
                   ` (11 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Srivatsa S. Bhat, Benjamin Herrenschmidt, Jiri Slaby

From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 011e4b02f1da156ac7fea28a9da878f3c23af739 upstream.

If we try to perform a kexec when the machine is in ST (Single-Threaded) mode
(ppc64_cpu --smt=off), the kexec operation doesn't succeed properly, and we
get the following messages during boot:

[    0.089866] POWER8 performance monitor hardware support registered
[    0.089985] power8-pmu: PMAO restore workaround active.
[    5.095419] Processor 1 is stuck.
[   10.097933] Processor 2 is stuck.
[   15.100480] Processor 3 is stuck.
[   20.102982] Processor 4 is stuck.
[   25.105489] Processor 5 is stuck.
[   30.108005] Processor 6 is stuck.
[   35.110518] Processor 7 is stuck.
[   40.113369] Processor 9 is stuck.
[   45.115879] Processor 10 is stuck.
[   50.118389] Processor 11 is stuck.
[   55.120904] Processor 12 is stuck.
[   60.123425] Processor 13 is stuck.
[   65.125970] Processor 14 is stuck.
[   70.128495] Processor 15 is stuck.
[   75.131316] Processor 17 is stuck.

Note that only the sibling threads are stuck, while the primary threads (0, 8,
16 etc) boot just fine. Looking closer at the previous step of kexec, we observe
that kexec tries to wakeup (bring online) the sibling threads of all the cores,
before performing kexec:

[ 9464.131231] Starting new kernel
[ 9464.148507] kexec: Waking offline cpu 1.
[ 9464.148552] kexec: Waking offline cpu 2.
[ 9464.148600] kexec: Waking offline cpu 3.
[ 9464.148636] kexec: Waking offline cpu 4.
[ 9464.148671] kexec: Waking offline cpu 5.
[ 9464.148708] kexec: Waking offline cpu 6.
[ 9464.148743] kexec: Waking offline cpu 7.
[ 9464.148779] kexec: Waking offline cpu 9.
[ 9464.148815] kexec: Waking offline cpu 10.
[ 9464.148851] kexec: Waking offline cpu 11.
[ 9464.148887] kexec: Waking offline cpu 12.
[ 9464.148922] kexec: Waking offline cpu 13.
[ 9464.148958] kexec: Waking offline cpu 14.
[ 9464.148994] kexec: Waking offline cpu 15.
[ 9464.149030] kexec: Waking offline cpu 17.

Instrumenting this piece of code revealed that the cpu_up() operation actually
fails with -EBUSY. Thus, only the primary threads of all the cores are online
during kexec, and hence this is a sure-shot receipe for disaster, as explained
in commit e8e5c2155b (powerpc/kexec: Fix orphaned offline CPUs across kexec),
as well as in the comment above wake_offline_cpus().

It turns out that cpu_up() was returning -EBUSY because the variable
'cpu_hotplug_disabled' was set to 1; and this disabling of CPU hotplug was done
by migrate_to_reboot_cpu() inside kernel_kexec().

Now, migrate_to_reboot_cpu() was originally written with the assumption that
any further code will not need to perform CPU hotplug, since we are anyway in
the reboot path. However, kexec is clearly not such a case, since we depend on
onlining CPUs, atleast on powerpc.

So re-enable cpu-hotplug after returning from migrate_to_reboot_cpu() in the
kexec path, to fix this regression in kexec on powerpc.

Also, wrap the cpu_up() in powerpc kexec code within a WARN_ON(), so that we
can catch such issues more easily in the future.

Fixes: c97102ba963 (kexec: migrate to reboot cpu)
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/powerpc/kernel/machine_kexec_64.c | 2 +-
 kernel/kexec.c                         | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index 611acdf30096..263e44503138 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -237,7 +237,7 @@ static void wake_offline_cpus(void)
 		if (!cpu_online(cpu)) {
 			printk(KERN_INFO "kexec: Waking offline cpu %d.\n",
 			       cpu);
-			cpu_up(cpu);
+			WARN_ON(cpu_up(cpu));
 		}
 	}
 }
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 355e13af62c5..4c9dcffd1750 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1681,6 +1681,14 @@ int kernel_kexec(void)
 		kexec_in_progress = true;
 		kernel_restart_prepare(NULL);
 		migrate_to_reboot_cpu();
+
+		/*
+		 * migrate_to_reboot_cpu() disables CPU hotplug assuming that
+		 * no further code needs to use CPU hotplug (which is true in
+		 * the reboot case). However, the kexec path depends on using
+		 * CPU hotplug again; so re-enable it here.
+		 */
+		cpu_hotplug_enable();
 		printk(KERN_EMERG "Starting new kernel\n");
 		machine_shutdown();
 	}
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 137/146] spi: core: Ignore unsupported Dual/Quad Transfer Mode bits
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (135 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 136/146] powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 138/146] libceph: fix corruption when using page_count 0 page in rbd Jiri Slaby
                   ` (10 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Geert Uytterhoeven, Mark Brown, Jiri Slaby

From: Geert Uytterhoeven <geert+renesas@glider.be>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 83596fbeb5d28e8cb8878786133945d4dc7c0090 upstream.

The availability of SPI Dual or Quad Transfer Mode as indicated by the
"spi-tx-bus-width" and "spi-rx-bus-width" properties in the device tree is
a hardware property of the SPI master, SPI slave, and board wiring.  Hence
the SPI core should not reject an SPI slave because an SPI master driver
doesn't (yet) support Dual or Quad Transfer Mode.

Change the lack of Dual or Quad Transfer Mode support in the SPI master
driver from an error condition to a warning condition, and ignore the
unsupported mode bits, falling back to Single Transfer Mode, to avoid
breakages when running old kernels with new device trees.

Fixes: f477b7fb13df (spi: DUAL and QUAD support)
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/spi/spi.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9e039c60c068..d254477372b9 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1370,7 +1370,7 @@ EXPORT_SYMBOL_GPL(spi_busnum_to_master);
  */
 int spi_setup(struct spi_device *spi)
 {
-	unsigned	bad_bits;
+	unsigned	bad_bits, ugly_bits;
 	int		status = 0;
 
 	/* check mode to prevent that DUAL and QUAD set at the same time
@@ -1390,6 +1390,15 @@ int spi_setup(struct spi_device *spi)
 	 * that aren't supported with their current master
 	 */
 	bad_bits = spi->mode & ~spi->master->mode_bits;
+	ugly_bits = bad_bits &
+		    (SPI_TX_DUAL | SPI_TX_QUAD | SPI_RX_DUAL | SPI_RX_QUAD);
+	if (ugly_bits) {
+		dev_warn(&spi->dev,
+			 "setup: ignoring unsupported mode bits %x\n",
+			 ugly_bits);
+		spi->mode &= ~ugly_bits;
+		bad_bits &= ~ugly_bits;
+	}
 	if (bad_bits) {
 		dev_err(&spi->dev, "setup: unsupported mode bits %x\n",
 			bad_bits);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 138/146] libceph: fix corruption when using page_count 0 page in rbd
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (136 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 137/146] spi: core: Ignore unsupported Dual/Quad Transfer Mode bits Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 139/146] iommu/amd: Fix interrupt remapping for aliased devices Jiri Slaby
                   ` (9 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Chunwei Chen, Sage Weil, Yehuda Sadeh, Jiri Slaby

From: Chunwei Chen <tuxoko@gmail.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 178eda29ca721842f2146378e73d43e0044c4166 upstream.

It has been reported that using ZFSonLinux on rbd will result in memory
corruption. The bug report can be found here:

https://github.com/zfsonlinux/spl/issues/241
http://tracker.ceph.com/issues/7790

The reason is that ZFS will send pages with page_count 0 into rbd, which in
turns send them to tcp_sendpage. However, tcp_sendpage cannot deal with
page_count 0, as it will do get_page and put_page, and erroneously free the
page.

This type of issue has been noted before, and handled in iscsi, drbd,
etc. So, rbd should also handle this. This fix address this issue by fall back
to slower sendmsg when page_count 0 detected.

Cc: Sage Weil <sage@inktank.com>
Cc: Yehuda Sadeh <yehuda@inktank.com>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Reviewed-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/ceph/messenger.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 464303f61730..ce83d07eb419 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -556,7 +556,7 @@ static int ceph_tcp_sendmsg(struct socket *sock, struct kvec *iov,
 	return r;
 }
 
-static int ceph_tcp_sendpage(struct socket *sock, struct page *page,
+static int __ceph_tcp_sendpage(struct socket *sock, struct page *page,
 		     int offset, size_t size, bool more)
 {
 	int flags = MSG_DONTWAIT | MSG_NOSIGNAL | (more ? MSG_MORE : MSG_EOR);
@@ -569,6 +569,24 @@ static int ceph_tcp_sendpage(struct socket *sock, struct page *page,
 	return ret;
 }
 
+static int ceph_tcp_sendpage(struct socket *sock, struct page *page,
+		     int offset, size_t size, bool more)
+{
+	int ret;
+	struct kvec iov;
+
+	/* sendpage cannot properly handle pages with page_count == 0,
+	 * we need to fallback to sendmsg if that's the case */
+	if (page_count(page) >= 1)
+		return __ceph_tcp_sendpage(sock, page, offset, size, more);
+
+	iov.iov_base = kmap(page) + offset;
+	iov.iov_len = size;
+	ret = ceph_tcp_sendmsg(sock, &iov, 1, size, more);
+	kunmap(page);
+
+	return ret;
+}
 
 /*
  * Shutdown/close the socket for the given connection.
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 139/146] iommu/amd: Fix interrupt remapping for aliased devices
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (137 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 138/146] libceph: fix corruption when using page_count 0 page in rbd Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 140/146] media: fc2580: fix tuning failure on 32-bit arch Jiri Slaby
                   ` (8 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Alex Williamson, Joerg Roedel, Jiri Slaby

From: Alex Williamson <alex.williamson@redhat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit e028a9e6b8a637af09ac4114083280df4a7045f1 upstream.

An apparent cut and paste error prevents the correct flags from being
set on the alias device resulting in MSI on conventional PCI devices
failing to work.  This also produces error events from the IOMMU like:

AMD-Vi: Event logged [INVALID_DEVICE_REQUEST device=00:14.4 address=0x000000fdf8000000 flags=0x0a00]

Where 14.4 is a PCIe-to-PCI bridge with a device behind it trying to
use MSI interrupts.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/iommu/amd_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 5d2edb4b60aa..22f656e125dd 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3999,7 +3999,7 @@ static struct irq_remap_table *get_irq_table(u16 devid, bool ioapic)
 	iommu_flush_dte(iommu, devid);
 	if (devid != alias) {
 		irq_lookup_table[alias] = table;
-		set_dte_irq_entry(devid, table);
+		set_dte_irq_entry(alias, table);
 		iommu_flush_dte(iommu, alias);
 	}
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 140/146] media: fc2580: fix tuning failure on 32-bit arch
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (138 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 139/146] iommu/amd: Fix interrupt remapping for aliased devices Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 141/146] media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space Jiri Slaby
                   ` (7 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable; +Cc: linux-kernel, Antti Palosaari, Mauro Carvalho Chehab, Jiri Slaby

From: Antti Palosaari <crope@iki.fi>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 8845cc6415ec28ef8d57b3fb81c75ef9bce69c5f upstream.

There was some frequency calculation overflows which caused tuning
failure on 32-bit architecture. Use 64-bit numbers where needed in
order to avoid calculation overflows.

Thanks for the Finnish person, who asked remain anonymous, reporting,
testing and suggesting the fix.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/media/tuners/fc2580.c      | 6 +++---
 drivers/media/tuners/fc2580_priv.h | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/media/tuners/fc2580.c b/drivers/media/tuners/fc2580.c
index 3aecaf465094..f0c9c42867de 100644
--- a/drivers/media/tuners/fc2580.c
+++ b/drivers/media/tuners/fc2580.c
@@ -195,7 +195,7 @@ static int fc2580_set_params(struct dvb_frontend *fe)
 
 	f_ref = 2UL * priv->cfg->clock / r_val;
 	n_val = div_u64_rem(f_vco, f_ref, &k_val);
-	k_val_reg = 1UL * k_val * (1 << 20) / f_ref;
+	k_val_reg = div_u64(1ULL * k_val * (1 << 20), f_ref);
 
 	ret = fc2580_wr_reg(priv, 0x18, r18_val | ((k_val_reg >> 16) & 0xff));
 	if (ret < 0)
@@ -348,8 +348,8 @@ static int fc2580_set_params(struct dvb_frontend *fe)
 	if (ret < 0)
 		goto err;
 
-	ret = fc2580_wr_reg(priv, 0x37, 1UL * priv->cfg->clock * \
-			fc2580_if_filter_lut[i].mul / 1000000000);
+	ret = fc2580_wr_reg(priv, 0x37, div_u64(1ULL * priv->cfg->clock *
+			fc2580_if_filter_lut[i].mul, 1000000000));
 	if (ret < 0)
 		goto err;
 
diff --git a/drivers/media/tuners/fc2580_priv.h b/drivers/media/tuners/fc2580_priv.h
index be38a9e637e0..646c99452136 100644
--- a/drivers/media/tuners/fc2580_priv.h
+++ b/drivers/media/tuners/fc2580_priv.h
@@ -22,6 +22,7 @@
 #define FC2580_PRIV_H
 
 #include "fc2580.h"
+#include <linux/math64.h>
 
 struct fc2580_reg_val {
 	u8 reg;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 141/146] media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (139 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 140/146] media: fc2580: fix tuning failure on 32-bit arch Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 142/146] media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode Jiri Slaby
                   ` (6 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Guennadi Liakhovetski, Mauro Carvalho Chehab, Jiri Slaby

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit cfece5857ca51d1dcdb157017aba226f594e9dcf upstream.

Commit 75e2bdad8901a0b599e01a96229be922eef1e488 "ov7670: allow
configuration of image size, clock speed, and I/O method" uses a wrong
index to iterate an array. Apart from being wrong, it also uses an
unchecked value from user-space, which can cause access to unmapped
memory in the kernel, triggered by a normal desktop user with rights to
use V4L2 devices.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/media/i2c/ov7670.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
index e8a1ce204036..cdd7c1b7259b 100644
--- a/drivers/media/i2c/ov7670.c
+++ b/drivers/media/i2c/ov7670.c
@@ -1109,7 +1109,7 @@ static int ov7670_enum_framesizes(struct v4l2_subdev *sd,
 	 * windows that fall outside that.
 	 */
 	for (i = 0; i < n_win_sizes; i++) {
-		struct ov7670_win_size *win = &info->devtype->win_sizes[index];
+		struct ov7670_win_size *win = &info->devtype->win_sizes[i];
 		if (info->min_width && win->width < info->min_width)
 			continue;
 		if (info->min_height && win->height < info->min_height)
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 142/146] media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (140 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 141/146] media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 143/146] futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1) Jiri Slaby
                   ` (5 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Guennadi Liakhovetski, Mauro Carvalho Chehab, Jiri Slaby

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 97d9d23dda6f37d90aefeec4ed619d52df525382 upstream.

If a struct contains 64-bit fields, it is aligned on 64-bit boundaries
within containing structs in 64-bit compilations. This is the case with
struct v4l2_window, which contains pointers and is embedded into struct
v4l2_format, and that one is embedded into struct v4l2_create_buffers.
Unlike some other structs, used as a part of the kernel ABI as ioctl()
arguments, that are packed, these structs aren't packed. This isn't a
problem per se, but the ioctl-compat code for VIDIOC_CREATE_BUFS contains
a bug, that triggers in such 64-bit builds. That code wrongly assumes,
that in struct v4l2_create_buffers, struct v4l2_format immediately follows
the __u32 memory field, which in fact isn't the case. This bug wasn't
visible until now, because until recently hardly any applications used
this ioctl() and mostly embedded 32-bit only drivers implemented it. This
is changing now with addition of this ioctl() to some USB drivers, e.g.
UVC. This patch fixes the bug by copying parts of struct
v4l2_create_buffers separately.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index b63a5e584aa0..fca336b65351 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -178,6 +178,9 @@ struct v4l2_create_buffers32 {
 
 static int __get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user *up)
 {
+	if (get_user(kp->type, &up->type))
+		return -EFAULT;
+
 	switch (kp->type) {
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE:
 	case V4L2_BUF_TYPE_VIDEO_OUTPUT:
@@ -204,17 +207,16 @@ static int __get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __us
 
 static int get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user *up)
 {
-	if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_format32)) ||
-			get_user(kp->type, &up->type))
-			return -EFAULT;
+	if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_format32)))
+		return -EFAULT;
 	return __get_v4l2_format32(kp, up);
 }
 
 static int get_v4l2_create32(struct v4l2_create_buffers *kp, struct v4l2_create_buffers32 __user *up)
 {
 	if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_create_buffers32)) ||
-	    copy_from_user(kp, up, offsetof(struct v4l2_create_buffers32, format.fmt)))
-			return -EFAULT;
+	    copy_from_user(kp, up, offsetof(struct v4l2_create_buffers32, format)))
+		return -EFAULT;
 	return __get_v4l2_format32(&kp->format, &up->format);
 }
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 143/146] futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1)
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (141 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 142/146] media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 144/146] futex: Validate atomic acquisition in futex_lock_pi_atomic() Jiri Slaby
                   ` (4 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Thomas Gleixner, Will Drewry, Kees Cook,
	Linus Torvalds, Jiri Slaby

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit e9c243a5a6de0be8e584c604d353412584b592f8 upstream.

If uaddr == uaddr2, then we have broken the rule of only requeueing from
a non-pi futex to a pi futex with this call.  If we attempt this, then
dangling pointers may be left for rt_waiter resulting in an exploitable
condition.

This change brings futex_requeue() in line with futex_wait_requeue_pi()
which performs the same check as per commit 6f7b0a2a5c0f ("futex: Forbid
uaddr == uaddr2 in futex_wait_requeue_pi()")

[ tglx: Compare the resulting keys as well, as uaddrs might be
  	different depending on the mapping ]

Fixes CVE-2014-3153.

Reported-by: Pinkie Pie
Signed-off-by: Will Drewry <wad@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/futex.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/kernel/futex.c b/kernel/futex.c
index 6c7975b3f291..ab207d65c55f 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1295,6 +1295,13 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags,
 
 	if (requeue_pi) {
 		/*
+		 * Requeue PI only works on two distinct uaddrs. This
+		 * check is only valid for private futexes. See below.
+		 */
+		if (uaddr1 == uaddr2)
+			return -EINVAL;
+
+		/*
 		 * requeue_pi requires a pi_state, try to allocate it now
 		 * without any locks in case it fails.
 		 */
@@ -1332,6 +1339,15 @@ retry:
 	if (unlikely(ret != 0))
 		goto out_put_key1;
 
+	/*
+	 * The check above which compares uaddrs is not sufficient for
+	 * shared futexes. We need to compare the keys:
+	 */
+	if (requeue_pi && match_futex(&key1, &key2)) {
+		ret = -EINVAL;
+		goto out_put_keys;
+	}
+
 	hb1 = hash_futex(&key1);
 	hb2 = hash_futex(&key2);
 
@@ -2362,6 +2378,15 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
 	if (ret)
 		goto out_key2;
 
+	/*
+	 * The check above which compares uaddrs is not sufficient for
+	 * shared futexes. We need to compare the keys:
+	 */
+	if (match_futex(&q.key, &key2)) {
+		ret = -EINVAL;
+		goto out_put_keys;
+	}
+
 	/* Queue the futex_q, drop the hb lock, wait for wakeup. */
 	futex_wait_queue_me(hb, &q, to);
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 144/146] futex: Validate atomic acquisition in futex_lock_pi_atomic()
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (142 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 143/146] futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1) Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 145/146] futex: Always cleanup owner tid in unlock_pi Jiri Slaby
                   ` (3 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Thomas Gleixner, Darren Hart, Kees Cook,
	Will Drewry, Linus Torvalds, Jiri Slaby

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit b3eaa9fc5cd0a4d74b18f6b8dc617aeaf1873270 upstream.

We need to protect the atomic acquisition in the kernel against rogue
user space which sets the user space futex to 0, so the kernel side
acquisition succeeds while there is existing state in the kernel
associated to the real owner.

Verify whether the futex has waiters associated with kernel state.  If
it has, return -EINVAL.  The state is corrupted already, so no point in
cleaning it up.  Subsequent calls will fail as well.  Not our problem.

[ tglx: Use futex_top_waiter() and explain why we do not need to try
  	restoring the already corrupted user space state. ]

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Will Drewry <wad@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/futex.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index ab207d65c55f..2f48beac4969 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -764,10 +764,18 @@ retry:
 		return -EDEADLK;
 
 	/*
-	 * Surprise - we got the lock. Just return to userspace:
+	 * Surprise - we got the lock, but we do not trust user space at all.
 	 */
-	if (unlikely(!curval))
-		return 1;
+	if (unlikely(!curval)) {
+		/*
+		 * We verify whether there is kernel state for this
+		 * futex. If not, we can safely assume, that the 0 ->
+		 * TID transition is correct. If state exists, we do
+		 * not bother to fixup the user space state as it was
+		 * corrupted already.
+		 */
+		return futex_top_waiter(hb, key) ? -EINVAL : 1;
+	}
 
 	uval = curval;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 145/146] futex: Always cleanup owner tid in unlock_pi
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (143 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 144/146] futex: Validate atomic acquisition in futex_lock_pi_atomic() Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09  8:51 ` [PATCH 3.12 146/146] futex: Make lookup_pi_state more robust Jiri Slaby
                   ` (2 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Thomas Gleixner, Kees Cook, Will Drewry,
	Darren Hart, Linus Torvalds, Jiri Slaby

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 13fbca4c6ecd96ec1a1cfa2e4f2ce191fe928a5e upstream.

If the owner died bit is set at futex_unlock_pi, we currently do not
cleanup the user space futex.  So the owner TID of the current owner
(the unlocker) persists.  That's observable inconsistant state,
especially when the ownership of the pi state got transferred.

Clean it up unconditionally.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: Will Drewry <wad@chromium.org>
Cc: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/futex.c | 40 ++++++++++++++++++----------------------
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index 2f48beac4969..e86dcf9303bd 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -905,6 +905,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
 	struct task_struct *new_owner;
 	struct futex_pi_state *pi_state = this->pi_state;
 	u32 uninitialized_var(curval), newval;
+	int ret = 0;
 
 	if (!pi_state)
 		return -EINVAL;
@@ -928,23 +929,19 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
 		new_owner = this->task;
 
 	/*
-	 * We pass it to the next owner. (The WAITERS bit is always
-	 * kept enabled while there is PI state around. We must also
-	 * preserve the owner died bit.)
+	 * We pass it to the next owner. The WAITERS bit is always
+	 * kept enabled while there is PI state around. We cleanup the
+	 * owner died bit, because we are the owner.
 	 */
-	if (!(uval & FUTEX_OWNER_DIED)) {
-		int ret = 0;
-
-		newval = FUTEX_WAITERS | task_pid_vnr(new_owner);
+	newval = FUTEX_WAITERS | task_pid_vnr(new_owner);
 
-		if (cmpxchg_futex_value_locked(&curval, uaddr, uval, newval))
-			ret = -EFAULT;
-		else if (curval != uval)
-			ret = -EINVAL;
-		if (ret) {
-			raw_spin_unlock(&pi_state->pi_mutex.wait_lock);
-			return ret;
-		}
+	if (cmpxchg_futex_value_locked(&curval, uaddr, uval, newval))
+		ret = -EFAULT;
+	else if (curval != uval)
+		ret = -EINVAL;
+	if (ret) {
+		raw_spin_unlock(&pi_state->pi_mutex.wait_lock);
+		return ret;
 	}
 
 	raw_spin_lock_irq(&pi_state->owner->pi_lock);
@@ -2189,9 +2186,10 @@ retry:
 	/*
 	 * To avoid races, try to do the TID -> 0 atomic transition
 	 * again. If it succeeds then we can return without waking
-	 * anyone else up:
+	 * anyone else up. We only try this if neither the waiters nor
+	 * the owner died bit are set.
 	 */
-	if (!(uval & FUTEX_OWNER_DIED) &&
+	if (!(uval & ~FUTEX_TID_MASK) &&
 	    cmpxchg_futex_value_locked(&uval, uaddr, vpid, 0))
 		goto pi_faulted;
 	/*
@@ -2223,11 +2221,9 @@ retry:
 	/*
 	 * No waiters - kernel unlocks the futex:
 	 */
-	if (!(uval & FUTEX_OWNER_DIED)) {
-		ret = unlock_futex_pi(uaddr, uval);
-		if (ret == -EFAULT)
-			goto pi_faulted;
-	}
+	ret = unlock_futex_pi(uaddr, uval);
+	if (ret == -EFAULT)
+		goto pi_faulted;
 
 out_unlock:
 	spin_unlock(&hb->lock);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 3.12 146/146] futex: Make lookup_pi_state more robust
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (144 preceding siblings ...)
  2014-06-09  8:51 ` [PATCH 3.12 145/146] futex: Always cleanup owner tid in unlock_pi Jiri Slaby
@ 2014-06-09  8:51 ` Jiri Slaby
  2014-06-09 23:22   ` Satoru Takeuchi
  2014-06-10 15:34 ` Guenter Roeck
  147 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09  8:51 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, Thomas Gleixner, Kees Cook, Will Drewry,
	Darren Hart, Linus Torvalds, Jiri Slaby

From: Thomas Gleixner <tglx@linutronix.de>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 54a217887a7b658e2650c3feff22756ab80c7339 upstream.

The current implementation of lookup_pi_state has ambigous handling of
the TID value 0 in the user space futex.  We can get into the kernel
even if the TID value is 0, because either there is a stale waiters bit
or the owner died bit is set or we are called from the requeue_pi path
or from user space just for fun.

The current code avoids an explicit sanity check for pid = 0 in case
that kernel internal state (waiters) are found for the user space
address.  This can lead to state leakage and worse under some
circumstances.

Handle the cases explicit:

       Waiter | pi_state | pi->owner | uTID      | uODIED | ?

  [1]  NULL   | ---      | ---       | 0         | 0/1    | Valid
  [2]  NULL   | ---      | ---       | >0        | 0/1    | Valid

  [3]  Found  | NULL     | --        | Any       | 0/1    | Invalid

  [4]  Found  | Found    | NULL      | 0         | 1      | Valid
  [5]  Found  | Found    | NULL      | >0        | 1      | Invalid

  [6]  Found  | Found    | task      | 0         | 1      | Valid

  [7]  Found  | Found    | NULL      | Any       | 0      | Invalid

  [8]  Found  | Found    | task      | ==taskTID | 0/1    | Valid
  [9]  Found  | Found    | task      | 0         | 0      | Invalid
  [10] Found  | Found    | task      | !=taskTID | 0/1    | Invalid

 [1] Indicates that the kernel can acquire the futex atomically. We
     came came here due to a stale FUTEX_WAITERS/FUTEX_OWNER_DIED bit.

 [2] Valid, if TID does not belong to a kernel thread. If no matching
     thread is found then it indicates that the owner TID has died.

 [3] Invalid. The waiter is queued on a non PI futex

 [4] Valid state after exit_robust_list(), which sets the user space
     value to FUTEX_WAITERS | FUTEX_OWNER_DIED.

 [5] The user space value got manipulated between exit_robust_list()
     and exit_pi_state_list()

 [6] Valid state after exit_pi_state_list() which sets the new owner in
     the pi_state but cannot access the user space value.

 [7] pi_state->owner can only be NULL when the OWNER_DIED bit is set.

 [8] Owner and user space value match

 [9] There is no transient state which sets the user space TID to 0
     except exit_robust_list(), but this is indicated by the
     FUTEX_OWNER_DIED bit. See [4]

[10] There is no transient state which leaves owner and user space
     TID out of sync.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: Will Drewry <wad@chromium.org>
Cc: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/futex.c | 134 +++++++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 106 insertions(+), 28 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index e86dcf9303bd..f94695c9d38b 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -594,10 +594,58 @@ void exit_pi_state_list(struct task_struct *curr)
 	raw_spin_unlock_irq(&curr->pi_lock);
 }
 
+/*
+ * We need to check the following states:
+ *
+ *      Waiter | pi_state | pi->owner | uTID      | uODIED | ?
+ *
+ * [1]  NULL   | ---      | ---       | 0         | 0/1    | Valid
+ * [2]  NULL   | ---      | ---       | >0        | 0/1    | Valid
+ *
+ * [3]  Found  | NULL     | --        | Any       | 0/1    | Invalid
+ *
+ * [4]  Found  | Found    | NULL      | 0         | 1      | Valid
+ * [5]  Found  | Found    | NULL      | >0        | 1      | Invalid
+ *
+ * [6]  Found  | Found    | task      | 0         | 1      | Valid
+ *
+ * [7]  Found  | Found    | NULL      | Any       | 0      | Invalid
+ *
+ * [8]  Found  | Found    | task      | ==taskTID | 0/1    | Valid
+ * [9]  Found  | Found    | task      | 0         | 0      | Invalid
+ * [10] Found  | Found    | task      | !=taskTID | 0/1    | Invalid
+ *
+ * [1]	Indicates that the kernel can acquire the futex atomically. We
+ *	came came here due to a stale FUTEX_WAITERS/FUTEX_OWNER_DIED bit.
+ *
+ * [2]	Valid, if TID does not belong to a kernel thread. If no matching
+ *      thread is found then it indicates that the owner TID has died.
+ *
+ * [3]	Invalid. The waiter is queued on a non PI futex
+ *
+ * [4]	Valid state after exit_robust_list(), which sets the user space
+ *	value to FUTEX_WAITERS | FUTEX_OWNER_DIED.
+ *
+ * [5]	The user space value got manipulated between exit_robust_list()
+ *	and exit_pi_state_list()
+ *
+ * [6]	Valid state after exit_pi_state_list() which sets the new owner in
+ *	the pi_state but cannot access the user space value.
+ *
+ * [7]	pi_state->owner can only be NULL when the OWNER_DIED bit is set.
+ *
+ * [8]	Owner and user space value match
+ *
+ * [9]	There is no transient state which sets the user space TID to 0
+ *	except exit_robust_list(), but this is indicated by the
+ *	FUTEX_OWNER_DIED bit. See [4]
+ *
+ * [10] There is no transient state which leaves owner and user space
+ *	TID out of sync.
+ */
 static int
 lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
-		union futex_key *key, struct futex_pi_state **ps,
-		struct task_struct *task)
+		union futex_key *key, struct futex_pi_state **ps)
 {
 	struct futex_pi_state *pi_state = NULL;
 	struct futex_q *this, *next;
@@ -610,12 +658,13 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
 	plist_for_each_entry_safe(this, next, head, list) {
 		if (match_futex(&this->key, key)) {
 			/*
-			 * Another waiter already exists - bump up
-			 * the refcount and return its pi_state:
+			 * Sanity check the waiter before increasing
+			 * the refcount and attaching to it.
 			 */
 			pi_state = this->pi_state;
 			/*
-			 * Userspace might have messed up non-PI and PI futexes
+			 * Userspace might have messed up non-PI and
+			 * PI futexes [3]
 			 */
 			if (unlikely(!pi_state))
 				return -EINVAL;
@@ -623,44 +672,70 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
 			WARN_ON(!atomic_read(&pi_state->refcount));
 
 			/*
-			 * When pi_state->owner is NULL then the owner died
-			 * and another waiter is on the fly. pi_state->owner
-			 * is fixed up by the task which acquires
-			 * pi_state->rt_mutex.
-			 *
-			 * We do not check for pid == 0 which can happen when
-			 * the owner died and robust_list_exit() cleared the
-			 * TID.
+			 * Handle the owner died case:
 			 */
-			if (pid && pi_state->owner) {
+			if (uval & FUTEX_OWNER_DIED) {
 				/*
-				 * Bail out if user space manipulated the
-				 * futex value.
+				 * exit_pi_state_list sets owner to NULL and
+				 * wakes the topmost waiter. The task which
+				 * acquires the pi_state->rt_mutex will fixup
+				 * owner.
 				 */
-				if (pid != task_pid_vnr(pi_state->owner))
+				if (!pi_state->owner) {
+					/*
+					 * No pi state owner, but the user
+					 * space TID is not 0. Inconsistent
+					 * state. [5]
+					 */
+					if (pid)
+						return -EINVAL;
+					/*
+					 * Take a ref on the state and
+					 * return. [4]
+					 */
+					goto out_state;
+				}
+
+				/*
+				 * If TID is 0, then either the dying owner
+				 * has not yet executed exit_pi_state_list()
+				 * or some waiter acquired the rtmutex in the
+				 * pi state, but did not yet fixup the TID in
+				 * user space.
+				 *
+				 * Take a ref on the state and return. [6]
+				 */
+				if (!pid)
+					goto out_state;
+			} else {
+				/*
+				 * If the owner died bit is not set,
+				 * then the pi_state must have an
+				 * owner. [7]
+				 */
+				if (!pi_state->owner)
 					return -EINVAL;
 			}
 
 			/*
-			 * Protect against a corrupted uval. If uval
-			 * is 0x80000000 then pid is 0 and the waiter
-			 * bit is set. So the deadlock check in the
-			 * calling code has failed and we did not fall
-			 * into the check above due to !pid.
+			 * Bail out if user space manipulated the
+			 * futex value. If pi state exists then the
+			 * owner TID must be the same as the user
+			 * space TID. [9/10]
 			 */
-			if (task && pi_state->owner == task)
-				return -EDEADLK;
+			if (pid != task_pid_vnr(pi_state->owner))
+				return -EINVAL;
 
+		out_state:
 			atomic_inc(&pi_state->refcount);
 			*ps = pi_state;
-
 			return 0;
 		}
 	}
 
 	/*
 	 * We are the first waiter - try to look up the real owner and attach
-	 * the new pi_state to it, but bail out when TID = 0
+	 * the new pi_state to it, but bail out when TID = 0 [1]
 	 */
 	if (!pid)
 		return -ESRCH;
@@ -693,6 +768,9 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
 		return ret;
 	}
 
+	/*
+	 * No existing pi state. First waiter. [2]
+	 */
 	pi_state = alloc_pi_state();
 
 	/*
@@ -813,7 +891,7 @@ retry:
 	 * We dont have the lock. Look up the PI state (or create it if
 	 * we are the first waiter):
 	 */
-	ret = lookup_pi_state(uval, hb, key, ps, task);
+	ret = lookup_pi_state(uval, hb, key, ps);
 
 	if (unlikely(ret)) {
 		switch (ret) {
@@ -1416,7 +1494,7 @@ retry_private:
 			 * rereading and handing potential crap to
 			 * lookup_pi_state.
 			 */
-			ret = lookup_pi_state(ret, hb2, &key2, &pi_state, NULL);
+			ret = lookup_pi_state(ret, hb2, &key2, &pi_state);
 		}
 
 		switch (ret) {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* Re: [PATCH 3.12 064/146] Bluetooth: Fix redundant encryption request for reauthentication
  2014-06-09  8:49 ` [PATCH 3.12 064/146] Bluetooth: Fix redundant encryption request for reauthentication Jiri Slaby
@ 2014-06-09 13:33   ` Johan Hedberg
  2014-06-09 13:51     ` Jiri Slaby
  0 siblings, 1 reply; 163+ messages in thread
From: Johan Hedberg @ 2014-06-09 13:33 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: stable, linux-kernel, Marcel Holtmann

Hi,

On Mon, Jun 09, 2014, Jiri Slaby wrote:
> 3.12-stable review patch.  If anyone has any objections, please let me know.
> 
> ===============
> 
> commit 09da1f3463eb81d59685df723b1c5950b7570340 upstream.
> 
> When we're performing reauthentication (in order to elevate the
> security level from an unauthenticated key to an authenticated one) we
> do not need to issue any encryption command once authentication
> completes. Since the trigger for the encryption HCI command is the
> ENCRYPT_PEND flag this flag should not be set in this scenario.
> Instead, the REAUTH_PEND flag takes care of all necessary steps for
> reauthentication.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> ---
>  net/bluetooth/hci_conn.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

This one seems to be causing a regression, so it's probably best to keep
it out of stable trees for now:

https://bugzilla.kernel.org/show_bug.cgi?id=77541

Johan

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 3.12 068/146] revert "mm: vmscan: do not swap anon pages just because free+file is low"
  2014-06-09  8:50 ` [PATCH 3.12 068/146] revert "mm: vmscan: do not swap anon pages just because free+file is low" Jiri Slaby
@ 2014-06-09 13:35   ` Johannes Weiner
  2014-06-09 13:58     ` Jiri Slaby
  0 siblings, 1 reply; 163+ messages in thread
From: Johannes Weiner @ 2014-06-09 13:35 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: stable, linux-kernel, Rik van Riel, Andrew Morton, Linus Torvalds

On Mon, Jun 09, 2014 at 10:50:03AM +0200, Jiri Slaby wrote:
> From: Johannes Weiner <hannes@cmpxchg.org>
> 
> 3.12-stable review patch.  If anyone has any objections, please let me know.
> 
> ===============
> 
> commit 623762517e2370be3b3f95f4fe08d6c063a49b06 upstream.
> 
> This reverts commit 0bf1457f0cfc ("mm: vmscan: do not swap anon pages
> just because free+file is low") because it introduced a regression in

That commit never made it into 3.12, please don't merge the revert as
it would introduce duplicate code.

Thanks!

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 3.12 064/146] Bluetooth: Fix redundant encryption request for reauthentication
  2014-06-09 13:33   ` Johan Hedberg
@ 2014-06-09 13:51     ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09 13:51 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: stable, linux-kernel, Marcel Holtmann

On 06/09/2014 03:33 PM, Johan Hedberg wrote:
> Hi,
> 
> On Mon, Jun 09, 2014, Jiri Slaby wrote:
>> 3.12-stable review patch.  If anyone has any objections, please let me know.
>>
>> ===============
>>
>> commit 09da1f3463eb81d59685df723b1c5950b7570340 upstream.
>>
>> When we're performing reauthentication (in order to elevate the
>> security level from an unauthenticated key to an authenticated one) we
>> do not need to issue any encryption command once authentication
>> completes. Since the trigger for the encryption HCI command is the
>> ENCRYPT_PEND flag this flag should not be set in this scenario.
>> Instead, the REAUTH_PEND flag takes care of all necessary steps for
>> reauthentication.
>>
>> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
>> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
>> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
>> ---
>>  net/bluetooth/hci_conn.c | 9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> This one seems to be causing a regression, so it's probably best to keep
> it out of stable trees for now:
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=77541

Oh, thanks for letting me know. Now dropped.

thanks,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 3.12 068/146] revert "mm: vmscan: do not swap anon pages just because free+file is low"
  2014-06-09 13:35   ` Johannes Weiner
@ 2014-06-09 13:58     ` Jiri Slaby
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-09 13:58 UTC (permalink / raw)
  To: Johannes Weiner
  Cc: stable, linux-kernel, Rik van Riel, Andrew Morton, Linus Torvalds

On 06/09/2014 03:35 PM, Johannes Weiner wrote:
> On Mon, Jun 09, 2014 at 10:50:03AM +0200, Jiri Slaby wrote:
>> From: Johannes Weiner <hannes@cmpxchg.org>
>>
>> 3.12-stable review patch.  If anyone has any objections, please let me know.
>>
>> ===============
>>
>> commit 623762517e2370be3b3f95f4fe08d6c063a49b06 upstream.
>>
>> This reverts commit 0bf1457f0cfc ("mm: vmscan: do not swap anon pages
>> just because free+file is low") because it introduced a regression in
> 
> That commit never made it into 3.12, please don't merge the revert as
> it would introduce duplicate code.

Ugh, now dropped. Thanks for noticing!

-- 
js
suse labs

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 3.12 000/146] 3.12.22-stable review
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
@ 2014-06-09 23:22   ` Satoru Takeuchi
  2014-06-09  8:48 ` [PATCH 3.12 002/146] oom_kill: change oom_kill.c to use for_each_thread() Jiri Slaby
                     ` (146 subsequent siblings)
  147 siblings, 0 replies; 163+ messages in thread
From: Satoru Takeuchi @ 2014-06-09 23:22 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: stable, linux, satoru.takeuchi, shuah.kh, linux-kernel

Hi Jiri,

At Mon,  9 Jun 2014 10:50:59 +0200,
Jiri Slaby wrote:
> 
> This is the start of the stable review cycle for the 3.12.22 release.
> There are 146 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Wed Jun 11 08:50:21 2014
> Anything received after that time might be too late.

This kernel passed my test.

 - Test Cases:
   - Build this kernel.
   - Boot this kernel.
   - Build the latest mainline kernel with this kernel.

 - Test Tool:
   https://github.com/satoru-takeuchi/test-linux-stable

 - Test Result (kernel .config, ktest config and test log):
   http://satoru-takeuchi.org/test-linux-stable/results/<version>-<test datetime>.tar.xz

 - Build Environment:
   - OS: Debian Jessy x86_64
   - CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
   - memory: 8GB

 - Test Target Environment:
   - Debian Jessy x86_64 (KVM guest on the Build Environment)
   - # of vCPU: 2
   - memory: 2GB

Thanks,
Satoru

> 
> The whole patch series can be found in one patch at:
> 	http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.22-rc1.xz
> and the diffstat can be found below.
> 
> thanks,
> js
> 
> ===============
> 
> 
> Aaron Lu (1):
>   ACPI / video: Fix initial level validity test
> 
> Alan Stern (1):
>   USB: OHCI: fix problem with global suspend on ATI controllers
> 
> Alex Deucher (6):
>   drm/radeon: disable mclk dpm on R7 260X
>   drm/radeon: add support for newer mc ucode on SI (v2)
>   drm/radeon/si: make sure mc ucode is loaded before checking the size
>   drm/radeon: fix ATPX detection on non-VGA GPUs
>   drm/radeon/pm: don't walk the crtc list before it has been initialized
>     (v2)
>   drm/radeon: fix count in cik_sdma_ring_test()
> 
> Alex Williamson (1):
>   iommu/amd: Fix interrupt remapping for aliased devices
> 
> Andy Grover (1):
>   target: Don't allow setting WC emulation if device doesn't support
> 
> Andy Shevchenko (1):
>   dmaengine: dw: went back to plain {request,free}_irq() calls
> 
> Anssi Hannula (1):
>   ALSA: hda - hdmi: Set converter channel count even without sink
> 
> Anthony Iliopoulos (1):
>   x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow()
> 
> Antti Palosaari (1):
>   media: fc2580: fix tuning failure on 32-bit arch
> 
> Aristeu Rozanski (2):
>   device_cgroup: rework device access check and exception checking
>   device_cgroup: check if exception removal is allowed
> 
> Arnd Bergmann (1):
>   genirq: Provide irq_force_affinity fallback for non-SMP
> 
> Atilla Filiz (1):
>   iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null
>     dereference
> 
> Bartlomiej Zolnierkiewicz (1):
>   pata_at91: fix ata_host_activate() failure handling
> 
> Ben Hutchings (1):
>   rtl8192cu: Fix unbalanced irq enable in error path of
>     rtl92cu_hw_init()
> 
> Bjørn Mork (1):
>   usb: qcserial: add a number of Dell devices
> 
> Charles Keepax (1):
>   ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile
> 
> Chen Yucong (1):
>   hwpoison, hugetlb: lock_page/unlock_page does not match for handling a
>     free hugepage
> 
> Chris Wilson (1):
>   drm/i915: Fix unsafe loop iteration over vma whilst unbinding them
> 
> Christian König (2):
>   drm/radeon/uvd: use lower clocks on old UVD to boot v2
>   drm/radeon: use pflip irq on R600+ v2
> 
> Christoph Hellwig (1):
>   posix_acl: handle NULL ACL in posix_acl_equiv_mode
> 
> Chunwei Chen (1):
>   libceph: fix corruption when using page_count 0 page in rbd
> 
> Clemens Ladisch (1):
>   ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data
> 
> Corey Minyard (1):
>   ipmi: Reset the KCS timeout when starting error recovery
> 
> Daeseok Youn (1):
>   workqueue: fix bugs in wq_update_unbound_numa() failure path
> 
> Dan Carpenter (1):
>   clk: vexpress: NULL dereference on error path
> 
> Daniel Vetter (2):
>   drm/i915: Don't check gmch state on inherited configs
>   drm/i915: Disable self-refresh for untiled fbs on i915gm
> 
> Daniele Forsi (2):
>   usb: storage: shuttle_usbat: fix discs being detected twice
>   USB: Nokia 5300 should be treated as unusual dev
> 
> David Rientjes (1):
>   mm, oom: prefer thread group leaders for display purposes
> 
> Du, Wenkai (1):
>   i2c: designware: Mask all interrupts during i2c controller enable
> 
> Edward Lin (1):
>   ACPI: blacklist win8 OSI for Dell Inspiron 7737
> 
> Egbert Eich (1):
>   drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc()
> 
> Eliad Peller (1):
>   cfg80211: free sme on connection failures
> 
> Emmanuel Grumbach (1):
>   mac80211: fix suspend vs. association race
> 
> Eric Dumazet (1):
>   coredump: fix va_list corruption
> 
> Ezequiel Garcia (1):
>   dma: mv_xor: Flush descriptors before activating a channel
> 
> Gavin Shan (1):
>   powerpc/powernv: Reset root port in firmware
> 
> Geert Uytterhoeven (2):
>   Documentation: Update stable address in Chinese and Japanese
>     translations
>   spi: core: Ignore unsupported Dual/Quad Transfer Mode bits
> 
> Grant Likely (1):
>   drivercore: deferral race condition fix
> 
> Guennadi Liakhovetski (2):
>   media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel
>     from user-space
>   media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode
> 
> Guenter Roeck (1):
>   powerpc: Fix 64 bit builds with binutils 2.24
> 
> Hans de Goede (4):
>   Input: elantech - fix touchpad initialization on Gigabyte U2442
>   Input: synaptics - add min/max quirk for the ThinkPad W540
>   Input: synaptics - T540p - unify with other LEN0034 models
>   ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC
>     1015PX
> 
> Horia Geanta (1):
>   crypto: caam - add allocation failure handling in SPRINTFCAT macro
> 
> Ian Kent (1):
>   autofs: fix lockref lookup
> 
> Igor Mammedov (1):
>   ACPI / processor: do not mark present at boot but not onlined CPU as
>     onlined
> 
> Ilia Mirkin (1):
>   drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi
> 
> J. Bruce Fields (2):
>   nfsd4: warn on finding lockowner without stateid's
>   nfsd4: remove lockowner when removing lock stateid
> 
> James Hogan (1):
>   metag: Reduce maximum stack size to 256MB
> 
> Jani Nikula (2):
>   drm/i915/vlv: reset VLV media force wake request register
>   drm/i915: quirk invert brightness for Acer Aspire 5336
> 
> Jean-Jacques Hiblot (1):
>   usb: gadget: at91-udc: fix irq and iomem resource retrieval
> 
> Jianyu Zhan (1):
>   percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree()
> 
> Jiri Bohac (1):
>   timer: Prevent overflow in apply_slack
> 
> Johan Hedberg (2):
>   Bluetooth: Fix triggering BR/EDR L2CAP Connect too early
>   Bluetooth: Fix redundant encryption request for reauthentication
> 
> Johannes Berg (1):
>   mac80211: fix on-channel remain-on-channel
> 
> Johannes Weiner (1):
>   revert "mm: vmscan: do not swap anon pages just because free+file is
>     low"
> 
> Josef Gajdusek (2):
>   hwmon: (emc1403) fix inverted store_hyst()
>   hwmon: (emc1403) Support full range of known chip revision numbers
> 
> Kinglong Mee (1):
>   NFSD: Call ->set_acl with a NULL ACL structure if no entries
> 
> Kirill A. Shutemov (1):
>   mm, thp: close race between mremap() and split_huge_page()
> 
> Krzysztof Kozlowski (1):
>   clocksource: Exynos_mct: Register clock event after request_irq()
> 
> Lai Jiangshan (2):
>   workqueue: fix a possible race condition between rescuer and
>     pwq-release
>   workqueue: make rescuer_thread() empty wq->maydays list before exiting
> 
> Leif Lindholm (2):
>   mips: dts: Fix missing device_type="memory" property in memory nodes
>   arm: dts: Fix missing device_type="memory" for ste-ccu8540
> 
> Leo Liu (1):
>   drm/radeon: check buffer relocation offset
> 
> Leon Ma (1):
>   hrtimer: Prevent remote enqueue of leftmost timers
> 
> Leon Yu (1):
>   aio: fix potential leak in aio_run_iocb().
> 
> Levente Kurusa (1):
>   libata: clean up ZPODD when a port is detached
> 
> Linus Torvalds (2):
>   mm: make fixup_user_fault() check the vma access rights too
>   x86-64, modify_ldt: Make support for 16-bit segments a runtime option
> 
> Liu Hua (1):
>   ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr
> 
> Loic Poulain (2):
>   serial: 8250: Fix thread unsafe __dma_tx_complete function
>   8250_core: Fix unwanted TX chars write
> 
> Maarten Lankhorst (1):
>   drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip
> 
> Marcel Apfelbaum (1):
>   PCI: shpchp: Check bridge's secondary (not primary) bus speed
> 
> Mark Salter (1):
>   arm64: fix pud_huge() for 2-level pagetables
> 
> Martin Peres (1):
>   drm/nouveau/pm/fan: drop the fan lock in fan_update() before
>     rescheduling
> 
> Mikulas Patocka (3):
>   metag: fix memory barriers
>   target: fix memory leak on XCOPY
>   dm crypt: fix cpu hotplug crash by removing per-cpu structure
> 
> Mohammed Habibulla (1):
>   Bluetooth: Add support for Lite-on [04ca:3007]
> 
> NeilBrown (1):
>   md: avoid possible spinning md thread at shutdown.
> 
> Nicholas Bellinger (1):
>   iscsi-target: Change BUG_ON to REJECT in iscsit_process_nop_out
> 
> Nikita Yushchenko (1):
>   fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6
> 
> Oleg Nesterov (4):
>   introduce for_each_thread() to replace the buggy while_each_thread()
>   oom_kill: change oom_kill.c to use for_each_thread()
>   oom_kill: has_intersects_mems_allowed() needs rcu_read_lock()
>   oom_kill: add rcu_read_lock() into find_lock_task_mm()
> 
> Olof Johansson (1):
>   i2c: s3c2410: resume race fix
> 
> Peter De Schrijver (1):
>   clk: tegra: use pll_ref as the pll_e parent
> 
> Rik van Riel (1):
>   mm/page-writeback.c: fix divide by zero in pos_ratio_polynom
> 
> Romain Izard (1):
>   trace: module: Maintain a valid user count
> 
> Russell King (1):
>   leds: leds-pwm: properly clean up after probe failure
> 
> Sagi Grimberg (2):
>   Target/iser: Fix wrong connection requests list addition
>   Target/iser: Fix iscsit_accept_np and rdma_cm racy flow
> 
> Salva Peiró (1):
>   media: media-device: fix infoleak in ioctl media_enum_entities()
> 
> Sascha Hauer (1):
>   ARM: dts: i.MX53: Fix ipu register space size
> 
> Sebastian Hesselbarth (1):
>   ARM: dts: kirkwood: fix mislocated pcie-controller nodes
> 
> Sergey Popovich (1):
>   netfilter: Fix potential use after free in ip6_route_me_harder()
> 
> Sheng-Liang Song (1):
>   Input: atkbd - fix keyboard not working on some LG laptops
> 
> Srivatsa S. Bhat (1):
>   powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST
>     mode
> 
> Stanislaw Gruszka (1):
>   rt2x00: fix beaconing on USB
> 
> Stephen Warren (1):
>   gpu: host1x: handle the correct # of syncpt regs
> 
> Steven Rostedt (Red Hat) (1):
>   ftrace/module: Hardcode ftrace_module_init() call into load_module()
> 
> Stuart Hayes (1):
>   hrtimer: Prevent all reprogramming if hang detected
> 
> Takashi Iwai (1):
>   ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets
> 
> Thierry Reding (1):
>   drm/tegra: Remove gratuitous pad field
> 
> Thomas Gleixner (9):
>   futex: Add another early deadlock detection check
>   futex: Prevent attaching to kernel threads
>   irqchip: Gic: Support forced affinity setting
>   genirq: Allow forcing cpu affinity of interrupts
>   clocksource: Exynos_mct: Use irq_force_affinity() in cpu bringup
>   futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr ==
>     uaddr2 in futex_requeue(..., requeue_pi=1)
>   futex: Validate atomic acquisition in futex_lock_pi_atomic()
>   futex: Always cleanup owner tid in unlock_pi
>   futex: Make lookup_pi_state more robust
> 
> Thomas Petazzoni (6):
>   ARM: orion5x: fix target ID for crypto SRAM window
>   ARM: mvebu: fix NOR bus-width in Armada XP GP Device Tree
>   ARM: mvebu: fix NOR bus-width in Armada XP DB Device Tree
>   ARM: mvebu: fix NOR bus-width in Armada XP OpenBlocks AX3 Device Tree
>   memory: mvebu-devbus: fix the conversion of the bus width
>   bus: mvebu-mbus: allow several windows with the same target/attribute
> 
> Tim Chen (1):
>   crypto: crypto_wq - Fix late crypto work queue initialization
> 
> Trond Myklebust (2):
>   NFSd: Move default initialisers from create_client() to alloc_client()
>   NFSd: call rpc_destroy_wait_queue() from free_client()
> 
> Tuomas Tynkkynen (1):
>   clk: tegra: Fix wrong value written to PLLE_AUX
> 
> Victor A. Santos (1):
>   USB: Nokia 305 should be treated as unusual dev
> 
> Viresh Kumar (1):
>   hrtimer: Set expiry time before switch_hrtimer_base()
> 
> Willy Tarreau (1):
>   PCI: mvebu: fix off-by-one in the computed size of the mbus windows
> 
> Wolfram Sang (1):
>   i2c: rcar: bail out on zero length transfers
> 
>  Documentation/input/elantech.txt                 |   5 +-
>  Documentation/ja_JP/HOWTO                        |   2 +-
>  Documentation/ja_JP/stable_kernel_rules.txt      |   6 +-
>  Documentation/zh_CN/HOWTO                        |   2 +-
>  Documentation/zh_CN/stable_kernel_rules.txt      |   2 +-
>  arch/arm/boot/dts/armada-xp-db.dts               |   2 +-
>  arch/arm/boot/dts/armada-xp-gp.dts               |   2 +-
>  arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts |   2 +-
>  arch/arm/boot/dts/imx53.dtsi                     |   2 +-
>  arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts   |  18 +-
>  arch/arm/boot/dts/kirkwood-nsa310-common.dtsi    |  18 +-
>  arch/arm/boot/dts/ste-ccu8540.dts                |   1 +
>  arch/arm/kernel/crash_dump.c                     |   2 +-
>  arch/arm/mach-orion5x/common.h                   |   2 +-
>  arch/arm64/mm/hugetlbpage.c                      |   4 +
>  arch/metag/include/asm/barrier.h                 |   3 +
>  arch/metag/include/asm/processor.h               |   2 +
>  arch/mips/cavium-octeon/octeon-irq.c             |   2 +-
>  arch/mips/lantiq/dts/easy50712.dts               |   1 +
>  arch/mips/ralink/dts/mt7620a_eval.dts            |   1 +
>  arch/mips/ralink/dts/rt2880_eval.dts             |   1 +
>  arch/mips/ralink/dts/rt3052_eval.dts             |   1 +
>  arch/mips/ralink/dts/rt3883_eval.dts             |   1 +
>  arch/parisc/include/asm/processor.h              |   2 +
>  arch/powerpc/Makefile                            |   4 +-
>  arch/powerpc/include/asm/ppc_asm.h               |   7 +-
>  arch/powerpc/kernel/machine_kexec_64.c           |   2 +-
>  arch/powerpc/platforms/powernv/eeh-ioda.c        |   3 +-
>  arch/x86/include/asm/hugetlb.h                   |   1 +
>  arch/x86/kernel/ldt.c                            |   4 +-
>  arch/x86/vdso/vdso32-setup.c                     |   8 +
>  crypto/crypto_wq.c                               |   2 +-
>  drivers/acpi/acpi_processor.c                    |   1 -
>  drivers/acpi/blacklist.c                         |  21 ++
>  drivers/acpi/video.c                             |   2 +-
>  drivers/ata/libata-core.c                        |   9 +
>  drivers/ata/pata_at91.c                          |  11 +-
>  drivers/base/dd.c                                |  17 ++
>  drivers/bluetooth/ath3k.c                        |   2 +
>  drivers/bluetooth/btusb.c                        |   1 +
>  drivers/bus/mvebu-mbus.c                         |   6 -
>  drivers/char/ipmi/ipmi_kcs_sm.c                  |   5 +-
>  drivers/clk/tegra/clk-pll.c                      |  10 +-
>  drivers/clk/tegra/clk-tegra114.c                 |   3 +-
>  drivers/clk/versatile/clk-vexpress-osc.c         |   2 +-
>  drivers/clocksource/exynos_mct.c                 |  12 +-
>  drivers/crypto/caam/error.c                      |  10 +-
>  drivers/dma/dw/core.c                            |  11 +-
>  drivers/dma/mv_xor.c                             |   8 +-
>  drivers/gpu/drm/i915/i915_gem.c                  |   4 +-
>  drivers/gpu/drm/i915/intel_display.c             |  52 +++--
>  drivers/gpu/drm/i915/intel_drv.h                 |   3 +-
>  drivers/gpu/drm/i915/intel_pm.c                  |  10 +
>  drivers/gpu/drm/i915/intel_uncore.c              |   2 +
>  drivers/gpu/drm/nouveau/core/subdev/therm/fan.c  |  19 +-
>  drivers/gpu/drm/nouveau/nouveau_acpi.c           |   3 -
>  drivers/gpu/drm/nouveau/nouveau_display.c        |   2 +-
>  drivers/gpu/drm/radeon/ci_dpm.c                  |   4 +
>  drivers/gpu/drm/radeon/cik.c                     |  76 +++++++
>  drivers/gpu/drm/radeon/cik_sdma.c                |   2 +-
>  drivers/gpu/drm/radeon/cikd.h                    |   9 +
>  drivers/gpu/drm/radeon/evergreen.c               |  28 ++-
>  drivers/gpu/drm/radeon/r600.c                    |  13 +-
>  drivers/gpu/drm/radeon/r600_dpm.c                |  35 ++--
>  drivers/gpu/drm/radeon/radeon.h                  |   6 +
>  drivers/gpu/drm/radeon/radeon_atpx_handler.c     |   7 +
>  drivers/gpu/drm/radeon/radeon_display.c          |   4 +
>  drivers/gpu/drm/radeon/radeon_pm.c               |  28 +--
>  drivers/gpu/drm/radeon/radeon_ucode.h            |   3 +
>  drivers/gpu/drm/radeon/radeon_uvd.c              |   4 +
>  drivers/gpu/drm/radeon/si.c                      |  65 ++++--
>  drivers/gpu/drm/radeon/uvd_v1_0.c                |  10 +-
>  drivers/gpu/host1x/hw/intr_hw.c                  |   4 +-
>  drivers/hwmon/emc1403.c                          |   4 +-
>  drivers/i2c/busses/i2c-designware-core.c         |   3 +
>  drivers/i2c/busses/i2c-rcar.c                    |   9 +-
>  drivers/i2c/busses/i2c-s3c2410.c                 |   2 +-
>  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c       |   7 +-
>  drivers/infiniband/ulp/isert/ib_isert.c          |  27 +--
>  drivers/infiniband/ulp/isert/ib_isert.h          |   2 +-
>  drivers/input/keyboard/atkbd.c                   |  29 ++-
>  drivers/input/mouse/elantech.c                   |  26 ++-
>  drivers/input/mouse/elantech.h                   |   1 +
>  drivers/input/mouse/synaptics.c                  |  10 +-
>  drivers/iommu/amd_iommu.c                        |   2 +-
>  drivers/irqchip/irq-gic.c                        |   8 +-
>  drivers/leds/leds-pwm.c                          |  23 ++-
>  drivers/md/dm-crypt.c                            |  61 ++----
>  drivers/md/md.c                                  |   3 +-
>  drivers/media/i2c/ov7670.c                       |   2 +-
>  drivers/media/media-device.c                     |   1 +
>  drivers/media/tuners/fc2580.c                    |   6 +-
>  drivers/media/tuners/fc2580_priv.h               |   1 +
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c    |  12 +-
>  drivers/memory/mvebu-devbus.c                    |  15 +-
>  drivers/net/wireless/rt2x00/rt2x00mac.c          |  22 ++-
>  drivers/net/wireless/rtlwifi/rtl8192cu/hw.c      |   2 +-
>  drivers/pci/host/pci-mvebu.c                     |   4 +-
>  drivers/pci/hotplug/shpchp_ctrl.c                |   4 +-
>  drivers/spi/spi.c                                |  11 +-
>  drivers/target/iscsi/iscsi_target.c              |   4 +-
>  drivers/target/target_core_device.c              |   8 +-
>  drivers/target/target_core_transport.c           |   2 +-
>  drivers/tty/serial/8250/8250_core.c              |   2 +-
>  drivers/tty/serial/8250/8250_dma.c               |   9 +-
>  drivers/usb/gadget/at91_udc.c                    |  10 -
>  drivers/usb/host/ehci-fsl.c                      |   3 +-
>  drivers/usb/host/ohci-hub.c                      |  18 ++
>  drivers/usb/host/ohci-pci.c                      |   1 +
>  drivers/usb/host/ohci.h                          |   2 +
>  drivers/usb/serial/qcserial.c                    |  15 ++
>  drivers/usb/storage/shuttle_usbat.c              |   2 +-
>  drivers/usb/storage/unusual_devs.h               |  14 ++
>  fs/aio.c                                         |   6 +-
>  fs/autofs4/root.c                                |   4 +-
>  fs/coredump.c                                    |   7 +-
>  fs/exec.c                                        |   6 +-
>  fs/nfsd/nfs4acl.c                                |  17 +-
>  fs/nfsd/nfs4state.c                              |  40 ++--
>  fs/posix_acl.c                                   |   6 +
>  include/linux/ftrace.h                           |   2 +
>  include/linux/init_task.h                        |   2 +
>  include/linux/interrupt.h                        |  40 +++-
>  include/linux/irq.h                              |   3 +-
>  include/linux/sched.h                            |  12 ++
>  include/trace/events/module.h                    |   2 +-
>  include/uapi/drm/tegra_drm.h                     |   1 -
>  kernel/exit.c                                    |   1 +
>  kernel/fork.c                                    |   7 +
>  kernel/futex.c                                   | 239 ++++++++++++++++++-----
>  kernel/hrtimer.c                                 |  30 ++-
>  kernel/irq/manage.c                              |  17 +-
>  kernel/kexec.c                                   |   8 +
>  kernel/module.c                                  |   3 +
>  kernel/timer.c                                   |   2 +-
>  kernel/trace/ftrace.c                            |  27 +--
>  kernel/workqueue.c                               |  36 +++-
>  mm/memcontrol.c                                  |  19 +-
>  mm/memory-failure.c                              |  15 +-
>  mm/memory.c                                      |   5 +
>  mm/mremap.c                                      |   9 +-
>  mm/oom_kill.c                                    |  63 +++---
>  mm/page-writeback.c                              |   6 +-
>  mm/percpu.c                                      |   2 +-
>  mm/vmscan.c                                      |  18 ++
>  net/bluetooth/hci_conn.c                         |   9 +-
>  net/bluetooth/hci_event.c                        |   6 +
>  net/ceph/messenger.c                             |  20 +-
>  net/ipv6/netfilter.c                             |   6 +-
>  net/mac80211/ieee80211_i.h                       |   1 +
>  net/mac80211/mlme.c                              |  20 +-
>  net/mac80211/offchannel.c                        |  27 ++-
>  net/wireless/sme.c                               |   2 +-
>  security/device_cgroup.c                         | 203 +++++++++++++++----
>  sound/pci/hda/hda_intel.c                        |   3 +
>  sound/pci/hda/patch_hdmi.c                       |   4 +-
>  sound/soc/codecs/wm8962.c                        |  15 +-
>  sound/soc/codecs/wm8962.h                        |   4 +
>  sound/usb/card.h                                 |   1 +
>  sound/usb/endpoint.c                             |  15 +-
>  160 files changed, 1456 insertions(+), 561 deletions(-)
> 
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 3.12 000/146] 3.12.22-stable review
@ 2014-06-09 23:22   ` Satoru Takeuchi
  0 siblings, 0 replies; 163+ messages in thread
From: Satoru Takeuchi @ 2014-06-09 23:22 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: stable, linux, satoru.takeuchi, shuah.kh, linux-kernel

Hi Jiri,

At Mon,  9 Jun 2014 10:50:59 +0200,
Jiri Slaby wrote:
> 
> This is the start of the stable review cycle for the 3.12.22 release.
> There are 146 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Wed Jun 11 08:50:21 2014
> Anything received after that time might be too late.

This kernel passed my test.

 - Test Cases:
   - Build this kernel.
   - Boot this kernel.
   - Build the latest mainline kernel with this kernel.

 - Test Tool:
   https://github.com/satoru-takeuchi/test-linux-stable

 - Test Result (kernel .config, ktest config and test log):
   http://satoru-takeuchi.org/test-linux-stable/results/<version>-<test datetime>.tar.xz

 - Build Environment:
   - OS: Debian Jessy x86_64
   - CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
   - memory: 8GB

 - Test Target Environment:
   - Debian Jessy x86_64 (KVM guest on the Build Environment)
   - # of vCPU: 2
   - memory: 2GB

Thanks,
Satoru

> 
> The whole patch series can be found in one patch at:
> 	http://kernel.org/pub/linux/kernel/people/jirislaby/stable-review/patch-3.12.22-rc1.xz
> and the diffstat can be found below.
> 
> thanks,
> js
> 
> ===============
> 
> 
> Aaron Lu (1):
>   ACPI / video: Fix initial level validity test
> 
> Alan Stern (1):
>   USB: OHCI: fix problem with global suspend on ATI controllers
> 
> Alex Deucher (6):
>   drm/radeon: disable mclk dpm on R7 260X
>   drm/radeon: add support for newer mc ucode on SI (v2)
>   drm/radeon/si: make sure mc ucode is loaded before checking the size
>   drm/radeon: fix ATPX detection on non-VGA GPUs
>   drm/radeon/pm: don't walk the crtc list before it has been initialized
>     (v2)
>   drm/radeon: fix count in cik_sdma_ring_test()
> 
> Alex Williamson (1):
>   iommu/amd: Fix interrupt remapping for aliased devices
> 
> Andy Grover (1):
>   target: Don't allow setting WC emulation if device doesn't support
> 
> Andy Shevchenko (1):
>   dmaengine: dw: went back to plain {request,free}_irq() calls
> 
> Anssi Hannula (1):
>   ALSA: hda - hdmi: Set converter channel count even without sink
> 
> Anthony Iliopoulos (1):
>   x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow()
> 
> Antti Palosaari (1):
>   media: fc2580: fix tuning failure on 32-bit arch
> 
> Aristeu Rozanski (2):
>   device_cgroup: rework device access check and exception checking
>   device_cgroup: check if exception removal is allowed
> 
> Arnd Bergmann (1):
>   genirq: Provide irq_force_affinity fallback for non-SMP
> 
> Atilla Filiz (1):
>   iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null
>     dereference
> 
> Bartlomiej Zolnierkiewicz (1):
>   pata_at91: fix ata_host_activate() failure handling
> 
> Ben Hutchings (1):
>   rtl8192cu: Fix unbalanced irq enable in error path of
>     rtl92cu_hw_init()
> 
> Bj�rn Mork (1):
>   usb: qcserial: add a number of Dell devices
> 
> Charles Keepax (1):
>   ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile
> 
> Chen Yucong (1):
>   hwpoison, hugetlb: lock_page/unlock_page does not match for handling a
>     free hugepage
> 
> Chris Wilson (1):
>   drm/i915: Fix unsafe loop iteration over vma whilst unbinding them
> 
> Christian K�nig (2):
>   drm/radeon/uvd: use lower clocks on old UVD to boot v2
>   drm/radeon: use pflip irq on R600+ v2
> 
> Christoph Hellwig (1):
>   posix_acl: handle NULL ACL in posix_acl_equiv_mode
> 
> Chunwei Chen (1):
>   libceph: fix corruption when using page_count 0 page in rbd
> 
> Clemens Ladisch (1):
>   ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data
> 
> Corey Minyard (1):
>   ipmi: Reset the KCS timeout when starting error recovery
> 
> Daeseok Youn (1):
>   workqueue: fix bugs in wq_update_unbound_numa() failure path
> 
> Dan Carpenter (1):
>   clk: vexpress: NULL dereference on error path
> 
> Daniel Vetter (2):
>   drm/i915: Don't check gmch state on inherited configs
>   drm/i915: Disable self-refresh for untiled fbs on i915gm
> 
> Daniele Forsi (2):
>   usb: storage: shuttle_usbat: fix discs being detected twice
>   USB: Nokia 5300 should be treated as unusual dev
> 
> David Rientjes (1):
>   mm, oom: prefer thread group leaders for display purposes
> 
> Du, Wenkai (1):
>   i2c: designware: Mask all interrupts during i2c controller enable
> 
> Edward Lin (1):
>   ACPI: blacklist win8 OSI for Dell Inspiron 7737
> 
> Egbert Eich (1):
>   drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc()
> 
> Eliad Peller (1):
>   cfg80211: free sme on connection failures
> 
> Emmanuel Grumbach (1):
>   mac80211: fix suspend vs. association race
> 
> Eric Dumazet (1):
>   coredump: fix va_list corruption
> 
> Ezequiel Garcia (1):
>   dma: mv_xor: Flush descriptors before activating a channel
> 
> Gavin Shan (1):
>   powerpc/powernv: Reset root port in firmware
> 
> Geert Uytterhoeven (2):
>   Documentation: Update stable address in Chinese and Japanese
>     translations
>   spi: core: Ignore unsupported Dual/Quad Transfer Mode bits
> 
> Grant Likely (1):
>   drivercore: deferral race condition fix
> 
> Guennadi Liakhovetski (2):
>   media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel
>     from user-space
>   media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode
> 
> Guenter Roeck (1):
>   powerpc: Fix 64 bit builds with binutils 2.24
> 
> Hans de Goede (4):
>   Input: elantech - fix touchpad initialization on Gigabyte U2442
>   Input: synaptics - add min/max quirk for the ThinkPad W540
>   Input: synaptics - T540p - unify with other LEN0034 models
>   ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC
>     1015PX
> 
> Horia Geanta (1):
>   crypto: caam - add allocation failure handling in SPRINTFCAT macro
> 
> Ian Kent (1):
>   autofs: fix lockref lookup
> 
> Igor Mammedov (1):
>   ACPI / processor: do not mark present at boot but not onlined CPU as
>     onlined
> 
> Ilia Mirkin (1):
>   drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi
> 
> J. Bruce Fields (2):
>   nfsd4: warn on finding lockowner without stateid's
>   nfsd4: remove lockowner when removing lock stateid
> 
> James Hogan (1):
>   metag: Reduce maximum stack size to 256MB
> 
> Jani Nikula (2):
>   drm/i915/vlv: reset VLV media force wake request register
>   drm/i915: quirk invert brightness for Acer Aspire 5336
> 
> Jean-Jacques Hiblot (1):
>   usb: gadget: at91-udc: fix irq and iomem resource retrieval
> 
> Jianyu Zhan (1):
>   percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree()
> 
> Jiri Bohac (1):
>   timer: Prevent overflow in apply_slack
> 
> Johan Hedberg (2):
>   Bluetooth: Fix triggering BR/EDR L2CAP Connect too early
>   Bluetooth: Fix redundant encryption request for reauthentication
> 
> Johannes Berg (1):
>   mac80211: fix on-channel remain-on-channel
> 
> Johannes Weiner (1):
>   revert "mm: vmscan: do not swap anon pages just because free+file is
>     low"
> 
> Josef Gajdusek (2):
>   hwmon: (emc1403) fix inverted store_hyst()
>   hwmon: (emc1403) Support full range of known chip revision numbers
> 
> Kinglong Mee (1):
>   NFSD: Call ->set_acl with a NULL ACL structure if no entries
> 
> Kirill A. Shutemov (1):
>   mm, thp: close race between mremap() and split_huge_page()
> 
> Krzysztof Kozlowski (1):
>   clocksource: Exynos_mct: Register clock event after request_irq()
> 
> Lai Jiangshan (2):
>   workqueue: fix a possible race condition between rescuer and
>     pwq-release
>   workqueue: make rescuer_thread() empty wq->maydays list before exiting
> 
> Leif Lindholm (2):
>   mips: dts: Fix missing device_type="memory" property in memory nodes
>   arm: dts: Fix missing device_type="memory" for ste-ccu8540
> 
> Leo Liu (1):
>   drm/radeon: check buffer relocation offset
> 
> Leon Ma (1):
>   hrtimer: Prevent remote enqueue of leftmost timers
> 
> Leon Yu (1):
>   aio: fix potential leak in aio_run_iocb().
> 
> Levente Kurusa (1):
>   libata: clean up ZPODD when a port is detached
> 
> Linus Torvalds (2):
>   mm: make fixup_user_fault() check the vma access rights too
>   x86-64, modify_ldt: Make support for 16-bit segments a runtime option
> 
> Liu Hua (1):
>   ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr
> 
> Loic Poulain (2):
>   serial: 8250: Fix thread unsafe __dma_tx_complete function
>   8250_core: Fix unwanted TX chars write
> 
> Maarten Lankhorst (1):
>   drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip
> 
> Marcel Apfelbaum (1):
>   PCI: shpchp: Check bridge's secondary (not primary) bus speed
> 
> Mark Salter (1):
>   arm64: fix pud_huge() for 2-level pagetables
> 
> Martin Peres (1):
>   drm/nouveau/pm/fan: drop the fan lock in fan_update() before
>     rescheduling
> 
> Mikulas Patocka (3):
>   metag: fix memory barriers
>   target: fix memory leak on XCOPY
>   dm crypt: fix cpu hotplug crash by removing per-cpu structure
> 
> Mohammed Habibulla (1):
>   Bluetooth: Add support for Lite-on [04ca:3007]
> 
> NeilBrown (1):
>   md: avoid possible spinning md thread at shutdown.
> 
> Nicholas Bellinger (1):
>   iscsi-target: Change BUG_ON to REJECT in iscsit_process_nop_out
> 
> Nikita Yushchenko (1):
>   fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6
> 
> Oleg Nesterov (4):
>   introduce for_each_thread() to replace the buggy while_each_thread()
>   oom_kill: change oom_kill.c to use for_each_thread()
>   oom_kill: has_intersects_mems_allowed() needs rcu_read_lock()
>   oom_kill: add rcu_read_lock() into find_lock_task_mm()
> 
> Olof Johansson (1):
>   i2c: s3c2410: resume race fix
> 
> Peter De Schrijver (1):
>   clk: tegra: use pll_ref as the pll_e parent
> 
> Rik van Riel (1):
>   mm/page-writeback.c: fix divide by zero in pos_ratio_polynom
> 
> Romain Izard (1):
>   trace: module: Maintain a valid user count
> 
> Russell King (1):
>   leds: leds-pwm: properly clean up after probe failure
> 
> Sagi Grimberg (2):
>   Target/iser: Fix wrong connection requests list addition
>   Target/iser: Fix iscsit_accept_np and rdma_cm racy flow
> 
> Salva Peir� (1):
>   media: media-device: fix infoleak in ioctl media_enum_entities()
> 
> Sascha Hauer (1):
>   ARM: dts: i.MX53: Fix ipu register space size
> 
> Sebastian Hesselbarth (1):
>   ARM: dts: kirkwood: fix mislocated pcie-controller nodes
> 
> Sergey Popovich (1):
>   netfilter: Fix potential use after free in ip6_route_me_harder()
> 
> Sheng-Liang Song (1):
>   Input: atkbd - fix keyboard not working on some LG laptops
> 
> Srivatsa S. Bhat (1):
>   powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST
>     mode
> 
> Stanislaw Gruszka (1):
>   rt2x00: fix beaconing on USB
> 
> Stephen Warren (1):
>   gpu: host1x: handle the correct # of syncpt regs
> 
> Steven Rostedt (Red Hat) (1):
>   ftrace/module: Hardcode ftrace_module_init() call into load_module()
> 
> Stuart Hayes (1):
>   hrtimer: Prevent all reprogramming if hang detected
> 
> Takashi Iwai (1):
>   ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets
> 
> Thierry Reding (1):
>   drm/tegra: Remove gratuitous pad field
> 
> Thomas Gleixner (9):
>   futex: Add another early deadlock detection check
>   futex: Prevent attaching to kernel threads
>   irqchip: Gic: Support forced affinity setting
>   genirq: Allow forcing cpu affinity of interrupts
>   clocksource: Exynos_mct: Use irq_force_affinity() in cpu bringup
>   futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr ==
>     uaddr2 in futex_requeue(..., requeue_pi=1)
>   futex: Validate atomic acquisition in futex_lock_pi_atomic()
>   futex: Always cleanup owner tid in unlock_pi
>   futex: Make lookup_pi_state more robust
> 
> Thomas Petazzoni (6):
>   ARM: orion5x: fix target ID for crypto SRAM window
>   ARM: mvebu: fix NOR bus-width in Armada XP GP Device Tree
>   ARM: mvebu: fix NOR bus-width in Armada XP DB Device Tree
>   ARM: mvebu: fix NOR bus-width in Armada XP OpenBlocks AX3 Device Tree
>   memory: mvebu-devbus: fix the conversion of the bus width
>   bus: mvebu-mbus: allow several windows with the same target/attribute
> 
> Tim Chen (1):
>   crypto: crypto_wq - Fix late crypto work queue initialization
> 
> Trond Myklebust (2):
>   NFSd: Move default initialisers from create_client() to alloc_client()
>   NFSd: call rpc_destroy_wait_queue() from free_client()
> 
> Tuomas Tynkkynen (1):
>   clk: tegra: Fix wrong value written to PLLE_AUX
> 
> Victor A. Santos (1):
>   USB: Nokia 305 should be treated as unusual dev
> 
> Viresh Kumar (1):
>   hrtimer: Set expiry time before switch_hrtimer_base()
> 
> Willy Tarreau (1):
>   PCI: mvebu: fix off-by-one in the computed size of the mbus windows
> 
> Wolfram Sang (1):
>   i2c: rcar: bail out on zero length transfers
> 
>  Documentation/input/elantech.txt                 |   5 +-
>  Documentation/ja_JP/HOWTO                        |   2 +-
>  Documentation/ja_JP/stable_kernel_rules.txt      |   6 +-
>  Documentation/zh_CN/HOWTO                        |   2 +-
>  Documentation/zh_CN/stable_kernel_rules.txt      |   2 +-
>  arch/arm/boot/dts/armada-xp-db.dts               |   2 +-
>  arch/arm/boot/dts/armada-xp-gp.dts               |   2 +-
>  arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts |   2 +-
>  arch/arm/boot/dts/imx53.dtsi                     |   2 +-
>  arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts   |  18 +-
>  arch/arm/boot/dts/kirkwood-nsa310-common.dtsi    |  18 +-
>  arch/arm/boot/dts/ste-ccu8540.dts                |   1 +
>  arch/arm/kernel/crash_dump.c                     |   2 +-
>  arch/arm/mach-orion5x/common.h                   |   2 +-
>  arch/arm64/mm/hugetlbpage.c                      |   4 +
>  arch/metag/include/asm/barrier.h                 |   3 +
>  arch/metag/include/asm/processor.h               |   2 +
>  arch/mips/cavium-octeon/octeon-irq.c             |   2 +-
>  arch/mips/lantiq/dts/easy50712.dts               |   1 +
>  arch/mips/ralink/dts/mt7620a_eval.dts            |   1 +
>  arch/mips/ralink/dts/rt2880_eval.dts             |   1 +
>  arch/mips/ralink/dts/rt3052_eval.dts             |   1 +
>  arch/mips/ralink/dts/rt3883_eval.dts             |   1 +
>  arch/parisc/include/asm/processor.h              |   2 +
>  arch/powerpc/Makefile                            |   4 +-
>  arch/powerpc/include/asm/ppc_asm.h               |   7 +-
>  arch/powerpc/kernel/machine_kexec_64.c           |   2 +-
>  arch/powerpc/platforms/powernv/eeh-ioda.c        |   3 +-
>  arch/x86/include/asm/hugetlb.h                   |   1 +
>  arch/x86/kernel/ldt.c                            |   4 +-
>  arch/x86/vdso/vdso32-setup.c                     |   8 +
>  crypto/crypto_wq.c                               |   2 +-
>  drivers/acpi/acpi_processor.c                    |   1 -
>  drivers/acpi/blacklist.c                         |  21 ++
>  drivers/acpi/video.c                             |   2 +-
>  drivers/ata/libata-core.c                        |   9 +
>  drivers/ata/pata_at91.c                          |  11 +-
>  drivers/base/dd.c                                |  17 ++
>  drivers/bluetooth/ath3k.c                        |   2 +
>  drivers/bluetooth/btusb.c                        |   1 +
>  drivers/bus/mvebu-mbus.c                         |   6 -
>  drivers/char/ipmi/ipmi_kcs_sm.c                  |   5 +-
>  drivers/clk/tegra/clk-pll.c                      |  10 +-
>  drivers/clk/tegra/clk-tegra114.c                 |   3 +-
>  drivers/clk/versatile/clk-vexpress-osc.c         |   2 +-
>  drivers/clocksource/exynos_mct.c                 |  12 +-
>  drivers/crypto/caam/error.c                      |  10 +-
>  drivers/dma/dw/core.c                            |  11 +-
>  drivers/dma/mv_xor.c                             |   8 +-
>  drivers/gpu/drm/i915/i915_gem.c                  |   4 +-
>  drivers/gpu/drm/i915/intel_display.c             |  52 +++--
>  drivers/gpu/drm/i915/intel_drv.h                 |   3 +-
>  drivers/gpu/drm/i915/intel_pm.c                  |  10 +
>  drivers/gpu/drm/i915/intel_uncore.c              |   2 +
>  drivers/gpu/drm/nouveau/core/subdev/therm/fan.c  |  19 +-
>  drivers/gpu/drm/nouveau/nouveau_acpi.c           |   3 -
>  drivers/gpu/drm/nouveau/nouveau_display.c        |   2 +-
>  drivers/gpu/drm/radeon/ci_dpm.c                  |   4 +
>  drivers/gpu/drm/radeon/cik.c                     |  76 +++++++
>  drivers/gpu/drm/radeon/cik_sdma.c                |   2 +-
>  drivers/gpu/drm/radeon/cikd.h                    |   9 +
>  drivers/gpu/drm/radeon/evergreen.c               |  28 ++-
>  drivers/gpu/drm/radeon/r600.c                    |  13 +-
>  drivers/gpu/drm/radeon/r600_dpm.c                |  35 ++--
>  drivers/gpu/drm/radeon/radeon.h                  |   6 +
>  drivers/gpu/drm/radeon/radeon_atpx_handler.c     |   7 +
>  drivers/gpu/drm/radeon/radeon_display.c          |   4 +
>  drivers/gpu/drm/radeon/radeon_pm.c               |  28 +--
>  drivers/gpu/drm/radeon/radeon_ucode.h            |   3 +
>  drivers/gpu/drm/radeon/radeon_uvd.c              |   4 +
>  drivers/gpu/drm/radeon/si.c                      |  65 ++++--
>  drivers/gpu/drm/radeon/uvd_v1_0.c                |  10 +-
>  drivers/gpu/host1x/hw/intr_hw.c                  |   4 +-
>  drivers/hwmon/emc1403.c                          |   4 +-
>  drivers/i2c/busses/i2c-designware-core.c         |   3 +
>  drivers/i2c/busses/i2c-rcar.c                    |   9 +-
>  drivers/i2c/busses/i2c-s3c2410.c                 |   2 +-
>  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c       |   7 +-
>  drivers/infiniband/ulp/isert/ib_isert.c          |  27 +--
>  drivers/infiniband/ulp/isert/ib_isert.h          |   2 +-
>  drivers/input/keyboard/atkbd.c                   |  29 ++-
>  drivers/input/mouse/elantech.c                   |  26 ++-
>  drivers/input/mouse/elantech.h                   |   1 +
>  drivers/input/mouse/synaptics.c                  |  10 +-
>  drivers/iommu/amd_iommu.c                        |   2 +-
>  drivers/irqchip/irq-gic.c                        |   8 +-
>  drivers/leds/leds-pwm.c                          |  23 ++-
>  drivers/md/dm-crypt.c                            |  61 ++----
>  drivers/md/md.c                                  |   3 +-
>  drivers/media/i2c/ov7670.c                       |   2 +-
>  drivers/media/media-device.c                     |   1 +
>  drivers/media/tuners/fc2580.c                    |   6 +-
>  drivers/media/tuners/fc2580_priv.h               |   1 +
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c    |  12 +-
>  drivers/memory/mvebu-devbus.c                    |  15 +-
>  drivers/net/wireless/rt2x00/rt2x00mac.c          |  22 ++-
>  drivers/net/wireless/rtlwifi/rtl8192cu/hw.c      |   2 +-
>  drivers/pci/host/pci-mvebu.c                     |   4 +-
>  drivers/pci/hotplug/shpchp_ctrl.c                |   4 +-
>  drivers/spi/spi.c                                |  11 +-
>  drivers/target/iscsi/iscsi_target.c              |   4 +-
>  drivers/target/target_core_device.c              |   8 +-
>  drivers/target/target_core_transport.c           |   2 +-
>  drivers/tty/serial/8250/8250_core.c              |   2 +-
>  drivers/tty/serial/8250/8250_dma.c               |   9 +-
>  drivers/usb/gadget/at91_udc.c                    |  10 -
>  drivers/usb/host/ehci-fsl.c                      |   3 +-
>  drivers/usb/host/ohci-hub.c                      |  18 ++
>  drivers/usb/host/ohci-pci.c                      |   1 +
>  drivers/usb/host/ohci.h                          |   2 +
>  drivers/usb/serial/qcserial.c                    |  15 ++
>  drivers/usb/storage/shuttle_usbat.c              |   2 +-
>  drivers/usb/storage/unusual_devs.h               |  14 ++
>  fs/aio.c                                         |   6 +-
>  fs/autofs4/root.c                                |   4 +-
>  fs/coredump.c                                    |   7 +-
>  fs/exec.c                                        |   6 +-
>  fs/nfsd/nfs4acl.c                                |  17 +-
>  fs/nfsd/nfs4state.c                              |  40 ++--
>  fs/posix_acl.c                                   |   6 +
>  include/linux/ftrace.h                           |   2 +
>  include/linux/init_task.h                        |   2 +
>  include/linux/interrupt.h                        |  40 +++-
>  include/linux/irq.h                              |   3 +-
>  include/linux/sched.h                            |  12 ++
>  include/trace/events/module.h                    |   2 +-
>  include/uapi/drm/tegra_drm.h                     |   1 -
>  kernel/exit.c                                    |   1 +
>  kernel/fork.c                                    |   7 +
>  kernel/futex.c                                   | 239 ++++++++++++++++++-----
>  kernel/hrtimer.c                                 |  30 ++-
>  kernel/irq/manage.c                              |  17 +-
>  kernel/kexec.c                                   |   8 +
>  kernel/module.c                                  |   3 +
>  kernel/timer.c                                   |   2 +-
>  kernel/trace/ftrace.c                            |  27 +--
>  kernel/workqueue.c                               |  36 +++-
>  mm/memcontrol.c                                  |  19 +-
>  mm/memory-failure.c                              |  15 +-
>  mm/memory.c                                      |   5 +
>  mm/mremap.c                                      |   9 +-
>  mm/oom_kill.c                                    |  63 +++---
>  mm/page-writeback.c                              |   6 +-
>  mm/percpu.c                                      |   2 +-
>  mm/vmscan.c                                      |  18 ++
>  net/bluetooth/hci_conn.c                         |   9 +-
>  net/bluetooth/hci_event.c                        |   6 +
>  net/ceph/messenger.c                             |  20 +-
>  net/ipv6/netfilter.c                             |   6 +-
>  net/mac80211/ieee80211_i.h                       |   1 +
>  net/mac80211/mlme.c                              |  20 +-
>  net/mac80211/offchannel.c                        |  27 ++-
>  net/wireless/sme.c                               |   2 +-
>  security/device_cgroup.c                         | 203 +++++++++++++++----
>  sound/pci/hda/hda_intel.c                        |   3 +
>  sound/pci/hda/patch_hdmi.c                       |   4 +-
>  sound/soc/codecs/wm8962.c                        |  15 +-
>  sound/soc/codecs/wm8962.h                        |   4 +
>  sound/usb/card.h                                 |   1 +
>  sound/usb/endpoint.c                             |  15 +-
>  160 files changed, 1456 insertions(+), 561 deletions(-)
> 
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 3.12 000/146] 3.12.22-stable review
  2014-06-09 23:22   ` Satoru Takeuchi
  (?)
@ 2014-06-10 15:24   ` Jiri Slaby
  -1 siblings, 0 replies; 163+ messages in thread
From: Jiri Slaby @ 2014-06-10 15:24 UTC (permalink / raw)
  To: Satoru Takeuchi; +Cc: stable, linux, shuah.kh, linux-kernel

On 06/10/2014 01:22 AM, Satoru Takeuchi wrote:
> Hi Jiri,
> 
> At Mon,  9 Jun 2014 10:50:59 +0200,
> Jiri Slaby wrote:
>>
>> This is the start of the stable review cycle for the 3.12.22 release.
>> There are 146 patches in this series, all will be posted as a response
>> to this one.  If anyone has any issues with these being applied, please
>> let me know.
>>
>> Responses should be made by Wed Jun 11 08:50:21 2014
>> Anything received after that time might be too late.
> 
> This kernel passed my test.

Hi and thank you!

-- 
js
suse labs

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 3.12 000/146] 3.12.22-stable review
  2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
                   ` (146 preceding siblings ...)
  2014-06-09 23:22   ` Satoru Takeuchi
@ 2014-06-10 15:34 ` Guenter Roeck
  147 siblings, 0 replies; 163+ messages in thread
From: Guenter Roeck @ 2014-06-10 15:34 UTC (permalink / raw)
  To: Jiri Slaby, stable; +Cc: satoru.takeuchi, shuah.kh, linux-kernel

On 06/09/2014 01:50 AM, Jiri Slaby wrote:
> This is the start of the stable review cycle for the 3.12.22 release.
> There are 146 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Wed Jun 11 08:50:21 2014
> Anything received after that time might be too late.
>

Build results:
	total: 143 pass: 135 skipped: 7 fail: 1

Qemu tests all passed.

Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.

Guenter


^ permalink raw reply	[flat|nested] 163+ messages in thread

end of thread, other threads:[~2014-06-10 15:34 UTC | newest]

Thread overview: 163+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-09  8:50 [PATCH 3.12 000/146] 3.12.22-stable review Jiri Slaby
2014-06-09  8:48 ` [PATCH 3.12 001/146] introduce for_each_thread() to replace the buggy while_each_thread() Jiri Slaby
2014-06-09  8:48 ` [PATCH 3.12 002/146] oom_kill: change oom_kill.c to use for_each_thread() Jiri Slaby
2014-06-09  8:48 ` [PATCH 3.12 003/146] oom_kill: has_intersects_mems_allowed() needs rcu_read_lock() Jiri Slaby
2014-06-09  8:48 ` [PATCH 3.12 004/146] oom_kill: add rcu_read_lock() into find_lock_task_mm() Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 005/146] mm, oom: prefer thread group leaders for display purposes Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 006/146] mac80211: fix on-channel remain-on-channel Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 007/146] netfilter: Fix potential use after free in ip6_route_me_harder() Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 008/146] usb: qcserial: add a number of Dell devices Jiri Slaby
2014-06-09  8:49   ` Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 009/146] clk: tegra: use pll_ref as the pll_e parent Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 010/146] ACPI / video: Fix initial level validity test Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 011/146] futex: Add another early deadlock detection check Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 012/146] futex: Prevent attaching to kernel threads Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 013/146] mips: dts: Fix missing device_type="memory" property in memory nodes Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 014/146] ftrace/module: Hardcode ftrace_module_init() call into load_module() Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 015/146] irqchip: Gic: Support forced affinity setting Jiri Slaby
2014-06-09  8:49   ` Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 016/146] genirq: Allow forcing cpu affinity of interrupts Jiri Slaby
2014-06-09  8:49   ` Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 017/146] clocksource: Exynos_mct: Use irq_force_affinity() in cpu bringup Jiri Slaby
2014-06-09  8:49   ` Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 018/146] clocksource: Exynos_mct: Register clock event after request_irq() Jiri Slaby
2014-06-09  8:49   ` Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 019/146] pata_at91: fix ata_host_activate() failure handling Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 020/146] coredump: fix va_list corruption Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 021/146] mm: make fixup_user_fault() check the vma access rights too Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 022/146] serial: 8250: Fix thread unsafe __dma_tx_complete function Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 023/146] 8250_core: Fix unwanted TX chars write Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 024/146] gpu: host1x: handle the correct # of syncpt regs Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 025/146] timer: Prevent overflow in apply_slack Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 026/146] ipmi: Reset the KCS timeout when starting error recovery Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 027/146] cfg80211: free sme on connection failures Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 028/146] mac80211: fix suspend vs. association race Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 029/146] mm, thp: close race between mremap() and split_huge_page() Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 030/146] x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow() Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 031/146] arm64: fix pud_huge() for 2-level pagetables Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 032/146] hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 033/146] aio: fix potential leak in aio_run_iocb() Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 034/146] hwmon: (emc1403) fix inverted store_hyst() Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 035/146] hwmon: (emc1403) Support full range of known chip revision numbers Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 036/146] drivercore: deferral race condition fix Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 037/146] hrtimer: Prevent all reprogramming if hang detected Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 038/146] hrtimer: Prevent remote enqueue of leftmost timers Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 039/146] hrtimer: Set expiry time before switch_hrtimer_base() Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 040/146] md: avoid possible spinning md thread at shutdown Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 041/146] drm/i915: Don't check gmch state on inherited configs Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 042/146] drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc() Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 043/146] drm/radeon: disable mclk dpm on R7 260X Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 044/146] drm/radeon: add support for newer mc ucode on SI (v2) Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 045/146] drm/radeon/si: make sure mc ucode is loaded before checking the size Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 046/146] drm/radeon: fix ATPX detection on non-VGA GPUs Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 047/146] drm/radeon/pm: don't walk the crtc list before it has been initialized (v2) Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 048/146] drm/radeon: fix count in cik_sdma_ring_test() Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 049/146] drm/radeon/uvd: use lower clocks on old UVD to boot v2 Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 050/146] drm/radeon: use pflip irq on R600+ v2 Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 051/146] drm/radeon: check buffer relocation offset Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 052/146] drm/tegra: Remove gratuitous pad field Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 053/146] clk: tegra: Fix wrong value written to PLLE_AUX Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 054/146] iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 055/146] fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6 Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 056/146] usb: gadget: at91-udc: fix irq and iomem resource retrieval Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 057/146] USB: OHCI: fix problem with global suspend on ATI controllers Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 058/146] usb: storage: shuttle_usbat: fix discs being detected twice Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 059/146] USB: Nokia 305 should be treated as unusual dev Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 060/146] USB: Nokia 5300 " Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 061/146] rt2x00: fix beaconing on USB Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 062/146] ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 063/146] Bluetooth: Fix triggering BR/EDR L2CAP Connect too early Jiri Slaby
2014-06-09  8:49 ` [PATCH 3.12 064/146] Bluetooth: Fix redundant encryption request for reauthentication Jiri Slaby
2014-06-09 13:33   ` Johan Hedberg
2014-06-09 13:51     ` Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 065/146] Bluetooth: Add support for Lite-on [04ca:3007] Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 066/146] posix_acl: handle NULL ACL in posix_acl_equiv_mode Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 067/146] mm/page-writeback.c: fix divide by zero in pos_ratio_polynom Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 068/146] revert "mm: vmscan: do not swap anon pages just because free+file is low" Jiri Slaby
2014-06-09 13:35   ` Johannes Weiner
2014-06-09 13:58     ` Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 069/146] ARM: orion5x: fix target ID for crypto SRAM window Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 070/146] ARM: dts: kirkwood: fix mislocated pcie-controller nodes Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 071/146] ARM: dts: i.MX53: Fix ipu register space size Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 072/146] ARM: mvebu: fix NOR bus-width in Armada XP GP Device Tree Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 073/146] ARM: mvebu: fix NOR bus-width in Armada XP DB " Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 074/146] ARM: mvebu: fix NOR bus-width in Armada XP OpenBlocks AX3 " Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 075/146] arm: dts: Fix missing device_type="memory" for ste-ccu8540 Jiri Slaby
2014-06-09  8:50   ` Jiri Slaby
2014-06-09  8:50   ` Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 076/146] ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 077/146] rtl8192cu: Fix unbalanced irq enable in error path of rtl92cu_hw_init() Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 078/146] drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 079/146] drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 080/146] drm/i915/vlv: reset VLV media force wake request register Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 081/146] drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 082/146] leds: leds-pwm: properly clean up after probe failure Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 083/146] Documentation: Update stable address in Chinese and Japanese translations Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 084/146] device_cgroup: rework device access check and exception checking Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 085/146] device_cgroup: check if exception removal is allowed Jiri Slaby
2014-06-09  8:50   ` Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 086/146] crypto: crypto_wq - Fix late crypto work queue initialization Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 087/146] clk: vexpress: NULL dereference on error path Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 088/146] media: media-device: fix infoleak in ioctl media_enum_entities() Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 089/146] autofs: fix lockref lookup Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 090/146] trace: module: Maintain a valid user count Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 091/146] Input: atkbd - fix keyboard not working on some LG laptops Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 092/146] Input: elantech - fix touchpad initialization on Gigabyte U2442 Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 093/146] Input: synaptics - add min/max quirk for the ThinkPad W540 Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 094/146] Input: synaptics - T540p - unify with other LEN0034 models Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 095/146] ALSA: hda - hdmi: Set converter channel count even without sink Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 096/146] ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 097/146] NFSd: Move default initialisers from create_client() to alloc_client() Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 098/146] NFSd: call rpc_destroy_wait_queue() from free_client() Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 099/146] NFSD: Call ->set_acl with a NULL ACL structure if no entries Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 100/146] nfsd4: warn on finding lockowner without stateid's Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 101/146] nfsd4: remove lockowner when removing lock stateid Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 102/146] workqueue: fix bugs in wq_update_unbound_numa() failure path Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 103/146] workqueue: fix a possible race condition between rescuer and pwq-release Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 104/146] workqueue: make rescuer_thread() empty wq->maydays list before exiting Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 105/146] memory: mvebu-devbus: fix the conversion of the bus width Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 106/146] PCI: mvebu: fix off-by-one in the computed size of the mbus windows Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 107/146] bus: mvebu-mbus: allow several windows with the same target/attribute Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 108/146] percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree() Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 109/146] ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 110/146] metag: fix memory barriers Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 111/146] metag: Reduce maximum stack size to 256MB Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 112/146] x86-64, modify_ldt: Make support for 16-bit segments a runtime option Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 113/146] genirq: Provide irq_force_affinity fallback for non-SMP Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 114/146] PCI: shpchp: Check bridge's secondary (not primary) bus speed Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 115/146] Target/iser: Fix wrong connection requests list addition Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 116/146] Target/iser: Fix iscsit_accept_np and rdma_cm racy flow Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 117/146] iscsi-target: Change BUG_ON to REJECT in iscsit_process_nop_out Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 118/146] target: Don't allow setting WC emulation if device doesn't support Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 119/146] target: fix memory leak on XCOPY Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 120/146] drm/i915: Disable self-refresh for untiled fbs on i915gm Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 121/146] drm/i915: Fix unsafe loop iteration over vma whilst unbinding them Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 122/146] drm/i915: quirk invert brightness for Acer Aspire 5336 Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 123/146] dm crypt: fix cpu hotplug crash by removing per-cpu structure Jiri Slaby
2014-06-09  8:50 ` [PATCH 3.12 124/146] dma: mv_xor: Flush descriptors before activating a channel Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 125/146] dmaengine: dw: went back to plain {request,free}_irq() calls Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 126/146] libata: clean up ZPODD when a port is detached Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 127/146] ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC 1015PX Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 128/146] ACPI / processor: do not mark present at boot but not onlined CPU as onlined Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 129/146] ACPI: blacklist win8 OSI for Dell Inspiron 7737 Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 130/146] i2c: rcar: bail out on zero length transfers Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 131/146] i2c: designware: Mask all interrupts during i2c controller enable Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 132/146] i2c: s3c2410: resume race fix Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 133/146] crypto: caam - add allocation failure handling in SPRINTFCAT macro Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 134/146] powerpc/powernv: Reset root port in firmware Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 135/146] powerpc: Fix 64 bit builds with binutils 2.24 Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 136/146] powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 137/146] spi: core: Ignore unsupported Dual/Quad Transfer Mode bits Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 138/146] libceph: fix corruption when using page_count 0 page in rbd Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 139/146] iommu/amd: Fix interrupt remapping for aliased devices Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 140/146] media: fc2580: fix tuning failure on 32-bit arch Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 141/146] media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 142/146] media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 143/146] futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1) Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 144/146] futex: Validate atomic acquisition in futex_lock_pi_atomic() Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 145/146] futex: Always cleanup owner tid in unlock_pi Jiri Slaby
2014-06-09  8:51 ` [PATCH 3.12 146/146] futex: Make lookup_pi_state more robust Jiri Slaby
2014-06-09 23:22 ` [PATCH 3.12 000/146] 3.12.22-stable review Satoru Takeuchi
2014-06-09 23:22   ` Satoru Takeuchi
2014-06-10 15:24   ` Jiri Slaby
2014-06-10 15:34 ` Guenter Roeck

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.