* [PATCH 3.12 001/123] x86/nmi/64: Fix a paravirt stack-clobbering bug in the NMI code
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 002/123] x86/paravirt: Replace the paravirt nop with a bona fide empty function Jiri Slaby
` (123 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Andy Lutomirski, Thomas Gleixner, Jiri Slaby
From: Andy Lutomirski <luto@kernel.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 83c133cf11fb0e68a51681447e372489f052d40e upstream.
The NMI entry code that switches to the normal kernel stack needs to
be very careful not to clobber any extra stack slots on the NMI
stack. The code is fine under the assumption that SWAPGS is just a
normal instruction, but that assumption isn't really true. Use
SWAPGS_UNSAFE_STACK instead.
This is part of a fix for some random crashes that Sasha saw.
Fixes: 9b6e6a8334d5 ("x86/nmi/64: Switch stacks on userspace NMI entry")
Reported-and-tested-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Link: http://lkml.kernel.org/r/974bc40edffdb5c2950a5c4977f821a446b76178.1442791737.git.luto@kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/x86/kernel/entry_64.S | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 7ed99df028ca..2bafcb32941e 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1727,9 +1727,12 @@ ENTRY(nmi)
* we don't want to enable interrupts, because then we'll end
* up in an awkward situation in which IRQs are on but NMIs
* are off.
+ *
+ * We also must not push anything to the stack before switching
+ * stacks lest we corrupt the "NMI executing" variable.
*/
- SWAPGS
+ SWAPGS_UNSAFE_STACK
cld
movq %rsp, %rdx
movq PER_CPU_VAR(kernel_stack), %rsp
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 002/123] x86/paravirt: Replace the paravirt nop with a bona fide empty function
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 001/123] x86/nmi/64: Fix a paravirt stack-clobbering bug in the NMI code Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 003/123] jbd2: avoid infinite loop when destroying aborted journal Jiri Slaby
` (122 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Andy Lutomirski, Thomas Gleixner, Jiri Slaby
From: Andy Lutomirski <luto@kernel.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit fc57a7c68020dcf954428869eafd934c0ab1536f upstream.
PARAVIRT_ADJUST_EXCEPTION_FRAME generates this code (using nmi as an
example, trimmed for readability):
ff 15 00 00 00 00 callq *0x0(%rip) # 2796 <nmi+0x6>
2792: R_X86_64_PC32 pv_irq_ops+0x2c
That's a call through a function pointer to regular C function that
does nothing on native boots, but that function isn't protected
against kprobes, isn't marked notrace, and is certainly not
guaranteed to preserve any registers if the compiler is feeling
perverse. This is bad news for a CLBR_NONE operation.
Of course, if everything works correctly, once paravirt ops are
patched, it gets nopped out, but what if we hit this code before
paravirt ops are patched in? This can potentially cause breakage
that is very difficult to debug.
A more subtle failure is possible here, too: if _paravirt_nop uses
the stack at all (even just to push RBP), it will overwrite the "NMI
executing" variable if it's called in the NMI prologue.
The Xen case, perhaps surprisingly, is fine, because it's already
written in asm.
Fix all of the cases that default to paravirt_nop (including
adjust_exception_frame) with a big hammer: replace paravirt_nop with
an asm function that is just a ret instruction.
The Xen case may have other problems, so document them.
This is part of a fix for some random crashes that Sasha saw.
Reported-and-tested-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Link: http://lkml.kernel.org/r/8f5d2ba295f9d73751c33d97fda03e0495d9ade0.1442791737.git.luto@kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/x86/kernel/entry_64.S | 11 +++++++++++
arch/x86/kernel/paravirt.c | 16 ++++++++++++----
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 2bafcb32941e..ead3e7c9672e 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1675,7 +1675,18 @@ END(error_exit)
/* runs on exception stack */
ENTRY(nmi)
INTR_FRAME
+ /*
+ * Fix up the exception frame if we're on Xen.
+ * PARAVIRT_ADJUST_EXCEPTION_FRAME is guaranteed to push at most
+ * one value to the stack on native, so it may clobber the rdx
+ * scratch slot, but it won't clobber any of the important
+ * slots past it.
+ *
+ * Xen is a different story, because the Xen frame itself overlaps
+ * the "NMI executing" variable.
+ */
PARAVIRT_ADJUST_EXCEPTION_FRAME
+
/*
* We allow breakpoints in NMIs. If a breakpoint occurs, then
* the iretq it performs will take us out of NMI context.
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 1b10af835c31..45c2045692bd 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -40,10 +40,18 @@
#include <asm/timer.h>
#include <asm/special_insns.h>
-/* nop stub */
-void _paravirt_nop(void)
-{
-}
+/*
+ * nop stub, which must not clobber anything *including the stack* to
+ * avoid confusing the entry prologues.
+ */
+extern void _paravirt_nop(void);
+asm (".pushsection .entry.text, \"ax\"\n"
+ ".global _paravirt_nop\n"
+ "_paravirt_nop:\n\t"
+ "ret\n\t"
+ ".size _paravirt_nop, . - _paravirt_nop\n\t"
+ ".type _paravirt_nop, @function\n\t"
+ ".popsection");
/* identity function, which can be inlined */
u32 _paravirt_ident_32(u32 x)
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 003/123] jbd2: avoid infinite loop when destroying aborted journal
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 001/123] x86/nmi/64: Fix a paravirt stack-clobbering bug in the NMI code Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 002/123] x86/paravirt: Replace the paravirt nop with a bona fide empty function Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 004/123] rcu: Reject memory-order-induced stall-warning false positives Jiri Slaby
` (121 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Jan Kara, Theodore Ts'o, Jiri Slaby
From: Jan Kara <jack@suse.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 841df7df196237ea63233f0f9eaa41db53afd70f upstream.
Commit 6f6a6fda2945 "jbd2: fix ocfs2 corrupt when updating journal
superblock fails" changed jbd2_cleanup_journal_tail() to return EIO
when the journal is aborted. That makes logic in
jbd2_log_do_checkpoint() bail out which is fine, except that
jbd2_journal_destroy() expects jbd2_log_do_checkpoint() to always make
a progress in cleaning the journal. Without it jbd2_journal_destroy()
just loops in an infinite loop.
Fix jbd2_journal_destroy() to cleanup journal checkpoint lists of
jbd2_log_do_checkpoint() fails with error.
Reported-by: Eryu Guan <guaneryu@gmail.com>
Tested-by: Eryu Guan <guaneryu@gmail.com>
Fixes: 6f6a6fda294506dfe0e3e0a253bb2d2923f28f0a
Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/jbd2/checkpoint.c | 39 +++++++++++++++++++++++++++++++++------
fs/jbd2/commit.c | 2 +-
fs/jbd2/journal.c | 11 ++++++++++-
include/linux/jbd2.h | 3 ++-
4 files changed, 46 insertions(+), 9 deletions(-)
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
index b892355f1944..d4c7e470dec8 100644
--- a/fs/jbd2/checkpoint.c
+++ b/fs/jbd2/checkpoint.c
@@ -475,14 +475,15 @@ int jbd2_cleanup_journal_tail(journal_t *journal)
* journal_clean_one_cp_list
*
* Find all the written-back checkpoint buffers in the given list and
- * release them.
+ * release them. If 'destroy' is set, clean all buffers unconditionally.
*
* Called with the journal locked.
* Called with j_list_lock held.
* Returns number of buffers reaped (for debug)
*/
-static int journal_clean_one_cp_list(struct journal_head *jh, int *released)
+static int journal_clean_one_cp_list(struct journal_head *jh, bool destroy,
+ int *released)
{
struct journal_head *last_jh;
struct journal_head *next_jh = jh;
@@ -496,7 +497,10 @@ static int journal_clean_one_cp_list(struct journal_head *jh, int *released)
do {
jh = next_jh;
next_jh = jh->b_cpnext;
- ret = __try_to_free_cp_buf(jh);
+ if (!destroy)
+ ret = __try_to_free_cp_buf(jh);
+ else
+ ret = __jbd2_journal_remove_checkpoint(jh) + 1;
if (ret) {
freed++;
if (ret == 2) {
@@ -521,13 +525,14 @@ static int journal_clean_one_cp_list(struct journal_head *jh, int *released)
* journal_clean_checkpoint_list
*
* Find all the written-back checkpoint buffers in the journal and release them.
+ * If 'destroy' is set, release all buffers unconditionally.
*
* Called with the journal locked.
* Called with j_list_lock held.
* Returns number of buffers reaped (for debug)
*/
-int __jbd2_journal_clean_checkpoint_list(journal_t *journal)
+int __jbd2_journal_clean_checkpoint_list(journal_t *journal, bool destroy)
{
transaction_t *transaction, *last_transaction, *next_transaction;
int ret = 0;
@@ -543,7 +548,7 @@ int __jbd2_journal_clean_checkpoint_list(journal_t *journal)
transaction = next_transaction;
next_transaction = transaction->t_cpnext;
ret += journal_clean_one_cp_list(transaction->
- t_checkpoint_list, &released);
+ t_checkpoint_list, destroy, &released);
/*
* This function only frees up some memory if possible so we
* dont have an obligation to finish processing. Bail out if
@@ -559,7 +564,7 @@ int __jbd2_journal_clean_checkpoint_list(journal_t *journal)
* we can possibly see not yet submitted buffers on io_list
*/
ret += journal_clean_one_cp_list(transaction->
- t_checkpoint_io_list, &released);
+ t_checkpoint_io_list, destroy, &released);
if (need_resched())
goto out;
} while (transaction != last_transaction);
@@ -568,6 +573,28 @@ out:
}
/*
+ * Remove buffers from all checkpoint lists as journal is aborted and we just
+ * need to free memory
+ */
+void jbd2_journal_destroy_checkpoint(journal_t *journal)
+{
+ /*
+ * We loop because __jbd2_journal_clean_checkpoint_list() may abort
+ * early due to a need of rescheduling.
+ */
+ while (1) {
+ spin_lock(&journal->j_list_lock);
+ if (!journal->j_checkpoint_transactions) {
+ spin_unlock(&journal->j_list_lock);
+ break;
+ }
+ __jbd2_journal_clean_checkpoint_list(journal, true);
+ spin_unlock(&journal->j_list_lock);
+ cond_resched();
+ }
+}
+
+/*
* journal_remove_checkpoint: called after a buffer has been committed
* to disk (either by being write-back flushed to disk, or being
* committed to the log).
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 9181c2b22b3c..4207cf2caa87 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -510,7 +510,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
* frees some memory
*/
spin_lock(&journal->j_list_lock);
- __jbd2_journal_clean_checkpoint_list(journal);
+ __jbd2_journal_clean_checkpoint_list(journal, false);
spin_unlock(&journal->j_list_lock);
jbd_debug(3, "JBD2: commit phase 1\n");
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 614ecbf8a48c..2ebb7aadb381 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1710,8 +1710,17 @@ int jbd2_journal_destroy(journal_t *journal)
while (journal->j_checkpoint_transactions != NULL) {
spin_unlock(&journal->j_list_lock);
mutex_lock(&journal->j_checkpoint_mutex);
- jbd2_log_do_checkpoint(journal);
+ err = jbd2_log_do_checkpoint(journal);
mutex_unlock(&journal->j_checkpoint_mutex);
+ /*
+ * If checkpointing failed, just free the buffers to avoid
+ * looping forever
+ */
+ if (err) {
+ jbd2_journal_destroy_checkpoint(journal);
+ spin_lock(&journal->j_list_lock);
+ break;
+ }
spin_lock(&journal->j_list_lock);
}
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index e1fb0f613a99..385593d748f6 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1042,8 +1042,9 @@ void jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block);
extern void jbd2_journal_commit_transaction(journal_t *);
/* Checkpoint list management */
-int __jbd2_journal_clean_checkpoint_list(journal_t *journal);
+int __jbd2_journal_clean_checkpoint_list(journal_t *journal, bool destroy);
int __jbd2_journal_remove_checkpoint(struct journal_head *);
+void jbd2_journal_destroy_checkpoint(journal_t *journal);
void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 004/123] rcu: Reject memory-order-induced stall-warning false positives
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (2 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 003/123] jbd2: avoid infinite loop when destroying aborted journal Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 005/123] sched: Fix cpu_active_mask/cpu_online_mask race Jiri Slaby
` (120 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Paul E. McKenney, Jiri Slaby
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 26cdfedf6a902345f8604ea8e0b7dd2566b37a46 upstream.
If a system is idle from an RCU perspective for longer than specified
by CONFIG_RCU_CPU_STALL_TIMEOUT, and if one CPU starts a grace period
just as a second checks for CPU stalls, and if this second CPU happens
to see the old value of rsp->jiffies_stall, it will incorrectly report a
CPU stall. This is quite rare, but apparently occurs deterministically
on systems with about 6TB of memory.
This commit therefore orders accesses to the data used to determine
whether or not a CPU stall is in progress. Grace-period initialization
and cleanup first increments rsp->completed to mark the end of the
previous grace period, then records the current jiffies in rsp->gp_start,
then records the jiffies at which a stall can be expected to occur in
rsp->jiffies_stall, and finally increments rsp->gpnum to mark the start
of the new grace period. Now, this ordering by itself does not prevent
false positives. For example, if grace-period initialization was delayed
between recording rsp->gp_start and rsp->jiffies_stall, the CPU stall
warning code might still see an old value of rsp->jiffies_stall.
Therefore, this commit also orders the CPU stall warning accesses as
well, loading rsp->gpnum and jiffies, then rsp->jiffies_stall, then
rsp->gp_start, and finally rsp->completed. This ordering means that
the false-positive scenario in the previous paragraph would result
in rsp->completed being greater than or equal to rsp->gpnum, which is
never valid for a CPU stall, allowing the false positive to be rejected.
Furthermore, any fetch that gets an old value of rsp->jiffies_stall
must also get an old value of rsp->gpnum, which will again be rejected
by the comparison of rsp->gpnum and rsp->completed. Situations where
rsp->gp_start is later than rsp->jiffies_stall are also rejected, as
are situations where jiffies is less than rsp->jiffies_stall.
Although use of unsynchronized accesses means that there are likely
still some false-positive scenarios (synchronization has proven to be
a very bad idea on large systems), this should get rid of a large class
of these scenarios.
Reported-by: Fabian Herschel <fabian.herschel@suse.com>
Reported-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Tested-by: Jochen Striepe <jochen@tolot.escape.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
kernel/rcutree.c | 45 ++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 40 insertions(+), 5 deletions(-)
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index e27526232b5f..a92bd6bd2bf1 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -802,8 +802,11 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
static void record_gp_stall_check_time(struct rcu_state *rsp)
{
- rsp->gp_start = jiffies;
- rsp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
+ unsigned long j = ACCESS_ONCE(jiffies);
+
+ rsp->gp_start = j;
+ smp_wmb(); /* Record start time before stall time. */
+ rsp->jiffies_stall = j + rcu_jiffies_till_stall_check();
}
/*
@@ -932,17 +935,48 @@ static void print_cpu_stall(struct rcu_state *rsp)
static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)
{
+ unsigned long completed;
+ unsigned long gpnum;
+ unsigned long gps;
unsigned long j;
unsigned long js;
struct rcu_node *rnp;
- if (rcu_cpu_stall_suppress)
+ if (rcu_cpu_stall_suppress || !rcu_gp_in_progress(rsp))
return;
j = ACCESS_ONCE(jiffies);
+
+ /*
+ * Lots of memory barriers to reject false positives.
+ *
+ * The idea is to pick up rsp->gpnum, then rsp->jiffies_stall,
+ * then rsp->gp_start, and finally rsp->completed. These values
+ * are updated in the opposite order with memory barriers (or
+ * equivalent) during grace-period initialization and cleanup.
+ * Now, a false positive can occur if we get an new value of
+ * rsp->gp_start and a old value of rsp->jiffies_stall. But given
+ * the memory barriers, the only way that this can happen is if one
+ * grace period ends and another starts between these two fetches.
+ * Detect this by comparing rsp->completed with the previous fetch
+ * from rsp->gpnum.
+ *
+ * Given this check, comparisons of jiffies, rsp->jiffies_stall,
+ * and rsp->gp_start suffice to forestall false positives.
+ */
+ gpnum = ACCESS_ONCE(rsp->gpnum);
+ smp_rmb(); /* Pick up ->gpnum first... */
js = ACCESS_ONCE(rsp->jiffies_stall);
+ smp_rmb(); /* ...then ->jiffies_stall before the rest... */
+ gps = ACCESS_ONCE(rsp->gp_start);
+ smp_rmb(); /* ...and finally ->gp_start before ->completed. */
+ completed = ACCESS_ONCE(rsp->completed);
+ if (ULONG_CMP_GE(completed, gpnum) ||
+ ULONG_CMP_LT(j, js) ||
+ ULONG_CMP_GE(gps, js))
+ return; /* No stall or GP completed since entering function. */
rnp = rdp->mynode;
if (rcu_gp_in_progress(rsp) &&
- (ACCESS_ONCE(rnp->qsmask) & rdp->grpmask) && ULONG_CMP_GE(j, js)) {
+ (ACCESS_ONCE(rnp->qsmask) & rdp->grpmask)) {
/* We haven't checked in, so go dump stack. */
print_cpu_stall(rsp);
@@ -1331,9 +1365,10 @@ static int rcu_gp_init(struct rcu_state *rsp)
}
/* Advance to a new grace period and initialize state. */
+ record_gp_stall_check_time(rsp);
+ smp_wmb(); /* Record GP times before starting GP. */
rsp->gpnum++;
trace_rcu_grace_period(rsp->name, rsp->gpnum, TPS("start"));
- record_gp_stall_check_time(rsp);
raw_spin_unlock_irq(&rnp->lock);
/* Exclude any concurrent CPU-hotplug operations. */
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 005/123] sched: Fix cpu_active_mask/cpu_online_mask race
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (3 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 004/123] rcu: Reject memory-order-induced stall-warning false positives Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 006/123] xhci: Workaround for PME stuck issues in Intel xhci Jiri Slaby
` (119 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Jan H. Schönherr, Anton Blanchard,
Borislav Petkov, Joerg Roedel, Linus Torvalds, Matt Wilson,
Michael Ellerman, Peter Zijlstra, Thomas Gleixner, Ingo Molnar,
Jiri Slaby
From: Jan H. Schönherr <jschoenh@amazon.de>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit dd9d3843755da95f63dd3a376f62b3e45c011210 upstream.
There is a race condition in SMP bootup code, which may result
in
WARNING: CPU: 0 PID: 1 at kernel/workqueue.c:4418
workqueue_cpu_up_callback()
or
kernel BUG at kernel/smpboot.c:135!
It can be triggered with a bit of luck in Linux guests running
on busy hosts.
CPU0 CPUn
==== ====
_cpu_up()
__cpu_up()
start_secondary()
set_cpu_online()
cpumask_set_cpu(cpu,
to_cpumask(cpu_online_bits));
cpu_notify(CPU_ONLINE)
<do stuff, see below>
cpumask_set_cpu(cpu,
to_cpumask(cpu_active_bits));
During the various CPU_ONLINE callbacks CPUn is online but not
active. Several things can go wrong at that point, depending on
the scheduling of tasks on CPU0.
Variant 1:
cpu_notify(CPU_ONLINE)
workqueue_cpu_up_callback()
rebind_workers()
set_cpus_allowed_ptr()
This call fails because it requires an active CPU; rebind_workers()
ends with a warning:
WARNING: CPU: 0 PID: 1 at kernel/workqueue.c:4418
workqueue_cpu_up_callback()
Variant 2:
cpu_notify(CPU_ONLINE)
smpboot_thread_call()
smpboot_unpark_threads()
..
__kthread_unpark()
__kthread_bind()
wake_up_state()
..
select_task_rq()
select_fallback_rq()
The ->wake_cpu of the unparked thread is not allowed, making a call
to select_fallback_rq() necessary. Then, select_fallback_rq() cannot
find an allowed, active CPU and promptly resets the allowed CPUs, so
that the task in question ends up on CPU0.
When those unparked tasks are eventually executed, they run
immediately into a BUG:
kernel BUG at kernel/smpboot.c:135!
Just changing the order in which the online/active bits are set
(and adding some memory barriers), would solve the two issues
above. However, it would change the order of operations back to
the one before commit 6acbfb96976f ("sched: Fix hotplug vs.
set_cpus_allowed_ptr()"), thus, reintroducing that particular
problem.
Going further back into history, we have at least the following
commits touching this topic:
- commit 2baab4e90495 ("sched: Fix select_fallback_rq() vs cpu_active/cpu_online")
- commit 5fbd036b552f ("sched: Cleanup cpu_active madness")
Together, these give us the following non-working solutions:
- secondary CPU sets active before online, because active is assumed to
be a subset of online;
- secondary CPU sets online before active, because the primary CPU
assumes that an online CPU is also active;
- secondary CPU sets online and waits for primary CPU to set active,
because it might deadlock.
Commit 875ebe940d77 ("powerpc/smp: Wait until secondaries are
active & online") introduces an arch-specific solution to this
arch-independent problem.
Now, go for a more general solution without explicit waiting and
simply set active twice: once on the secondary CPU after online
was set and once on the primary CPU after online was seen.
set_cpus_allowed_ptr()")
Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Anton Blanchard <anton@samba.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Wilson <msw@amazon.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 6acbfb96976f ("sched: Fix hotplug vs. set_cpus_allowed_ptr()")
Link: http://lkml.kernel.org/r/1439408156-18840-1-git-send-email-jschoenh@amazon.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
kernel/sched/core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 0030db473c99..45e90105a59c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4729,6 +4729,14 @@ static int sched_cpu_active(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
switch (action & ~CPU_TASKS_FROZEN) {
+ case CPU_ONLINE:
+ /*
+ * At this point a starting CPU has marked itself as online via
+ * set_cpu_online(). But it might not yet have marked itself
+ * as active, which is essential from here on.
+ *
+ * Thus, fall-through and help the starting CPU along.
+ */
case CPU_DOWN_FAILED:
set_cpu_active((long)hcpu, true);
return NOTIFY_OK;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 006/123] xhci: Workaround for PME stuck issues in Intel xhci
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (4 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 005/123] sched: Fix cpu_active_mask/cpu_online_mask race Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 007/123] xhci: rework cycle bit checking for new dequeue pointers Jiri Slaby
` (118 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Mathias Nyman, Greg Kroah-Hartman, Jiri Slaby
From: Mathias Nyman <mathias.nyman@linux.intel.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b8cb91e058cd0c0f02059c1207293c5b31d350fa upstream.
The xhci in Intel Sunrisepoint and Cherryview platforms need a driver
workaround for a Stuck PME that might either block PME events in suspend,
or create spurious PME events preventing runtime suspend.
Workaround is to clear a internal PME flag, BIT(28) in a vendor specific
PMCTRL register at offset 0x80a4, in both suspend resume callbacks
Without this, xhci connected usb devices might never be able to wake up the
system from suspend, or prevent device from going to suspend (xhci d3)
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/host/xhci-pci.c | 30 ++++++++++++++++++++++++++++++
drivers/usb/host/xhci.h | 1 +
2 files changed, 31 insertions(+)
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 4ddceb7e05c3..68b8bc2e82d9 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -37,6 +37,9 @@
#define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31
#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31
+#define PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI 0x22b5
+#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI 0xa12f
+#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI 0x9d2f
static const char hcd_name[] = "xhci_hcd";
@@ -129,6 +132,12 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) {
xhci->quirks |= XHCI_SPURIOUS_REBOOT;
}
+ if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
+ (pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI ||
+ pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI ||
+ pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI)) {
+ xhci->quirks |= XHCI_PME_STUCK_QUIRK;
+ }
if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
pdev->device == PCI_DEVICE_ID_ASROCK_P67) {
xhci->quirks |= XHCI_RESET_ON_RESUME;
@@ -143,6 +152,21 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
xhci->quirks |= XHCI_RESET_ON_RESUME;
}
+/*
+ * Make sure PME works on some Intel xHCI controllers by writing 1 to clear
+ * the Internal PME flag bit in vendor specific PMCTRL register at offset 0x80a4
+ */
+static void xhci_pme_quirk(struct xhci_hcd *xhci)
+{
+ u32 val;
+ void __iomem *reg;
+
+ reg = (void __iomem *) xhci->cap_regs + 0x80a4;
+ val = readl(reg);
+ writel(val | BIT(28), reg);
+ readl(reg);
+}
+
/* called during probe() after chip reset completes */
static int xhci_pci_setup(struct usb_hcd *hcd)
{
@@ -269,6 +293,9 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
if (xhci_compliance_mode_recovery_timer_quirk_check())
pdev->no_d3cold = true;
+ if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
+ xhci_pme_quirk(xhci);
+
return xhci_suspend(xhci, do_wakeup);
}
@@ -299,6 +326,9 @@ static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
if (pdev->vendor == PCI_VENDOR_ID_INTEL)
usb_enable_intel_xhci_ports(pdev);
+ if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
+ xhci_pme_quirk(xhci);
+
retval = xhci_resume(xhci, hibernated);
return retval;
}
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 8686a06d83d4..0419137c4732 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1554,6 +1554,7 @@ struct xhci_hcd {
#define XHCI_PLAT (1 << 16)
#define XHCI_SLOW_SUSPEND (1 << 17)
#define XHCI_SPURIOUS_WAKEUP (1 << 18)
+#define XHCI_PME_STUCK_QUIRK (1 << 20)
unsigned int num_active_eps;
unsigned int limit_active_eps;
/* There are two roothubs to keep track of bus suspend info for */
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 007/123] xhci: rework cycle bit checking for new dequeue pointers
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (5 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 006/123] xhci: Workaround for PME stuck issues in Intel xhci Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 008/123] usb: core: Fix USB 3.0 devices lost in NOTATTACHED state after a hub port reset Jiri Slaby
` (117 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Mathias Nyman, Greg Kroah-Hartman, Jiri Slaby
From: Mathias Nyman <mathias.nyman@linux.intel.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 365038d83313951d6ace15342eb24624bbef1666 upstream.
When we manually need to move the TR dequeue pointer we need to set the
correct cycle bit as well. Previously we used the trb pointer from the
last event received as a base, but this was changed in
commit 1f81b6d22a59 ("usb: xhci: Prefer endpoint context dequeue pointer")
to use the dequeue pointer from the endpoint context instead
It turns out some Asmedia controllers advance the dequeue pointer
stored in the endpoint context past the event triggering TRB, and
this messed up the way the cycle bit was calculated.
Instead of adding a quirk or complicating the already hard to follow cycle bit
code, the whole cycle bit calculation is now simplified and adapted to handle
event and endpoint context dequeue pointer differences.
[js] do not touch find_trb_seg, it is still in use in other portions
of the code
Fixes: 1f81b6d22a59 ("usb: xhci: Prefer endpoint context dequeue pointer")
Reported-by: Maciej Puzio <mx34567@gmail.com>
Reported-by: Evan Langlois <uudruid74@gmail.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Maciej Puzio <mx34567@gmail.com>
Tested-by: Evan Langlois <uudruid74@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/host/xhci-ring.c | 75 +++++++++++++++++++++++---------------------
drivers/usb/host/xhci.c | 3 ++
2 files changed, 42 insertions(+), 36 deletions(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 66deb0af258e..d5652d21826a 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -554,9 +554,12 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
struct xhci_virt_device *dev = xhci->devs[slot_id];
struct xhci_virt_ep *ep = &dev->eps[ep_index];
struct xhci_ring *ep_ring;
- struct xhci_generic_trb *trb;
+ struct xhci_segment *new_seg;
+ union xhci_trb *new_deq;
dma_addr_t addr;
u64 hw_dequeue;
+ bool cycle_found = false;
+ bool td_last_trb_found = false;
ep_ring = xhci_triad_to_transfer_ring(xhci, slot_id,
ep_index, stream_id);
@@ -581,45 +584,45 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
hw_dequeue = le64_to_cpu(ep_ctx->deq);
}
- /* Find virtual address and segment of hardware dequeue pointer */
- state->new_deq_seg = ep_ring->deq_seg;
- state->new_deq_ptr = ep_ring->dequeue;
- while (xhci_trb_virt_to_dma(state->new_deq_seg, state->new_deq_ptr)
- != (dma_addr_t)(hw_dequeue & ~0xf)) {
- next_trb(xhci, ep_ring, &state->new_deq_seg,
- &state->new_deq_ptr);
- if (state->new_deq_ptr == ep_ring->dequeue) {
- WARN_ON(1);
- return;
- }
- }
+ new_seg = ep_ring->deq_seg;
+ new_deq = ep_ring->dequeue;
+ state->new_cycle_state = hw_dequeue & 0x1;
+
/*
- * Find cycle state for last_trb, starting at old cycle state of
- * hw_dequeue. If there is only one segment ring, find_trb_seg() will
- * return immediately and cannot toggle the cycle state if this search
- * wraps around, so add one more toggle manually in that case.
+ * We want to find the pointer, segment and cycle state of the new trb
+ * (the one after current TD's last_trb). We know the cycle state at
+ * hw_dequeue, so walk the ring until both hw_dequeue and last_trb are
+ * found.
*/
- state->new_cycle_state = hw_dequeue & 0x1;
- if (ep_ring->first_seg == ep_ring->first_seg->next &&
- cur_td->last_trb < state->new_deq_ptr)
- state->new_cycle_state ^= 0x1;
+ do {
+ if (!cycle_found && xhci_trb_virt_to_dma(new_seg, new_deq)
+ == (dma_addr_t)(hw_dequeue & ~0xf)) {
+ cycle_found = true;
+ if (td_last_trb_found)
+ break;
+ }
+ if (new_deq == cur_td->last_trb)
+ td_last_trb_found = true;
- state->new_deq_ptr = cur_td->last_trb;
- xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
- "Finding segment containing last TRB in TD.");
- state->new_deq_seg = find_trb_seg(state->new_deq_seg,
- state->new_deq_ptr, &state->new_cycle_state);
- if (!state->new_deq_seg) {
- WARN_ON(1);
- return;
- }
+ if (cycle_found &&
+ TRB_TYPE_LINK_LE32(new_deq->generic.field[3]) &&
+ new_deq->generic.field[3] & cpu_to_le32(LINK_TOGGLE))
+ state->new_cycle_state ^= 0x1;
+
+ next_trb(xhci, ep_ring, &new_seg, &new_deq);
+
+ /* Search wrapped around, bail out */
+ if (new_deq == ep->ring->dequeue) {
+ xhci_err(xhci, "Error: Failed finding new dequeue state\n");
+ state->new_deq_seg = NULL;
+ state->new_deq_ptr = NULL;
+ return;
+ }
+
+ } while (!cycle_found || !td_last_trb_found);
- /* Increment to find next TRB after last_trb. Cycle if appropriate. */
- trb = &state->new_deq_ptr->generic;
- if (TRB_TYPE_LINK_LE32(trb->field[3]) &&
- (trb->field[3] & cpu_to_le32(LINK_TOGGLE)))
- state->new_cycle_state ^= 0x1;
- next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr);
+ state->new_deq_seg = new_seg;
+ state->new_deq_ptr = new_deq;
/* Don't update the ring cycle state for the producer (us). */
xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 00686a8c4fa0..1dd08da9652a 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -2902,6 +2902,9 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
ep_index, ep->stopped_stream, ep->stopped_td,
&deq_state);
+ if (!deq_state.new_deq_ptr || !deq_state.new_deq_seg)
+ return;
+
/* HW with the reset endpoint quirk will use the saved dequeue state to
* issue a configure endpoint command later.
*/
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 008/123] usb: core: Fix USB 3.0 devices lost in NOTATTACHED state after a hub port reset
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (6 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 007/123] xhci: rework cycle bit checking for new dequeue pointers Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 009/123] USB: usbtmc: add device quirk for Rigol DS6104 Jiri Slaby
` (116 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Robert Schlabbach, Robert Schlabbach,
Greg Kroah-Hartman, Oliver Neukum, Jiri Slaby
From: Robert Schlabbach <Robert.Schlabbach@gmx.net>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit fb6d1f7df5d25299fd7b3e84b72b8851d3634764 upstream.
Fix USB 3.0 devices lost in NOTATTACHED state after a hub port reset.
Dissolve the function hub_port_finish_reset() completely and divide the
actions to be taken into those which need to be done after each reset
attempt and those which need to be done after the full procedure is
complete, and place them in the appropriate places in hub_port_reset().
Also, remove an unneeded forward declaration of hub_port_reset().
Verbose Problem Description:
USB 3.0 devices may be "lost for good" during a hub port reset.
This makes Linux unable to boot from USB 3.0 devices in certain
constellations of host controllers and devices, because the USB device is
lost during initialization, preventing the rootfs from being mounted.
The underlying problem is that in the affected constellations, during the
processing inside hub_port_reset(), the hub link state goes from 0 to
SS.inactive after the initial reset, and back to 0 again only after the
following "warm" reset.
However, hub_port_finish_reset() is called after each reset attempt and
sets the state the connected USB device based on the "preliminary" status
of the hot reset to USB_STATE_NOTATTACHED due to SS.inactive, yet when
the following warm reset is complete and hub_port_finish_reset() is
called again, its call to set the device to USB_STATE_DEFAULT is blocked
by usb_set_device_state() which does not allow taking USB devices out of
USB_STATE_NOTATTACHED state.
Thanks to Alan Stern for guiding me to the proper solution and how to
submit it.
Link: http://lkml.kernel.org/r/trinity-25981484-72a9-4d46-bf17-9c1cf9301a31-1432073240136%20()%203capp-gmx-bs27
Signed-off-by: Robert Schlabbach <robert_s@gmx.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/core/hub.c | 82 ++++++++++++++++++++------------------------------
1 file changed, 33 insertions(+), 49 deletions(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 78141993dfd0..f9af3bf33e1b 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2539,9 +2539,6 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
#define HUB_LONG_RESET_TIME 200
#define HUB_RESET_TIMEOUT 800
-static int hub_port_reset(struct usb_hub *hub, int port1,
- struct usb_device *udev, unsigned int delay, bool warm);
-
/* Is a USB 3.0 port in the Inactive or Complinance Mode state?
* Port worm reset is required to recover
*/
@@ -2622,44 +2619,6 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
return 0;
}
-static void hub_port_finish_reset(struct usb_hub *hub, int port1,
- struct usb_device *udev, int *status)
-{
- switch (*status) {
- case 0:
- /* TRSTRCY = 10 ms; plus some extra */
- msleep(10 + 40);
- if (udev) {
- struct usb_hcd *hcd = bus_to_hcd(udev->bus);
-
- update_devnum(udev, 0);
- /* The xHC may think the device is already reset,
- * so ignore the status.
- */
- if (hcd->driver->reset_device)
- hcd->driver->reset_device(hcd, udev);
- }
- /* FALL THROUGH */
- case -ENOTCONN:
- case -ENODEV:
- usb_clear_port_feature(hub->hdev,
- port1, USB_PORT_FEAT_C_RESET);
- if (hub_is_superspeed(hub->hdev)) {
- usb_clear_port_feature(hub->hdev, port1,
- USB_PORT_FEAT_C_BH_PORT_RESET);
- usb_clear_port_feature(hub->hdev, port1,
- USB_PORT_FEAT_C_PORT_LINK_STATE);
- usb_clear_port_feature(hub->hdev, port1,
- USB_PORT_FEAT_C_CONNECTION);
- }
- if (udev)
- usb_set_device_state(udev, *status
- ? USB_STATE_NOTATTACHED
- : USB_STATE_DEFAULT);
- break;
- }
-}
-
/* Handle port reset and port warm(BH) reset (for USB3 protocol ports) */
static int hub_port_reset(struct usb_hub *hub, int port1,
struct usb_device *udev, unsigned int delay, bool warm)
@@ -2682,13 +2641,10 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
* If the caller hasn't explicitly requested a warm reset,
* double check and see if one is needed.
*/
- status = hub_port_status(hub, port1,
- &portstatus, &portchange);
- if (status < 0)
- goto done;
-
- if (hub_port_warm_reset_required(hub, portstatus))
- warm = true;
+ if (hub_port_status(hub, port1, &portstatus, &portchange) == 0)
+ if (hub_port_warm_reset_required(hub,
+ portstatus))
+ warm = true;
}
/* Reset the port */
@@ -2713,11 +2669,19 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
/* Check for disconnect or reset */
if (status == 0 || status == -ENOTCONN || status == -ENODEV) {
- hub_port_finish_reset(hub, port1, udev, &status);
+ usb_clear_port_feature(hub->hdev, port1,
+ USB_PORT_FEAT_C_RESET);
if (!hub_is_superspeed(hub->hdev))
goto done;
+ usb_clear_port_feature(hub->hdev, port1,
+ USB_PORT_FEAT_C_BH_PORT_RESET);
+ usb_clear_port_feature(hub->hdev, port1,
+ USB_PORT_FEAT_C_PORT_LINK_STATE);
+ usb_clear_port_feature(hub->hdev, port1,
+ USB_PORT_FEAT_C_CONNECTION);
+
/*
* If a USB 3.0 device migrates from reset to an error
* state, re-issue the warm reset.
@@ -2751,6 +2715,26 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
port1);
done:
+ if (status == 0) {
+ /* TRSTRCY = 10 ms; plus some extra */
+ msleep(10 + 40);
+ if (udev) {
+ struct usb_hcd *hcd = bus_to_hcd(udev->bus);
+
+ update_devnum(udev, 0);
+ /* The xHC may think the device is already reset,
+ * so ignore the status.
+ */
+ if (hcd->driver->reset_device)
+ hcd->driver->reset_device(hcd, udev);
+
+ usb_set_device_state(udev, USB_STATE_DEFAULT);
+ }
+ } else {
+ if (udev)
+ usb_set_device_state(udev, USB_STATE_NOTATTACHED);
+ }
+
if (!hub_is_superspeed(hub->hdev))
up_read(&ehci_cf_port_reset_rwsem);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 009/123] USB: usbtmc: add device quirk for Rigol DS6104
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (7 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 008/123] usb: core: Fix USB 3.0 devices lost in NOTATTACHED state after a hub port reset Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 15:33 ` Teunis van Beelen
2015-10-28 13:50 ` [PATCH 3.12 010/123] client MUST ignore EncryptionKeyLength if CAP_EXTENDED_SECURITY is set Jiri Slaby
` (115 subsequent siblings)
124 siblings, 1 reply; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Teunis van Beelen, Greg Kroah-Hartman, Jiri Slaby
From: Teunis van Beelen <teuniz@gmail.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f50420223071b6ff4b586308f5c27eec54694a81 upstream.
Recently we purchased the Rigol DS6104 and when I try to operate it from
my Linux pc, everything works well with the default usbtmc driver,
except when I want to download a big datachunk like a screenshot. This
bitmapfile has a size of 1152054 bytes but I receive a smaller file and
no new packets can be read.
When I took a look at the driver source, I found this "Rigol quirk" and
I added the id of the new DS series oscilloscopes to this list. I
compiled it and loaded the new driver and now everything seems to work
fine.
Signed-off-by: Teunis van Beelen <teuniz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/class/usbtmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 09de131ee0cb..c997ee9122bc 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -110,6 +110,7 @@ struct usbtmc_ID_rigol_quirk {
static const struct usbtmc_ID_rigol_quirk usbtmc_id_quirk[] = {
{ 0x1ab1, 0x0588 },
+ { 0x1ab1, 0x04b0 },
{ 0, 0 }
};
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* Re: [PATCH 3.12 009/123] USB: usbtmc: add device quirk for Rigol DS6104
2015-10-28 13:50 ` [PATCH 3.12 009/123] USB: usbtmc: add device quirk for Rigol DS6104 Jiri Slaby
@ 2015-10-28 15:33 ` Teunis van Beelen
0 siblings, 0 replies; 134+ messages in thread
From: Teunis van Beelen @ 2015-10-28 15:33 UTC (permalink / raw)
To: Jiri Slaby; +Cc: stable, linux-kernel, Greg Kroah-Hartman
Recently there was a firmware update for the Rigol DS6000 series that
seems to solve the need for the "Rigol quirk".
After a quick check, it looks like the scope now works well with and
without the patch.
I need to do some more testing though...
What do you suggest, we put it on hold, we wait?
How much time do we have? Let me know.
Kind Regards,
Teunis van Beelen
On Wed, Oct 28, 2015 at 2:50 PM, Jiri Slaby <jslaby@suse.cz> wrote:
> From: Teunis van Beelen <teuniz@gmail.com>
>
> 3.12-stable review patch. If anyone has any objections, please let me know.
>
> ===============
>
> commit f50420223071b6ff4b586308f5c27eec54694a81 upstream.
>
> Recently we purchased the Rigol DS6104 and when I try to operate it from
> my Linux pc, everything works well with the default usbtmc driver,
> except when I want to download a big datachunk like a screenshot. This
> bitmapfile has a size of 1152054 bytes but I receive a smaller file and
> no new packets can be read.
>
> When I took a look at the driver source, I found this "Rigol quirk" and
> I added the id of the new DS series oscilloscopes to this list. I
> compiled it and loaded the new driver and now everything seems to work
> fine.
>
> Signed-off-by: Teunis van Beelen <teuniz@gmail.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> ---
> drivers/usb/class/usbtmc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
> index 09de131ee0cb..c997ee9122bc 100644
> --- a/drivers/usb/class/usbtmc.c
> +++ b/drivers/usb/class/usbtmc.c
> @@ -110,6 +110,7 @@ struct usbtmc_ID_rigol_quirk {
>
> static const struct usbtmc_ID_rigol_quirk usbtmc_id_quirk[] = {
> { 0x1ab1, 0x0588 },
> + { 0x1ab1, 0x04b0 },
> { 0, 0 }
> };
>
> --
> 2.6.2
>
--
"C'è qualcosa nella nebbia! Qualcosa nella nebbia ha preso John Lee!"
^ permalink raw reply [flat|nested] 134+ messages in thread
* [PATCH 3.12 010/123] client MUST ignore EncryptionKeyLength if CAP_EXTENDED_SECURITY is set
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (8 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 009/123] USB: usbtmc: add device quirk for Rigol DS6104 Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 011/123] iommu/amd: Handle integer overflow in dma_ops_area_alloc Jiri Slaby
` (114 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Noel Power, Steve French, Jiri Slaby
From: Noel Power <noel.power@suse.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f291095f340db986271e951e3891bb95624a93ea upstream.
[MS-SMB] 2.2.4.5.2.1 states:
"ChallengeLength (1 byte): When the CAP_EXTENDED_SECURITY bit is set,
the server MUST set this value to zero and clients MUST ignore this
value."
Signed-off-by: Noel Power <noel.power@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/cifs/cifssmb.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 5f1f3285479e..ea938a8bf240 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -629,9 +629,8 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
server->negflavor = CIFS_NEGFLAVOR_UNENCAP;
memcpy(ses->server->cryptkey, pSMBr->u.EncryptionKey,
CIFS_CRYPTO_KEY_SIZE);
- } else if ((pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC ||
- server->capabilities & CAP_EXTENDED_SECURITY) &&
- (pSMBr->EncryptionKeyLength == 0)) {
+ } else if (pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC ||
+ server->capabilities & CAP_EXTENDED_SECURITY) {
server->negflavor = CIFS_NEGFLAVOR_EXTENDED;
rc = decode_ext_sec_blob(ses, pSMBr);
} else if (server->sec_mode & SECMODE_PW_ENCRYPT) {
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 011/123] iommu/amd: Handle integer overflow in dma_ops_area_alloc
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (9 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 010/123] client MUST ignore EncryptionKeyLength if CAP_EXTENDED_SECURITY is set Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 012/123] s390/3270: redraw screen on unsolicited device end Jiri Slaby
` (113 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Joerg Roedel, Jiri Slaby
From: Joerg Roedel <jroedel@suse.de>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e6aabee05f41c9d18e0b92194819edd84f352ac9 upstream.
Handle this case to make sure boundary_size does not become
0 and trigger a BUG_ON later.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/iommu/amd_iommu.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index b853bb47fc7d..d22b4af761f5 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1750,14 +1750,16 @@ static unsigned long dma_ops_area_alloc(struct device *dev,
unsigned long next_bit = dom->next_address % APERTURE_RANGE_SIZE;
int max_index = dom->aperture_size >> APERTURE_RANGE_SHIFT;
int i = start >> APERTURE_RANGE_SHIFT;
- unsigned long boundary_size;
+ unsigned long boundary_size, mask;
unsigned long address = -1;
unsigned long limit;
next_bit >>= PAGE_SHIFT;
- boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
- PAGE_SIZE) >> PAGE_SHIFT;
+ mask = dma_get_seg_boundary(dev);
+
+ boundary_size = mask + 1 ? ALIGN(mask + 1, PAGE_SIZE) >> PAGE_SHIFT :
+ 1UL << (BITS_PER_LONG - PAGE_SHIFT);
for (;i < max_index; ++i) {
unsigned long offset = dom->aperture[i]->offset >> PAGE_SHIFT;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 012/123] s390/3270: redraw screen on unsolicited device end
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (10 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 011/123] iommu/amd: Handle integer overflow in dma_ops_area_alloc Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 013/123] Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS Jiri Slaby
` (112 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Martin Schwidefsky, Jiri Slaby
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 05bfd70bcdd3cd12c061cb77b73a11ba6f87379d upstream.
If a 3270 terminal is disconnected and later reconnected again,
it gets an unsolicited device end. This is currently ignored and
you have to hit the clear key to get the screen redrawn.
Add an automatic full redraw of the screen for this case.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/s390/char/con3270.c | 4 ++++
drivers/s390/char/tty3270.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c
index bb6b0df50b33..efb6e13dc788 100644
--- a/drivers/s390/char/con3270.c
+++ b/drivers/s390/char/con3270.c
@@ -407,6 +407,10 @@ con3270_irq(struct con3270 *cp, struct raw3270_request *rq, struct irb *irb)
else
/* Normal end. Copy residual count. */
rq->rescnt = irb->scsw.cmd.count;
+ } else if (irb->scsw.cmd.dstat & DEV_STAT_DEV_END) {
+ /* Interrupt without an outstanding request -> update all */
+ cp->update_flags = CON_UPDATE_ALL;
+ con3270_set_timer(cp, 1);
}
return RAW3270_IO_DONE;
}
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index 34629ea913d4..49f034facf77 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -662,6 +662,10 @@ tty3270_irq(struct tty3270 *tp, struct raw3270_request *rq, struct irb *irb)
else
/* Normal end. Copy residual count. */
rq->rescnt = irb->scsw.cmd.count;
+ } else if (irb->scsw.cmd.dstat & DEV_STAT_DEV_END) {
+ /* Interrupt without an outstanding request -> update all */
+ tp->update_flags = TTY_UPDATE_ALL;
+ tty3270_set_timer(tp, 1);
}
return RAW3270_IO_DONE;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 013/123] Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (11 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 012/123] s390/3270: redraw screen on unsolicited device end Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 014/123] ARM: 7880/1: Clear the IT state independent of the Thumb-2 mode Jiri Slaby
` (111 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Dirk Müller, Paolo Bonzini, Jiri Slaby
From: Dirk Müller <dmueller@suse.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit d2922422c48df93f3edff7d872ee4f3191fefb08 upstream.
The cpu feature flags are not ever going to change, so warning
everytime can cause a lot of kernel log spam
(in our case more than 10GB/hour).
The warning seems to only occur when nested virtualization is
enabled, so it's probably triggered by a KVM bug. This is a
sensible and safe change anyway, and the KVM bug fix might not
be suitable for stable releases anyway.
Signed-off-by: Dirk Mueller <dmueller@suse.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/x86/kvm/svm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 2996635196d3..d1a065ec683f 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -496,7 +496,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
struct vcpu_svm *svm = to_svm(vcpu);
if (svm->vmcb->control.next_rip != 0) {
- WARN_ON(!static_cpu_has(X86_FEATURE_NRIPS));
+ WARN_ON_ONCE(!static_cpu_has(X86_FEATURE_NRIPS));
svm->next_rip = svm->vmcb->control.next_rip;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 014/123] ARM: 7880/1: Clear the IT state independent of the Thumb-2 mode
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (12 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 013/123] Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 015/123] net: add length argument to skb_copy_and_csum_datagram_iovec Jiri Slaby
` (110 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, T.J. Purtell, Russell King, Jiri Slaby
From: "T.J. Purtell" <tj@mobisocial.us>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6ecf830e5029598732e04067e325d946097519cb upstream.
The ARM architecture reference specifies that the IT state bits in the
PSR must be all zeros in ARM mode or behavior is unspecified. On the
Qualcomm Snapdragon S4/Krait architecture CPUs the processor continues
to consider the IT state bits while in ARM mode. This makes it so
that some instructions are skipped by the CPU.
Signed-off-by: T.J. Purtell <tj@mobisocial.us>
[rmk+kernel@arm.linux.org.uk: fixed whitespace formatting in patch]
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/arm/kernel/signal.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index ab3304225272..1aa5ecdd1b3d 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -375,12 +375,18 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
*/
thumb = handler & 1;
- if (thumb) {
- cpsr |= PSR_T_BIT;
#if __LINUX_ARM_ARCH__ >= 7
- /* clear the If-Then Thumb-2 execution state */
- cpsr &= ~PSR_IT_MASK;
+ /*
+ * Clear the If-Then Thumb-2 execution state
+ * ARM spec requires this to be all 000s in ARM mode
+ * Snapdragon S4/Krait misbehaves on a Thumb=>ARM
+ * signal transition without this.
+ */
+ cpsr &= ~PSR_IT_MASK;
#endif
+
+ if (thumb) {
+ cpsr |= PSR_T_BIT;
} else
cpsr &= ~PSR_T_BIT;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 015/123] net: add length argument to skb_copy_and_csum_datagram_iovec
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (13 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 014/123] ARM: 7880/1: Clear the IT state independent of the Thumb-2 mode Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 016/123] ALSA: hda - Control SPDIF out pin on MacBookPro 11,2 Jiri Slaby
` (109 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Sabrina Dubroca, Jiri Slaby
From: Sabrina Dubroca <sd@queasysnail.net>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
Without this length argument, we can read past the end of the iovec in
memcpy_toiovec because we have no way of knowing the total length of the
iovec's buffers.
This is needed for stable kernels where 89c22d8c3b27 ("net: Fix skb
csum races when peeking") has been backported but that don't have the
ioviter conversion, which is almost all the stable trees <= 3.18.
This also fixes a kernel crash for NFS servers when the client uses
-onfsvers=3,proto=udp to mount the export.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
include/linux/skbuff.h | 3 ++-
net/core/datagram.c | 6 +++++-
net/ipv4/tcp_input.c | 2 +-
net/ipv4/udp.c | 2 +-
net/ipv6/raw.c | 2 +-
net/ipv6/udp.c | 3 ++-
net/rxrpc/ar-recvmsg.c | 3 ++-
7 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 79147dc9630d..47032528386a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2350,7 +2350,8 @@ extern int skb_copy_datagram_iovec(const struct sk_buff *from,
int size);
extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
int hlen,
- struct iovec *iov);
+ struct iovec *iov,
+ int len);
extern int skb_copy_datagram_from_iovec(struct sk_buff *skb,
int offset,
const struct iovec *from,
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 98e3d61e7476..f22f120771ef 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -796,6 +796,7 @@ EXPORT_SYMBOL(__skb_checksum_complete);
* @skb: skbuff
* @hlen: hardware length
* @iov: io vector
+ * @len: amount of data to copy from skb to iov
*
* Caller _must_ check that skb will fit to this iovec.
*
@@ -805,11 +806,14 @@ EXPORT_SYMBOL(__skb_checksum_complete);
* can be modified!
*/
int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
- int hlen, struct iovec *iov)
+ int hlen, struct iovec *iov, int len)
{
__wsum csum;
int chunk = skb->len - hlen;
+ if (chunk > len)
+ chunk = len;
+
if (!chunk)
return 0;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 49c87a39948f..4829750aa424 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4892,7 +4892,7 @@ static int tcp_copy_to_iovec(struct sock *sk, struct sk_buff *skb, int hlen)
err = skb_copy_datagram_iovec(skb, hlen, tp->ucopy.iov, chunk);
else
err = skb_copy_and_csum_datagram_iovec(skb, hlen,
- tp->ucopy.iov);
+ tp->ucopy.iov, chunk);
if (!err) {
tp->ucopy.len -= chunk;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 268ed25f2d65..4908eaa1cdec 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1245,7 +1245,7 @@ try_again:
else {
err = skb_copy_and_csum_datagram_iovec(skb,
sizeof(struct udphdr),
- msg->msg_iov);
+ msg->msg_iov, copied);
if (err == -EINVAL)
goto csum_copy_err;
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 430067cb9210..0d51ebc176a7 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -489,7 +489,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
goto csum_copy_err;
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
} else {
- err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov);
+ err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov, copied);
if (err == -EINVAL)
goto csum_copy_err;
}
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index e09ca285e8f5..946ee8efe74b 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -410,7 +410,8 @@ try_again:
err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr),
msg->msg_iov, copied);
else {
- err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov);
+ err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr),
+ msg->msg_iov, copied);
if (err == -EINVAL)
goto csum_copy_err;
}
diff --git a/net/rxrpc/ar-recvmsg.c b/net/rxrpc/ar-recvmsg.c
index 5cc2da5d295d..c67f5d3f6e61 100644
--- a/net/rxrpc/ar-recvmsg.c
+++ b/net/rxrpc/ar-recvmsg.c
@@ -185,7 +185,8 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock,
msg->msg_iov, copy);
} else {
ret = skb_copy_and_csum_datagram_iovec(skb, offset,
- msg->msg_iov);
+ msg->msg_iov,
+ copy);
if (ret == -EINVAL)
goto csum_copy_error;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 016/123] ALSA: hda - Control SPDIF out pin on MacBookPro 11,2
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (14 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 015/123] net: add length argument to skb_copy_and_csum_datagram_iovec Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 017/123] kvm: fix zero length mmio searching Jiri Slaby
` (108 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13: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 0c52db8cca7b033d03ebcda652158e2311d5ac64 upstream.
The SPDIF output MBP11,2 requires the pin control to be set/cleared
for turning on/off the optical SPDIF. The red light turns off only
when the corresponding pin control is cleared (or powered to D3).
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64401
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
sound/pci/hda/patch_cirrus.c | 56 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 55 insertions(+), 1 deletion(-)
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index d54d218fe810..7b0aac9d27ca 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -47,6 +47,10 @@ struct cs_spec {
unsigned int spdif_present:1;
unsigned int sense_b:1;
hda_nid_t vendor_nid;
+
+ /* for MBP SPDIF control */
+ int (*spdif_sw_put)(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol);
};
/* available models with CS420x */
@@ -331,10 +335,21 @@ static int cs_init(struct hda_codec *codec)
return 0;
}
+static int cs_build_controls(struct hda_codec *codec)
+{
+ int err;
+
+ err = snd_hda_gen_build_controls(codec);
+ if (err < 0)
+ return err;
+ snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
+ return 0;
+}
+
#define cs_free snd_hda_gen_free
static const struct hda_codec_ops cs_patch_ops = {
- .build_controls = snd_hda_gen_build_controls,
+ .build_controls = cs_build_controls,
.build_pcms = snd_hda_gen_build_pcms,
.init = cs_init,
.free = cs_free,
@@ -601,12 +616,14 @@ static int patch_cs420x(struct hda_codec *codec)
enum {
CS4208_MAC_AUTO,
CS4208_MBA6,
+ CS4208_MBP11,
CS4208_GPIO0,
};
static const struct hda_model_fixup cs4208_models[] = {
{ .id = CS4208_GPIO0, .name = "gpio0" },
{ .id = CS4208_MBA6, .name = "mba6" },
+ { .id = CS4208_MBP11, .name = "mbp11" },
{}
};
@@ -617,6 +634,7 @@ static const struct snd_pci_quirk cs4208_fixup_tbl[] = {
/* codec SSID matching */
static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = {
+ SND_PCI_QUIRK(0x106b, 0x5e00, "MacBookPro 11,2", CS4208_MBP11),
SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6),
SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6),
{} /* terminator */
@@ -648,6 +666,36 @@ static void cs4208_fixup_mac(struct hda_codec *codec,
snd_hda_apply_fixup(codec, action);
}
+static int cs4208_spdif_sw_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct cs_spec *spec = codec->spec;
+ hda_nid_t pin = spec->gen.autocfg.dig_out_pins[0];
+ int pinctl = ucontrol->value.integer.value[0] ? PIN_OUT : 0;
+
+ snd_hda_set_pin_ctl_cache(codec, pin, pinctl);
+ return spec->spdif_sw_put(kcontrol, ucontrol);
+}
+
+/* hook the SPDIF switch */
+static void cs4208_fixup_spdif_switch(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action)
+{
+ if (action == HDA_FIXUP_ACT_BUILD) {
+ struct cs_spec *spec = codec->spec;
+ struct snd_kcontrol *kctl;
+
+ if (!spec->gen.autocfg.dig_out_pins[0])
+ return;
+ kctl = snd_hda_find_mixer_ctl(codec, "IEC958 Playback Switch");
+ if (!kctl)
+ return;
+ spec->spdif_sw_put = kctl->put;
+ kctl->put = cs4208_spdif_sw_put;
+ }
+}
+
static const struct hda_fixup cs4208_fixups[] = {
[CS4208_MBA6] = {
.type = HDA_FIXUP_PINS,
@@ -655,6 +703,12 @@ static const struct hda_fixup cs4208_fixups[] = {
.chained = true,
.chain_id = CS4208_GPIO0,
},
+ [CS4208_MBP11] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = cs4208_fixup_spdif_switch,
+ .chained = true,
+ .chain_id = CS4208_GPIO0,
+ },
[CS4208_GPIO0] = {
.type = HDA_FIXUP_FUNC,
.v.func = cs4208_fixup_gpio0,
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 017/123] kvm: fix zero length mmio searching
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (15 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 016/123] ALSA: hda - Control SPDIF out pin on MacBookPro 11,2 Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 018/123] scsi: fix scsi_error_handler vs. scsi_host_dev_release race Jiri Slaby
` (107 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Jason Wang, Gleb Natapov, Paolo Bonzini, Jiri Slaby
From: Jason Wang <jasowang@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8f4216c7d28976f7ec1b2bcbfa0a9f787133c45e upstream.
Currently, if we had a zero length mmio eventfd assigned on
KVM_MMIO_BUS. It will never be found by kvm_io_bus_cmp() since it
always compares the kvm_io_range() with the length that guest
wrote. This will cause e.g for vhost, kick will be trapped by qemu
userspace instead of vhost. Fixing this by using zero length if an
iodevice is zero length.
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
virt/kvm/kvm_main.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index a3510441f7d7..235b3f0cc97e 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2813,10 +2813,25 @@ static void kvm_io_bus_destroy(struct kvm_io_bus *bus)
static inline int kvm_io_bus_cmp(const struct kvm_io_range *r1,
const struct kvm_io_range *r2)
{
- if (r1->addr < r2->addr)
+ gpa_t addr1 = r1->addr;
+ gpa_t addr2 = r2->addr;
+
+ if (addr1 < addr2)
return -1;
- if (r1->addr + r1->len > r2->addr + r2->len)
+
+ /* If r2->len == 0, match the exact address. If r2->len != 0,
+ * accept any overlapping write. Any order is acceptable for
+ * overlapping ranges, because kvm_io_bus_get_first_dev ensures
+ * we process all of them.
+ */
+ if (r2->len) {
+ addr1 += r1->len;
+ addr2 += r2->len;
+ }
+
+ if (addr1 > addr2)
return 1;
+
return 0;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 018/123] scsi: fix scsi_error_handler vs. scsi_host_dev_release race
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (16 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 017/123] kvm: fix zero length mmio searching Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 019/123] iser-target: remove command with state ISTATE_REMOVE Jiri Slaby
` (106 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Michal Hocko, James Bottomley, Jiri Slaby
From: Michal Hocko <mhocko@suse.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 537b604c8b3aa8b96fe35f87dd085816552e294c upstream.
b9d5c6b7ef57 ("[SCSI] cleanup setting task state in
scsi_error_handler()") has introduced a race between scsi_error_handler
and scsi_host_dev_release resulting in the hang when the device goes
away because scsi_error_handler might miss a wake up:
CPU0 CPU1
scsi_error_handler scsi_host_dev_release
kthread_stop()
kthread_should_stop()
test_bit(KTHREAD_SHOULD_STOP)
set_bit(KTHREAD_SHOULD_STOP)
wake_up_process()
wait_for_completion()
set_current_state(TASK_INTERRUPTIBLE)
schedule()
The most straightforward solution seems to be to invert the ordering of
the set_current_state and kthread_should_stop.
The issue has been noticed during reboot test on a 3.0 based kernel but
the current code seems to be affected in the same way.
[jejb: additional comment added]
Reported-and-debugged-by: Mike Mayer <Mike.Meyer@teradata.com>
Signed-off-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/scsi/scsi_error.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 066e3198838d..ff2689d01209 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1906,8 +1906,17 @@ int scsi_error_handler(void *data)
* We never actually get interrupted because kthread_run
* disables signal delivery for the created thread.
*/
- while (!kthread_should_stop()) {
+ while (true) {
+ /*
+ * The sequence in kthread_stop() sets the stop flag first
+ * then wakes the process. To avoid missed wakeups, the task
+ * should always be in a non running state before the stop
+ * flag is checked
+ */
set_current_state(TASK_INTERRUPTIBLE);
+ if (kthread_should_stop())
+ break;
+
if ((shost->host_failed == 0 && shost->host_eh_scheduled == 0) ||
shost->host_failed != shost->host_busy) {
SCSI_LOG_ERROR_RECOVERY(1,
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 019/123] iser-target: remove command with state ISTATE_REMOVE
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (17 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 018/123] scsi: fix scsi_error_handler vs. scsi_host_dev_release race Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 020/123] perf hists: Update the column width for the "srcline" sort key Jiri Slaby
` (105 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Jenny Derzhavetz, Sagi Grimberg, Nicholas Bellinger,
Jiri Slaby
From: Jenny Derzhavetz <jennyf@mellanox.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a4c15cd957cbd728f685645de7a150df5912591a upstream.
As documented in iscsit_sequence_cmd:
/*
* Existing callers for iscsit_sequence_cmd() will silently
* ignore commands with CMDSN_LOWER_THAN_EXP, so force this
* return for CMDSN_MAXCMDSN_OVERRUN as well..
*/
We need to silently finish a command when it's in ISTATE_REMOVE.
This fixes an teardown hang we were seeing where a mis-behaved
initiator (triggered by allocation error injections) sent us a
cmdsn which was lower than expected.
Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.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 | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 9a51eb2242a0..2e04d5253130 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -2541,9 +2541,16 @@ isert_get_dataout(struct iscsi_conn *conn, struct iscsi_cmd *cmd, bool recovery)
static int
isert_immediate_queue(struct iscsi_conn *conn, struct iscsi_cmd *cmd, int state)
{
- int ret;
+ struct isert_cmd *isert_cmd = iscsit_priv_cmd(cmd);
+ int ret = 0;
switch (state) {
+ case ISTATE_REMOVE:
+ spin_lock_bh(&conn->cmd_lock);
+ list_del_init(&cmd->i_conn_node);
+ spin_unlock_bh(&conn->cmd_lock);
+ isert_put_cmd(isert_cmd, true);
+ break;
case ISTATE_SEND_NOPIN_WANT_RESPONSE:
ret = isert_put_nopin(cmd, conn, false);
break;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 020/123] perf hists: Update the column width for the "srcline" sort key
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (18 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 019/123] iser-target: remove command with state ISTATE_REMOVE Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 021/123] perf stat: Get correct cpu id for print_aggr Jiri Slaby
` (104 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Arnaldo Carvalho de Melo, Namhyung Kim, Andi Kleen,
Jiri Olsa, Jiri Slaby
From: Arnaldo Carvalho de Melo <acme@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e8e6d37e73e6b950c891c780745460b87f4755b6 upstream.
When we introduce a new sort key, we need to update the
hists__calc_col_len() function accordingly, otherwise the width
will be limited to strlen(header).
We can't update it when obtaining a line value for a column (for
instance, in sort__srcline_cmp()), because we reset it all when doing a
resort (see hists__output_recalc_col_len()), so we need to, from what is
in the hist_entry fields, set each of the column widths.
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Fixes: 409a8be61560 ("perf tools: Add sort by src line/number")
Link: http://lkml.kernel.org/n/tip-jgbe0yx8v1gs89cslr93pvz2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
tools/perf/util/hist.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 9ff6cf3e9a99..b1c914413c5f 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -160,6 +160,9 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
hists__new_col_len(hists, HISTC_MEM_LVL, 21 + 3);
hists__new_col_len(hists, HISTC_LOCAL_WEIGHT, 12);
hists__new_col_len(hists, HISTC_GLOBAL_WEIGHT, 12);
+
+ if (h->srcline)
+ hists__new_col_len(hists, HISTC_SRCLINE, strlen(h->srcline));
}
void hists__output_recalc_col_len(struct hists *hists, int max_rows)
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 021/123] perf stat: Get correct cpu id for print_aggr
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (19 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 020/123] perf hists: Update the column width for the "srcline" sort key Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 022/123] perf header: Fixup reading of HEADER_NRCPUS feature Jiri Slaby
` (103 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Kan Liang, Adrian Hunter, Andi Kleen, David Ahern,
Namhyung Kim, Peter Zijlstra, Arnaldo Carvalho de Melo,
Jiri Slaby
From: Kan Liang <kan.liang@intel.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 601083cffb7cabdcc55b8195d732f0f7028570fa upstream.
print_aggr() fails to print per-core/per-socket statistics after commit
582ec0829b3d ("perf stat: Fix per-socket output bug for uncore events")
if events have differnt cpus. Because in print_aggr(), aggr_get_id needs
index (not cpu id) to find core/pkg id. Also, evsel cpu maps should be
used to get aggregated id.
Here is an example:
Counting events cycles,uncore_imc_0/cas_count_read/. (Uncore event has
cpumask 0,18)
$ perf stat -e cycles,uncore_imc_0/cas_count_read/ -C0,18 --per-core sleep 2
Without this patch, it failes to get CPU 18 result.
Performance counter stats for 'CPU(s) 0,18':
S0-C0 1 7526851 cycles
S0-C0 1 1.05 MiB uncore_imc_0/cas_count_read/
S1-C0 0 <not counted> cycles
S1-C0 0 <not counted> MiB uncore_imc_0/cas_count_read/
With this patch, it can get both CPU0 and CPU18 result.
Performance counter stats for 'CPU(s) 0,18':
S0-C0 1 6327768 cycles
S0-C0 1 0.47 MiB uncore_imc_0/cas_count_read/
S1-C0 1 330228 cycles
S1-C0 1 0.29 MiB uncore_imc_0/cas_count_read/
Signed-off-by: Kan Liang <kan.liang@intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Stephane Eranian <eranian@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Fixes: 582ec0829b3d ("perf stat: Fix per-socket output bug for uncore events")
Link: http://lkml.kernel.org/r/1435820925-51091-1-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
tools/perf/builtin-stat.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 5098f144b92d..df4784df26b3 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -945,7 +945,7 @@ static void abs_printout(int cpu, int nr, struct perf_evsel *evsel, double avg)
static void print_aggr(char *prefix)
{
struct perf_evsel *counter;
- int cpu, cpu2, s, s2, id, nr;
+ int cpu, s, s2, id, nr;
u64 ena, run, val;
if (!(aggr_map || aggr_get_id))
@@ -957,8 +957,7 @@ static void print_aggr(char *prefix)
val = ena = run = 0;
nr = 0;
for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
- cpu2 = perf_evsel__cpus(counter)->map[cpu];
- s2 = aggr_get_id(evsel_list->cpus, cpu2);
+ s2 = aggr_get_id(perf_evsel__cpus(counter), cpu);
if (s2 != id)
continue;
val += counter->counts->cpu[cpu].val;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 022/123] perf header: Fixup reading of HEADER_NRCPUS feature
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (20 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 021/123] perf stat: Get correct cpu id for print_aggr Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 023/123] hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for most chips Jiri Slaby
` (102 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Borislav Petkov, David Ahern, Frederic Weisbecker, Jiri Olsa,
Kan Liang, Stephane Eranian, Wang Nan, Jiri Slaby
From: Arnaldo Carvalho de Melo <acme@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit caa470475d9b59eeff093ae650800d34612c4379 upstream.
The original patch introducing this header wrote the number of CPUs available
and online in one order and then swapped those values when reading, fix it.
Before:
# perf record usleep 1
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 4
# nrcpus avail : 4
# echo 0 > /sys/devices/system/cpu/cpu2/online
# perf record usleep 1
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 4
# nrcpus avail : 3
# echo 0 > /sys/devices/system/cpu/cpu1/online
# perf record usleep 1
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 4
# nrcpus avail : 2
After the fix, bringing back the CPUs online:
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 2
# nrcpus avail : 4
# echo 1 > /sys/devices/system/cpu/cpu2/online
# perf record usleep 1
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 3
# nrcpus avail : 4
# echo 1 > /sys/devices/system/cpu/cpu1/online
# perf record usleep 1
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 4
# nrcpus avail : 4
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: fbe96f29ce4b ("perf tools: Make perf.data more self-descriptive (v8)")
Link: http://lkml.kernel.org/r/20150911153323.GP23511@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
| 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--git a/tools/perf/util/header.c b/tools/perf/util/header.c
index c3e5a3b817ab..3f82a2f65a65 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1718,7 +1718,7 @@ static int process_nrcpus(struct perf_file_section *section __maybe_unused,
if (ph->needs_swap)
nr = bswap_32(nr);
- ph->env.nr_cpus_online = nr;
+ ph->env.nr_cpus_avail = nr;
ret = readn(fd, &nr, sizeof(nr));
if (ret != sizeof(nr))
@@ -1727,7 +1727,7 @@ static int process_nrcpus(struct perf_file_section *section __maybe_unused,
if (ph->needs_swap)
nr = bswap_32(nr);
- ph->env.nr_cpus_avail = nr;
+ ph->env.nr_cpus_online = nr;
return 0;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 023/123] hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for most chips
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (21 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 022/123] perf header: Fixup reading of HEADER_NRCPUS feature Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 024/123] ARM: fix Thumb2 signal handling when ARMv6 is enabled Jiri Slaby
` (101 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Guenter Roeck, Jiri Slaby
From: Guenter Roeck <linux@roeck-us.net>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 728d29400488d54974d3317fe8a232b45fdb42ee upstream.
The STEP_UP_TIME and STEP_DOWN_TIME registers are swapped for all chips but
NCT6775.
Reported-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/hwmon/nct6775.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index b6d28439f1b9..96dc7e7a58e3 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -348,6 +348,10 @@ static const u16 NCT6775_REG_TEMP_CRIT[ARRAY_SIZE(nct6775_temp_label) - 1]
/* NCT6776 specific data */
+/* STEP_UP_TIME and STEP_DOWN_TIME regs are swapped for all chips but NCT6775 */
+#define NCT6776_REG_FAN_STEP_UP_TIME NCT6775_REG_FAN_STEP_DOWN_TIME
+#define NCT6776_REG_FAN_STEP_DOWN_TIME NCT6775_REG_FAN_STEP_UP_TIME
+
static const s8 NCT6776_ALARM_BITS[] = {
0, 1, 2, 3, 8, 21, 20, 16, /* in0.. in7 */
17, -1, -1, -1, -1, -1, -1, /* in8..in14 */
@@ -3492,8 +3496,8 @@ static int nct6775_probe(struct platform_device *pdev)
data->REG_FAN_PULSES = NCT6776_REG_FAN_PULSES;
data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT;
data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME;
- data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME;
- data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME;
+ data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME;
+ data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME;
data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H;
data->REG_PWM[0] = NCT6775_REG_PWM;
data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT;
@@ -3562,8 +3566,8 @@ static int nct6775_probe(struct platform_device *pdev)
data->REG_FAN_PULSES = NCT6779_REG_FAN_PULSES;
data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT;
data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME;
- data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME;
- data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME;
+ data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME;
+ data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME;
data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H;
data->REG_PWM[0] = NCT6775_REG_PWM;
data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT;
@@ -3636,8 +3640,8 @@ static int nct6775_probe(struct platform_device *pdev)
data->REG_FAN_PULSES = NCT6779_REG_FAN_PULSES;
data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT;
data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME;
- data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME;
- data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME;
+ data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME;
+ data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME;
data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H;
data->REG_PWM[0] = NCT6775_REG_PWM;
data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 024/123] ARM: fix Thumb2 signal handling when ARMv6 is enabled
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (22 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 023/123] hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for most chips Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 025/123] ARM: 8429/1: disable GCC SRA optimization Jiri Slaby
` (100 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Russell King, 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 9b55613f42e8d40d5c9ccb8970bde6af4764b2ab upstream.
When a kernel is built covering ARMv6 to ARMv7, we omit to clear the
IT state when entering a signal handler. This can cause the first
few instructions to be conditionally executed depending on the parent
context.
In any case, the original test for >= ARMv7 is broken - ARMv6 can have
Thumb-2 support as well, and an ARMv6T2 specific build would omit this
code too.
Relax the test back to ARMv6 or greater. This results in us always
clearing the IT state bits in the PSR, even on CPUs where these bits
are reserved. However, they're reserved for the IT state, so this
should cause no harm.
Fixes: d71e1352e240 ("Clear the IT state when invoking a Thumb-2 signal handler")
Acked-by: Tony Lindgren <tony@atomide.com>
Tested-by: H. Nikolaus Schaller <hns@goldelico.com>
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/arm/kernel/signal.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 1aa5ecdd1b3d..ab5b238ba59a 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -375,12 +375,17 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
*/
thumb = handler & 1;
-#if __LINUX_ARM_ARCH__ >= 7
+#if __LINUX_ARM_ARCH__ >= 6
/*
- * Clear the If-Then Thumb-2 execution state
- * ARM spec requires this to be all 000s in ARM mode
- * Snapdragon S4/Krait misbehaves on a Thumb=>ARM
- * signal transition without this.
+ * Clear the If-Then Thumb-2 execution state. ARM spec
+ * requires this to be all 000s in ARM mode. Snapdragon
+ * S4/Krait misbehaves on a Thumb=>ARM signal transition
+ * without this.
+ *
+ * We must do this whenever we are running on a Thumb-2
+ * capable CPU, which includes ARMv6T2. However, we elect
+ * to do this whenever we're on an ARMv6 or later CPU for
+ * simplicity.
*/
cpsr &= ~PSR_IT_MASK;
#endif
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 025/123] ARM: 8429/1: disable GCC SRA optimization
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (23 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 024/123] ARM: fix Thumb2 signal handling when ARMv6 is enabled Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 026/123] windfarm: decrement client count when unregistering Jiri Slaby
` (99 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Ard Biesheuvel, Russell King, Jiri Slaby
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a077224fd35b2f7fbc93f14cf67074fc792fbac2 upstream.
While working on the 32-bit ARM port of UEFI, I noticed a strange
corruption in the kernel log. The following snprintf() statement
(in drivers/firmware/efi/efi.c:efi_md_typeattr_format())
snprintf(pos, size, "|%3s|%2s|%2s|%2s|%3s|%2s|%2s|%2s|%2s]",
was producing the following output in the log:
| | | | | |WB|WT|WC|UC]
| | | | | |WB|WT|WC|UC]
| | | | | |WB|WT|WC|UC]
|RUN| | | | |WB|WT|WC|UC]*
|RUN| | | | |WB|WT|WC|UC]*
| | | | | |WB|WT|WC|UC]
|RUN| | | | |WB|WT|WC|UC]*
| | | | | |WB|WT|WC|UC]
|RUN| | | | | | | |UC]
|RUN| | | | | | | |UC]
As it turns out, this is caused by incorrect code being emitted for
the string() function in lib/vsprintf.c. The following code
if (!(spec.flags & LEFT)) {
while (len < spec.field_width--) {
if (buf < end)
*buf = ' ';
++buf;
}
}
for (i = 0; i < len; ++i) {
if (buf < end)
*buf = *s;
++buf; ++s;
}
while (len < spec.field_width--) {
if (buf < end)
*buf = ' ';
++buf;
}
when called with len == 0, triggers an issue in the GCC SRA optimization
pass (Scalar Replacement of Aggregates), which handles promotion of signed
struct members incorrectly. This is a known but as yet unresolved issue.
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932). In this particular
case, it is causing the second while loop to be executed erroneously a
single time, causing the additional space characters to be printed.
So disable the optimization by passing -fno-ipa-sra.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/arm/Makefile | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index db50b626be98..a4254e8ab36c 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -55,6 +55,14 @@ endif
comma = ,
+#
+# The Scalar Replacement of Aggregates (SRA) optimization pass in GCC 4.9 and
+# later may result in code being generated that handles signed short and signed
+# char struct members incorrectly. So disable it.
+# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932)
+#
+KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra)
+
# This selects which instruction set is used.
# Note that GCC does not numerically define an architecture version
# macro, but instead defines a whole series of macros which makes
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 026/123] windfarm: decrement client count when unregistering
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (24 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 025/123] ARM: 8429/1: disable GCC SRA optimization Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 027/123] ARM: dts: omap5-uevm.dts: fix i2c5 pinctrl offsets Jiri Slaby
` (98 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Paul Bolle, Michael Ellerman, Jiri Slaby
From: Paul Bolle <pebolle@tiscali.nl>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit fe2b592173ff0274e70dc44d1d28c19bb995aa7c upstream.
wf_unregister_client() increments the client count when a client
unregisters. That is obviously incorrect. Decrement that client count
instead.
Fixes: 75722d3992f5 ("[PATCH] ppc64: Thermal control for SMU based machines")
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/macintosh/windfarm_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c
index 3ee198b65843..cc7ece1712b5 100644
--- a/drivers/macintosh/windfarm_core.c
+++ b/drivers/macintosh/windfarm_core.c
@@ -435,7 +435,7 @@ int wf_unregister_client(struct notifier_block *nb)
{
mutex_lock(&wf_lock);
blocking_notifier_chain_unregister(&wf_client_list, nb);
- wf_client_count++;
+ wf_client_count--;
if (wf_client_count == 0)
wf_stop_thread();
mutex_unlock(&wf_lock);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 027/123] ARM: dts: omap5-uevm.dts: fix i2c5 pinctrl offsets
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (25 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 026/123] windfarm: decrement client count when unregistering Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 028/123] dmaengine: dw: properly read DWC_PARAMS register Jiri Slaby
` (97 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Grazvydas Ignotas, Tony Lindgren, Jiri Slaby
From: Grazvydas Ignotas <notasas@gmail.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 1dbdad75074d16c3e3005180f81a01cdc04a7872 upstream.
The i2c5 pinctrl offsets are wrong. If the bootloader doesn't set the
pins up, communication with tca6424a doesn't work (controller timeouts)
and it is not possible to enable HDMI.
Fixes: 9be495c42609 ("ARM: dts: omap5-evm: Add I2c pinctrl data")
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/arm/boot/dts/omap5-uevm.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 65d7b601651c..542e21da2425 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -143,8 +143,8 @@
i2c5_pins: pinmux_i2c5_pins {
pinctrl-single,pins = <
- 0x184 (PIN_INPUT | MUX_MODE0) /* i2c5_scl */
- 0x186 (PIN_INPUT | MUX_MODE0) /* i2c5_sda */
+ 0x186 (PIN_INPUT | MUX_MODE0) /* i2c5_scl */
+ 0x188 (PIN_INPUT | MUX_MODE0) /* i2c5_sda */
>;
};
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 028/123] dmaengine: dw: properly read DWC_PARAMS register
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (26 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 027/123] ARM: dts: omap5-uevm.dts: fix i2c5 pinctrl offsets Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 029/123] x86/apic: Serialize LVTT and TSC_DEADLINE writes Jiri Slaby
` (96 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Andy Shevchenko, yitian.bu, 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 6bea0f6d1c47b07be88dfd93f013ae05fcb3d8bf upstream.
In case we have less than maximum allowed channels (8) and autoconfiguration is
enabled the DWC_PARAMS read is wrong because it uses different arithmetic to
what is needed for channel priority setup.
Re-do the caclulations properly. This now works on AVR32 board well.
Fixes: fed2574b3c9f (dw_dmac: introduce software emulation of LLP transfers)
Cc: yitian.bu@tangramtek.com
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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index a8884b8aaa9e..c128aab076ab 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1585,7 +1585,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
INIT_LIST_HEAD(&dw->dma.channels);
for (i = 0; i < nr_channels; i++) {
struct dw_dma_chan *dwc = &dw->chan[i];
- int r = nr_channels - i - 1;
dwc->chan.device = &dw->dma;
dma_cookie_init(&dwc->chan);
@@ -1597,7 +1596,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
/* 7 is highest priority & 0 is lowest. */
if (pdata->chan_priority == CHAN_PRIORITY_ASCENDING)
- dwc->priority = r;
+ dwc->priority = nr_channels - i - 1;
else
dwc->priority = i;
@@ -1617,6 +1616,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
/* Hardware configuration */
if (autocfg) {
unsigned int dwc_params;
+ unsigned int r = DW_DMA_MAX_NR_CHANNELS - i - 1;
void __iomem *addr = chip->regs + r * sizeof(u32);
dwc_params = dma_read_byaddr(addr, DWC_PARAMS);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 029/123] x86/apic: Serialize LVTT and TSC_DEADLINE writes
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (27 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 028/123] dmaengine: dw: properly read DWC_PARAMS register Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 030/123] x86/platform: Fix Geode LX timekeeping in the generic x86 build Jiri Slaby
` (95 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Shaohua Li, Kernel-team, lenb, fenghua.yu,
Andi Kleen, H . Peter Anvin, Thomas Gleixner, Jiri Slaby
From: Shaohua Li <shli@fb.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 5d7c631d926b59aa16f3c56eaeb83f1036c81dc7 upstream.
The APIC LVTT register is MMIO mapped but the TSC_DEADLINE register is an
MSR. The write to the TSC_DEADLINE MSR is not serializing, so it's not
guaranteed that the write to LVTT has reached the APIC before the
TSC_DEADLINE MSR is written. In such a case the write to the MSR is
ignored and as a consequence the local timer interrupt never fires.
The SDM decribes this issue for xAPIC and x2APIC modes. The
serialization methods recommended by the SDM differ.
xAPIC:
"1. Memory-mapped write to LVT Timer Register, setting bits 18:17 to 10b.
2. WRMSR to the IA32_TSC_DEADLINE MSR a value much larger than current time-stamp counter.
3. If RDMSR of the IA32_TSC_DEADLINE MSR returns zero, go to step 2.
4. WRMSR to the IA32_TSC_DEADLINE MSR the desired deadline."
x2APIC:
"To allow for efficient access to the APIC registers in x2APIC mode,
the serializing semantics of WRMSR are relaxed when writing to the
APIC registers. Thus, system software should not use 'WRMSR to APIC
registers in x2APIC mode' as a serializing instruction. Read and write
accesses to the APIC registers will occur in program order. A WRMSR to
an APIC register may complete before all preceding stores are globally
visible; software can prevent this by inserting a serializing
instruction, an SFENCE, or an MFENCE before the WRMSR."
The xAPIC method is to just wait for the memory mapped write to hit
the LVTT by checking whether the MSR write has reached the hardware.
There is no reason why a proper MFENCE after the memory mapped write would
not do the same. Andi Kleen confirmed that MFENCE is sufficient for the
xAPIC case as well.
Issue MFENCE before writing to the TSC_DEADLINE MSR. This can be done
unconditionally as all CPUs which have TSC_DEADLINE also have MFENCE
support.
[ tglx: Massaged the changelog ]
Signed-off-by: Shaohua Li <shli@fb.com>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Cc: <Kernel-team@fb.com>
Cc: <lenb@kernel.org>
Cc: <fenghua.yu@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Link: http://lkml.kernel.org/r/20150909041352.GA2059853@devbig257.prn2.facebook.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/x86/kernel/apic/apic.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 7170f1738793..5c2742b75be1 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -351,6 +351,13 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
apic_write(APIC_LVTT, lvtt_value);
if (lvtt_value & APIC_LVT_TIMER_TSCDEADLINE) {
+ /*
+ * See Intel SDM: TSC-Deadline Mode chapter. In xAPIC mode,
+ * writing to the APIC LVTT and TSC_DEADLINE MSR isn't serialized.
+ * According to Intel, MFENCE can do the serialization here.
+ */
+ asm volatile("mfence" : : : "memory");
+
printk_once(KERN_DEBUG "TSC deadline timer enabled\n");
return;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 030/123] x86/platform: Fix Geode LX timekeeping in the generic x86 build
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (28 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 029/123] x86/apic: Serialize LVTT and TSC_DEADLINE writes Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 031/123] x86/mm: Set NX on gap between __ex_table and rodata Jiri Slaby
` (94 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, David Woodhouse, David Woodhouse, Andres Salomon,
Linus Torvalds, Marcelo Tosatti, Peter Zijlstra, Thomas Gleixner,
Ingo Molnar, Jiri Slaby
From: David Woodhouse <dwmw2@infradead.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 03da3ff1cfcd7774c8780d2547ba0d995f7dc03d upstream.
In 2007, commit 07190a08eef36 ("Mark TSC on GeodeLX reliable")
bypassed verification of the TSC on Geode LX. However, this code
(now in the check_system_tsc_reliable() function in
arch/x86/kernel/tsc.c) was only present if CONFIG_MGEODE_LX was
set.
OpenWRT has recently started building its generic Geode target
for Geode GX, not LX, to include support for additional
platforms. This broke the timekeeping on LX-based devices,
because the TSC wasn't marked as reliable:
https://dev.openwrt.org/ticket/20531
By adding a runtime check on is_geode_lx(), we can also include
the fix if CONFIG_MGEODEGX1 or CONFIG_X86_GENERIC are set, thus
fixing the problem.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marcelo Tosatti <marcelo@kvack.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1442409003.131189.87.camel@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/x86/kernel/tsc.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index cefe57ce4ebd..b40765803d05 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -20,6 +20,7 @@
#include <asm/hypervisor.h>
#include <asm/nmi.h>
#include <asm/x86_init.h>
+#include <asm/geode.h>
unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
EXPORT_SYMBOL(cpu_khz);
@@ -812,15 +813,17 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable);
static void __init check_system_tsc_reliable(void)
{
-#ifdef CONFIG_MGEODE_LX
- /* RTSC counts during suspend */
+#if defined(CONFIG_MGEODEGX1) || defined(CONFIG_MGEODE_LX) || defined(CONFIG_X86_GENERIC)
+ if (is_geode_lx()) {
+ /* RTSC counts during suspend */
#define RTSC_SUSP 0x100
- unsigned long res_low, res_high;
+ unsigned long res_low, res_high;
- rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high);
- /* Geode_LX - the OLPC CPU has a very reliable TSC */
- if (res_low & RTSC_SUSP)
- tsc_clocksource_reliable = 1;
+ rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high);
+ /* Geode_LX - the OLPC CPU has a very reliable TSC */
+ if (res_low & RTSC_SUSP)
+ tsc_clocksource_reliable = 1;
+ }
#endif
if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE))
tsc_clocksource_reliable = 1;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 031/123] x86/mm: Set NX on gap between __ex_table and rodata
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (29 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 030/123] x86/platform: Fix Geode LX timekeeping in the generic x86 build Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 032/123] x86/xen: Support kexec/kdump in HVM guests by doing a soft reset Jiri Slaby
` (93 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Stephen Smalley, Linus Torvalds, Mike Galbraith,
Peter Zijlstra, Thomas Gleixner, Ingo Molnar, Jiri Slaby
From: Stephen Smalley <sds@tycho.nsa.gov>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 upstream.
Unused space between the end of __ex_table and the start of
rodata can be left W+x in the kernel page tables. Extend the
setting of the NX bit to cover this gap by starting from
text_end rather than rodata_start.
Before:
---[ High Kernel Mapping ]---
0xffffffff80000000-0xffffffff81000000 16M pmd
0xffffffff81000000-0xffffffff81600000 6M ro PSE GLB x pmd
0xffffffff81600000-0xffffffff81754000 1360K ro GLB x pte
0xffffffff81754000-0xffffffff81800000 688K RW GLB x pte
0xffffffff81800000-0xffffffff81a00000 2M ro PSE GLB NX pmd
0xffffffff81a00000-0xffffffff81b3b000 1260K ro GLB NX pte
0xffffffff81b3b000-0xffffffff82000000 4884K RW GLB NX pte
0xffffffff82000000-0xffffffff82200000 2M RW PSE GLB NX pmd
0xffffffff82200000-0xffffffffa0000000 478M pmd
After:
---[ High Kernel Mapping ]---
0xffffffff80000000-0xffffffff81000000 16M pmd
0xffffffff81000000-0xffffffff81600000 6M ro PSE GLB x pmd
0xffffffff81600000-0xffffffff81754000 1360K ro GLB x pte
0xffffffff81754000-0xffffffff81800000 688K RW GLB NX pte
0xffffffff81800000-0xffffffff81a00000 2M ro PSE GLB NX pmd
0xffffffff81a00000-0xffffffff81b3b000 1260K ro GLB NX pte
0xffffffff81b3b000-0xffffffff82000000 4884K RW GLB NX pte
0xffffffff82000000-0xffffffff82200000 2M RW PSE GLB NX pmd
0xffffffff82200000-0xffffffffa0000000 478M pmd
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/1443704662-3138-1-git-send-email-sds@tycho.nsa.gov
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/x86/mm/init_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index b599241aea81..a93e32722ab1 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1131,7 +1131,7 @@ void mark_rodata_ro(void)
* has been zapped already via cleanup_highmem().
*/
all_end = roundup((unsigned long)_brk_end, PMD_SIZE);
- set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT);
+ set_memory_nx(text_end, (all_end - text_end) >> PAGE_SHIFT);
rodata_test();
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 032/123] x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (30 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 031/123] x86/mm: Set NX on gap between __ex_table and rodata Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 15:26 ` Luis Henriques
2015-10-28 13:50 ` [PATCH 3.12 033/123] arch: Clean up asm/barrier.h implementations using asm-generic/barrier.h Jiri Slaby
` (92 subsequent siblings)
124 siblings, 1 reply; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Vitaly Kuznetsov, David Vrabel, Jiri Slaby
From: Vitaly Kuznetsov <vkuznets@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 0b34a166f291d255755be46e43ed5497cdd194f2 upstream.
Currently there is a number of issues preventing PVHVM Xen guests from
doing successful kexec/kdump:
- Bound event channels.
- Registered vcpu_info.
- PIRQ/emuirq mappings.
- shared_info frame after XENMAPSPACE_shared_info operation.
- Active grant mappings.
Basically, newly booted kernel stumbles upon already set up Xen
interfaces and there is no way to reestablish them. In Xen-4.7 a new
feature called 'soft reset' is coming. A guest performing kexec/kdump
operation is supposed to call SCHEDOP_shutdown hypercall with
SHUTDOWN_soft_reset reason before jumping to new kernel. Hypervisor
(with some help from toolstack) will do full domain cleanup (but
keeping its memory and vCPU contexts intact) returning the guest to
the state it had when it was first booted and thus allowing it to
start over.
Doing SHUTDOWN_soft_reset on Xen hypervisors which don't support it is
probably OK as by default all unknown shutdown reasons cause domain
destroy with a message in toolstack log: 'Unknown shutdown reason code
5. Destroying domain.' which gives a clue to what the problem is and
eliminates false expectations.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/x86/xen/enlighten.c | 23 +++++++++++++++++++++++
include/xen/interface/sched.h | 8 ++++++++
2 files changed, 31 insertions(+)
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 2cbc2f2cf43e..aa82317de9c0 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -33,6 +33,10 @@
#include <linux/memblock.h>
#include <linux/edd.h>
+#ifdef CONFIG_KEXEC_CORE
+#include <linux/kexec.h>
+#endif
+
#include <xen/xen.h>
#include <xen/events.h>
#include <xen/interface/xen.h>
@@ -1746,6 +1750,21 @@ static struct notifier_block xen_hvm_cpu_notifier = {
.notifier_call = xen_hvm_cpu_notify,
};
+#ifdef CONFIG_KEXEC_CORE
+static void xen_hvm_shutdown(void)
+{
+ native_machine_shutdown();
+ if (kexec_in_progress)
+ xen_reboot(SHUTDOWN_soft_reset);
+}
+
+static void xen_hvm_crash_shutdown(struct pt_regs *regs)
+{
+ native_machine_crash_shutdown(regs);
+ xen_reboot(SHUTDOWN_soft_reset);
+}
+#endif
+
static void __init xen_hvm_guest_init(void)
{
init_hvm_pv_info();
@@ -1762,6 +1781,10 @@ static void __init xen_hvm_guest_init(void)
x86_init.irqs.intr_init = xen_init_IRQ;
xen_hvm_init_time_ops();
xen_hvm_init_mmu_ops();
+#ifdef CONFIG_KEXEC_CORE
+ machine_ops.shutdown = xen_hvm_shutdown;
+ machine_ops.crash_shutdown = xen_hvm_crash_shutdown;
+#endif
}
static uint32_t __init xen_hvm_platform(void)
diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h
index 9ce083960a25..f18490985fc8 100644
--- a/include/xen/interface/sched.h
+++ b/include/xen/interface/sched.h
@@ -107,5 +107,13 @@ struct sched_watchdog {
#define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */
#define SHUTDOWN_crash 3 /* Tell controller we've crashed. */
#define SHUTDOWN_watchdog 4 /* Restart because watchdog time expired. */
+/*
+ * Domain asked to perform 'soft reset' for it. The expected behavior is to
+ * reset internal Xen state for the domain returning it to the point where it
+ * was created but leaving the domain's memory contents and vCPU contexts
+ * intact. This will allow the domain to start over and set up all Xen specific
+ * interfaces again.
+ */
+#define SHUTDOWN_soft_reset 5
#endif /* __XEN_PUBLIC_SCHED_H__ */
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* Re: [PATCH 3.12 032/123] x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
2015-10-28 13:50 ` [PATCH 3.12 032/123] x86/xen: Support kexec/kdump in HVM guests by doing a soft reset Jiri Slaby
@ 2015-10-28 15:26 ` Luis Henriques
2015-10-28 15:37 ` Jiri Slaby
0 siblings, 1 reply; 134+ messages in thread
From: Luis Henriques @ 2015-10-28 15:26 UTC (permalink / raw)
To: Jiri Slaby; +Cc: stable, linux-kernel, Vitaly Kuznetsov, David Vrabel
On Wed, Oct 28, 2015 at 02:50:49PM +0100, Jiri Slaby wrote:
...
> #include <linux/memblock.h>
> #include <linux/edd.h>
>
> +#ifdef CONFIG_KEXEC_CORE
As already suggested by David Vrabel, this should be CONFIG_KEXEC for
kernels <= 4.2, and not CONFIG_KEXEC_CORE.
Cheers,
--
Lu�s
> +#include <linux/kexec.h>
> +#endif
> +
> #include <xen/xen.h>
> #include <xen/events.h>
> #include <xen/interface/xen.h>
> @@ -1746,6 +1750,21 @@ static struct notifier_block xen_hvm_cpu_notifier = {
> .notifier_call = xen_hvm_cpu_notify,
> };
>
> +#ifdef CONFIG_KEXEC_CORE
> +static void xen_hvm_shutdown(void)
> +{
> + native_machine_shutdown();
> + if (kexec_in_progress)
> + xen_reboot(SHUTDOWN_soft_reset);
> +}
> +
> +static void xen_hvm_crash_shutdown(struct pt_regs *regs)
> +{
> + native_machine_crash_shutdown(regs);
> + xen_reboot(SHUTDOWN_soft_reset);
> +}
> +#endif
> +
> static void __init xen_hvm_guest_init(void)
> {
> init_hvm_pv_info();
> @@ -1762,6 +1781,10 @@ static void __init xen_hvm_guest_init(void)
> x86_init.irqs.intr_init = xen_init_IRQ;
> xen_hvm_init_time_ops();
> xen_hvm_init_mmu_ops();
> +#ifdef CONFIG_KEXEC_CORE
> + machine_ops.shutdown = xen_hvm_shutdown;
> + machine_ops.crash_shutdown = xen_hvm_crash_shutdown;
> +#endif
> }
>
> static uint32_t __init xen_hvm_platform(void)
> diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h
> index 9ce083960a25..f18490985fc8 100644
> --- a/include/xen/interface/sched.h
> +++ b/include/xen/interface/sched.h
> @@ -107,5 +107,13 @@ struct sched_watchdog {
> #define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */
> #define SHUTDOWN_crash 3 /* Tell controller we've crashed. */
> #define SHUTDOWN_watchdog 4 /* Restart because watchdog time expired. */
> +/*
> + * Domain asked to perform 'soft reset' for it. The expected behavior is to
> + * reset internal Xen state for the domain returning it to the point where it
> + * was created but leaving the domain's memory contents and vCPU contexts
> + * intact. This will allow the domain to start over and set up all Xen specific
> + * interfaces again.
> + */
> +#define SHUTDOWN_soft_reset 5
>
> #endif /* __XEN_PUBLIC_SCHED_H__ */
> --
> 2.6.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: [PATCH 3.12 032/123] x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
2015-10-28 15:26 ` Luis Henriques
@ 2015-10-28 15:37 ` Jiri Slaby
0 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 15:37 UTC (permalink / raw)
To: Luis Henriques; +Cc: stable, linux-kernel, Vitaly Kuznetsov, David Vrabel
On 10/28/2015, 04:26 PM, Luis Henriques wrote:
> On Wed, Oct 28, 2015 at 02:50:49PM +0100, Jiri Slaby wrote:
> ...
>> #include <linux/memblock.h>
>> #include <linux/edd.h>
>>
>> +#ifdef CONFIG_KEXEC_CORE
>
> As already suggested by David Vrabel, this should be CONFIG_KEXEC for
> kernels <= 4.2, and not CONFIG_KEXEC_CORE.
Fixed. Thanks!
--
js
suse labs
^ permalink raw reply [flat|nested] 134+ messages in thread
* [PATCH 3.12 033/123] arch: Clean up asm/barrier.h implementations using asm-generic/barrier.h
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (31 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 032/123] x86/xen: Support kexec/kdump in HVM guests by doing a soft reset Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 034/123] arch: Move smp_mb__{before,after}_atomic_{inc,dec}.h into asm/atomic.h Jiri Slaby
` (91 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Peter Zijlstra, Michael Ellerman, Michael Neuling,
Russell King, Heiko Carstens, Linus Torvalds, Martin Schwidefsky,
Victor Kaplansky, Tony Luck, Oleg Nesterov,
Benjamin Herrenschmidt, Frederic Weisbecker, Ingo Molnar,
Jiri Slaby
From: Peter Zijlstra <peterz@infradead.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 93ea02bb84354370e51de803a9405f171f3edf88 upstream.
We're going to be adding a few new barrier primitives, and in order to
avoid endless duplication make more agressive use of
asm-generic/barrier.h.
Change the asm-generic/barrier.h such that it allows partial barrier
definitions and fills out the rest with defaults.
There are a few architectures (m32r, m68k) that could probably
do away with their barrier.h file entirely but are kept for now due to
their unconventional nop() implementation.
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Michael Ellerman <michael@ellerman.id.au>
Cc: Michael Neuling <mikey@neuling.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Victor Kaplansky <VICTORK@il.ibm.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/20131213150640.846368594@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/alpha/include/asm/barrier.h | 25 +++--------
arch/arc/include/asm/Kbuild | 1 +
arch/avr32/include/asm/barrier.h | 17 +++-----
arch/blackfin/include/asm/barrier.h | 18 +-------
arch/cris/include/asm/Kbuild | 1 +
arch/cris/include/asm/barrier.h | 25 -----------
arch/frv/include/asm/barrier.h | 8 +---
arch/hexagon/include/asm/Kbuild | 1 +
arch/m32r/include/asm/barrier.h | 80 +----------------------------------
arch/m68k/include/asm/barrier.h | 14 +-----
arch/microblaze/include/asm/Kbuild | 1 +
arch/microblaze/include/asm/barrier.h | 27 ------------
arch/mn10300/include/asm/Kbuild | 1 +
arch/mn10300/include/asm/barrier.h | 37 ----------------
arch/parisc/include/asm/Kbuild | 1 +
arch/parisc/include/asm/barrier.h | 35 ---------------
arch/score/include/asm/Kbuild | 1 +
arch/score/include/asm/barrier.h | 16 -------
arch/sh/include/asm/barrier.h | 21 ++-------
arch/sparc/include/asm/barrier_32.h | 12 +-----
arch/tile/include/asm/barrier.h | 68 +----------------------------
arch/unicore32/include/asm/barrier.h | 11 +----
arch/xtensa/include/asm/barrier.h | 9 +---
include/asm-generic/barrier.h | 42 ++++++++++++------
24 files changed, 58 insertions(+), 414 deletions(-)
delete mode 100644 arch/cris/include/asm/barrier.h
delete mode 100644 arch/microblaze/include/asm/barrier.h
delete mode 100644 arch/mn10300/include/asm/barrier.h
delete mode 100644 arch/parisc/include/asm/barrier.h
delete mode 100644 arch/score/include/asm/barrier.h
diff --git a/arch/alpha/include/asm/barrier.h b/arch/alpha/include/asm/barrier.h
index ce8860a0b32d..3832bdb794fe 100644
--- a/arch/alpha/include/asm/barrier.h
+++ b/arch/alpha/include/asm/barrier.h
@@ -3,33 +3,18 @@
#include <asm/compiler.h>
-#define mb() \
-__asm__ __volatile__("mb": : :"memory")
+#define mb() __asm__ __volatile__("mb": : :"memory")
+#define rmb() __asm__ __volatile__("mb": : :"memory")
+#define wmb() __asm__ __volatile__("wmb": : :"memory")
-#define rmb() \
-__asm__ __volatile__("mb": : :"memory")
-
-#define wmb() \
-__asm__ __volatile__("wmb": : :"memory")
-
-#define read_barrier_depends() \
-__asm__ __volatile__("mb": : :"memory")
+#define read_barrier_depends() __asm__ __volatile__("mb": : :"memory")
#ifdef CONFIG_SMP
#define __ASM_SMP_MB "\tmb\n"
-#define smp_mb() mb()
-#define smp_rmb() rmb()
-#define smp_wmb() wmb()
-#define smp_read_barrier_depends() read_barrier_depends()
#else
#define __ASM_SMP_MB
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-#define smp_read_barrier_depends() do { } while (0)
#endif
-#define set_mb(var, value) \
-do { var = value; mb(); } while (0)
+#include <asm-generic/barrier.h>
#endif /* __BARRIER_H */
diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild
index d8dd660898b9..5c359cf55934 100644
--- a/arch/arc/include/asm/Kbuild
+++ b/arch/arc/include/asm/Kbuild
@@ -46,3 +46,4 @@ generic-y += ucontext.h
generic-y += user.h
generic-y += vga.h
generic-y += xor.h
+generic-y += barrier.h
diff --git a/arch/avr32/include/asm/barrier.h b/arch/avr32/include/asm/barrier.h
index 0961275373db..715100790fd0 100644
--- a/arch/avr32/include/asm/barrier.h
+++ b/arch/avr32/include/asm/barrier.h
@@ -8,22 +8,15 @@
#ifndef __ASM_AVR32_BARRIER_H
#define __ASM_AVR32_BARRIER_H
-#define nop() asm volatile("nop")
-
-#define mb() asm volatile("" : : : "memory")
-#define rmb() mb()
-#define wmb() asm volatile("sync 0" : : : "memory")
-#define read_barrier_depends() do { } while(0)
-#define set_mb(var, value) do { var = value; mb(); } while(0)
+/*
+ * Weirdest thing ever.. no full barrier, but it has a write barrier!
+ */
+#define wmb() asm volatile("sync 0" : : : "memory")
#ifdef CONFIG_SMP
# error "The AVR32 port does not support SMP"
-#else
-# define smp_mb() barrier()
-# define smp_rmb() barrier()
-# define smp_wmb() barrier()
-# define smp_read_barrier_depends() do { } while(0)
#endif
+#include <asm-generic/barrier.h>
#endif /* __ASM_AVR32_BARRIER_H */
diff --git a/arch/blackfin/include/asm/barrier.h b/arch/blackfin/include/asm/barrier.h
index ebb189507dd7..19283a16ac08 100644
--- a/arch/blackfin/include/asm/barrier.h
+++ b/arch/blackfin/include/asm/barrier.h
@@ -23,26 +23,10 @@
# define rmb() do { barrier(); smp_check_barrier(); } while (0)
# define wmb() do { barrier(); smp_mark_barrier(); } while (0)
# define read_barrier_depends() do { barrier(); smp_check_barrier(); } while (0)
-#else
-# define mb() barrier()
-# define rmb() barrier()
-# define wmb() barrier()
-# define read_barrier_depends() do { } while (0)
#endif
-#else /* !CONFIG_SMP */
-
-#define mb() barrier()
-#define rmb() barrier()
-#define wmb() barrier()
-#define read_barrier_depends() do { } while (0)
-
#endif /* !CONFIG_SMP */
-#define smp_mb() mb()
-#define smp_rmb() rmb()
-#define smp_wmb() wmb()
-#define set_mb(var, value) do { var = value; mb(); } while (0)
-#define smp_read_barrier_depends() read_barrier_depends()
+#include <asm-generic/barrier.h>
#endif /* _BLACKFIN_BARRIER_H */
diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild
index c8325455520e..497776e4777d 100644
--- a/arch/cris/include/asm/Kbuild
+++ b/arch/cris/include/asm/Kbuild
@@ -11,3 +11,4 @@ generic-y += module.h
generic-y += trace_clock.h
generic-y += vga.h
generic-y += xor.h
+generic-y += barrier.h
diff --git a/arch/cris/include/asm/barrier.h b/arch/cris/include/asm/barrier.h
deleted file mode 100644
index 198ad7fa6b25..000000000000
--- a/arch/cris/include/asm/barrier.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef __ASM_CRIS_BARRIER_H
-#define __ASM_CRIS_BARRIER_H
-
-#define nop() __asm__ __volatile__ ("nop");
-
-#define barrier() __asm__ __volatile__("": : :"memory")
-#define mb() barrier()
-#define rmb() mb()
-#define wmb() mb()
-#define read_barrier_depends() do { } while(0)
-#define set_mb(var, value) do { var = value; mb(); } while (0)
-
-#ifdef CONFIG_SMP
-#define smp_mb() mb()
-#define smp_rmb() rmb()
-#define smp_wmb() wmb()
-#define smp_read_barrier_depends() read_barrier_depends()
-#else
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-#define smp_read_barrier_depends() do { } while(0)
-#endif
-
-#endif /* __ASM_CRIS_BARRIER_H */
diff --git a/arch/frv/include/asm/barrier.h b/arch/frv/include/asm/barrier.h
index 06776ad9f5e9..abbef470154c 100644
--- a/arch/frv/include/asm/barrier.h
+++ b/arch/frv/include/asm/barrier.h
@@ -17,13 +17,7 @@
#define mb() asm volatile ("membar" : : :"memory")
#define rmb() asm volatile ("membar" : : :"memory")
#define wmb() asm volatile ("membar" : : :"memory")
-#define read_barrier_depends() do { } while (0)
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-#define smp_read_barrier_depends() do {} while(0)
-#define set_mb(var, value) \
- do { var = (value); barrier(); } while (0)
+#include <asm-generic/barrier.h>
#endif /* _ASM_BARRIER_H */
diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild
index 1da17caac23c..a214fa4502f0 100644
--- a/arch/hexagon/include/asm/Kbuild
+++ b/arch/hexagon/include/asm/Kbuild
@@ -53,3 +53,4 @@ generic-y += types.h
generic-y += ucontext.h
generic-y += unaligned.h
generic-y += xor.h
+generic-y += barrier.h
diff --git a/arch/m32r/include/asm/barrier.h b/arch/m32r/include/asm/barrier.h
index 6976621efd3f..1a40265e8d88 100644
--- a/arch/m32r/include/asm/barrier.h
+++ b/arch/m32r/include/asm/barrier.h
@@ -11,84 +11,6 @@
#define nop() __asm__ __volatile__ ("nop" : : )
-/*
- * Memory barrier.
- *
- * mb() prevents loads and stores being reordered across this point.
- * rmb() prevents loads being reordered across this point.
- * wmb() prevents stores being reordered across this point.
- */
-#define mb() barrier()
-#define rmb() mb()
-#define wmb() mb()
-
-/**
- * read_barrier_depends - Flush all pending reads that subsequents reads
- * depend on.
- *
- * No data-dependent reads from memory-like regions are ever reordered
- * over this barrier. All reads preceding this primitive are guaranteed
- * to access memory (but not necessarily other CPUs' caches) before any
- * reads following this primitive that depend on the data return by
- * any of the preceding reads. This primitive is much lighter weight than
- * rmb() on most CPUs, and is never heavier weight than is
- * rmb().
- *
- * These ordering constraints are respected by both the local CPU
- * and the compiler.
- *
- * Ordering is not guaranteed by anything other than these primitives,
- * not even by data dependencies. See the documentation for
- * memory_barrier() for examples and URLs to more information.
- *
- * For example, the following code would force ordering (the initial
- * value of "a" is zero, "b" is one, and "p" is "&a"):
- *
- * <programlisting>
- * CPU 0 CPU 1
- *
- * b = 2;
- * memory_barrier();
- * p = &b; q = p;
- * read_barrier_depends();
- * d = *q;
- * </programlisting>
- *
- *
- * because the read of "*q" depends on the read of "p" and these
- * two reads are separated by a read_barrier_depends(). However,
- * the following code, with the same initial values for "a" and "b":
- *
- * <programlisting>
- * CPU 0 CPU 1
- *
- * a = 2;
- * memory_barrier();
- * b = 3; y = b;
- * read_barrier_depends();
- * x = a;
- * </programlisting>
- *
- * does not enforce ordering, since there is no data dependency between
- * the read of "a" and the read of "b". Therefore, on some CPUs, such
- * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
- * in cases like this where there are no data dependencies.
- **/
-
-#define read_barrier_depends() do { } while (0)
-
-#ifdef CONFIG_SMP
-#define smp_mb() mb()
-#define smp_rmb() rmb()
-#define smp_wmb() wmb()
-#define smp_read_barrier_depends() read_barrier_depends()
-#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
-#else
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-#define smp_read_barrier_depends() do { } while (0)
-#define set_mb(var, value) do { var = value; barrier(); } while (0)
-#endif
+#include <asm-generic/barrier.h>
#endif /* _ASM_M32R_BARRIER_H */
diff --git a/arch/m68k/include/asm/barrier.h b/arch/m68k/include/asm/barrier.h
index 445ce22c23cb..15c5f77c1614 100644
--- a/arch/m68k/include/asm/barrier.h
+++ b/arch/m68k/include/asm/barrier.h
@@ -1,20 +1,8 @@
#ifndef _M68K_BARRIER_H
#define _M68K_BARRIER_H
-/*
- * Force strict CPU ordering.
- * Not really required on m68k...
- */
#define nop() do { asm volatile ("nop"); barrier(); } while (0)
-#define mb() barrier()
-#define rmb() barrier()
-#define wmb() barrier()
-#define read_barrier_depends() ((void)0)
-#define set_mb(var, value) ({ (var) = (value); wmb(); })
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-#define smp_read_barrier_depends() ((void)0)
+#include <asm-generic/barrier.h>
#endif /* _M68K_BARRIER_H */
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild
index d3c51a6a601d..9197b379d005 100644
--- a/arch/microblaze/include/asm/Kbuild
+++ b/arch/microblaze/include/asm/Kbuild
@@ -3,3 +3,4 @@ generic-y += clkdev.h
generic-y += exec.h
generic-y += trace_clock.h
generic-y += syscalls.h
+generic-y += barrier.h
diff --git a/arch/microblaze/include/asm/barrier.h b/arch/microblaze/include/asm/barrier.h
deleted file mode 100644
index df5be3e87044..000000000000
--- a/arch/microblaze/include/asm/barrier.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2006 Atmark Techno, Inc.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#ifndef _ASM_MICROBLAZE_BARRIER_H
-#define _ASM_MICROBLAZE_BARRIER_H
-
-#define nop() asm volatile ("nop")
-
-#define smp_read_barrier_depends() do {} while (0)
-#define read_barrier_depends() do {} while (0)
-
-#define mb() barrier()
-#define rmb() mb()
-#define wmb() mb()
-#define set_mb(var, value) do { var = value; mb(); } while (0)
-#define set_wmb(var, value) do { var = value; wmb(); } while (0)
-
-#define smp_mb() mb()
-#define smp_rmb() rmb()
-#define smp_wmb() wmb()
-
-#endif /* _ASM_MICROBLAZE_BARRIER_H */
diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild
index c5d767028306..a530bca92014 100644
--- a/arch/mn10300/include/asm/Kbuild
+++ b/arch/mn10300/include/asm/Kbuild
@@ -2,3 +2,4 @@
generic-y += clkdev.h
generic-y += exec.h
generic-y += trace_clock.h
+generic-y += barrier.h
diff --git a/arch/mn10300/include/asm/barrier.h b/arch/mn10300/include/asm/barrier.h
deleted file mode 100644
index 2bd97a5c8af7..000000000000
--- a/arch/mn10300/include/asm/barrier.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* MN10300 memory barrier definitions
- *
- * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
- */
-#ifndef _ASM_BARRIER_H
-#define _ASM_BARRIER_H
-
-#define nop() asm volatile ("nop")
-
-#define mb() asm volatile ("": : :"memory")
-#define rmb() mb()
-#define wmb() asm volatile ("": : :"memory")
-
-#ifdef CONFIG_SMP
-#define smp_mb() mb()
-#define smp_rmb() rmb()
-#define smp_wmb() wmb()
-#define set_mb(var, value) do { xchg(&var, value); } while (0)
-#else /* CONFIG_SMP */
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-#define set_mb(var, value) do { var = value; mb(); } while (0)
-#endif /* CONFIG_SMP */
-
-#define set_wmb(var, value) do { var = value; wmb(); } while (0)
-
-#define read_barrier_depends() do {} while (0)
-#define smp_read_barrier_depends() do {} while (0)
-
-#endif /* _ASM_BARRIER_H */
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild
index ff4c9faed546..827a8465a536 100644
--- a/arch/parisc/include/asm/Kbuild
+++ b/arch/parisc/include/asm/Kbuild
@@ -4,3 +4,4 @@ generic-y += word-at-a-time.h auxvec.h user.h cputime.h emergency-restart.h \
div64.h irq_regs.h kdebug.h kvm_para.h local64.h local.h param.h \
poll.h xor.h clkdev.h exec.h
generic-y += trace_clock.h
+generic-y += barrier.h
diff --git a/arch/parisc/include/asm/barrier.h b/arch/parisc/include/asm/barrier.h
deleted file mode 100644
index e77d834aa803..000000000000
--- a/arch/parisc/include/asm/barrier.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef __PARISC_BARRIER_H
-#define __PARISC_BARRIER_H
-
-/*
-** This is simply the barrier() macro from linux/kernel.h but when serial.c
-** uses tqueue.h uses smp_mb() defined using barrier(), linux/kernel.h
-** hasn't yet been included yet so it fails, thus repeating the macro here.
-**
-** PA-RISC architecture allows for weakly ordered memory accesses although
-** none of the processors use it. There is a strong ordered bit that is
-** set in the O-bit of the page directory entry. Operating systems that
-** can not tolerate out of order accesses should set this bit when mapping
-** pages. The O-bit of the PSW should also be set to 1 (I don't believe any
-** of the processor implemented the PSW O-bit). The PCX-W ERS states that
-** the TLB O-bit is not implemented so the page directory does not need to
-** have the O-bit set when mapping pages (section 3.1). This section also
-** states that the PSW Y, Z, G, and O bits are not implemented.
-** So it looks like nothing needs to be done for parisc-linux (yet).
-** (thanks to chada for the above comment -ggg)
-**
-** The __asm__ op below simple prevents gcc/ld from reordering
-** instructions across the mb() "call".
-*/
-#define mb() __asm__ __volatile__("":::"memory") /* barrier() */
-#define rmb() mb()
-#define wmb() mb()
-#define smp_mb() mb()
-#define smp_rmb() mb()
-#define smp_wmb() mb()
-#define smp_read_barrier_depends() do { } while(0)
-#define read_barrier_depends() do { } while(0)
-
-#define set_mb(var, value) do { var = value; mb(); } while (0)
-
-#endif /* __PARISC_BARRIER_H */
diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild
index e1c7bb999b06..825c7184fced 100644
--- a/arch/score/include/asm/Kbuild
+++ b/arch/score/include/asm/Kbuild
@@ -4,3 +4,4 @@ header-y +=
generic-y += clkdev.h
generic-y += trace_clock.h
generic-y += xor.h
+generic-y += barrier.h
diff --git a/arch/score/include/asm/barrier.h b/arch/score/include/asm/barrier.h
deleted file mode 100644
index 0eacb6471e6d..000000000000
--- a/arch/score/include/asm/barrier.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _ASM_SCORE_BARRIER_H
-#define _ASM_SCORE_BARRIER_H
-
-#define mb() barrier()
-#define rmb() barrier()
-#define wmb() barrier()
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-
-#define read_barrier_depends() do {} while (0)
-#define smp_read_barrier_depends() do {} while (0)
-
-#define set_mb(var, value) do {var = value; wmb(); } while (0)
-
-#endif /* _ASM_SCORE_BARRIER_H */
diff --git a/arch/sh/include/asm/barrier.h b/arch/sh/include/asm/barrier.h
index 72c103dae300..43715308b068 100644
--- a/arch/sh/include/asm/barrier.h
+++ b/arch/sh/include/asm/barrier.h
@@ -26,29 +26,14 @@
#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
#define mb() __asm__ __volatile__ ("synco": : :"memory")
#define rmb() mb()
-#define wmb() __asm__ __volatile__ ("synco": : :"memory")
+#define wmb() mb()
#define ctrl_barrier() __icbi(PAGE_OFFSET)
-#define read_barrier_depends() do { } while(0)
#else
-#define mb() __asm__ __volatile__ ("": : :"memory")
-#define rmb() mb()
-#define wmb() __asm__ __volatile__ ("": : :"memory")
#define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
-#define read_barrier_depends() do { } while(0)
-#endif
-
-#ifdef CONFIG_SMP
-#define smp_mb() mb()
-#define smp_rmb() rmb()
-#define smp_wmb() wmb()
-#define smp_read_barrier_depends() read_barrier_depends()
-#else
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-#define smp_read_barrier_depends() do { } while(0)
#endif
#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
+#include <asm-generic/barrier.h>
+
#endif /* __ASM_SH_BARRIER_H */
diff --git a/arch/sparc/include/asm/barrier_32.h b/arch/sparc/include/asm/barrier_32.h
index c1b76654ee76..ae69eda288f4 100644
--- a/arch/sparc/include/asm/barrier_32.h
+++ b/arch/sparc/include/asm/barrier_32.h
@@ -1,15 +1,7 @@
#ifndef __SPARC_BARRIER_H
#define __SPARC_BARRIER_H
-/* XXX Change this if we ever use a PSO mode kernel. */
-#define mb() __asm__ __volatile__ ("" : : : "memory")
-#define rmb() mb()
-#define wmb() mb()
-#define read_barrier_depends() do { } while(0)
-#define set_mb(__var, __value) do { __var = __value; mb(); } while(0)
-#define smp_mb() __asm__ __volatile__("":::"memory")
-#define smp_rmb() __asm__ __volatile__("":::"memory")
-#define smp_wmb() __asm__ __volatile__("":::"memory")
-#define smp_read_barrier_depends() do { } while(0)
+#include <asm/processor.h> /* for nop() */
+#include <asm-generic/barrier.h>
#endif /* !(__SPARC_BARRIER_H) */
diff --git a/arch/tile/include/asm/barrier.h b/arch/tile/include/asm/barrier.h
index a9a73da5865d..b5a05d050a8f 100644
--- a/arch/tile/include/asm/barrier.h
+++ b/arch/tile/include/asm/barrier.h
@@ -22,59 +22,6 @@
#include <arch/spr_def.h>
#include <asm/timex.h>
-/*
- * read_barrier_depends - Flush all pending reads that subsequents reads
- * depend on.
- *
- * No data-dependent reads from memory-like regions are ever reordered
- * over this barrier. All reads preceding this primitive are guaranteed
- * to access memory (but not necessarily other CPUs' caches) before any
- * reads following this primitive that depend on the data return by
- * any of the preceding reads. This primitive is much lighter weight than
- * rmb() on most CPUs, and is never heavier weight than is
- * rmb().
- *
- * These ordering constraints are respected by both the local CPU
- * and the compiler.
- *
- * Ordering is not guaranteed by anything other than these primitives,
- * not even by data dependencies. See the documentation for
- * memory_barrier() for examples and URLs to more information.
- *
- * For example, the following code would force ordering (the initial
- * value of "a" is zero, "b" is one, and "p" is "&a"):
- *
- * <programlisting>
- * CPU 0 CPU 1
- *
- * b = 2;
- * memory_barrier();
- * p = &b; q = p;
- * read_barrier_depends();
- * d = *q;
- * </programlisting>
- *
- * because the read of "*q" depends on the read of "p" and these
- * two reads are separated by a read_barrier_depends(). However,
- * the following code, with the same initial values for "a" and "b":
- *
- * <programlisting>
- * CPU 0 CPU 1
- *
- * a = 2;
- * memory_barrier();
- * b = 3; y = b;
- * read_barrier_depends();
- * x = a;
- * </programlisting>
- *
- * does not enforce ordering, since there is no data dependency between
- * the read of "a" and the read of "b". Therefore, on some CPUs, such
- * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
- * in cases like this where there are no data dependencies.
- */
-#define read_barrier_depends() do { } while (0)
-
#define __sync() __insn_mf()
#include <hv/syscall_public.h>
@@ -125,20 +72,7 @@ mb_incoherent(void)
#define mb() fast_mb()
#define iob() fast_iob()
-#ifdef CONFIG_SMP
-#define smp_mb() mb()
-#define smp_rmb() rmb()
-#define smp_wmb() wmb()
-#define smp_read_barrier_depends() read_barrier_depends()
-#else
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-#define smp_read_barrier_depends() do { } while (0)
-#endif
-
-#define set_mb(var, value) \
- do { var = value; mb(); } while (0)
+#include <asm-generic/barrier.h>
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_TILE_BARRIER_H */
diff --git a/arch/unicore32/include/asm/barrier.h b/arch/unicore32/include/asm/barrier.h
index a6620e5336b6..83d6a520f4bd 100644
--- a/arch/unicore32/include/asm/barrier.h
+++ b/arch/unicore32/include/asm/barrier.h
@@ -14,15 +14,6 @@
#define dsb() __asm__ __volatile__ ("" : : : "memory")
#define dmb() __asm__ __volatile__ ("" : : : "memory")
-#define mb() barrier()
-#define rmb() barrier()
-#define wmb() barrier()
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-#define read_barrier_depends() do { } while (0)
-#define smp_read_barrier_depends() do { } while (0)
-
-#define set_mb(var, value) do { var = value; smp_mb(); } while (0)
+#include <asm-generic/barrier.h>
#endif /* __UNICORE_BARRIER_H__ */
diff --git a/arch/xtensa/include/asm/barrier.h b/arch/xtensa/include/asm/barrier.h
index ef021677d536..e1ee6b51dfc5 100644
--- a/arch/xtensa/include/asm/barrier.h
+++ b/arch/xtensa/include/asm/barrier.h
@@ -9,21 +9,14 @@
#ifndef _XTENSA_SYSTEM_H
#define _XTENSA_SYSTEM_H
-#define smp_read_barrier_depends() do { } while(0)
-#define read_barrier_depends() do { } while(0)
-
#define mb() ({ __asm__ __volatile__("memw" : : : "memory"); })
#define rmb() barrier()
#define wmb() mb()
#ifdef CONFIG_SMP
#error smp_* not defined
-#else
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
#endif
-#define set_mb(var, value) do { var = value; mb(); } while (0)
+#include <asm-generic/barrier.h>
#endif /* _XTENSA_SYSTEM_H */
diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h
index 01613b382b0e..6f692f8ac664 100644
--- a/include/asm-generic/barrier.h
+++ b/include/asm-generic/barrier.h
@@ -1,4 +1,5 @@
-/* Generic barrier definitions, based on MN10300 definitions.
+/*
+ * Generic barrier definitions, originally based on MN10300 definitions.
*
* It should be possible to use these on really simple architectures,
* but it serves more as a starting point for new ports.
@@ -16,35 +17,50 @@
#ifndef __ASSEMBLY__
-#define nop() asm volatile ("nop")
+#include <linux/compiler.h>
+
+#ifndef nop
+#define nop() asm volatile ("nop")
+#endif
/*
- * Force strict CPU ordering.
- * And yes, this is required on UP too when we're talking
- * to devices.
+ * Force strict CPU ordering. And yes, this is required on UP too when we're
+ * talking to devices.
*
- * This implementation only contains a compiler barrier.
+ * Fall back to compiler barriers if nothing better is provided.
*/
-#define mb() asm volatile ("": : :"memory")
+#ifndef mb
+#define mb() barrier()
+#endif
+
+#ifndef rmb
#define rmb() mb()
-#define wmb() asm volatile ("": : :"memory")
+#endif
+
+#ifndef wmb
+#define wmb() mb()
+#endif
+
+#ifndef read_barrier_depends
+#define read_barrier_depends() do { } while (0)
+#endif
#ifdef CONFIG_SMP
#define smp_mb() mb()
#define smp_rmb() rmb()
#define smp_wmb() wmb()
+#define smp_read_barrier_depends() read_barrier_depends()
#else
#define smp_mb() barrier()
#define smp_rmb() barrier()
#define smp_wmb() barrier()
+#define smp_read_barrier_depends() do { } while (0)
#endif
-#define set_mb(var, value) do { var = value; mb(); } while (0)
-#define set_wmb(var, value) do { var = value; wmb(); } while (0)
-
-#define read_barrier_depends() do {} while (0)
-#define smp_read_barrier_depends() do {} while (0)
+#ifndef set_mb
+#define set_mb(var, value) do { (var) = (value); mb(); } while (0)
+#endif
#define smp_store_release(p, v) \
do { \
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 034/123] arch: Move smp_mb__{before,after}_atomic_{inc,dec}.h into asm/atomic.h
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (32 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 033/123] arch: Clean up asm/barrier.h implementations using asm-generic/barrier.h Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 035/123] arc,hexagon: Delete asm/barrier.h Jiri Slaby
` (90 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Peter Zijlstra, Linus Torvalds, Andrew Morton,
Thomas Gleixner, Paul E . McKenney, Ingo Molnar, Jiri Slaby
From: Peter Zijlstra <peterz@infradead.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 1de7da377bd880ff23917f78924d0e908329d978 upstream.
Move the barriers functions that depend on the atomic implementation
into the atomic implementation.
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Vineet Gupta <vgupta@synopsys.com> [for arch/arc bits]
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20131213150640.786183683@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/arc/include/asm/atomic.h | 5 +++++
arch/arc/include/asm/barrier.h | 5 -----
arch/hexagon/include/asm/atomic.h | 6 +++++-
arch/hexagon/include/asm/barrier.h | 4 ----
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/arc/include/asm/atomic.h b/arch/arc/include/asm/atomic.h
index 83f03ca6caf6..03e494f695d1 100644
--- a/arch/arc/include/asm/atomic.h
+++ b/arch/arc/include/asm/atomic.h
@@ -190,6 +190,11 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
#endif /* !CONFIG_ARC_HAS_LLSC */
+#define smp_mb__before_atomic_dec() barrier()
+#define smp_mb__after_atomic_dec() barrier()
+#define smp_mb__before_atomic_inc() barrier()
+#define smp_mb__after_atomic_inc() barrier()
+
/**
* __atomic_add_unless - add unless the number is a given value
* @v: pointer of type atomic_t
diff --git a/arch/arc/include/asm/barrier.h b/arch/arc/include/asm/barrier.h
index f6cb7c4ffb35..c32245c3d1e9 100644
--- a/arch/arc/include/asm/barrier.h
+++ b/arch/arc/include/asm/barrier.h
@@ -30,11 +30,6 @@
#define smp_wmb() barrier()
#endif
-#define smp_mb__before_atomic_dec() barrier()
-#define smp_mb__after_atomic_dec() barrier()
-#define smp_mb__before_atomic_inc() barrier()
-#define smp_mb__after_atomic_inc() barrier()
-
#define smp_read_barrier_depends() do { } while (0)
#endif
diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h
index 8a64ff2337f6..7aae4cb2a29a 100644
--- a/arch/hexagon/include/asm/atomic.h
+++ b/arch/hexagon/include/asm/atomic.h
@@ -160,8 +160,12 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
#define atomic_sub_and_test(i, v) (atomic_sub_return(i, (v)) == 0)
#define atomic_add_negative(i, v) (atomic_add_return(i, (v)) < 0)
-
#define atomic_inc_return(v) (atomic_add_return(1, v))
#define atomic_dec_return(v) (atomic_sub_return(1, v))
+#define smp_mb__before_atomic_dec() barrier()
+#define smp_mb__after_atomic_dec() barrier()
+#define smp_mb__before_atomic_inc() barrier()
+#define smp_mb__after_atomic_inc() barrier()
+
#endif
diff --git a/arch/hexagon/include/asm/barrier.h b/arch/hexagon/include/asm/barrier.h
index 1041a8e70ce8..4e863daea25b 100644
--- a/arch/hexagon/include/asm/barrier.h
+++ b/arch/hexagon/include/asm/barrier.h
@@ -29,10 +29,6 @@
#define smp_read_barrier_depends() barrier()
#define smp_wmb() barrier()
#define smp_mb() barrier()
-#define smp_mb__before_atomic_dec() barrier()
-#define smp_mb__after_atomic_dec() barrier()
-#define smp_mb__before_atomic_inc() barrier()
-#define smp_mb__after_atomic_inc() barrier()
/* Set a value and use a memory barrier. Used by the scheduler somewhere. */
#define set_mb(var, value) \
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 035/123] arc,hexagon: Delete asm/barrier.h
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (33 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 034/123] arch: Move smp_mb__{before,after}_atomic_{inc,dec}.h into asm/atomic.h Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 036/123] sched/core: Fix TASK_DEAD race in finish_task_switch() Jiri Slaby
` (89 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Peter Zijlstra, Linus Torvalds, Richard Kuo,
Vineet Gupta, linux-hexagon, Ingo Molnar, Jiri Slaby
From: Peter Zijlstra <peterz@infradead.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2ab08ee9f0a4eba27c7c4ce0b6d5118e8a18554b upstream.
Both already use asm-generic/barrier.h as per their
include/asm/Kbuild. Remove the stale files.
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/n/tip-c7vlkshl3tblim0o8z2p70kt@git.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Richard Kuo <rkuo@codeaurora.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: linux-hexagon@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/arc/include/asm/barrier.h | 37 -------------------------------------
arch/hexagon/include/asm/barrier.h | 37 -------------------------------------
2 files changed, 74 deletions(-)
delete mode 100644 arch/arc/include/asm/barrier.h
delete mode 100644 arch/hexagon/include/asm/barrier.h
diff --git a/arch/arc/include/asm/barrier.h b/arch/arc/include/asm/barrier.h
deleted file mode 100644
index c32245c3d1e9..000000000000
--- a/arch/arc/include/asm/barrier.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __ASM_BARRIER_H
-#define __ASM_BARRIER_H
-
-#ifndef __ASSEMBLY__
-
-/* TODO-vineetg: Need to see what this does, don't we need sync anywhere */
-#define mb() __asm__ __volatile__ ("" : : : "memory")
-#define rmb() mb()
-#define wmb() mb()
-#define set_mb(var, value) do { var = value; mb(); } while (0)
-#define set_wmb(var, value) do { var = value; wmb(); } while (0)
-#define read_barrier_depends() mb()
-
-/* TODO-vineetg verify the correctness of macros here */
-#ifdef CONFIG_SMP
-#define smp_mb() mb()
-#define smp_rmb() rmb()
-#define smp_wmb() wmb()
-#else
-#define smp_mb() barrier()
-#define smp_rmb() barrier()
-#define smp_wmb() barrier()
-#endif
-
-#define smp_read_barrier_depends() do { } while (0)
-
-#endif
-
-#endif
diff --git a/arch/hexagon/include/asm/barrier.h b/arch/hexagon/include/asm/barrier.h
deleted file mode 100644
index 4e863daea25b..000000000000
--- a/arch/hexagon/include/asm/barrier.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Memory barrier definitions for the Hexagon architecture
- *
- * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef _ASM_BARRIER_H
-#define _ASM_BARRIER_H
-
-#define rmb() barrier()
-#define read_barrier_depends() barrier()
-#define wmb() barrier()
-#define mb() barrier()
-#define smp_rmb() barrier()
-#define smp_read_barrier_depends() barrier()
-#define smp_wmb() barrier()
-#define smp_mb() barrier()
-
-/* Set a value and use a memory barrier. Used by the scheduler somewhere. */
-#define set_mb(var, value) \
- do { var = value; mb(); } while (0)
-
-#endif /* _ASM_BARRIER_H */
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 036/123] sched/core: Fix TASK_DEAD race in finish_task_switch()
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (34 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 035/123] arc,hexagon: Delete asm/barrier.h Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:50 ` [PATCH 3.12 037/123] spi: Fix documentation of spi_alloc_master() Jiri Slaby
` (88 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Peter Zijlstra, Thomas Gleixner, manfred,
will.deacon, Ingo Molnar, Jiri Slaby
From: Peter Zijlstra <peterz@infradead.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 95913d97914f44db2b81271c2e2ebd4d2ac2df83 upstream.
So the problem this patch is trying to address is as follows:
CPU0 CPU1
context_switch(A, B)
ttwu(A)
LOCK A->pi_lock
A->on_cpu == 0
finish_task_switch(A)
prev_state = A->state <-.
WMB |
A->on_cpu = 0; |
UNLOCK rq0->lock |
| context_switch(C, A)
`-- A->state = TASK_DEAD
prev_state == TASK_DEAD
put_task_struct(A)
context_switch(A, C)
finish_task_switch(A)
A->state == TASK_DEAD
put_task_struct(A)
The argument being that the WMB will allow the load of A->state on CPU0
to cross over and observe CPU1's store of A->state, which will then
result in a double-drop and use-after-free.
Now the comment states (and this was true once upon a long time ago)
that we need to observe A->state while holding rq->lock because that
will order us against the wakeup; however the wakeup will not in fact
acquire (that) rq->lock; it takes A->pi_lock these days.
We can obviously fix this by upgrading the WMB to an MB, but that is
expensive, so we'd rather avoid that.
The alternative this patch takes is: smp_store_release(&A->on_cpu, 0),
which avoids the MB on some archs, but not important ones like ARM.
Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: manfred@colorfullife.com
Cc: will.deacon@arm.com
Fixes: e4a52bcb9a18 ("sched: Remove rq->lock from the first half of ttwu()")
Link: http://lkml.kernel.org/r/20150929124509.GG3816@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
kernel/sched/core.c | 10 +++++-----
kernel/sched/sched.h | 5 +++--
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 45e90105a59c..0bcdceaca6e2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1873,11 +1873,11 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev)
* If a task dies, then it sets TASK_DEAD in tsk->state and calls
* schedule one last time. The schedule call will never return, and
* the scheduled task must drop that reference.
- * The test for TASK_DEAD must occur while the runqueue locks are
- * still held, otherwise prev could be scheduled on another cpu, die
- * there before we look at prev->state, and then the reference would
- * be dropped twice.
- * Manfred Spraul <manfred@colorfullife.com>
+ *
+ * We must observe prev->state before clearing prev->on_cpu (in
+ * finish_lock_switch), otherwise a concurrent wakeup can get prev
+ * running on another CPU and we could rave with its RUNNING -> DEAD
+ * transition, resulting in a double drop.
*/
prev_state = prev->state;
vtime_task_switch(prev);
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 4f310592b1ba..1a1cdc3783ed 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -845,9 +845,10 @@ static inline void finish_lock_switch(struct rq *rq, struct task_struct *prev)
* After ->on_cpu is cleared, the task can be moved to a different CPU.
* We must ensure this doesn't happen until the switch is completely
* finished.
+ *
+ * Pairs with the control dependency and rmb in try_to_wake_up().
*/
- smp_wmb();
- prev->on_cpu = 0;
+ smp_store_release(&prev->on_cpu, 0);
#endif
#ifdef CONFIG_DEBUG_SPINLOCK
/* this is a valid case when another task releases the spinlock */
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 037/123] spi: Fix documentation of spi_alloc_master()
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (35 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 036/123] sched/core: Fix TASK_DEAD race in finish_task_switch() Jiri Slaby
@ 2015-10-28 13:50 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 038/123] spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is disabled Jiri Slaby
` (87 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:50 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Guenter Roeck, Alexey Klimov, Mark Brown,
Jiri Slaby
From: Guenter Roeck <linux@roeck-us.net>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a394d635193b641f2c86ead5ada5b115d57c51f8 upstream.
Actually, spi_master_put() after spi_alloc_master() must _not_ be followed
by kfree(). The memory is already freed with the call to spi_master_put()
through spi_master_class, which registers a release function. Calling both
spi_master_put() and kfree() results in often nasty (and delayed) crashes
elsewhere in the kernel, often in the networking stack.
This reverts commit eb4af0f5349235df2e4a5057a72fc8962d00308a.
Link to patch and concerns: https://lkml.org/lkml/2012/9/3/269
or
http://lkml.iu.edu/hypermail/linux/kernel/1209.0/00790.html
Alexey Klimov: This revert becomes valid after
94c69f765f1b4a658d96905ec59928e3e3e07e6a when spi-imx.c
has been fixed and there is no need to call kfree() so comment
for spi_alloc_master() should be fixed.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/spi/spi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index d254477372b9..5ddda10472c6 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1087,8 +1087,7 @@ static struct class spi_master_class = {
*
* The caller is responsible for assigning the bus number and initializing
* the master's methods before calling spi_register_master(); and (after errors
- * adding the device) calling spi_master_put() and kfree() to prevent a memory
- * leak.
+ * adding the device) calling spi_master_put() to prevent a memory leak.
*/
struct spi_master *spi_alloc_master(struct device *dev, unsigned size)
{
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 038/123] spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is disabled
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (36 preceding siblings ...)
2015-10-28 13:50 ` [PATCH 3.12 037/123] spi: Fix documentation of spi_alloc_master() Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 039/123] mm: hugetlbfs: skip shared VMAs when unmapping private pages to satisfy a fault Jiri Slaby
` (86 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Tan Jui Nee, Mark Brown, Jiri Slaby
From: "Tan Jui Nee" <jui.nee.tan@intel.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 02bc933ebb59208f42c2e6305b2c17fd306f695d upstream.
On Intel Baytrail, there is case when interrupt handler get called, no SPI
message is captured. The RX FIFO is indeed empty when RX timeout pending
interrupt (SSSR_TINT) happens.
Use the BIOS version where both HSUART and SPI are on the same IRQ. Both
drivers are using IRQF_SHARED when calling the request_irq function. When
running two separate and independent SPI and HSUART application that
generate data traffic on both components, user will see messages like
below on the console:
pxa2xx-spi pxa2xx-spi.0: bad message state in interrupt handler
This commit will fix this by first checking Receiver Time-out Interrupt,
if it is disabled, ignore the request and return without servicing.
Signed-off-by: Tan Jui Nee <jui.nee.tan@intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/spi/spi-pxa2xx.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index d01ae4d353d4..bb4a919d2fdf 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -562,6 +562,10 @@ static irqreturn_t ssp_int(int irq, void *dev_id)
if (!(sccr1_reg & SSCR1_TIE))
mask &= ~SSSR_TFS;
+ /* Ignore RX timeout interrupt if it is disabled */
+ if (!(sccr1_reg & SSCR1_TINTE))
+ mask &= ~SSSR_TINT;
+
if (!(status & mask))
return IRQ_NONE;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 039/123] mm: hugetlbfs: skip shared VMAs when unmapping private pages to satisfy a fault
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (37 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 038/123] spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is disabled Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 040/123] ALSA: synth: Fix conflicting OSS device registration on AWE32 Jiri Slaby
` (85 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Mel Gorman, Andrea Arcangeli, Hugh Dickins,
Naoya Horiguchi, David Rientjes, Andrew Morton, Linus Torvalds,
Jiri Slaby
From: Mel Gorman <mgorman@techsingularity.net>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2f84a8990ebbe235c59716896e017c6b2ca1200f upstream.
SunDong reported the following on
https://bugzilla.kernel.org/show_bug.cgi?id=103841
I think I find a linux bug, I have the test cases is constructed. I
can stable recurring problems in fedora22(4.0.4) kernel version,
arch for x86_64. I construct transparent huge page, when the parent
and child process with MAP_SHARE, MAP_PRIVATE way to access the same
huge page area, it has the opportunity to lead to huge page copy on
write failure, and then it will munmap the child corresponding mmap
area, but then the child mmap area with VM_MAYSHARE attributes, child
process munmap this area can trigger VM_BUG_ON in set_vma_resv_flags
functions (vma - > vm_flags & VM_MAYSHARE).
There were a number of problems with the report (e.g. it's hugetlbfs that
triggers this, not transparent huge pages) but it was fundamentally
correct in that a VM_BUG_ON in set_vma_resv_flags() can be triggered that
looks like this
vma ffff8804651fd0d0 start 00007fc474e00000 end 00007fc475e00000
next ffff8804651fd018 prev ffff8804651fd188 mm ffff88046b1b1800
prot 8000000000000027 anon_vma (null) vm_ops ffffffff8182a7a0
pgoff 0 file ffff88106bdb9800 private_data (null)
flags: 0x84400fb(read|write|shared|mayread|maywrite|mayexec|mayshare|dontexpand|hugetlb)
------------
kernel BUG at mm/hugetlb.c:462!
SMP
Modules linked in: xt_pkttype xt_LOG xt_limit [..]
CPU: 38 PID: 26839 Comm: map Not tainted 4.0.4-default #1
Hardware name: Dell Inc. PowerEdge R810/0TT6JF, BIOS 2.7.4 04/26/2012
set_vma_resv_flags+0x2d/0x30
The VM_BUG_ON is correct because private and shared mappings have
different reservation accounting but the warning clearly shows that the
VMA is shared.
When a private COW fails to allocate a new page then only the process
that created the VMA gets the page -- all the children unmap the page.
If the children access that data in the future then they get killed.
The problem is that the same file is mapped shared and private. During
the COW, the allocation fails, the VMAs are traversed to unmap the other
private pages but a shared VMA is found and the bug is triggered. This
patch identifies such VMAs and skips them.
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Reported-by: SunDong <sund_sky@126.com>
Reviewed-by: Michal Hocko <mhocko@suse.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: David Rientjes <rientjes@google.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.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/hugetlb.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index c91c347bb3ea..a3a9676c65cf 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2605,6 +2605,14 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,
continue;
/*
+ * Shared VMAs have their own reserves and do not affect
+ * MAP_PRIVATE accounting but it is possible that a shared
+ * VMA is using the same page so check and skip such VMAs.
+ */
+ if (iter_vma->vm_flags & VM_MAYSHARE)
+ continue;
+
+ /*
* Unmap the page from other VMAs without their own reserves.
* They get marked to be SIGKILLed if they fault in these
* areas. This is because a future no-page fault on this VMA
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 040/123] ALSA: synth: Fix conflicting OSS device registration on AWE32
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (38 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 039/123] mm: hugetlbfs: skip shared VMAs when unmapping private pages to satisfy a fault Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 041/123] ALSA: hda - Apply SPDIF pin ctl to MacBookPro 12,1 Jiri Slaby
` (84 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 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 225db5762dc1a35b26850477ffa06e5cd0097243 upstream.
When OSS emulation is loaded on ISA SB AWE32 chip, we get now kernel
warnings like:
WARNING: CPU: 0 PID: 2791 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x51/0x80()
sysfs: cannot create duplicate filename '/devices/isa/sbawe.0/sound/card0/seq-oss-0-0'
It's because both emux synth and opl3 drivers try to register their
OSS device object with the same static index number 0. This hasn't
been a big problem until the recent rewrite of device management code
(that exposes sysfs at the same time), but it's been an obvious bug.
This patch works around it just by using a different index number of
emux synth object. There can be a more elegant way to fix, but it's
enough for now, as this code won't be touched so often, in anyway.
Reported-and-tested-by: Michael Shell <list1@michaelshell.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
sound/synth/emux/emux_oss.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c
index daf61abc3670..646b66703bd8 100644
--- a/sound/synth/emux/emux_oss.c
+++ b/sound/synth/emux/emux_oss.c
@@ -69,7 +69,8 @@ snd_emux_init_seq_oss(struct snd_emux *emu)
struct snd_seq_oss_reg *arg;
struct snd_seq_device *dev;
- if (snd_seq_device_new(emu->card, 0, SNDRV_SEQ_DEV_ID_OSS,
+ /* using device#1 here for avoiding conflicts with OPL3 */
+ if (snd_seq_device_new(emu->card, 1, SNDRV_SEQ_DEV_ID_OSS,
sizeof(struct snd_seq_oss_reg), &dev) < 0)
return;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 041/123] ALSA: hda - Apply SPDIF pin ctl to MacBookPro 12,1
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (39 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 040/123] ALSA: synth: Fix conflicting OSS device registration on AWE32 Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 042/123] ASoC: pxa: pxa2xx-ac97: fix dma requestor lines Jiri Slaby
` (83 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, John Flatness, Takashi Iwai, Jiri Slaby
From: John Flatness <john@zerocrates.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e8ff581f7ac2bc3b8886094b7ca635dcc4d1b0e9 upstream.
The MacBookPro 12,1 has the same setup as the 11 for controlling the
status of the optical audio light. Simply apply the existing workaround
to the subsystem ID for the 12,1.
[sorted the fixup entry by tiwai]
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=105401
Signed-off-by: John Flatness <john@zerocrates.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
sound/pci/hda/patch_cirrus.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 7b0aac9d27ca..3c90743fa50b 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -637,6 +637,7 @@ static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = {
SND_PCI_QUIRK(0x106b, 0x5e00, "MacBookPro 11,2", CS4208_MBP11),
SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6),
SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6),
+ SND_PCI_QUIRK(0x106b, 0x7b00, "MacBookPro 12,1", CS4208_MBP11),
{} /* terminator */
};
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 042/123] ASoC: pxa: pxa2xx-ac97: fix dma requestor lines
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (40 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 041/123] ALSA: hda - Apply SPDIF pin ctl to MacBookPro 12,1 Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 043/123] ASoC: fix broken pxa SoC support Jiri Slaby
` (82 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Robert Jarzmik, Mark Brown, Jiri Slaby
From: Robert Jarzmik <robert.jarzmik@free.fr>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8811191fdf7ed02ee07cb8469428158572d355a2 upstream.
PCM receive and transmit DMA requestor lines were reverted, breaking the
PCM playback interface for PXA platforms using the sound/soc/ variant
instead of the sound/arm variant.
The commit below shows the inversion in the requestor lines.
Fixes: d65a14587a9b ("ASoC: pxa: use snd_dmaengine_dai_dma_data")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
sound/soc/pxa/pxa2xx-ac97.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index f1059d999de6..ae939cf22ebd 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -49,7 +49,7 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
.reset = pxa2xx_ac97_cold_reset,
};
-static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 12;
+static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 11;
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
.addr = __PREG(PCDR),
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
@@ -57,7 +57,7 @@ static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
.filter_data = &pxa2xx_ac97_pcm_stereo_in_req,
};
-static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 11;
+static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 12;
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
.addr = __PREG(PCDR),
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 043/123] ASoC: fix broken pxa SoC support
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (41 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 042/123] ASoC: pxa: pxa2xx-ac97: fix dma requestor lines Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 044/123] ASoC: dwc: correct irq clear method Jiri Slaby
` (81 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Robert Jarzmik, Mark Brown, Jiri Slaby
From: Robert Jarzmik <robert.jarzmik@free.fr>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3c8f7710c1c44fb650bc29b6ef78ed8b60cfaa28 upstream.
The previous fix of pxa library support, which was introduced to fix the
library dependency, broke the previous SoC behavior, where a machine
code binding pxa2xx-ac97 with a coded relied on :
- sound/soc/pxa/pxa2xx-ac97.c
- sound/soc/codecs/XXX.c
For example, the mioa701_wm9713.c machine code is currently broken. The
"select ARM" statement wrongly selects the soc/arm/pxa2xx-ac97 for
compilation, as per an unfortunate fate SND_PXA2XX_AC97 is both declared
in sound/arm/Kconfig and sound/soc/pxa/Kconfig.
Fix this by ensuring that SND_PXA2XX_SOC correctly triggers the correct
pxa2xx-ac97 compilation.
Fixes: 846172dfe33c ("ASoC: fix SND_PXA2XX_LIB Kconfig warning")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
sound/arm/Kconfig | 15 ++++++++-------
sound/soc/pxa/Kconfig | 2 --
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig
index 885683a3b0bd..e0406211716b 100644
--- a/sound/arm/Kconfig
+++ b/sound/arm/Kconfig
@@ -9,6 +9,14 @@ menuconfig SND_ARM
Drivers that are implemented on ASoC can be found in
"ALSA for SoC audio support" section.
+config SND_PXA2XX_LIB
+ tristate
+ select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97
+ select SND_DMAENGINE_PCM
+
+config SND_PXA2XX_LIB_AC97
+ bool
+
if SND_ARM
config SND_ARMAACI
@@ -21,13 +29,6 @@ config SND_PXA2XX_PCM
tristate
select SND_PCM
-config SND_PXA2XX_LIB
- tristate
- select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97
-
-config SND_PXA2XX_LIB_AC97
- bool
-
config SND_PXA2XX_AC97
tristate "AC97 driver for the Intel PXA2xx chip"
depends on ARCH_PXA
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 4db74a083db1..dbaba4f4fa53 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -1,7 +1,6 @@
config SND_PXA2XX_SOC
tristate "SoC Audio for the Intel PXA2xx chip"
depends on ARCH_PXA
- select SND_ARM
select SND_PXA2XX_LIB
help
Say Y or M if you want to add support for codecs attached to
@@ -24,7 +23,6 @@ config SND_PXA2XX_AC97
config SND_PXA2XX_SOC_AC97
tristate
select AC97_BUS
- select SND_ARM
select SND_PXA2XX_LIB_AC97
select SND_SOC_AC97_BUS
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 044/123] ASoC: dwc: correct irq clear method
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (42 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 043/123] ASoC: fix broken pxa SoC support Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 045/123] btrfs: skip waiting on ordered range for special files Jiri Slaby
` (80 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Yitian Bu, Yitian Bu, Mark Brown, Jiri Slaby
From: Yitian Bu <buyitian@gmail.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4873867e5f2bd90faad861dd94865099fc3140f3 upstream.
from Designware I2S datasheet, tx/rx XRUN irq is cleared by
reading register TOR/ROR, rather than by writing into them.
Signed-off-by: Yitian Bu <yitian.bu@tangramtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
sound/soc/dwc/designware_i2s.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 2f6357578616..1b6cbbc95456 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -100,10 +100,10 @@ static inline void i2s_clear_irqs(struct dw_i2s_dev *dev, u32 stream)
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
for (i = 0; i < 4; i++)
- i2s_write_reg(dev->i2s_base, TOR(i), 0);
+ i2s_read_reg(dev->i2s_base, TOR(i));
} else {
for (i = 0; i < 4; i++)
- i2s_write_reg(dev->i2s_base, ROR(i), 0);
+ i2s_read_reg(dev->i2s_base, ROR(i));
}
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 045/123] btrfs: skip waiting on ordered range for special files
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (43 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 044/123] ASoC: dwc: correct irq clear method Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 046/123] Btrfs: fix read corruption of compressed and shared extents Jiri Slaby
` (79 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Jeff Mahoney, Jiri Slaby
From: Jeff Mahoney <jeffm@suse.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a30e577c96f59b1e1678ea5462432b09bf7d5cbc upstream.
In btrfs_evict_inode, we properly truncate the page cache for evicted
inodes but then we call btrfs_wait_ordered_range for every inode as well.
It's the right thing to do for regular files but results in incorrect
behavior for device inodes for block devices.
filemap_fdatawrite_range gets called with inode->i_mapping which gets
resolved to the block device inode before getting passed to
wbc_attach_fdatawrite_inode and ultimately to inode_to_bdi. What happens
next depends on whether there's an open file handle associated with the
inode. If there is, we write to the block device, which is unexpected
behavior. If there isn't, we through normally and inode->i_data is used.
We can also end up racing against open/close which can result in crashes
when i_mapping points to a block device inode that has been closed.
Since there can't be any page cache associated with special file inodes,
it's safe to skip the btrfs_wait_ordered_range call entirely and avoid
the problem.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=100911
Tested-by: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/btrfs/inode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 904ed6d7e4bb..50f08d5f9cbb 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4516,7 +4516,8 @@ void btrfs_evict_inode(struct inode *inode)
goto no_delete;
}
/* do we really want it for ->i_nlink > 0 and zero btrfs_root_refs? */
- btrfs_wait_ordered_range(inode, 0, (u64)-1);
+ if (!special_file(inode->i_mode))
+ btrfs_wait_ordered_range(inode, 0, (u64)-1);
if (root->fs_info->log_root_recovering) {
BUG_ON(test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM,
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 046/123] Btrfs: fix read corruption of compressed and shared extents
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (44 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 045/123] btrfs: skip waiting on ordered range for special files Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 047/123] Btrfs: update fix for " Jiri Slaby
` (78 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Filipe Manana, Jiri Slaby
From: Filipe Manana <fdmanana@suse.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 005efedf2c7d0a270ffbe28d8997b03844f3e3e7 upstream.
If a file has a range pointing to a compressed extent, followed by
another range that points to the same compressed extent and a read
operation attempts to read both ranges (either completely or part of
them), the pages that correspond to the second range are incorrectly
filled with zeroes.
Consider the following example:
File layout
[0 - 8K] [8K - 24K]
| |
| |
points to extent X, points to extent X,
offset 4K, length of 8K offset 0, length 16K
[extent X, compressed length = 4K uncompressed length = 16K]
If a readpages() call spans the 2 ranges, a single bio to read the extent
is submitted - extent_io.c:submit_extent_page() would only create a new
bio to cover the second range pointing to the extent if the extent it
points to had a different logical address than the extent associated with
the first range. This has a consequence of the compressed read end io
handler (compression.c:end_compressed_bio_read()) finish once the extent
is decompressed into the pages covering the first range, leaving the
remaining pages (belonging to the second range) filled with zeroes (done
by compression.c:btrfs_clear_biovec_end()).
So fix this by submitting the current bio whenever we find a range
pointing to a compressed extent that was preceded by a range with a
different extent map. This is the simplest solution for this corner
case. Making the end io callback populate both ranges (or more, if we
have multiple pointing to the same extent) is a much more complex
solution since each bio is tightly coupled with a single extent map and
the extent maps associated to the ranges pointing to the shared extent
can have different offsets and lengths.
The following test case for fstests triggers the issue:
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
rm -f $tmp.*
}
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
# real QA test starts here
_need_to_be_root
_supported_fs btrfs
_supported_os Linux
_require_scratch
_require_cloner
rm -f $seqres.full
test_clone_and_read_compressed_extent()
{
local mount_opts=$1
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount $mount_opts
# Create a test file with a single extent that is compressed (the
# data we write into it is highly compressible no matter which
# compression algorithm is used, zlib or lzo).
$XFS_IO_PROG -f -c "pwrite -S 0xaa 0K 4K" \
-c "pwrite -S 0xbb 4K 8K" \
-c "pwrite -S 0xcc 12K 4K" \
$SCRATCH_MNT/foo | _filter_xfs_io
# Now clone our extent into an adjacent offset.
$CLONER_PROG -s $((4 * 1024)) -d $((16 * 1024)) -l $((8 * 1024)) \
$SCRATCH_MNT/foo $SCRATCH_MNT/foo
# Same as before but for this file we clone the extent into a lower
# file offset.
$XFS_IO_PROG -f -c "pwrite -S 0xaa 8K 4K" \
-c "pwrite -S 0xbb 12K 8K" \
-c "pwrite -S 0xcc 20K 4K" \
$SCRATCH_MNT/bar | _filter_xfs_io
$CLONER_PROG -s $((12 * 1024)) -d 0 -l $((8 * 1024)) \
$SCRATCH_MNT/bar $SCRATCH_MNT/bar
echo "File digests before unmounting filesystem:"
md5sum $SCRATCH_MNT/foo | _filter_scratch
md5sum $SCRATCH_MNT/bar | _filter_scratch
# Evicting the inode or clearing the page cache before reading
# again the file would also trigger the bug - reads were returning
# all bytes in the range corresponding to the second reference to
# the extent with a value of 0, but the correct data was persisted
# (it was a bug exclusively in the read path). The issue happened
# only if the same readpages() call targeted pages belonging to the
# first and second ranges that point to the same compressed extent.
_scratch_remount
echo "File digests after mounting filesystem again:"
# Must match the same digests we got before.
md5sum $SCRATCH_MNT/foo | _filter_scratch
md5sum $SCRATCH_MNT/bar | _filter_scratch
}
echo -e "\nTesting with zlib compression..."
test_clone_and_read_compressed_extent "-o compress=zlib"
_scratch_unmount
echo -e "\nTesting with lzo compression..."
test_clone_and_read_compressed_extent "-o compress=lzo"
status=0
exit
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo<quwenruo@cn.fujitsu.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/btrfs/extent_io.c | 65 +++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 57 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 855f6668cb8e..6ac2bc1412c0 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2642,7 +2642,8 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree,
bio_end_io_t end_io_func,
int mirror_num,
unsigned long prev_bio_flags,
- unsigned long bio_flags)
+ unsigned long bio_flags,
+ bool force_bio_submit)
{
int ret = 0;
struct bio *bio;
@@ -2660,6 +2661,7 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree,
contig = bio_end_sector(bio) == sector;
if (prev_bio_flags != bio_flags || !contig ||
+ force_bio_submit ||
merge_bio(rw, tree, page, offset, page_size, bio, bio_flags) ||
bio_add_page(bio, page, page_size, offset) < page_size) {
ret = submit_one_bio(rw, bio, mirror_num,
@@ -2751,7 +2753,8 @@ static int __do_readpage(struct extent_io_tree *tree,
get_extent_t *get_extent,
struct extent_map **em_cached,
struct bio **bio, int mirror_num,
- unsigned long *bio_flags, int rw)
+ unsigned long *bio_flags, int rw,
+ u64 *prev_em_start)
{
struct inode *inode = page->mapping->host;
u64 start = page_offset(page);
@@ -2799,6 +2802,7 @@ static int __do_readpage(struct extent_io_tree *tree,
}
while (cur <= end) {
unsigned long pnr = (last_byte >> PAGE_CACHE_SHIFT) + 1;
+ bool force_bio_submit = false;
if (cur >= last_byte) {
char *userpage;
@@ -2849,6 +2853,49 @@ static int __do_readpage(struct extent_io_tree *tree,
block_start = em->block_start;
if (test_bit(EXTENT_FLAG_PREALLOC, &em->flags))
block_start = EXTENT_MAP_HOLE;
+
+ /*
+ * If we have a file range that points to a compressed extent
+ * and it's followed by a consecutive file range that points to
+ * to the same compressed extent (possibly with a different
+ * offset and/or length, so it either points to the whole extent
+ * or only part of it), we must make sure we do not submit a
+ * single bio to populate the pages for the 2 ranges because
+ * this makes the compressed extent read zero out the pages
+ * belonging to the 2nd range. Imagine the following scenario:
+ *
+ * File layout
+ * [0 - 8K] [8K - 24K]
+ * | |
+ * | |
+ * points to extent X, points to extent X,
+ * offset 4K, length of 8K offset 0, length 16K
+ *
+ * [extent X, compressed length = 4K uncompressed length = 16K]
+ *
+ * If the bio to read the compressed extent covers both ranges,
+ * it will decompress extent X into the pages belonging to the
+ * first range and then it will stop, zeroing out the remaining
+ * pages that belong to the other range that points to extent X.
+ * So here we make sure we submit 2 bios, one for the first
+ * range and another one for the third range. Both will target
+ * the same physical extent from disk, but we can't currently
+ * make the compressed bio endio callback populate the pages
+ * for both ranges because each compressed bio is tightly
+ * coupled with a single extent map, and each range can have
+ * an extent map with a different offset value relative to the
+ * uncompressed data of our extent and different lengths. This
+ * is a corner case so we prioritize correctness over
+ * non-optimal behavior (submitting 2 bios for the same extent).
+ */
+ if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags) &&
+ prev_em_start && *prev_em_start != (u64)-1 &&
+ *prev_em_start != em->orig_start)
+ force_bio_submit = true;
+
+ if (prev_em_start)
+ *prev_em_start = em->orig_start;
+
free_extent_map(em);
em = NULL;
@@ -2898,7 +2945,8 @@ static int __do_readpage(struct extent_io_tree *tree,
bdev, bio, pnr,
end_bio_extent_readpage, mirror_num,
*bio_flags,
- this_bio_flag);
+ this_bio_flag,
+ force_bio_submit);
if (!ret) {
nr++;
*bio_flags = this_bio_flag;
@@ -2930,6 +2978,7 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree,
struct inode *inode;
struct btrfs_ordered_extent *ordered;
int index;
+ u64 prev_em_start = (u64)-1;
inode = pages[0]->mapping->host;
while (1) {
@@ -2945,7 +2994,7 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree,
for (index = 0; index < nr_pages; index++) {
__do_readpage(tree, pages[index], get_extent, em_cached, bio,
- mirror_num, bio_flags, rw);
+ mirror_num, bio_flags, rw, &prev_em_start);
page_cache_release(pages[index]);
}
}
@@ -3013,7 +3062,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree,
}
ret = __do_readpage(tree, page, get_extent, NULL, bio, mirror_num,
- bio_flags, rw);
+ bio_flags, rw, NULL);
return ret;
}
@@ -3039,7 +3088,7 @@ int extent_read_full_page_nolock(struct extent_io_tree *tree, struct page *page,
int ret;
ret = __do_readpage(tree, page, get_extent, NULL, &bio, mirror_num,
- &bio_flags, READ);
+ &bio_flags, READ, NULL);
if (bio)
ret = submit_one_bio(READ, bio, mirror_num, bio_flags);
return ret;
@@ -3308,7 +3357,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
sector, iosize, pg_offset,
bdev, &epd->bio, max_nr,
end_bio_extent_writepage,
- 0, 0, 0);
+ 0, 0, 0, false);
if (ret)
SetPageError(page);
}
@@ -3479,7 +3528,7 @@ static int write_one_eb(struct extent_buffer *eb,
ret = submit_extent_page(rw, eb->tree, p, offset >> 9,
PAGE_CACHE_SIZE, 0, bdev, &epd->bio,
-1, end_bio_extent_buffer_writepage,
- 0, epd->bio_flags, bio_flags);
+ 0, epd->bio_flags, bio_flags, false);
epd->bio_flags = bio_flags;
if (ret) {
set_bit(EXTENT_BUFFER_IOERR, &eb->bflags);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 047/123] Btrfs: update fix for read corruption of compressed and shared extents
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (45 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 046/123] Btrfs: fix read corruption of compressed and shared extents Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 048/123] dm btree: add ref counting ops for the leaves of top level btrees Jiri Slaby
` (77 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Filipe Manana, Jiri Slaby
From: Filipe Manana <fdmanana@suse.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 808f80b46790f27e145c72112189d6a3be2bc884 upstream.
My previous fix in commit 005efedf2c7d ("Btrfs: fix read corruption of
compressed and shared extents") was effective only if the compressed
extents cover a file range with a length that is not a multiple of 16
pages. That's because the detection of when we reached a different range
of the file that shares the same compressed extent as the previously
processed range was done at extent_io.c:__do_contiguous_readpages(),
which covers subranges with a length up to 16 pages, because
extent_readpages() groups the pages in clusters no larger than 16 pages.
So fix this by tracking the start of the previously processed file
range's extent map at extent_readpages().
The following test case for fstests reproduces the issue:
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
rm -f $tmp.*
}
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
# real QA test starts here
_need_to_be_root
_supported_fs btrfs
_supported_os Linux
_require_scratch
_require_cloner
rm -f $seqres.full
test_clone_and_read_compressed_extent()
{
local mount_opts=$1
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount $mount_opts
# Create our test file with a single extent of 64Kb that is going to
# be compressed no matter which compression algo is used (zlib/lzo).
$XFS_IO_PROG -f -c "pwrite -S 0xaa 0K 64K" \
$SCRATCH_MNT/foo | _filter_xfs_io
# Now clone the compressed extent into an adjacent file offset.
$CLONER_PROG -s 0 -d $((64 * 1024)) -l $((64 * 1024)) \
$SCRATCH_MNT/foo $SCRATCH_MNT/foo
echo "File digest before unmount:"
md5sum $SCRATCH_MNT/foo | _filter_scratch
# Remount the fs or clear the page cache to trigger the bug in
# btrfs. Because the extent has an uncompressed length that is a
# multiple of 16 pages, all the pages belonging to the second range
# of the file (64K to 128K), which points to the same extent as the
# first range (0K to 64K), had their contents full of zeroes instead
# of the byte 0xaa. This was a bug exclusively in the read path of
# compressed extents, the correct data was stored on disk, btrfs
# just failed to fill in the pages correctly.
_scratch_remount
echo "File digest after remount:"
# Must match the digest we got before.
md5sum $SCRATCH_MNT/foo | _filter_scratch
}
echo -e "\nTesting with zlib compression..."
test_clone_and_read_compressed_extent "-o compress=zlib"
_scratch_unmount
echo -e "\nTesting with lzo compression..."
test_clone_and_read_compressed_extent "-o compress=lzo"
status=0
exit
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Tested-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/btrfs/extent_io.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 6ac2bc1412c0..85bcb25384c0 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2973,12 +2973,12 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree,
get_extent_t *get_extent,
struct extent_map **em_cached,
struct bio **bio, int mirror_num,
- unsigned long *bio_flags, int rw)
+ unsigned long *bio_flags, int rw,
+ u64 *prev_em_start)
{
struct inode *inode;
struct btrfs_ordered_extent *ordered;
int index;
- u64 prev_em_start = (u64)-1;
inode = pages[0]->mapping->host;
while (1) {
@@ -2994,7 +2994,7 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree,
for (index = 0; index < nr_pages; index++) {
__do_readpage(tree, pages[index], get_extent, em_cached, bio,
- mirror_num, bio_flags, rw, &prev_em_start);
+ mirror_num, bio_flags, rw, prev_em_start);
page_cache_release(pages[index]);
}
}
@@ -3004,7 +3004,8 @@ static void __extent_readpages(struct extent_io_tree *tree,
int nr_pages, get_extent_t *get_extent,
struct extent_map **em_cached,
struct bio **bio, int mirror_num,
- unsigned long *bio_flags, int rw)
+ unsigned long *bio_flags, int rw,
+ u64 *prev_em_start)
{
u64 start = 0;
u64 end = 0;
@@ -3025,7 +3026,7 @@ static void __extent_readpages(struct extent_io_tree *tree,
index - first_index, start,
end, get_extent, em_cached,
bio, mirror_num, bio_flags,
- rw);
+ rw, prev_em_start);
start = page_start;
end = start + PAGE_CACHE_SIZE - 1;
first_index = index;
@@ -3036,7 +3037,8 @@ static void __extent_readpages(struct extent_io_tree *tree,
__do_contiguous_readpages(tree, &pages[first_index],
index - first_index, start,
end, get_extent, em_cached, bio,
- mirror_num, bio_flags, rw);
+ mirror_num, bio_flags, rw,
+ prev_em_start);
}
static int __extent_read_full_page(struct extent_io_tree *tree,
@@ -3931,6 +3933,7 @@ int extent_readpages(struct extent_io_tree *tree,
struct page *page;
struct extent_map *em_cached = NULL;
int nr = 0;
+ u64 prev_em_start = (u64)-1;
for (page_idx = 0; page_idx < nr_pages; page_idx++) {
page = list_entry(pages->prev, struct page, lru);
@@ -3947,12 +3950,12 @@ int extent_readpages(struct extent_io_tree *tree,
if (nr < ARRAY_SIZE(pagepool))
continue;
__extent_readpages(tree, pagepool, nr, get_extent, &em_cached,
- &bio, 0, &bio_flags, READ);
+ &bio, 0, &bio_flags, READ, &prev_em_start);
nr = 0;
}
if (nr)
__extent_readpages(tree, pagepool, nr, get_extent, &em_cached,
- &bio, 0, &bio_flags, READ);
+ &bio, 0, &bio_flags, READ, &prev_em_start);
if (em_cached)
free_extent_map(em_cached);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 048/123] dm btree: add ref counting ops for the leaves of top level btrees
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (46 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 047/123] Btrfs: update fix for " Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 049/123] USB: option: add ZTE PIDs Jiri Slaby
` (76 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Joe Thornber, Mike Snitzer, Jiri Slaby
From: Joe Thornber <ejt@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b0dc3c8bc157c60b1d470163882be8c13e1950af upstream.
When using nested btrees, the top leaves of the top levels contain
block addresses for the root of the next tree down. If we shadow a
shared leaf node the leaf values (sub tree roots) should be incremented
accordingly.
This is only an issue if there is metadata sharing in the top levels.
Which only occurs if metadata snapshots are being used (as is possible
with dm-thinp). And could result in a block from the thinp metadata
snap being reused early, thus corrupting the thinp metadata snap.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/md/persistent-data/dm-btree-internal.h | 6 +++++
drivers/md/persistent-data/dm-btree-remove.c | 12 +++------
drivers/md/persistent-data/dm-btree-spine.c | 37 ++++++++++++++++++++++++++
drivers/md/persistent-data/dm-btree.c | 7 +----
4 files changed, 47 insertions(+), 15 deletions(-)
diff --git a/drivers/md/persistent-data/dm-btree-internal.h b/drivers/md/persistent-data/dm-btree-internal.h
index bf2b80d5c470..8731b6ea026b 100644
--- a/drivers/md/persistent-data/dm-btree-internal.h
+++ b/drivers/md/persistent-data/dm-btree-internal.h
@@ -138,4 +138,10 @@ int lower_bound(struct btree_node *n, uint64_t key);
extern struct dm_block_validator btree_node_validator;
+/*
+ * Value type for upper levels of multi-level btrees.
+ */
+extern void init_le64_type(struct dm_transaction_manager *tm,
+ struct dm_btree_value_type *vt);
+
#endif /* DM_BTREE_INTERNAL_H */
diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c
index a03178e91a79..7c0d75547ccf 100644
--- a/drivers/md/persistent-data/dm-btree-remove.c
+++ b/drivers/md/persistent-data/dm-btree-remove.c
@@ -544,14 +544,6 @@ static int remove_raw(struct shadow_spine *s, struct dm_btree_info *info,
return r;
}
-static struct dm_btree_value_type le64_type = {
- .context = NULL,
- .size = sizeof(__le64),
- .inc = NULL,
- .dec = NULL,
- .equal = NULL
-};
-
int dm_btree_remove(struct dm_btree_info *info, dm_block_t root,
uint64_t *keys, dm_block_t *new_root)
{
@@ -559,12 +551,14 @@ int dm_btree_remove(struct dm_btree_info *info, dm_block_t root,
int index = 0, r = 0;
struct shadow_spine spine;
struct btree_node *n;
+ struct dm_btree_value_type le64_vt;
+ init_le64_type(info->tm, &le64_vt);
init_shadow_spine(&spine, info);
for (level = 0; level < info->levels; level++) {
r = remove_raw(&spine, info,
(level == last_level ?
- &info->value_type : &le64_type),
+ &info->value_type : &le64_vt),
root, keys[level], (unsigned *)&index);
if (r < 0)
break;
diff --git a/drivers/md/persistent-data/dm-btree-spine.c b/drivers/md/persistent-data/dm-btree-spine.c
index 1b5e13ec7f96..0dee514ba4c5 100644
--- a/drivers/md/persistent-data/dm-btree-spine.c
+++ b/drivers/md/persistent-data/dm-btree-spine.c
@@ -249,3 +249,40 @@ int shadow_root(struct shadow_spine *s)
{
return s->root;
}
+
+static void le64_inc(void *context, const void *value_le)
+{
+ struct dm_transaction_manager *tm = context;
+ __le64 v_le;
+
+ memcpy(&v_le, value_le, sizeof(v_le));
+ dm_tm_inc(tm, le64_to_cpu(v_le));
+}
+
+static void le64_dec(void *context, const void *value_le)
+{
+ struct dm_transaction_manager *tm = context;
+ __le64 v_le;
+
+ memcpy(&v_le, value_le, sizeof(v_le));
+ dm_tm_dec(tm, le64_to_cpu(v_le));
+}
+
+static int le64_equal(void *context, const void *value1_le, const void *value2_le)
+{
+ __le64 v1_le, v2_le;
+
+ memcpy(&v1_le, value1_le, sizeof(v1_le));
+ memcpy(&v2_le, value2_le, sizeof(v2_le));
+ return v1_le == v2_le;
+}
+
+void init_le64_type(struct dm_transaction_manager *tm,
+ struct dm_btree_value_type *vt)
+{
+ vt->context = tm;
+ vt->size = sizeof(__le64);
+ vt->inc = le64_inc;
+ vt->dec = le64_dec;
+ vt->equal = le64_equal;
+}
diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c
index 8dad9849649e..50cf11119af9 100644
--- a/drivers/md/persistent-data/dm-btree.c
+++ b/drivers/md/persistent-data/dm-btree.c
@@ -667,12 +667,7 @@ static int insert(struct dm_btree_info *info, dm_block_t root,
struct btree_node *n;
struct dm_btree_value_type le64_type;
- le64_type.context = NULL;
- le64_type.size = sizeof(__le64);
- le64_type.inc = NULL;
- le64_type.dec = NULL;
- le64_type.equal = NULL;
-
+ init_le64_type(info->tm, &le64_type);
init_shadow_spine(&spine, info);
for (level = 0; level < (info->levels - 1); level++) {
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 049/123] USB: option: add ZTE PIDs
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (47 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 048/123] dm btree: add ref counting ops for the leaves of top level btrees Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 050/123] dm raid: fix round up of default region size Jiri Slaby
` (75 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Liu.Zhao, Johan Hovold, Jiri Slaby
From: "Liu.Zhao" <lzsos369@163.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 19ab6bc5674a30fdb6a2436b068d19a3c17dc73e upstream.
This is intended to add ZTE device PIDs on kernel.
Signed-off-by: Liu.Zhao <lzsos369@163.com>
[johan: sort the new entries ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/serial/option.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 096438e4fb0c..c918075e5eae 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -276,6 +276,10 @@ static void option_instat_callback(struct urb *urb);
#define ZTE_PRODUCT_MF622 0x0001
#define ZTE_PRODUCT_MF628 0x0015
#define ZTE_PRODUCT_MF626 0x0031
+#define ZTE_PRODUCT_ZM8620_X 0x0396
+#define ZTE_PRODUCT_ME3620_MBIM 0x0426
+#define ZTE_PRODUCT_ME3620_X 0x1432
+#define ZTE_PRODUCT_ME3620_L 0x1433
#define ZTE_PRODUCT_AC2726 0xfff1
#define ZTE_PRODUCT_CDMA_TECH 0xfffe
#define ZTE_PRODUCT_AC8710T 0xffff
@@ -549,6 +553,18 @@ static const struct option_blacklist_info zte_mc2716_z_blacklist = {
.sendsetup = BIT(1) | BIT(2) | BIT(3),
};
+static const struct option_blacklist_info zte_me3620_mbim_blacklist = {
+ .reserved = BIT(2) | BIT(3) | BIT(4),
+};
+
+static const struct option_blacklist_info zte_me3620_xl_blacklist = {
+ .reserved = BIT(3) | BIT(4) | BIT(5),
+};
+
+static const struct option_blacklist_info zte_zm8620_x_blacklist = {
+ .reserved = BIT(3) | BIT(4) | BIT(5),
+};
+
static const struct option_blacklist_info huawei_cdc12_blacklist = {
.reserved = BIT(1) | BIT(2),
};
@@ -1579,6 +1595,14 @@ static const struct usb_device_id option_ids[] = {
.driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist },
+ { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_L),
+ .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist },
+ { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_MBIM),
+ .driver_info = (kernel_ulong_t)&zte_me3620_mbim_blacklist },
+ { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_X),
+ .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist },
+ { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ZM8620_X),
+ .driver_info = (kernel_ulong_t)&zte_zm8620_x_blacklist },
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) },
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) },
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) },
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 050/123] dm raid: fix round up of default region size
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (48 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 049/123] USB: option: add ZTE PIDs Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 051/123] netfilter: nf_conntrack: Support expectations in different zones Jiri Slaby
` (74 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 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 042745ee53a0a7c1f5aff191a4a24213c6dcfb52 upstream.
Commit 3a0f9aaee028 ("dm raid: round region_size to power of two")
intended to make sure that the default region size is a power of two.
However, the logic in that commit is incorrect and sets the variable
region_size to 0 or 1, depending on whether min_region_size is a power
of two.
Fix this logic, using roundup_pow_of_two(), so that region_size is
properly rounded up to the next power of two.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 3a0f9aaee028 ("dm raid: round region_size to power of two")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/md/dm-raid.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 59715389b3cf..19cfd7affebe 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -325,8 +325,7 @@ static int validate_region_size(struct raid_set *rs, unsigned long region_size)
*/
if (min_region_size > (1 << 13)) {
/* If not a power of 2, make it the next power of 2 */
- if (min_region_size & (min_region_size - 1))
- region_size = 1 << fls(region_size);
+ region_size = roundup_pow_of_two(min_region_size);
DMINFO("Choosing default region size of %lu sectors",
region_size);
} else {
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 051/123] netfilter: nf_conntrack: Support expectations in different zones
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (49 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 050/123] dm raid: fix round up of default region size Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 052/123] netfilter: ctnetlink: put back references to master ct and expect objects Jiri Slaby
` (73 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Joe Stringer, Pablo Neira Ayuso, Jiri Slaby
From: Joe Stringer <joestringer@nicira.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4b31814d20cbe5cd4ccf18089751e77a04afe4f2 upstream.
When zones were originally introduced, the expectation functions were
all extended to perform lookup using the zone. However, insertion was
not modified to check the zone. This means that two expectations which
are intended to apply for different connections that have the same tuple
but exist in different zones cannot both be tracked.
Fixes: 5d0aa2ccd4 (netfilter: nf_conntrack: add support for "conntrack zones")
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
net/netfilter/nf_conntrack_expect.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index 4fd1ca94fd4a..71c46f463969 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -202,7 +202,8 @@ static inline int expect_clash(const struct nf_conntrack_expect *a,
a->mask.src.u3.all[count] & b->mask.src.u3.all[count];
}
- return nf_ct_tuple_mask_cmp(&a->tuple, &b->tuple, &intersect_mask);
+ return nf_ct_tuple_mask_cmp(&a->tuple, &b->tuple, &intersect_mask) &&
+ nf_ct_zone(a->master) == nf_ct_zone(b->master);
}
static inline int expect_matches(const struct nf_conntrack_expect *a,
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 052/123] netfilter: ctnetlink: put back references to master ct and expect objects
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (50 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 051/123] netfilter: nf_conntrack: Support expectations in different zones Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 053/123] disabling oplocks/leases via module parm enable_oplocks broken for SMB3 Jiri Slaby
` (72 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Pablo Neira Ayuso, Jiri Slaby
From: Pablo Neira Ayuso <pablo@netfilter.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 95dd8653de658143770cb0e55a58d2aab97c79d2 upstream.
We have to put back the references to the master conntrack and the expectation
that we just created, otherwise we'll leak them.
Fixes: 0ef71ee1a5b9 ("netfilter: ctnetlink: refactor ctnetlink_create_expect")
Reported-by: Tim Wiess <Tim.Wiess@watchguard.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
net/netfilter/nf_conntrack_netlink.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index eea936b70d15..db744dd68707 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -2925,11 +2925,6 @@ ctnetlink_create_expect(struct net *net, u16 zone,
}
err = nf_ct_expect_related_report(exp, portid, report);
- if (err < 0)
- goto err_exp;
-
- return 0;
-err_exp:
nf_ct_expect_put(exp);
err_ct:
nf_ct_put(ct);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 053/123] disabling oplocks/leases via module parm enable_oplocks broken for SMB3
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (51 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 052/123] netfilter: ctnetlink: put back references to master ct and expect objects Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 054/123] drm/qxl: only report first monitor as connected if we have no state Jiri Slaby
` (71 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Steve French, Steve French, Jiri Slaby
From: Steve French <smfrench@gmail.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e0ddde9d44e37fbc21ce893553094ecf1a633ab5 upstream.
leases (oplocks) were always requested for SMB2/SMB3 even when oplocks
disabled in the cifs.ko module.
Signed-off-by: Steve French <steve.french@primarydata.com>
Reviewed-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/cifs/smb2ops.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 6f79cd867a2e..57519567b2ac 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -49,9 +49,13 @@ change_conf(struct TCP_Server_Info *server)
break;
default:
server->echoes = true;
- server->oplocks = true;
+ if (enable_oplocks) {
+ server->oplocks = true;
+ server->oplock_credits = 1;
+ } else
+ server->oplocks = false;
+
server->echo_credits = 1;
- server->oplock_credits = 1;
}
server->credits -= server->echo_credits + server->oplock_credits;
return 0;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 054/123] drm/qxl: only report first monitor as connected if we have no state
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (52 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 053/123] disabling oplocks/leases via module parm enable_oplocks broken for SMB3 Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 055/123] drm/qxl: recreate the primary surface when the bo is not primary Jiri Slaby
` (70 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Dave Airlie, Jiri Slaby
From: Dave Airlie <airlied@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 69e5d3f893e19613486f300fd6e631810338aa4b upstream.
If the server isn't new enough to give us state, report the first
monitor as always connected, otherwise believe the server side.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/gpu/drm/qxl/qxl_display.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index ea0904875c74..9f4d1f71a995 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -799,13 +799,15 @@ static enum drm_connector_status qxl_conn_detect(
drm_connector_to_qxl_output(connector);
struct drm_device *ddev = connector->dev;
struct qxl_device *qdev = ddev->dev_private;
- int connected;
+ bool connected = false;
/* The first monitor is always connected */
- connected = (output->index == 0) ||
- (qdev->client_monitors_config &&
- qdev->client_monitors_config->count > output->index &&
- qxl_head_enabled(&qdev->client_monitors_config->heads[output->index]));
+ if (!qdev->client_monitors_config) {
+ if (output->index == 0)
+ connected = true;
+ } else
+ connected = qdev->client_monitors_config->count > output->index &&
+ qxl_head_enabled(&qdev->client_monitors_config->heads[output->index]);
DRM_DEBUG("\n");
return connected ? connector_status_connected
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 055/123] drm/qxl: recreate the primary surface when the bo is not primary
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (53 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 054/123] drm/qxl: only report first monitor as connected if we have no state Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 056/123] drm: Reject DRI1 hw lock ioctl functions for kms drivers Jiri Slaby
` (69 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Fabiano Fidêncio, Dave Airlie, Jiri Slaby
From: Fabiano Fidêncio <fidencio@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8d0d94015e96b8853c4f7f06eac3f269e1b3d866 upstream.
When disabling/enabling a crtc the primary area must be updated
independently of which crtc has been disabled/enabled.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1264735
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/gpu/drm/qxl/qxl_display.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 9f4d1f71a995..98976f054597 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -537,7 +537,7 @@ static int qxl_crtc_mode_set(struct drm_crtc *crtc,
adjusted_mode->hdisplay,
adjusted_mode->vdisplay);
- if (qcrtc->index == 0)
+ if (bo->is_primary == false)
recreate_primary = true;
if (bo->surf.stride * bo->surf.height > qdev->vram_size) {
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 056/123] drm: Reject DRI1 hw lock ioctl functions for kms drivers
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (54 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 055/123] drm/qxl: recreate the primary surface when the bo is not primary Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 057/123] USB: whiteheat: fix potential null-deref at probe Jiri Slaby
` (68 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Daniel Vetter, Peter Antoine, Daniel Vetter,
Jiri Slaby
From: Daniel Vetter <daniel.vetter@ffwll.ch>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit da168d81b44898404d281d5dbe70154ab5f117c1 upstream.
I've done some extensive history digging across libdrm, mesa and
xf86-video-{intel,nouveau,ati}. The only potential user of this with
kms drivers I could find was ttmtest, which once used drmGetLock
still. But that mistake was quickly fixed up. Even the intel xvmc
library (which otherwise was really good with using dri1 stuff in kms
mode) managed to never take the hw lock for dri2 (and hence kms).
Hence it should be save to unconditionally disallow this.
Cc: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Peter Antoine <peter.antoine@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/gpu/drm/drm_lock.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c
index d752c96d6090..bdceb60998d3 100644
--- a/drivers/gpu/drm/drm_lock.c
+++ b/drivers/gpu/drm/drm_lock.c
@@ -58,6 +58,9 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
struct drm_master *master = file_priv->master;
int ret = 0;
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
+ return -EINVAL;
+
++file_priv->lock_count;
if (lock->context == DRM_KERNEL_CONTEXT) {
@@ -151,6 +154,9 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
struct drm_lock *lock = data;
struct drm_master *master = file_priv->master;
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
+ return -EINVAL;
+
if (lock->context == DRM_KERNEL_CONTEXT) {
DRM_ERROR("Process %d using kernel context %d\n",
task_pid_nr(current), lock->context);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 057/123] USB: whiteheat: fix potential null-deref at probe
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (55 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 056/123] drm: Reject DRI1 hw lock ioctl functions for kms drivers Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 058/123] usb: xhci: Clear XHCI_STATE_DYING on start Jiri Slaby
` (67 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Johan Hovold, Jiri Slaby
From: Johan Hovold <johan@kernel.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit cbb4be652d374f64661137756b8f357a1827d6a4 upstream.
Fix potential null-pointer dereference at probe by making sure that the
required endpoints are present.
The whiteheat driver assumes there are at least five pairs of bulk
endpoints, of which the final pair is used for the "command port". An
attempt to bind to an interface with fewer bulk endpoints would
currently lead to an oops.
Fixes CVE-2015-5257.
Reported-by: Moein Ghasemzadeh <moein@istuary.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/serial/whiteheat.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index cc5a430dc357..69fec1a99b3e 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -81,6 +81,8 @@ static int whiteheat_firmware_download(struct usb_serial *serial,
static int whiteheat_firmware_attach(struct usb_serial *serial);
/* function prototypes for the Connect Tech WhiteHEAT serial converter */
+static int whiteheat_probe(struct usb_serial *serial,
+ const struct usb_device_id *id);
static int whiteheat_attach(struct usb_serial *serial);
static void whiteheat_release(struct usb_serial *serial);
static int whiteheat_port_probe(struct usb_serial_port *port);
@@ -117,6 +119,7 @@ static struct usb_serial_driver whiteheat_device = {
.description = "Connect Tech - WhiteHEAT",
.id_table = id_table_std,
.num_ports = 4,
+ .probe = whiteheat_probe,
.attach = whiteheat_attach,
.release = whiteheat_release,
.port_probe = whiteheat_port_probe,
@@ -218,6 +221,34 @@ static int whiteheat_firmware_attach(struct usb_serial *serial)
/*****************************************************************************
* Connect Tech's White Heat serial driver functions
*****************************************************************************/
+
+static int whiteheat_probe(struct usb_serial *serial,
+ const struct usb_device_id *id)
+{
+ struct usb_host_interface *iface_desc;
+ struct usb_endpoint_descriptor *endpoint;
+ size_t num_bulk_in = 0;
+ size_t num_bulk_out = 0;
+ size_t min_num_bulk;
+ unsigned int i;
+
+ iface_desc = serial->interface->cur_altsetting;
+
+ for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
+ endpoint = &iface_desc->endpoint[i].desc;
+ if (usb_endpoint_is_bulk_in(endpoint))
+ ++num_bulk_in;
+ if (usb_endpoint_is_bulk_out(endpoint))
+ ++num_bulk_out;
+ }
+
+ min_num_bulk = COMMAND_PORT + 1;
+ if (num_bulk_in < min_num_bulk || num_bulk_out < min_num_bulk)
+ return -ENODEV;
+
+ return 0;
+}
+
static int whiteheat_attach(struct usb_serial *serial)
{
struct usb_serial_port *command_port;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 058/123] usb: xhci: Clear XHCI_STATE_DYING on start
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (56 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 057/123] USB: whiteheat: fix potential null-deref at probe Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 059/123] xhci: change xhci 1.0 only restrictions to support xhci 1.1 Jiri Slaby
` (66 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Roger Quadros, Mathias Nyman, Jiri Slaby
From: Roger Quadros <rogerq@ti.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e5bfeab0ad515b4f6df39fe716603e9dc6d3dfd0 upstream.
For whatever reason if XHCI died in the previous instant
then it will never recover on the next xhci_start unless we
clear the DYING flag.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/host/xhci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 1dd08da9652a..319515406b4f 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -143,7 +143,8 @@ static int xhci_start(struct xhci_hcd *xhci)
"waited %u microseconds.\n",
XHCI_MAX_HALT_USEC);
if (!ret)
- xhci->xhc_state &= ~XHCI_STATE_HALTED;
+ xhci->xhc_state &= ~(XHCI_STATE_HALTED | XHCI_STATE_DYING);
+
return ret;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 059/123] xhci: change xhci 1.0 only restrictions to support xhci 1.1
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (57 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 058/123] usb: xhci: Clear XHCI_STATE_DYING on start Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 060/123] usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers Jiri Slaby
` (65 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Mathias Nyman, Jiri Slaby
From: Mathias Nyman <mathias.nyman@linux.intel.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit dca7794539eff04b786fb6907186989e5eaaa9c2 upstream.
Some changes between xhci 0.96 and xhci 1.0 specifications forced us to
check the hci version in code, some of these checks were implemented as
hci_version == 1.0, which will not work with new xhci 1.1 controllers.
xhci 1.1 behaves similar to xhci 1.0 in these cases, so change these
checks to hci_version >= 1.0
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/host/xhci-mem.c | 6 +++---
drivers/usb/host/xhci-ring.c | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 9af524c1f48f..9552d2080d12 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1402,10 +1402,10 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
* use Event Data TRBs, and we don't chain in a link TRB on short
* transfers, we're basically dividing by 1.
*
- * xHCI 1.0 specification indicates that the Average TRB Length should
- * be set to 8 for control endpoints.
+ * xHCI 1.0 and 1.1 specification indicates that the Average TRB Length
+ * should be set to 8 for control endpoints.
*/
- if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version == 0x100)
+ if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version >= 0x100)
ep_ctx->tx_info |= cpu_to_le32(AVG_TRB_LENGTH_FOR_EP(8));
else
ep_ctx->tx_info |=
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index d5652d21826a..46da2f63d07b 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3537,8 +3537,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
if (start_cycle == 0)
field |= 0x1;
- /* xHCI 1.0 6.4.1.2.1: Transfer Type field */
- if (xhci->hci_version == 0x100) {
+ /* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */
+ if (xhci->hci_version >= 0x100) {
if (urb->transfer_buffer_length > 0) {
if (setup->bRequestType & USB_DIR_IN)
field |= TRB_TX_TYPE(TRB_DATA_IN);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 060/123] usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (58 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 059/123] xhci: change xhci 1.0 only restrictions to support xhci 1.1 Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 061/123] Initialize msg/shm IPC objects before doing ipc_addid() Jiri Slaby
` (64 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Reyad Attiyat, Mathias Nyman, Oliver Neukum,
Jiri Slaby
From: Reyad Attiyat <reyad.attiyat@gmail.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4758dcd19a7d9ba9610b38fecb93f65f56f86346 upstream.
This commit checks for the URB_ZERO_PACKET flag and creates an extra
zero-length td if the urb transfer length is a multiple of the endpoint's
max packet length.
Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/host/xhci-ring.c | 66 ++++++++++++++++++++++++++++++++++----------
drivers/usb/host/xhci.c | 5 ++++
2 files changed, 57 insertions(+), 14 deletions(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 46da2f63d07b..ad381c22e5ac 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3193,9 +3193,11 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
struct xhci_td *td;
struct scatterlist *sg;
int num_sgs;
- int trb_buff_len, this_sg_len, running_total;
+ int trb_buff_len, this_sg_len, running_total, ret;
unsigned int total_packet_count;
+ bool zero_length_needed;
bool first_trb;
+ int last_trb_num;
u64 addr;
bool more_trbs_coming;
@@ -3211,13 +3213,27 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
total_packet_count = DIV_ROUND_UP(urb->transfer_buffer_length,
usb_endpoint_maxp(&urb->ep->desc));
- trb_buff_len = prepare_transfer(xhci, xhci->devs[slot_id],
+ ret = prepare_transfer(xhci, xhci->devs[slot_id],
ep_index, urb->stream_id,
num_trbs, urb, 0, mem_flags);
- if (trb_buff_len < 0)
- return trb_buff_len;
+ if (ret < 0)
+ return ret;
urb_priv = urb->hcpriv;
+
+ /* Deal with URB_ZERO_PACKET - need one more td/trb */
+ zero_length_needed = urb->transfer_flags & URB_ZERO_PACKET &&
+ urb_priv->length == 2;
+ if (zero_length_needed) {
+ num_trbs++;
+ xhci_dbg(xhci, "Creating zero length td.\n");
+ ret = prepare_transfer(xhci, xhci->devs[slot_id],
+ ep_index, urb->stream_id,
+ 1, urb, 1, mem_flags);
+ if (ret < 0)
+ return ret;
+ }
+
td = urb_priv->td[0];
/*
@@ -3247,6 +3263,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
trb_buff_len = urb->transfer_buffer_length;
first_trb = true;
+ last_trb_num = zero_length_needed ? 2 : 1;
/* Queue the first TRB, even if it's zero-length */
do {
u32 field = 0;
@@ -3264,12 +3281,15 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
/* Chain all the TRBs together; clear the chain bit in the last
* TRB to indicate it's the last TRB in the chain.
*/
- if (num_trbs > 1) {
+ if (num_trbs > last_trb_num) {
field |= TRB_CHAIN;
- } else {
- /* FIXME - add check for ZERO_PACKET flag before this */
+ } else if (num_trbs == last_trb_num) {
td->last_trb = ep_ring->enqueue;
field |= TRB_IOC;
+ } else if (zero_length_needed && num_trbs == 1) {
+ trb_buff_len = 0;
+ urb_priv->td[1]->last_trb = ep_ring->enqueue;
+ field |= TRB_IOC;
}
/* Only set interrupt on short packet for IN endpoints */
@@ -3331,7 +3351,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
if (running_total + trb_buff_len > urb->transfer_buffer_length)
trb_buff_len =
urb->transfer_buffer_length - running_total;
- } while (running_total < urb->transfer_buffer_length);
+ } while (num_trbs > 0);
check_trb_math(urb, num_trbs, running_total);
giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
@@ -3349,7 +3369,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
int num_trbs;
struct xhci_generic_trb *start_trb;
bool first_trb;
+ int last_trb_num;
bool more_trbs_coming;
+ bool zero_length_needed;
int start_cycle;
u32 field, length_field;
@@ -3380,7 +3402,6 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
num_trbs++;
running_total += TRB_MAX_BUFF_SIZE;
}
- /* FIXME: this doesn't deal with URB_ZERO_PACKET - need one more */
ret = prepare_transfer(xhci, xhci->devs[slot_id],
ep_index, urb->stream_id,
@@ -3389,6 +3410,20 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
return ret;
urb_priv = urb->hcpriv;
+
+ /* Deal with URB_ZERO_PACKET - need one more td/trb */
+ zero_length_needed = urb->transfer_flags & URB_ZERO_PACKET &&
+ urb_priv->length == 2;
+ if (zero_length_needed) {
+ num_trbs++;
+ xhci_dbg(xhci, "Creating zero length td.\n");
+ ret = prepare_transfer(xhci, xhci->devs[slot_id],
+ ep_index, urb->stream_id,
+ 1, urb, 1, mem_flags);
+ if (ret < 0)
+ return ret;
+ }
+
td = urb_priv->td[0];
/*
@@ -3410,7 +3445,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
trb_buff_len = urb->transfer_buffer_length;
first_trb = true;
-
+ last_trb_num = zero_length_needed ? 2 : 1;
/* Queue the first TRB, even if it's zero-length */
do {
u32 remainder = 0;
@@ -3427,12 +3462,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
/* Chain all the TRBs together; clear the chain bit in the last
* TRB to indicate it's the last TRB in the chain.
*/
- if (num_trbs > 1) {
+ if (num_trbs > last_trb_num) {
field |= TRB_CHAIN;
- } else {
- /* FIXME - add check for ZERO_PACKET flag before this */
+ } else if (num_trbs == last_trb_num) {
td->last_trb = ep_ring->enqueue;
field |= TRB_IOC;
+ } else if (zero_length_needed && num_trbs == 1) {
+ trb_buff_len = 0;
+ urb_priv->td[1]->last_trb = ep_ring->enqueue;
+ field |= TRB_IOC;
}
/* Only set interrupt on short packet for IN endpoints */
@@ -3470,7 +3508,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
trb_buff_len = urb->transfer_buffer_length - running_total;
if (trb_buff_len > TRB_MAX_BUFF_SIZE)
trb_buff_len = TRB_MAX_BUFF_SIZE;
- } while (running_total < urb->transfer_buffer_length);
+ } while (num_trbs > 0);
check_trb_math(urb, num_trbs, running_total);
giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 319515406b4f..3d98a3a82c79 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1319,6 +1319,11 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
if (usb_endpoint_xfer_isoc(&urb->ep->desc))
size = urb->number_of_packets;
+ else if (usb_endpoint_is_bulk_out(&urb->ep->desc) &&
+ urb->transfer_buffer_length > 0 &&
+ urb->transfer_flags & URB_ZERO_PACKET &&
+ !(urb->transfer_buffer_length % usb_endpoint_maxp(&urb->ep->desc)))
+ size = 2;
else
size = 1;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 061/123] Initialize msg/shm IPC objects before doing ipc_addid()
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (59 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 060/123] usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 062/123] ipvs: do not use random local source address for tunnels Jiri Slaby
` (63 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Linus Torvalds, Manfred Spraul, Davidlohr Bueso,
Jiri Slaby
From: Linus Torvalds <torvalds@linux-foundation.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b9a532277938798b53178d5a66af6e2915cb27cf upstream.
As reported by Dmitry Vyukov, we really shouldn't do ipc_addid() before
having initialized the IPC object state. Yes, we initialize the IPC
object in a locked state, but with all the lockless RCU lookup work,
that IPC object lock no longer means that the state cannot be seen.
We already did this for the IPC semaphore code (see commit e8577d1f0329:
"ipc/sem.c: fully initialize sem_array before making it visible") but we
clearly forgot about msg and shm.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
ipc/msg.c | 14 +++++++-------
ipc/shm.c | 12 ++++++------
ipc/util.c | 8 ++++----
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/ipc/msg.c b/ipc/msg.c
index 52770bfde2a5..32aaaab15c5c 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -202,13 +202,6 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params)
return retval;
}
- /* ipc_addid() locks msq upon success. */
- id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni);
- if (id < 0) {
- ipc_rcu_putref(msq, msg_rcu_free);
- return id;
- }
-
msq->q_stime = msq->q_rtime = 0;
msq->q_ctime = get_seconds();
msq->q_cbytes = msq->q_qnum = 0;
@@ -218,6 +211,13 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params)
INIT_LIST_HEAD(&msq->q_receivers);
INIT_LIST_HEAD(&msq->q_senders);
+ /* ipc_addid() locks msq upon success. */
+ id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni);
+ if (id < 0) {
+ ipc_rcu_putref(msq, msg_rcu_free);
+ return id;
+ }
+
ipc_unlock_object(&msq->q_perm);
rcu_read_unlock();
diff --git a/ipc/shm.c b/ipc/shm.c
index 623bc3877118..02f7125c8a0f 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -545,12 +545,6 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
if (IS_ERR(file))
goto no_file;
- id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
- if (id < 0) {
- error = id;
- goto no_id;
- }
-
shp->shm_cprid = task_tgid_vnr(current);
shp->shm_lprid = 0;
shp->shm_atim = shp->shm_dtim = 0;
@@ -560,6 +554,12 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
shp->shm_file = file;
shp->shm_creator = current;
+ id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
+ if (id < 0) {
+ error = id;
+ goto no_id;
+ }
+
/*
* shmid gets reported as "inode#" in /proc/pid/maps.
* proc-ps tools use this. Changing this will break them.
diff --git a/ipc/util.c b/ipc/util.c
index 7684f41bce76..735342570a87 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -292,6 +292,10 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
rcu_read_lock();
spin_lock(&new->lock);
+ current_euid_egid(&euid, &egid);
+ new->cuid = new->uid = euid;
+ new->gid = new->cgid = egid;
+
id = idr_alloc(&ids->ipcs_idr, new,
(next_id < 0) ? 0 : ipcid_to_idx(next_id), 0,
GFP_NOWAIT);
@@ -304,10 +308,6 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
ids->in_use++;
- current_euid_egid(&euid, &egid);
- new->cuid = new->uid = euid;
- new->gid = new->cgid = egid;
-
if (next_id < 0) {
new->seq = ids->seq++;
if (ids->seq > ids->seq_max)
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 062/123] ipvs: do not use random local source address for tunnels
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (60 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 061/123] Initialize msg/shm IPC objects before doing ipc_addid() Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 063/123] ipvs: fix crash with sync protocol v0 and FTP Jiri Slaby
` (62 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Julian Anastasov, Simon Horman, Jiri Slaby
From: Julian Anastasov <ja@ssi.bg>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 4754957f04f5f368792a0eb7dab0ae89fb93dcfd upstream.
Michael Vallaly reports about wrong source address used
in rare cases for tunneled traffic. Looks like
__ip_vs_get_out_rt in 3.10+ is providing uninitialized
dest_dst->dst_saddr.ip because ip_vs_dest_dst_alloc uses
kmalloc. While we retry after seeing EINVAL from routing
for data that does not look like valid local address, it
still succeeded when this memory was previously used from
other dests and with different local addresses. As result,
we can use valid local address that is not suitable for
our real server.
Fix it by providing 0.0.0.0 every time our cache is refreshed.
By this way we will get preferred source address from routing.
Reported-by: Michael Vallaly <lvs@nolatency.com>
Fixes: 026ace060dfe ("ipvs: optimize dst usage for real server")
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
net/netfilter/ipvs/ip_vs_xmit.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 1692e7534759..c3d204973dbc 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -129,7 +129,6 @@ static struct rtable *do_output_route4(struct net *net, __be32 daddr,
memset(&fl4, 0, sizeof(fl4));
fl4.daddr = daddr;
- fl4.saddr = (rt_mode & IP_VS_RT_MODE_CONNECT) ? *saddr : 0;
fl4.flowi4_flags = (rt_mode & IP_VS_RT_MODE_KNOWN_NH) ?
FLOWI_FLAG_KNOWN_NH : 0;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 063/123] ipvs: fix crash with sync protocol v0 and FTP
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (61 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 062/123] ipvs: do not use random local source address for tunnels Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 064/123] cifs: use server timestamp for ntlmv2 authentication Jiri Slaby
` (61 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Julian Anastasov, Simon Horman, Jiri Slaby
From: Julian Anastasov <ja@ssi.bg>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 56184858d1fc95c46723436b455cb7261cd8be6f upstream.
Fix crash in 3.5+ if FTP is used after switching
sync_version to 0.
Fixes: 749c42b620a9 ("ipvs: reduce sync rate with time thresholds")
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
net/netfilter/ipvs/ip_vs_sync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 6d91d760a896..3e3e4f4f594a 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -612,7 +612,7 @@ static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp,
pkts = atomic_add_return(1, &cp->in_pkts);
else
pkts = sysctl_sync_threshold(ipvs);
- ip_vs_sync_conn(net, cp->control, pkts);
+ ip_vs_sync_conn(net, cp, pkts);
}
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 064/123] cifs: use server timestamp for ntlmv2 authentication
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (62 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 063/123] ipvs: fix crash with sync protocol v0 and FTP Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 065/123] regmap: debugfs: Ensure we don't underflow when printing access masks Jiri Slaby
` (60 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Peter Seiderer, Steve French, Jiri Slaby
From: Peter Seiderer <ps.report@gmx.net>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 98ce94c8df762d413b3ecb849e2b966b21606d04 upstream.
Linux cifs mount with ntlmssp against an Mac OS X (Yosemite
10.10.5) share fails in case the clocks differ more than +/-2h:
digest-service: digest-request: od failed with 2 proto=ntlmv2
digest-service: digest-request: kdc failed with -1561745592 proto=ntlmv2
Fix this by (re-)using the given server timestamp for the
ntlmv2 authentication (as Windows 7 does).
A related problem was also reported earlier by Namjae Jaen (see below):
Windows machine has extended security feature which refuse to allow
authentication when there is time difference between server time and
client time when ntlmv2 negotiation is used. This problem is prevalent
in embedded enviornment where system time is set to default 1970.
Modern servers send the server timestamp in the TargetInfo Av_Pair
structure in the challenge message [see MS-NLMP 2.2.2.1]
In [MS-NLMP 3.1.5.1.2] it is explicitly mentioned that the client must
use the server provided timestamp if present OR current time if it is
not
Reported-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/cifs/cifsencrypt.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 51 insertions(+), 1 deletion(-)
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index fc6f4f3a1a9d..134ed52f616f 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -441,6 +441,48 @@ find_domain_name(struct cifs_ses *ses, const struct nls_table *nls_cp)
return 0;
}
+/* Server has provided av pairs/target info in the type 2 challenge
+ * packet and we have plucked it and stored within smb session.
+ * We parse that blob here to find the server given timestamp
+ * as part of ntlmv2 authentication (or local current time as
+ * default in case of failure)
+ */
+static __le64
+find_timestamp(struct cifs_ses *ses)
+{
+ unsigned int attrsize;
+ unsigned int type;
+ unsigned int onesize = sizeof(struct ntlmssp2_name);
+ unsigned char *blobptr;
+ unsigned char *blobend;
+ struct ntlmssp2_name *attrptr;
+
+ if (!ses->auth_key.len || !ses->auth_key.response)
+ return 0;
+
+ blobptr = ses->auth_key.response;
+ blobend = blobptr + ses->auth_key.len;
+
+ while (blobptr + onesize < blobend) {
+ attrptr = (struct ntlmssp2_name *) blobptr;
+ type = le16_to_cpu(attrptr->type);
+ if (type == NTLMSSP_AV_EOL)
+ break;
+ blobptr += 2; /* advance attr type */
+ attrsize = le16_to_cpu(attrptr->length);
+ blobptr += 2; /* advance attr size */
+ if (blobptr + attrsize > blobend)
+ break;
+ if (type == NTLMSSP_AV_TIMESTAMP) {
+ if (attrsize == sizeof(u64))
+ return *((__le64 *)blobptr);
+ }
+ blobptr += attrsize; /* advance attr value */
+ }
+
+ return cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
+}
+
static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
const struct nls_table *nls_cp)
{
@@ -630,6 +672,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
struct ntlmv2_resp *buf;
char ntlmv2_hash[16];
unsigned char *tiblob = NULL; /* target info blob */
+ __le64 rsp_timestamp;
if (ses->server->negflavor == CIFS_NEGFLAVOR_EXTENDED) {
if (!ses->domainName) {
@@ -648,6 +691,12 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
}
}
+ /* Must be within 5 minutes of the server (or in range +/-2h
+ * in case of Mac OS X), so simply carry over server timestamp
+ * (as Windows 7 does)
+ */
+ rsp_timestamp = find_timestamp(ses);
+
baselen = CIFS_SESS_KEY_SIZE + sizeof(struct ntlmv2_resp);
tilen = ses->auth_key.len;
tiblob = ses->auth_key.response;
@@ -664,7 +713,8 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
(ses->auth_key.response + CIFS_SESS_KEY_SIZE);
buf->blob_signature = cpu_to_le32(0x00000101);
buf->reserved = 0;
- buf->time = cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
+ buf->time = rsp_timestamp;
+
get_random_bytes(&buf->client_chal, sizeof(buf->client_chal));
buf->reserved2 = 0;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 065/123] regmap: debugfs: Ensure we don't underflow when printing access masks
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (63 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 064/123] cifs: use server timestamp for ntlmv2 authentication Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 066/123] regmap: debugfs: Don't bother actually printing when calculating max length Jiri Slaby
` (59 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Mark Brown, Jiri Slaby
From: Mark Brown <broonie@kernel.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b763ec17ac762470eec5be8ebcc43e4f8b2c2b82 upstream.
If a read is attempted which is smaller than the line length then we may
underflow the subtraction we're doing with the unsigned size_t type so
move some of the calculation to be additions on the right hand side
instead in order to avoid this.
Reported-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/base/regmap/regmap-debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index b18c7da77067..b8a17b52f8f3 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -423,7 +423,7 @@ static ssize_t regmap_access_read_file(struct file *file,
/* If we're in the region the user is trying to read */
if (p >= *ppos) {
/* ...but not beyond it */
- if (buf_pos >= count - 1 - tot_len)
+ if (buf_pos + tot_len + 1 >= count)
break;
/* Format the register */
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 066/123] regmap: debugfs: Don't bother actually printing when calculating max length
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (64 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 065/123] regmap: debugfs: Ensure we don't underflow when printing access masks Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 067/123] security: fix typo in security_task_prctl Jiri Slaby
` (58 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Mark Brown, Jiri Slaby
From: Mark Brown <broonie@kernel.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 176fc2d5770a0990eebff903ba680d2edd32e718 upstream.
The in kernel snprintf() will conveniently return the actual length of
the printed string even if not given an output beffer at all so just do
that rather than relying on the user to pass in a suitable buffer,
ensuring that we don't need to worry if the buffer was truncated due to
the size of the buffer passed in.
Reported-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/base/regmap/regmap-debugfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index b8a17b52f8f3..8135feff72a2 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -23,8 +23,7 @@ static struct dentry *regmap_debugfs_root;
/* Calculate the length of a fixed format */
static size_t regmap_calc_reg_len(int max_val, char *buf, size_t buf_size)
{
- snprintf(buf, buf_size, "%x", max_val);
- return strlen(buf);
+ return snprintf(NULL, 0, "%x", max_val);
}
static ssize_t regmap_name_read_file(struct file *file,
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 067/123] security: fix typo in security_task_prctl
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (65 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 066/123] regmap: debugfs: Don't bother actually printing when calculating max length Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:52 ` [PATCH 3.12 068/123] usb: Use the USB_SS_MULT() macro to get the burst multiplier Jiri Slaby
` (57 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Jann Horn, Linus Torvalds, Jiri Slaby
From: Jann Horn <jann@thejh.net>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b7f76ea2ef6739ee484a165ffbac98deb855d3d3 upstream.
Signed-off-by: Jann Horn <jann@thejh.net>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
include/linux/security.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/security.h b/include/linux/security.h
index 9d37e2b9d3ec..dd7c1a16ab5e 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -2441,7 +2441,7 @@ static inline int security_task_prctl(int option, unsigned long arg2,
unsigned long arg4,
unsigned long arg5)
{
- return cap_task_prctl(option, arg2, arg3, arg3, arg5);
+ return cap_task_prctl(option, arg2, arg3, arg4, arg5);
}
static inline void security_task_to_inode(struct task_struct *p, struct inode *inode)
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 068/123] usb: Use the USB_SS_MULT() macro to get the burst multiplier.
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (66 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 067/123] security: fix typo in security_task_prctl Jiri Slaby
@ 2015-10-28 13:52 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 069/123] usb: Add device quirk for Logitech PTZ cameras Jiri Slaby
` (56 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:52 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Mathias Nyman, Jiri Slaby
From: Mathias Nyman <mathias.nyman@linux.intel.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ff30cbc8da425754e8ab96904db1d295bd034f27 upstream.
Bits 1:0 of the bmAttributes are used for the burst multiplier.
The rest of the bits used to be reserved (zero), but USB3.1 takes bit 7
into use.
Use the existing USB_SS_MULT() macro instead to make sure the mult value
and hence max packet calculations are correct for USB3.1 devices.
Note that burst multiplier in bmAttributes is zero based and that
the USB_SS_MULT() macro adds one.
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/core/config.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 98cb09617b20..b9560f485d21 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -114,7 +114,7 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
cfgno, inum, asnum, ep->desc.bEndpointAddress);
ep->ss_ep_comp.bmAttributes = 16;
} else if (usb_endpoint_xfer_isoc(&ep->desc) &&
- desc->bmAttributes > 2) {
+ USB_SS_MULT(desc->bmAttributes) > 3) {
dev_warn(ddev, "Isoc endpoint has Mult of %d in "
"config %d interface %d altsetting %d ep %d: "
"setting to 3\n", desc->bmAttributes + 1,
@@ -123,7 +123,8 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
}
if (usb_endpoint_xfer_isoc(&ep->desc))
- max_tx = (desc->bMaxBurst + 1) * (desc->bmAttributes + 1) *
+ max_tx = (desc->bMaxBurst + 1) *
+ (USB_SS_MULT(desc->bmAttributes)) *
usb_endpoint_maxp(&ep->desc);
else if (usb_endpoint_xfer_int(&ep->desc))
max_tx = usb_endpoint_maxp(&ep->desc) *
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 069/123] usb: Add device quirk for Logitech PTZ cameras
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (67 preceding siblings ...)
2015-10-28 13:52 ` [PATCH 3.12 068/123] usb: Use the USB_SS_MULT() macro to get the burst multiplier Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 070/123] USB: Add reset-resume quirk for two Plantronics usb headphones Jiri Slaby
` (55 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Vincent Palatin, Jiri Slaby
From: Vincent Palatin <vpalatin@chromium.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 72194739f54607bbf8cfded159627a2015381557 upstream.
Add a device quirk for the Logitech PTZ Pro Camera and its sibling the
ConferenceCam CC3000e Camera.
This fixes the failed camera enumeration on some boot, particularly on
machines with fast CPU.
Tested by connecting a Logitech PTZ Pro Camera to a machine with a
Haswell Core i7-4600U CPU @ 2.10GHz, and doing thousands of reboot cycles
while recording the kernel logs and taking camera picture after each boot.
Before the patch, more than 7% of the boots show some enumeration transfer
failures and in a few of them, the kernel is giving up before actually
enumerating the webcam. After the patch, the enumeration has been correct
on every reboot.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/core/quirks.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 5014a4282352..ecaca8e65356 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -53,6 +53,13 @@ static const struct usb_device_id usb_quirk_list[] = {
{ USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
{ USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT },
+ /* Logitech ConferenceCam CC3000e */
+ { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT },
+ { USB_DEVICE(0x046d, 0x0848), .driver_info = USB_QUIRK_DELAY_INIT },
+
+ /* Logitech PTZ Pro Camera */
+ { USB_DEVICE(0x046d, 0x0853), .driver_info = USB_QUIRK_DELAY_INIT },
+
/* Logitech Quickcam Fusion */
{ USB_DEVICE(0x046d, 0x08c1), .driver_info = USB_QUIRK_RESET_RESUME },
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 070/123] USB: Add reset-resume quirk for two Plantronics usb headphones.
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (68 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 069/123] usb: Add device quirk for Logitech PTZ cameras Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 071/123] MIPS: dma-default: Fix 32-bit fall back to GFP_DMA Jiri Slaby
` (54 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Yao-Wen Mao, Jiri Slaby
From: Yao-Wen Mao <yaowen@google.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8484bf2981b3d006426ac052a3642c9ce1d8d980 upstream.
These two headphones need a reset-resume quirk to properly resume to
original volume level.
Signed-off-by: Yao-Wen Mao <yaowen@google.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/core/quirks.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index ecaca8e65356..84d1d4629b8a 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -84,6 +84,12 @@ static const struct usb_device_id usb_quirk_list[] = {
/* Philips PSC805 audio device */
{ USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
+ /* Plantronic Audio 655 DSP */
+ { USB_DEVICE(0x047f, 0xc008), .driver_info = USB_QUIRK_RESET_RESUME },
+
+ /* Plantronic Audio 648 USB */
+ { USB_DEVICE(0x047f, 0xc013), .driver_info = USB_QUIRK_RESET_RESUME },
+
/* Artisman Watchdog Dongle */
{ USB_DEVICE(0x04b4, 0x0526), .driver_info =
USB_QUIRK_CONFIG_INTF_STRINGS },
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 071/123] MIPS: dma-default: Fix 32-bit fall back to GFP_DMA
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (69 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 070/123] USB: Add reset-resume quirk for two Plantronics usb headphones Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 072/123] UBI: Validate data_size Jiri Slaby
` (53 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, James Hogan, Ralf Baechle, linux-mips, Jiri Slaby
From: James Hogan <james.hogan@imgtec.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 53960059d56ecef67d4ddd546731623641a3d2d1 upstream.
If there is a DMA zone (usually 24bit = 16MB I believe), but no DMA32
zone, as is the case for some 32-bit kernels, then massage_gfp_flags()
will cause DMA memory allocated for devices with a 32..63-bit
coherent_dma_mask to fall back to using __GFP_DMA, even though there may
only be 32-bits of physical address available anyway.
Correct that case to compare against a mask the size of phys_addr_t
instead of always using a 64-bit mask.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Fixes: a2e715a86c6d ("MIPS: DMA: Fix computation of DMA flags from device's coherent_dma_mask.")
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9610/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/mips/mm/dma-default.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 5f8b95512580..7dd78fc991bf 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -92,7 +92,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
else
#endif
#if defined(CONFIG_ZONE_DMA) && !defined(CONFIG_ZONE_DMA32)
- if (dev->coherent_dma_mask < DMA_BIT_MASK(64))
+ if (dev->coherent_dma_mask < DMA_BIT_MASK(sizeof(phys_addr_t) * 8))
dma_flag = __GFP_DMA;
else
#endif
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 072/123] UBI: Validate data_size
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (70 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 071/123] MIPS: dma-default: Fix 32-bit fall back to GFP_DMA Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 073/123] UBI: return ENOSPC if no enough space available Jiri Slaby
` (52 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Richard Weinberger, Jiri Slaby
From: Richard Weinberger <richard@nod.at>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 281fda27673f833a01d516658a64d22a32c8e072 upstream.
Make sure that data_size is less than LEB size.
Otherwise a handcrafted UBI image is able to trigger
an out of bounds memory access in ubi_compare_lebs().
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: David Gstir <david@sigma-star.at>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/mtd/ubi/io.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index bf79def40126..8822e880833b 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -931,6 +931,11 @@ static int validate_vid_hdr(const struct ubi_device *ubi,
goto bad;
}
+ if (data_size > ubi->leb_size) {
+ ubi_err("bad data_size");
+ goto bad;
+ }
+
if (vol_type == UBI_VID_STATIC) {
/*
* Although from high-level point of view static volumes may
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 073/123] UBI: return ENOSPC if no enough space available
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (71 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 072/123] UBI: Validate data_size Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 074/123] arm64: readahead: fault retry breaks mmap file read random detection Jiri Slaby
` (51 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, shengyong, Richard Weinberger, Jiri Slaby
From: shengyong <shengyong1@huawei.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 7c7feb2ebfc9c0552c51f0c050db1d1a004faac5 upstream.
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI error: init_volumes: not enough PEBs, required 706, available 686
UBI error: ubi_wl_init: no enough physical eraseblocks (-20, need 1)
UBI error: ubi_attach_mtd_dev: failed to attach mtd1, error -12 <= NOT ENOMEM
UBI error: ubi_init: cannot attach mtd1
If available PEBs are not enough when initializing volumes, return -ENOSPC
directly. If available PEBs are not enough when initializing WL, return
-ENOSPC instead of -ENOMEM.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: David Gstir <david@sigma-star.at>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/mtd/ubi/vtbl.c | 1 +
drivers/mtd/ubi/wl.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index d77b1c1d7c72..bebf49e0dbe9 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -651,6 +651,7 @@ static int init_volumes(struct ubi_device *ubi,
if (ubi->corr_peb_count)
ubi_err("%d PEBs are corrupted and not used",
ubi->corr_peb_count);
+ return -ENOSPC;
}
ubi->rsvd_pebs += reserved_pebs;
ubi->avail_pebs -= reserved_pebs;
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index c08254016fe8..3375bfb1b246 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -1978,6 +1978,7 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
if (ubi->corr_peb_count)
ubi_err("%d PEBs are corrupted and not used",
ubi->corr_peb_count);
+ err = -ENOSPC;
goto out_free;
}
ubi->avail_pebs -= reserved_pebs;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 074/123] arm64: readahead: fault retry breaks mmap file read random detection
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (72 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 073/123] UBI: return ENOSPC if no enough space available Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 075/123] m68k: Define asmlinkage_protect Jiri Slaby
` (50 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Mark Salyzyn, Shaohua Li, Rik van Riel,
Wu Fengguang, Riley Andrews, Will Deacon, Jiri Slaby
From: Mark Salyzyn <salyzyn@android.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 569ba74a7ba69f46ce2950bf085b37fea2408385 upstream.
This is the arm64 portion of commit 45cac65b0fcd ("readahead: fault
retry breaks mmap file read random detection"), which was absent from
the initial port and has since gone unnoticed. The original commit says:
> .fault now can retry. The retry can break state machine of .fault. In
> filemap_fault, if page is miss, ra->mmap_miss is increased. In the second
> try, since the page is in page cache now, ra->mmap_miss is decreased. And
> these are done in one fault, so we can't detect random mmap file access.
>
> Add a new flag to indicate .fault is tried once. In the second try, skip
> ra->mmap_miss decreasing. The filemap_fault state machine is ok with it.
With this change, Mark reports that:
> Random read improves by 250%, sequential read improves by 40%, and
> random write by 400% to an eMMC device with dm crypto wrapped around it.
Cc: Shaohua Li <shli@kernel.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Signed-off-by: Riley Andrews <riandrews@android.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/arm64/mm/fault.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index c23751b06120..cc083b6e4ce7 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -278,6 +278,7 @@ retry:
* starvation.
*/
mm_flags &= ~FAULT_FLAG_ALLOW_RETRY;
+ mm_flags |= FAULT_FLAG_TRIED;
goto retry;
}
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 075/123] m68k: Define asmlinkage_protect
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (73 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 074/123] arm64: readahead: fault retry breaks mmap file read random detection Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 076/123] genirq: Fix race in register_irq_proc() Jiri Slaby
` (49 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Andreas Schwab, Geert Uytterhoeven, Jiri Slaby
From: Andreas Schwab <schwab@linux-m68k.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8474ba74193d302e8340dddd1e16c85cc4b98caf upstream.
Make sure the compiler does not modify arguments of syscall functions.
This can happen if the compiler generates a tailcall to another
function. For example, without asmlinkage_protect sys_openat is compiled
into this function:
sys_openat:
clr.l %d0
move.w 18(%sp),%d0
move.l %d0,16(%sp)
jbra do_sys_open
Note how the fourth argument is modified in place, modifying the register
%d4 that gets restored from this stack slot when the function returns to
user-space. The caller may expect the register to be unmodified across
system calls.
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/m68k/include/asm/linkage.h | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/arch/m68k/include/asm/linkage.h b/arch/m68k/include/asm/linkage.h
index 5a822bb790f7..066e74f666ae 100644
--- a/arch/m68k/include/asm/linkage.h
+++ b/arch/m68k/include/asm/linkage.h
@@ -4,4 +4,34 @@
#define __ALIGN .align 4
#define __ALIGN_STR ".align 4"
+/*
+ * Make sure the compiler doesn't do anything stupid with the
+ * arguments on the stack - they are owned by the *caller*, not
+ * the callee. This just fools gcc into not spilling into them,
+ * and keeps it from doing tailcall recursion and/or using the
+ * stack slots for temporaries, since they are live and "used"
+ * all the way to the end of the function.
+ */
+#define asmlinkage_protect(n, ret, args...) \
+ __asmlinkage_protect##n(ret, ##args)
+#define __asmlinkage_protect_n(ret, args...) \
+ __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args)
+#define __asmlinkage_protect0(ret) \
+ __asmlinkage_protect_n(ret)
+#define __asmlinkage_protect1(ret, arg1) \
+ __asmlinkage_protect_n(ret, "m" (arg1))
+#define __asmlinkage_protect2(ret, arg1, arg2) \
+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2))
+#define __asmlinkage_protect3(ret, arg1, arg2, arg3) \
+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3))
+#define __asmlinkage_protect4(ret, arg1, arg2, arg3, arg4) \
+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \
+ "m" (arg4))
+#define __asmlinkage_protect5(ret, arg1, arg2, arg3, arg4, arg5) \
+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \
+ "m" (arg4), "m" (arg5))
+#define __asmlinkage_protect6(ret, arg1, arg2, arg3, arg4, arg5, arg6) \
+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \
+ "m" (arg4), "m" (arg5), "m" (arg6))
+
#endif
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 076/123] genirq: Fix race in register_irq_proc()
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (74 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 075/123] m68k: Define asmlinkage_protect Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 077/123] dm cache: fix NULL pointer when switching from cleaner policy Jiri Slaby
` (48 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Ben Hutchings, Thomas Gleixner, Jiri Slaby
From: Ben Hutchings <ben@decadent.org.uk>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 95c2b17534654829db428f11bcf4297c059a2a7e upstream.
Per-IRQ directories in procfs are created only when a handler is first
added to the irqdesc, not when the irqdesc is created. In the case of
a shared IRQ, multiple tasks can race to create a directory. This
race condition seems to have been present forever, but is easier to
hit with async probing.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Link: http://lkml.kernel.org/r/1443266636.2004.2.camel@decadent.org.uk
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
kernel/irq/proc.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 095cd7230aef..56d7272199ff 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -12,6 +12,7 @@
#include <linux/seq_file.h>
#include <linux/interrupt.h>
#include <linux/kernel_stat.h>
+#include <linux/mutex.h>
#include "internals.h"
@@ -326,18 +327,29 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
void register_irq_proc(unsigned int irq, struct irq_desc *desc)
{
+ static DEFINE_MUTEX(register_lock);
char name [MAX_NAMELEN];
- if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip) || desc->dir)
+ if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip))
return;
+ /*
+ * irq directories are registered only when a handler is
+ * added, not when the descriptor is created, so multiple
+ * tasks might try to register at the same time.
+ */
+ mutex_lock(®ister_lock);
+
+ if (desc->dir)
+ goto out_unlock;
+
memset(name, 0, MAX_NAMELEN);
sprintf(name, "%d", irq);
/* create /proc/irq/1234 */
desc->dir = proc_mkdir(name, root_irq_dir);
if (!desc->dir)
- return;
+ goto out_unlock;
#ifdef CONFIG_SMP
/* create /proc/irq/<irq>/smp_affinity */
@@ -358,6 +370,9 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc)
proc_create_data("spurious", 0444, desc->dir,
&irq_spurious_proc_fops, (void *)(long)irq);
+
+out_unlock:
+ mutex_unlock(®ister_lock);
}
void unregister_irq_proc(unsigned int irq, struct irq_desc *desc)
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 077/123] dm cache: fix NULL pointer when switching from cleaner policy
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (75 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 076/123] genirq: Fix race in register_irq_proc() Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 078/123] staging: speakup: fix speakup-r regression Jiri Slaby
` (47 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Joe Thornber, Mike Snitzer, Jiri Slaby
From: Joe Thornber <ejt@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2bffa1503c5c06192eb1459180fac4416575a966 upstream.
The cleaner policy doesn't make use of the per cache block hint space in
the metadata (unlike the other policies). When switching from the
cleaner policy to mq or smq a NULL pointer crash (in dm_tm_new_block)
was observed. The crash was caused by bugs in dm-cache-metadata.c
when trying to skip creation of the hint btree.
The minimal fix is to change hint size for the cleaner policy to 4 bytes
(only hint size supported).
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/md/dm-cache-policy-cleaner.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-cache-policy-cleaner.c b/drivers/md/dm-cache-policy-cleaner.c
index b04d1f904d07..2eca9084defe 100644
--- a/drivers/md/dm-cache-policy-cleaner.c
+++ b/drivers/md/dm-cache-policy-cleaner.c
@@ -434,7 +434,7 @@ static struct dm_cache_policy *wb_create(dm_cblock_t cache_size,
static struct dm_cache_policy_type wb_policy_type = {
.name = "cleaner",
.version = {1, 0, 0},
- .hint_size = 0,
+ .hint_size = 4,
.owner = THIS_MODULE,
.create = wb_create
};
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 078/123] staging: speakup: fix speakup-r regression
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (76 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 077/123] dm cache: fix NULL pointer when switching from cleaner policy Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 079/123] mm/slab: fix unexpected index mapping result of kmalloc_size(INDEX_NODE+1) Jiri Slaby
` (46 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, covici@ccs.covici.com, Jiri Slaby
From: "covici@ccs.covici.com" <covici@ccs.covici.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b1d562acc78f0af46de0dfe447410bc40bdb7ece upstream.
Here is a patch to make speakup-r work again.
It broke in 3.6 due to commit 4369c64c79a22b98d3b7eff9d089196cd878a10a
"Input: Send events one packet at a time)
The problem was that the fakekey.c routine to fake a down arrow no
longer functioned properly and putting the input_sync fixed it.
Fixes: 4369c64c79a22b98d3b7eff9d089196cd878a10a
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: John Covici <covici@ccs.covici.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/staging/speakup/fakekey.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/speakup/fakekey.c b/drivers/staging/speakup/fakekey.c
index 4299cf45f947..5e1f16c36b49 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -81,6 +81,7 @@ void speakup_fake_down_arrow(void)
__this_cpu_write(reporting_keystroke, true);
input_report_key(virt_keyboard, KEY_DOWN, PRESSED);
input_report_key(virt_keyboard, KEY_DOWN, RELEASED);
+ input_sync(virt_keyboard);
__this_cpu_write(reporting_keystroke, false);
/* reenable preemption */
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 079/123] mm/slab: fix unexpected index mapping result of kmalloc_size(INDEX_NODE+1)
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (77 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 078/123] staging: speakup: fix speakup-r regression Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 080/123] 3w-9xxx: don't unmap bounce buffered commands Jiri Slaby
` (45 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Joonsoo Kim, Joonsoo Kim, Pekka Enberg,
David Rientjes, Andrew Morton, Linus Torvalds, Jiri Slaby
From: Joonsoo Kim <js1304@gmail.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 03a2d2a3eafe4015412cf4e9675ca0e2d9204074 upstream.
Commit description is copied from the original post of this bug:
http://comments.gmane.org/gmane.linux.kernel.mm/135349
Kernels after v3.9 use kmalloc_size(INDEX_NODE + 1) to get the next
larger cache size than the size index INDEX_NODE mapping. In kernels
3.9 and earlier we used malloc_sizes[INDEX_L3 + 1].cs_size.
However, sometimes we can't get the right output we expected via
kmalloc_size(INDEX_NODE + 1), causing a BUG().
The mapping table in the latest kernel is like:
index = {0, 1, 2 , 3, 4, 5, 6, n}
size = {0, 96, 192, 8, 16, 32, 64, 2^n}
The mapping table before 3.10 is like this:
index = {0 , 1 , 2, 3, 4 , 5 , 6, n}
size = {32, 64, 96, 128, 192, 256, 512, 2^(n+3)}
The problem on my mips64 machine is as follows:
(1) When configured DEBUG_SLAB && DEBUG_PAGEALLOC && DEBUG_LOCK_ALLOC
&& DEBUG_SPINLOCK, the sizeof(struct kmem_cache_node) will be "150",
and the macro INDEX_NODE turns out to be "2": #define INDEX_NODE
kmalloc_index(sizeof(struct kmem_cache_node))
(2) Then the result of kmalloc_size(INDEX_NODE + 1) is 8.
(3) Then "if(size >= kmalloc_size(INDEX_NODE + 1)" will lead to "size
= PAGE_SIZE".
(4) Then "if ((size >= (PAGE_SIZE >> 3))" test will be satisfied and
"flags |= CFLGS_OFF_SLAB" will be covered.
(5) if (flags & CFLGS_OFF_SLAB)" test will be satisfied and will go to
"cachep->slabp_cache = kmalloc_slab(slab_size, 0u)", and the result
here may be NULL while kernel bootup.
(6) Finally,"BUG_ON(ZERO_OR_NULL_PTR(cachep->slabp_cache));" causes the
BUG info as the following shows (may be only mips64 has this problem):
This patch fixes the problem of kmalloc_size(INDEX_NODE + 1) and removes
the BUG by adding 'size >= 256' check to guarantee that all necessary
small sized slabs are initialized regardless sequence of slab size in
mapping table.
Fixes: e33660165c90 ("slab: Use common kmalloc_index/kmalloc_size...")
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Reported-by: Liuhailong <liu.hailong6@zte.com.cn>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: 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/slab.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index c180fbb8460b..e160d9c39796 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2304,9 +2304,16 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
size += BYTES_PER_WORD;
}
#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
- if (size >= kmalloc_size(INDEX_NODE + 1)
- && cachep->object_size > cache_line_size()
- && ALIGN(size, cachep->align) < PAGE_SIZE) {
+ /*
+ * To activate debug pagealloc, off-slab management is necessary
+ * requirement. In early phase of initialization, small sized slab
+ * doesn't get initialized so it would not be possible. So, we need
+ * to check size >= 256. It guarantees that all necessary small
+ * sized slab is initialized in current slab initialization sequence.
+ */
+ if (!slab_early_init && size >= kmalloc_size(INDEX_NODE) &&
+ size >= 256 && cachep->object_size > cache_line_size() &&
+ ALIGN(size, cachep->align) < PAGE_SIZE) {
cachep->obj_offset += PAGE_SIZE - ALIGN(size, cachep->align);
size = PAGE_SIZE;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 080/123] 3w-9xxx: don't unmap bounce buffered commands
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (78 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 079/123] mm/slab: fix unexpected index mapping result of kmalloc_size(INDEX_NODE+1) Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 081/123] l2tp: protect tunnel->del_work by ref_count Jiri Slaby
` (44 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Christoph Hellwig, James Bottomley, Jiri Slaby
From: Christoph Hellwig <hch@lst.de>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 15e3d5a285ab9283136dba34bbf72886d9146706 upstream.
3w controller don't dma map small single SGL entry commands but instead
bounce buffer them. Add a helper to identify these commands and don't
call scsi_dma_unmap for them.
Based on an earlier patch from James Bottomley.
Fixes: 118c85 ("3w-9xxx: fix command completion race")
Reported-by: Tóth Attila <atoth@atoth.sote.hu>
Tested-by: Tóth Attila <atoth@atoth.sote.hu>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/scsi/3w-9xxx.c | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 5f57e3d35e26..6adf9abdf955 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -225,6 +225,17 @@ static const struct file_operations twa_fops = {
.llseek = noop_llseek,
};
+/*
+ * The controllers use an inline buffer instead of a mapped SGL for small,
+ * single entry buffers. Note that we treat a zero-length transfer like
+ * a mapped SGL.
+ */
+static bool twa_command_mapped(struct scsi_cmnd *cmd)
+{
+ return scsi_sg_count(cmd) != 1 ||
+ scsi_bufflen(cmd) >= TW_MIN_SGL_LENGTH;
+}
+
/* This function will complete an aen request from the isr */
static int twa_aen_complete(TW_Device_Extension *tw_dev, int request_id)
{
@@ -1351,7 +1362,8 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
}
/* Now complete the io */
- scsi_dma_unmap(cmd);
+ if (twa_command_mapped(cmd))
+ scsi_dma_unmap(cmd);
cmd->scsi_done(cmd);
tw_dev->state[request_id] = TW_S_COMPLETED;
twa_free_request_id(tw_dev, request_id);
@@ -1594,7 +1606,8 @@ static int twa_reset_device_extension(TW_Device_Extension *tw_dev)
struct scsi_cmnd *cmd = tw_dev->srb[i];
cmd->result = (DID_RESET << 16);
- scsi_dma_unmap(cmd);
+ if (twa_command_mapped(cmd))
+ scsi_dma_unmap(cmd);
cmd->scsi_done(cmd);
}
}
@@ -1777,12 +1790,14 @@ static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_
retval = twa_scsiop_execute_scsi(tw_dev, request_id, NULL, 0, NULL);
switch (retval) {
case SCSI_MLQUEUE_HOST_BUSY:
- scsi_dma_unmap(SCpnt);
+ if (twa_command_mapped(SCpnt))
+ scsi_dma_unmap(SCpnt);
twa_free_request_id(tw_dev, request_id);
break;
case 1:
SCpnt->result = (DID_ERROR << 16);
- scsi_dma_unmap(SCpnt);
+ if (twa_command_mapped(SCpnt))
+ scsi_dma_unmap(SCpnt);
done(SCpnt);
tw_dev->state[request_id] = TW_S_COMPLETED;
twa_free_request_id(tw_dev, request_id);
@@ -1843,8 +1858,7 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
/* Map sglist from scsi layer to cmd packet */
if (scsi_sg_count(srb)) {
- if ((scsi_sg_count(srb) == 1) &&
- (scsi_bufflen(srb) < TW_MIN_SGL_LENGTH)) {
+ if (!twa_command_mapped(srb)) {
if (srb->sc_data_direction == DMA_TO_DEVICE ||
srb->sc_data_direction == DMA_BIDIRECTIONAL)
scsi_sg_copy_to_buffer(srb,
@@ -1917,7 +1931,7 @@ static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int re
{
struct scsi_cmnd *cmd = tw_dev->srb[request_id];
- if (scsi_bufflen(cmd) < TW_MIN_SGL_LENGTH &&
+ if (!twa_command_mapped(cmd) &&
(cmd->sc_data_direction == DMA_FROM_DEVICE ||
cmd->sc_data_direction == DMA_BIDIRECTIONAL)) {
if (scsi_sg_count(cmd) == 1) {
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 081/123] l2tp: protect tunnel->del_work by ref_count
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (79 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 080/123] 3w-9xxx: don't unmap bounce buffered commands Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 082/123] af_unix: Convert the unix_sk macro to an inline function for type safety Jiri Slaby
` (43 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Alexander Couzens, David S . Miller, Jiri Slaby
From: Alexander Couzens <lynxis@fe80.eu>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 06a15f51cf3618e32a73871ee6a547ef7fd902b5 ]
There is a small chance that tunnel_free() is called before tunnel->del_work scheduled
resulting in a zero pointer dereference.
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Acked-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
net/l2tp/l2tp_core.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index b076e8309bc2..6639bc27edb9 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1438,7 +1438,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
tunnel = container_of(work, struct l2tp_tunnel, del_work);
sk = l2tp_tunnel_sock_lookup(tunnel);
if (!sk)
- return;
+ goto out;
sock = sk->sk_socket;
@@ -1459,6 +1459,8 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
}
l2tp_tunnel_sock_put(sk);
+out:
+ l2tp_tunnel_dec_refcount(tunnel);
}
/* Create a socket for the tunnel, if one isn't set up by
@@ -1788,8 +1790,13 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create);
*/
int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
{
+ l2tp_tunnel_inc_refcount(tunnel);
l2tp_tunnel_closeall(tunnel);
- return (false == queue_work(l2tp_wq, &tunnel->del_work));
+ if (false == queue_work(l2tp_wq, &tunnel->del_work)) {
+ l2tp_tunnel_dec_refcount(tunnel);
+ return 1;
+ }
+ return 0;
}
EXPORT_SYMBOL_GPL(l2tp_tunnel_delete);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 082/123] af_unix: Convert the unix_sk macro to an inline function for type safety
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (80 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 081/123] l2tp: protect tunnel->del_work by ref_count Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 083/123] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag Jiri Slaby
` (42 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Aaron Conole, David S . Miller, Jiri Slaby
From: Aaron Conole <aconole@bytheb.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 4613012db1d911f80897f9446a49de817b2c4c47 ]
As suggested by Eric Dumazet this change replaces the
#define with a static inline function to enjoy
complaints by the compiler when misusing the API.
Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
include/net/af_unix.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index a175ba4a7adb..dfe4ddfbb43c 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -64,7 +64,11 @@ struct unix_sock {
#define UNIX_GC_MAYBE_CYCLE 1
struct socket_wq peer_wq;
};
-#define unix_sk(__sk) ((struct unix_sock *)__sk)
+
+static inline struct unix_sock *unix_sk(struct sock *sk)
+{
+ return (struct unix_sock *)sk;
+}
#define peer_wait peer_wq.wait
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 083/123] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (81 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 082/123] af_unix: Convert the unix_sk macro to an inline function for type safety Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 084/123] net/unix: fix logic about sk_peek_offset Jiri Slaby
` (41 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Aaron Conole, David S . Miller, Jiri Slaby
From: Aaron Conole <aconole@bytheb.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 9f389e35674f5b086edd70ed524ca0f287259725 ]
AF_UNIX sockets now return multiple skbs from recv() when MSG_PEEK flag
is set.
This is referenced in kernel bugzilla #12323 @
https://bugzilla.kernel.org/show_bug.cgi?id=12323
As described both in the BZ and lkml thread @
http://lkml.org/lkml/2008/1/8/444 calling recv() with MSG_PEEK on an
AF_UNIX socket only reads a single skb, where the desired effect is
to return as much skb data has been queued, until hitting the recv
buffer size (whichever comes first).
The modified MSG_PEEK path will now move to the next skb in the tree
and jump to the again: label, rather than following the natural loop
structure. This requires duplicating some of the loop head actions.
This was tested using the python socketpair python code attached to
the bugzilla issue.
Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
net/unix/af_unix.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 9afa362d8a31..39b9429c2c86 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2062,8 +2062,20 @@ again:
if (UNIXCB(skb).fp)
siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp);
- sk_peek_offset_fwd(sk, chunk);
+ if (skip) {
+ sk_peek_offset_fwd(sk, chunk);
+ skip -= chunk;
+ }
+
+ if (UNIXCB(skb).fp)
+ break;
+ last = skb;
+ unix_state_lock(sk);
+ skb = skb_peek_next(skb, &sk->sk_receive_queue);
+ if (skb)
+ goto again;
+ unix_state_unlock(sk);
break;
}
} while (size);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 084/123] net/unix: fix logic about sk_peek_offset
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (82 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 083/123] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 085/123] skbuff: Fix skb checksum flag on skb pull Jiri Slaby
` (40 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Andrey Vagin, David S. Miller, Eric Dumazet,
Aaron Conole, Jiri Slaby
From: Andrey Vagin <avagin@openvz.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit e9193d60d363e4dff75ff6d43a48f22be26d59c7 ]
Now send with MSG_PEEK can return data from multiple SKBs.
Unfortunately we take into account the peek offset for each skb,
that is wrong. We need to apply the peek offset only once.
In addition, the peek offset should be used only if MSG_PEEK is set.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Aaron Conole <aconole@bytheb.org>
Fixes: 9f389e35674f ("af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag")
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Tested-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
net/unix/af_unix.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 39b9429c2c86..157b3595ef62 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1954,6 +1954,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
goto out;
}
+ if (flags & MSG_PEEK)
+ skip = sk_peek_offset(sk, flags);
+ else
+ skip = 0;
+
do {
int chunk;
struct sk_buff *skb, *last;
@@ -2000,7 +2005,6 @@ again:
break;
}
- skip = sk_peek_offset(sk, flags);
while (skip >= unix_skb_len(skb)) {
skip -= unix_skb_len(skb);
last = skb;
@@ -2062,14 +2066,12 @@ again:
if (UNIXCB(skb).fp)
siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp);
- if (skip) {
- sk_peek_offset_fwd(sk, chunk);
- skip -= chunk;
- }
+ sk_peek_offset_fwd(sk, chunk);
if (UNIXCB(skb).fp)
break;
+ skip = 0;
last = skb;
unix_state_lock(sk);
skb = skb_peek_next(skb, &sk->sk_receive_queue);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 085/123] skbuff: Fix skb checksum flag on skb pull
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (83 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 084/123] net/unix: fix logic about sk_peek_offset Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 086/123] skbuff: Fix skb checksum partial check Jiri Slaby
` (39 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Pravin B Shelar, David S . Miller, Jiri Slaby
From: Pravin B Shelar <pshelar@nicira.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 6ae459bdaaeebc632b16e54dcbabb490c6931d61 ]
VXLAN device can receive skb with checksum partial. But the checksum
offset could be in outer header which is pulled on receive. This results
in negative checksum offset for the skb. Such skb can cause the assert
failure in skb_checksum_help(). Following patch fixes the bug by setting
checksum-none while pulling outer header.
Following is the kernel panic msg from old kernel hitting the bug.
------------[ cut here ]------------
kernel BUG at net/core/dev.c:1906!
RIP: 0010:[<ffffffff81518034>] skb_checksum_help+0x144/0x150
Call Trace:
<IRQ>
[<ffffffffa0164c28>] queue_userspace_packet+0x408/0x470 [openvswitch]
[<ffffffffa016614d>] ovs_dp_upcall+0x5d/0x60 [openvswitch]
[<ffffffffa0166236>] ovs_dp_process_packet_with_key+0xe6/0x100 [openvswitch]
[<ffffffffa016629b>] ovs_dp_process_received_packet+0x4b/0x80 [openvswitch]
[<ffffffffa016c51a>] ovs_vport_receive+0x2a/0x30 [openvswitch]
[<ffffffffa0171383>] vxlan_rcv+0x53/0x60 [openvswitch]
[<ffffffffa01734cb>] vxlan_udp_encap_recv+0x8b/0xf0 [openvswitch]
[<ffffffff8157addc>] udp_queue_rcv_skb+0x2dc/0x3b0
[<ffffffff8157b56f>] __udp4_lib_rcv+0x1cf/0x6c0
[<ffffffff8157ba7a>] udp_rcv+0x1a/0x20
[<ffffffff8154fdbd>] ip_local_deliver_finish+0xdd/0x280
[<ffffffff81550128>] ip_local_deliver+0x88/0x90
[<ffffffff8154fa7d>] ip_rcv_finish+0x10d/0x370
[<ffffffff81550365>] ip_rcv+0x235/0x300
[<ffffffff8151ba1d>] __netif_receive_skb+0x55d/0x620
[<ffffffff8151c360>] netif_receive_skb+0x80/0x90
[<ffffffff81459935>] virtnet_poll+0x555/0x6f0
[<ffffffff8151cd04>] net_rx_action+0x134/0x290
[<ffffffff810683d8>] __do_softirq+0xa8/0x210
[<ffffffff8162fe6c>] call_softirq+0x1c/0x30
[<ffffffff810161a5>] do_softirq+0x65/0xa0
[<ffffffff810687be>] irq_exit+0x8e/0xb0
[<ffffffff81630733>] do_IRQ+0x63/0xe0
[<ffffffff81625f2e>] common_interrupt+0x6e/0x6e
Reported-by: Anupam Chanda <achanda@vmware.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
include/linux/skbuff.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 47032528386a..80fad984cd8e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2264,6 +2264,9 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,
{
if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
+ else if (skb->ip_summed == CHECKSUM_PARTIAL &&
+ skb_checksum_start_offset(skb) <= len)
+ skb->ip_summed = CHECKSUM_NONE;
}
unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 086/123] skbuff: Fix skb checksum partial check.
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (84 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 085/123] skbuff: Fix skb checksum flag on skb pull Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 087/123] net: add pfmemalloc check in sk_add_backlog() Jiri Slaby
` (38 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Pravin B Shelar, David S . Miller, Jiri Slaby
From: Pravin B Shelar <pshelar@nicira.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 31b33dfb0a144469dd805514c9e63f4993729a48 ]
Earlier patch 6ae459bda tried to detect void ckecksum partial
skb by comparing pull length to checksum offset. But it does
not work for all cases since checksum-offset depends on
updates to skb->data.
Following patch fixes it by validating checksum start offset
after skb-data pointer is updated. Negative value of checksum
offset start means there is no need to checksum.
Fixes: 6ae459bda ("skbuff: Fix skb checksum flag on skb pull")
Reported-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
include/linux/skbuff.h | 2 +-
net/core/skbuff.c | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 80fad984cd8e..16e753a9922a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2265,7 +2265,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,
if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
else if (skb->ip_summed == CHECKSUM_PARTIAL &&
- skb_checksum_start_offset(skb) <= len)
+ skb_checksum_start_offset(skb) < 0)
skb->ip_summed = CHECKSUM_NONE;
}
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index b01dd5f421da..de76393a9916 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2726,11 +2726,12 @@ EXPORT_SYMBOL(skb_append_datato_frags);
*/
unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len)
{
+ unsigned char *data = skb->data;
+
BUG_ON(len > skb->len);
- skb->len -= len;
- BUG_ON(skb->len < skb->data_len);
- skb_postpull_rcsum(skb, skb->data, len);
- return skb->data += len;
+ __skb_pull(skb, len);
+ skb_postpull_rcsum(skb, data, len);
+ return skb->data;
}
EXPORT_SYMBOL_GPL(skb_pull_rcsum);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 087/123] net: add pfmemalloc check in sk_add_backlog()
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (85 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 086/123] skbuff: Fix skb checksum partial check Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 088/123] ppp: don't override sk->sk_state in pppoe_flush_dev() Jiri Slaby
` (37 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Eric Dumazet, David S . Miller, Jiri Slaby
From: Eric Dumazet <edumazet@google.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit c7c49b8fde26b74277188bdc6c9dca38db6fa35b ]
Greg reported crashes hitting the following check in __sk_backlog_rcv()
BUG_ON(!sock_flag(sk, SOCK_MEMALLOC));
The pfmemalloc bit is currently checked in sk_filter().
This works correctly for TCP, because sk_filter() is ran in
tcp_v[46]_rcv() before hitting the prequeue or backlog checks.
For UDP or other protocols, this does not work, because the sk_filter()
is ran from sock_queue_rcv_skb(), which might be called _after_ backlog
queuing if socket is owned by user by the time packet is processed by
softirq handler.
Fixes: b4b9e35585089 ("netvm: set PF_MEMALLOC as appropriate during SKB processing")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Greg Thelen <gthelen@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
include/net/sock.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/net/sock.h b/include/net/sock.h
index d157f4f56f01..4f355e69e5d2 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -788,6 +788,14 @@ static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *s
if (sk_rcvqueues_full(sk, skb, limit))
return -ENOBUFS;
+ /*
+ * If the skb was allocated from pfmemalloc reserves, only
+ * allow SOCK_MEMALLOC sockets to use it as this socket is
+ * helping free memory
+ */
+ if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC))
+ return -ENOMEM;
+
__sk_add_backlog(sk, skb);
sk->sk_backlog.len += skb->truesize;
return 0;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 088/123] ppp: don't override sk->sk_state in pppoe_flush_dev()
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (86 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 087/123] net: add pfmemalloc check in sk_add_backlog() Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 089/123] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings Jiri Slaby
` (36 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Guillaume Nault, David S . Miller, Jiri Slaby
From: Guillaume Nault <g.nault@alphalink.fr>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit e6740165b8f7f06d8caee0fceab3fb9d790a6fed ]
Since commit 2b018d57ff18 ("pppoe: drop PPPOX_ZOMBIEs in pppoe_release"),
pppoe_release() calls dev_put(po->pppoe_dev) if sk is in the
PPPOX_ZOMBIE state. But pppoe_flush_dev() can set sk->sk_state to
PPPOX_ZOMBIE _and_ reset po->pppoe_dev to NULL. This leads to the
following oops:
[ 570.140800] BUG: unable to handle kernel NULL pointer dereference at 00000000000004e0
[ 570.142931] IP: [<ffffffffa018c701>] pppoe_release+0x50/0x101 [pppoe]
[ 570.144601] PGD 3d119067 PUD 3dbc1067 PMD 0
[ 570.144601] Oops: 0000 [#1] SMP
[ 570.144601] Modules linked in: l2tp_ppp l2tp_netlink l2tp_core ip6_udp_tunnel udp_tunnel pppoe pppox ppp_generic slhc loop crc32c_intel ghash_clmulni_intel jitterentropy_rng sha256_generic hmac drbg ansi_cprng aesni_intel aes_x86_64 ablk_helper cryptd lrw gf128mul glue_helper acpi_cpufreq evdev serio_raw processor button ext4 crc16 mbcache jbd2 virtio_net virtio_blk virtio_pci virtio_ring virtio
[ 570.144601] CPU: 1 PID: 15738 Comm: ppp-apitest Not tainted 4.2.0 #1
[ 570.144601] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014
[ 570.144601] task: ffff88003d30d600 ti: ffff880036b60000 task.ti: ffff880036b60000
[ 570.144601] RIP: 0010:[<ffffffffa018c701>] [<ffffffffa018c701>] pppoe_release+0x50/0x101 [pppoe]
[ 570.144601] RSP: 0018:ffff880036b63e08 EFLAGS: 00010202
[ 570.144601] RAX: 0000000000000000 RBX: ffff880034340000 RCX: 0000000000000206
[ 570.144601] RDX: 0000000000000006 RSI: ffff88003d30dd20 RDI: ffff88003d30dd20
[ 570.144601] RBP: ffff880036b63e28 R08: 0000000000000001 R09: 0000000000000000
[ 570.144601] R10: 00007ffee9b50420 R11: ffff880034340078 R12: ffff8800387ec780
[ 570.144601] R13: ffff8800387ec7b0 R14: ffff88003e222aa0 R15: ffff8800387ec7b0
[ 570.144601] FS: 00007f5672f48700(0000) GS:ffff88003fc80000(0000) knlGS:0000000000000000
[ 570.144601] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 570.144601] CR2: 00000000000004e0 CR3: 0000000037f7e000 CR4: 00000000000406a0
[ 570.144601] Stack:
[ 570.144601] ffffffffa018f240 ffff8800387ec780 ffffffffa018f240 ffff8800387ec7b0
[ 570.144601] ffff880036b63e48 ffffffff812caabe ffff880039e4e000 0000000000000008
[ 570.144601] ffff880036b63e58 ffffffff812cabad ffff880036b63ea8 ffffffff811347f5
[ 570.144601] Call Trace:
[ 570.144601] [<ffffffff812caabe>] sock_release+0x1a/0x75
[ 570.144601] [<ffffffff812cabad>] sock_close+0xd/0x11
[ 570.144601] [<ffffffff811347f5>] __fput+0xff/0x1a5
[ 570.144601] [<ffffffff811348cb>] ____fput+0x9/0xb
[ 570.144601] [<ffffffff81056682>] task_work_run+0x66/0x90
[ 570.144601] [<ffffffff8100189e>] prepare_exit_to_usermode+0x8c/0xa7
[ 570.144601] [<ffffffff81001a26>] syscall_return_slowpath+0x16d/0x19b
[ 570.144601] [<ffffffff813babb1>] int_ret_from_sys_call+0x25/0x9f
[ 570.144601] Code: 48 8b 83 c8 01 00 00 a8 01 74 12 48 89 df e8 8b 27 14 e1 b8 f7 ff ff ff e9 b7 00 00 00 8a 43 12 a8 0b 74 1c 48 8b 83 a8 04 00 00 <48> 8b 80 e0 04 00 00 65 ff 08 48 c7 83 a8 04 00 00 00 00 00 00
[ 570.144601] RIP [<ffffffffa018c701>] pppoe_release+0x50/0x101 [pppoe]
[ 570.144601] RSP <ffff880036b63e08>
[ 570.144601] CR2: 00000000000004e0
[ 570.200518] ---[ end trace 46956baf17349563 ]---
pppoe_flush_dev() has no reason to override sk->sk_state with
PPPOX_ZOMBIE. pppox_unbind_sock() already sets sk->sk_state to
PPPOX_DEAD, which is the correct state given that sk is unbound and
po->pppoe_dev is NULL.
Fixes: 2b018d57ff18 ("pppoe: drop PPPOX_ZOMBIEs in pppoe_release")
Tested-by: Oleksii Berezhniak <core@irc.lg.ua>
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/net/ppp/pppoe.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index addd23246eb6..d66cf214e95e 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -313,7 +313,6 @@ static void pppoe_flush_dev(struct net_device *dev)
if (po->pppoe_dev == dev &&
sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) {
pppox_unbind_sock(sk);
- sk->sk_state = PPPOX_ZOMBIE;
sk->sk_state_change(sk);
po->pppoe_dev = NULL;
dev_put(dev);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 089/123] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (87 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 088/123] ppp: don't override sk->sk_state in pppoe_flush_dev() Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 090/123] asix: Don't reset PHY on if_up for ASIX 88772 Jiri Slaby
` (35 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Joe Perches, David S . Miller, Jiri Slaby
From: Joe Perches <joe@perches.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 077cb37fcf6f00a45f375161200b5ee0cd4e937b ]
It seems that kernel memory can leak into userspace by a
kmalloc, ethtool_get_strings, then copy_to_user sequence.
Avoid this by using kcalloc to zero fill the copied buffer.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
net/core/ethtool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 78e9d9223e40..944c60ce15d8 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1077,7 +1077,7 @@ static int ethtool_get_strings(struct net_device *dev, void __user *useraddr)
gstrings.len = ret;
- data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER);
+ data = kcalloc(gstrings.len, ETH_GSTRING_LEN, GFP_USER);
if (!data)
return -ENOMEM;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 090/123] asix: Don't reset PHY on if_up for ASIX 88772
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (88 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 089/123] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 091/123] asix: Do full reset during ax88772_bind Jiri Slaby
` (34 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Michel Stam, David S . Miller, Jiri Slaby
From: Michel Stam <m.stam@fugro.nl>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 3cc81d85ee01e5a0b7ea2f4190e2ed1165f53c31 ]
I've noticed every time the interface is set to 'up,', the kernel
reports that the link speed is set to 100 Mbps/Full Duplex, even
when ethtool is used to set autonegotiation to 'off', half
duplex, 10 Mbps.
It can be tested by:
ifconfig eth0 down
ethtool -s eth0 autoneg off speed 10 duplex half
ifconfig eth0 up
Then checking 'dmesg' for the link speed.
Signed-off-by: Michel Stam <m.stam@fugro.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/net/usb/asix_devices.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index 20643833f0e6..19c1705e0c5c 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -891,7 +891,7 @@ static const struct driver_info ax88772_info = {
.unbind = ax88772_unbind,
.status = asix_status,
.link_reset = ax88772_link_reset,
- .reset = ax88772_reset,
+ .reset = ax88772_link_reset,
.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | FLAG_MULTI_PACKET,
.rx_fixup = asix_rx_fixup_common,
.tx_fixup = asix_tx_fixup,
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 091/123] asix: Do full reset during ax88772_bind
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (89 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 090/123] asix: Don't reset PHY on if_up for ASIX 88772 Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 092/123] crypto: sparc - initialize blkcipher.ivsize Jiri Slaby
` (33 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Charles Keepax, David S . Miller, Jiri Slaby
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
[ Upstream commit 436c2a5036b6ffe813310df2cf327d3b69be0734 ]
commit 3cc81d85ee01 ("asix: Don't reset PHY on if_up for ASIX 88772")
causes the ethernet on Arndale to no longer function. This appears to
be because the Arndale ethernet requires a full reset before it will
function correctly, however simply reverting the above patch causes
problems with ethtool settings getting reset.
It seems the problem is that the ethernet is not properly reset during
bind, and indeed the code in ax88772_bind that resets the device is a
very small subset of the actual ax88772_reset function. This patch uses
ax88772_reset in place of the existing reset code in ax88772_bind which
removes some code duplication and fixes the ethernet on Arndale.
It is still possible that the original patch causes some issues with
suspend and resume but that seems like a separate issue and I haven't
had a chance to test that yet.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/net/usb/asix_devices.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index 19c1705e0c5c..31e607afb1d0 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -466,19 +466,7 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
return ret;
}
- ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL);
- if (ret < 0)
- return ret;
-
- msleep(150);
-
- ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
- if (ret < 0)
- return ret;
-
- msleep(150);
-
- ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_PRTE);
+ ax88772_reset(dev);
/* Read PHYID register *AFTER* the PHY was reset properly */
phyid = asix_get_phyid(dev);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 092/123] crypto: sparc - initialize blkcipher.ivsize
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (90 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 091/123] asix: Do full reset during ax88772_bind Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 093/123] crypto: ahash - ensure statesize is non-zero Jiri Slaby
` (32 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Dave Kleikamp, Herbert Xu, Jiri Slaby
From: Dave Kleikamp <dave.kleikamp@oracle.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a66d7f724a96d6fd279bfbd2ee488def6b081bea upstream.
Some of the crypto algorithms write to the initialization vector,
but no space has been allocated for it. This clobbers adjacent memory.
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/sparc/crypto/aes_glue.c | 2 ++
arch/sparc/crypto/camellia_glue.c | 1 +
arch/sparc/crypto/des_glue.c | 2 ++
3 files changed, 5 insertions(+)
diff --git a/arch/sparc/crypto/aes_glue.c b/arch/sparc/crypto/aes_glue.c
index ded4cee35318..dc78cdd43e0a 100644
--- a/arch/sparc/crypto/aes_glue.c
+++ b/arch/sparc/crypto/aes_glue.c
@@ -433,6 +433,7 @@ static struct crypto_alg algs[] = { {
.blkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
+ .ivsize = AES_BLOCK_SIZE,
.setkey = aes_set_key,
.encrypt = cbc_encrypt,
.decrypt = cbc_decrypt,
@@ -452,6 +453,7 @@ static struct crypto_alg algs[] = { {
.blkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
+ .ivsize = AES_BLOCK_SIZE,
.setkey = aes_set_key,
.encrypt = ctr_crypt,
.decrypt = ctr_crypt,
diff --git a/arch/sparc/crypto/camellia_glue.c b/arch/sparc/crypto/camellia_glue.c
index 641f55cb61c3..eb87d6dd86b1 100644
--- a/arch/sparc/crypto/camellia_glue.c
+++ b/arch/sparc/crypto/camellia_glue.c
@@ -274,6 +274,7 @@ static struct crypto_alg algs[] = { {
.blkcipher = {
.min_keysize = CAMELLIA_MIN_KEY_SIZE,
.max_keysize = CAMELLIA_MAX_KEY_SIZE,
+ .ivsize = CAMELLIA_BLOCK_SIZE,
.setkey = camellia_set_key,
.encrypt = cbc_encrypt,
.decrypt = cbc_decrypt,
diff --git a/arch/sparc/crypto/des_glue.c b/arch/sparc/crypto/des_glue.c
index d11500972994..1359bfc544e4 100644
--- a/arch/sparc/crypto/des_glue.c
+++ b/arch/sparc/crypto/des_glue.c
@@ -429,6 +429,7 @@ static struct crypto_alg algs[] = { {
.blkcipher = {
.min_keysize = DES_KEY_SIZE,
.max_keysize = DES_KEY_SIZE,
+ .ivsize = DES_BLOCK_SIZE,
.setkey = des_set_key,
.encrypt = cbc_encrypt,
.decrypt = cbc_decrypt,
@@ -485,6 +486,7 @@ static struct crypto_alg algs[] = { {
.blkcipher = {
.min_keysize = DES3_EDE_KEY_SIZE,
.max_keysize = DES3_EDE_KEY_SIZE,
+ .ivsize = DES3_EDE_BLOCK_SIZE,
.setkey = des3_ede_set_key,
.encrypt = cbc3_encrypt,
.decrypt = cbc3_decrypt,
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 093/123] crypto: ahash - ensure statesize is non-zero
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (91 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 092/123] crypto: sparc - initialize blkcipher.ivsize Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 094/123] btrfs: fix use after free iterating extrefs Jiri Slaby
` (31 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Russell King, Herbert Xu, 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 8996eafdcbad149ac0f772fb1649fbb75c482a6a upstream.
Unlike shash algorithms, ahash drivers must implement export
and import as their descriptors may contain hardware state and
cannot be exported as is. Unfortunately some ahash drivers did
not provide them and end up causing crashes with algif_hash.
This patch adds a check to prevent these drivers from registering
ahash algorithms until they are fixed.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
crypto/ahash.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crypto/ahash.c b/crypto/ahash.c
index 793a27f2493e..857ae2b2a2a2 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -462,7 +462,8 @@ static int ahash_prepare_alg(struct ahash_alg *alg)
struct crypto_alg *base = &alg->halg.base;
if (alg->halg.digestsize > PAGE_SIZE / 8 ||
- alg->halg.statesize > PAGE_SIZE / 8)
+ alg->halg.statesize > PAGE_SIZE / 8 ||
+ alg->halg.statesize == 0)
return -EINVAL;
base->cra_type = &crypto_ahash_type;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 094/123] btrfs: fix use after free iterating extrefs
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (92 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 093/123] crypto: ahash - ensure statesize is non-zero Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 095/123] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419 Jiri Slaby
` (30 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Chris Mason, Mark Fasheh, Jiri Slaby
From: Chris Mason <clm@fb.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit dc6c5fb3b514221f2e9d21ee626a9d95d3418dff upstream.
The code for btrfs inode-resolve has never worked properly for
files with enough hard links to trigger extrefs. It was trying to
get the leaf out of a path after freeing the path:
btrfs_release_path(path);
leaf = path->nodes[0];
item_size = btrfs_item_size_nr(leaf, slot);
The fix here is to use the extent buffer we cloned just a little higher
up to avoid deadlocks caused by using the leaf in the path.
Signed-off-by: Chris Mason <clm@fb.com>
cc: Mark Fasheh <mfasheh@suse.de>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
fs/btrfs/backref.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 53039de1495d..db6818878462 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1668,7 +1668,6 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
int found = 0;
struct extent_buffer *eb;
struct btrfs_inode_extref *extref;
- struct extent_buffer *leaf;
u32 item_size;
u32 cur_offset;
unsigned long ptr;
@@ -1693,9 +1692,8 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
btrfs_release_path(path);
- leaf = path->nodes[0];
- item_size = btrfs_item_size_nr(leaf, path->slots[0]);
- ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
+ item_size = btrfs_item_size_nr(eb, path->slots[0]);
+ ptr = btrfs_item_ptr_offset(eb, path->slots[0]);
cur_offset = 0;
while (cur_offset < item_size) {
@@ -1709,7 +1707,7 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
if (ret)
break;
- cur_offset += btrfs_inode_extref_name_len(leaf, extref);
+ cur_offset += btrfs_inode_extref_name_len(eb, extref);
cur_offset += sizeof(*extref);
}
btrfs_tree_read_unlock_blocking(eb);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 095/123] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (93 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 094/123] btrfs: fix use after free iterating extrefs Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 096/123] i2c: rcar: enable RuntimePM before registering to the core Jiri Slaby
` (29 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Will Deacon, Ard Biesheuvel, Jiri Slaby
From: Will Deacon <will.deacon@arm.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b6dd8e0719c0d2d01429639a11b7bc2677de240c upstream.
Commit df057cc7b4fa ("arm64: errata: add module build workaround for
erratum #843419") sets CFLAGS_MODULE to ensure that the large memory
model is used by the compiler when building kernel modules.
However, CFLAGS_MODULE is an environment variable and intended to be
overridden on the command line, which appears to be the case with the
Ubuntu kernel packaging system, so use KBUILD_CFLAGS_MODULE instead.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: df057cc7b4fa ("arm64: errata: add module build workaround for erratum #843419")
Reported-by: Dann Frazier <dann.frazier@canonical.com>
Tested-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/arm64/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 4148c05df99a..e06f99f5e37a 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -29,7 +29,7 @@ comma = ,
CHECKFLAGS += -D__aarch64__
ifeq ($(CONFIG_ARM64_ERRATUM_843419), y)
-CFLAGS_MODULE += -mcmodel=large
+KBUILD_CFLAGS_MODULE += -mcmodel=large
endif
# Default value
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 096/123] i2c: rcar: enable RuntimePM before registering to the core
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (94 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 095/123] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419 Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 097/123] i2c: s3c2410: " Jiri Slaby
` (28 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 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 4f7effddf4549d57114289f273710f077c4c330a upstream.
The core may register clients attached to this master which may use
funtionality from the master. So, RuntimePM must be enabled before, otherwise
this will fail. While here, move drvdata, too.
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
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 | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index c8a42602205b..622b6fce149b 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -690,15 +690,16 @@ static int rcar_i2c_probe(struct platform_device *pdev)
return ret;
}
+ pm_runtime_enable(dev);
+ platform_set_drvdata(pdev, priv);
+
ret = i2c_add_numbered_adapter(adap);
if (ret < 0) {
dev_err(dev, "reg adap failed: %d\n", ret);
+ pm_runtime_disable(dev);
return ret;
}
- pm_runtime_enable(dev);
- platform_set_drvdata(pdev, priv);
-
dev_info(dev, "probed\n");
return 0;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 097/123] i2c: s3c2410: enable RuntimePM before registering to the core
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (95 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 096/123] i2c: rcar: enable RuntimePM before registering to the core Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 098/123] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348 Jiri Slaby
` (27 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 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 eadd709f5d2e8aebb1b7bf49460e97a68d81a9b0 upstream.
The core may register clients attached to this master which may use
funtionality from the master. So, RuntimePM must be enabled before, otherwise
this will fail. While here, move drvdata, too.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/i2c/busses/i2c-s3c2410.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index ce09bf932831..8983e7fa0fb4 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1151,17 +1151,19 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
i2c->adap.nr = i2c->pdata->bus_num;
i2c->adap.dev.of_node = pdev->dev.of_node;
+ platform_set_drvdata(pdev, i2c);
+
+ pm_runtime_enable(&pdev->dev);
+
ret = i2c_add_numbered_adapter(&i2c->adap);
if (ret < 0) {
dev_err(&pdev->dev, "failed to add bus to i2c core\n");
+ pm_runtime_disable(&pdev->dev);
s3c24xx_i2c_deregister_cpufreq(i2c);
clk_unprepare(i2c->clk);
return ret;
}
- platform_set_drvdata(pdev, i2c);
-
- pm_runtime_enable(&pdev->dev);
pm_runtime_enable(&i2c->adap.dev);
dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 098/123] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (96 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 097/123] i2c: s3c2410: " Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 099/123] workqueue: make sure delayed work run in local cpu Jiri Slaby
` (26 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Mika Westerberg, Wolfram Sang, Jiri Slaby
From: Mika Westerberg <mika.westerberg@linux.intel.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 56d4b8a24cef5d66f0d10ac778a520d3c2c68a48 upstream.
ACPI SSCN/FMCN methods were originally added because then the platform can
provide the most accurate HCNT/LCNT values to the driver. However, this
seems not to be true for Dell Inspiron 7348 where using these causes the
touchpad to fail in boot:
i2c_hid i2c-DLL0675:00: failed to retrieve report from device.
i2c_designware INT3433:00: i2c_dw_handle_tx_abort: lost arbitration
i2c_hid i2c-DLL0675:00: failed to retrieve report from device.
i2c_designware INT3433:00: controller timed out
The values received from ACPI are (in fast mode):
HCNT: 72
LCNT: 160
this translates to following timings (input clock is 100MHz on Broadwell):
tHIGH: 720 ns (spec min 600 ns)
tLOW: 1600 ns (spec min 1300 ns)
Bus period: 2920 ns (assuming 300 ns tf and tr)
Bus speed: 342.5 kHz
Both tHIGH and tLOW are within the I2C specification.
The calculated values when ACPI parameters are not used are (in fast mode):
HCNT: 87
LCNT: 159
which translates to:
tHIGH: 870 ns (spec min 600 ns)
tLOW: 1590 ns (spec min 1300 ns)
Bus period 3060 ns (assuming 300 ns tf and tr)
Bus speed 326.8 kHz
These values are also within the I2C specification.
Since both ACPI and calculated values meet the I2C specification timing
requirements it is hard to say why the touchpad does not function properly
with the ACPI values except that the bus speed is higher in this case (but
still well below the max 400kHz).
Solve this by adding DMI quirk to the driver that disables using ACPI
parameters on this particulare machine.
Reported-by: Pavel Roskin <plroskin@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Pavel Roskin <plroskin@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/i2c/busses/i2c-designware-platdrv.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index d0bdac0498ce..f7439c556413 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -28,6 +28,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/delay.h>
+#include <linux/dmi.h>
#include <linux/i2c.h>
#include <linux/clk.h>
#include <linux/errno.h>
@@ -53,6 +54,22 @@ static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
}
#ifdef CONFIG_ACPI
+/*
+ * The HCNT/LCNT information coming from ACPI should be the most accurate
+ * for given platform. However, some systems get it wrong. On such systems
+ * we get better results by calculating those based on the input clock.
+ */
+static const struct dmi_system_id dw_i2c_no_acpi_params[] = {
+ {
+ .ident = "Dell Inspiron 7348",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7348"),
+ },
+ },
+ { }
+};
+
static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
u16 *hcnt, u16 *lcnt, u32 *sda_hold)
{
@@ -60,6 +77,9 @@ static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
acpi_handle handle = ACPI_HANDLE(&pdev->dev);
union acpi_object *obj;
+ if (dmi_check_system(dw_i2c_no_acpi_params))
+ return;
+
if (ACPI_FAILURE(acpi_evaluate_object(handle, method, NULL, &buf)))
return;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 099/123] workqueue: make sure delayed work run in local cpu
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (97 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 098/123] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348 Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 100/123] drm/nouveau/fbcon: take runpm reference when userspace has an open fd Jiri Slaby
` (25 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Shaohua Li, Tejun Heo, Jiri Slaby
From: Shaohua Li <shli@fb.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 874bbfe600a660cba9c776b3957b1ce393151b76 upstream.
My system keeps crashing with below message. vmstat_update() schedules a delayed
work in current cpu and expects the work runs in the cpu.
schedule_delayed_work() is expected to make delayed work run in local cpu. The
problem is timer can be migrated with NO_HZ. __queue_work() queues work in
timer handler, which could run in a different cpu other than where the delayed
work is scheduled. The end result is the delayed work runs in different cpu.
The patch makes __queue_delayed_work records local cpu earlier. Where the timer
runs doesn't change where the work runs with the change.
[ 28.010131] ------------[ cut here ]------------
[ 28.010609] kernel BUG at ../mm/vmstat.c:1392!
[ 28.011099] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN
[ 28.011860] Modules linked in:
[ 28.012245] CPU: 0 PID: 289 Comm: kworker/0:3 Tainted: G W4.3.0-rc3+ #634
[ 28.013065] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140709_153802- 04/01/2014
[ 28.014160] Workqueue: events vmstat_update
[ 28.014571] task: ffff880117682580 ti: ffff8800ba428000 task.ti: ffff8800ba428000
[ 28.015445] RIP: 0010:[<ffffffff8115f921>] [<ffffffff8115f921>]vmstat_update+0x31/0x80
[ 28.016282] RSP: 0018:ffff8800ba42fd80 EFLAGS: 00010297
[ 28.016812] RAX: 0000000000000000 RBX: ffff88011a858dc0 RCX:0000000000000000
[ 28.017585] RDX: ffff880117682580 RSI: ffffffff81f14d8c RDI:ffffffff81f4df8d
[ 28.018366] RBP: ffff8800ba42fd90 R08: 0000000000000001 R09:0000000000000000
[ 28.019169] R10: 0000000000000000 R11: 0000000000000121 R12:ffff8800baa9f640
[ 28.019947] R13: ffff88011a81e340 R14: ffff88011a823700 R15:0000000000000000
[ 28.020071] FS: 0000000000000000(0000) GS:ffff88011a800000(0000)knlGS:0000000000000000
[ 28.020071] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 28.020071] CR2: 00007ff6144b01d0 CR3: 00000000b8e93000 CR4:00000000000006f0
[ 28.020071] Stack:
[ 28.020071] ffff88011a858dc0 ffff8800baa9f640 ffff8800ba42fe00ffffffff8106bd88
[ 28.020071] ffffffff8106bd0b 0000000000000096 0000000000000000ffffffff82f9b1e8
[ 28.020071] ffffffff829f0b10 0000000000000000 ffffffff81f18460ffff88011a81e340
[ 28.020071] Call Trace:
[ 28.020071] [<ffffffff8106bd88>] process_one_work+0x1c8/0x540
[ 28.020071] [<ffffffff8106bd0b>] ? process_one_work+0x14b/0x540
[ 28.020071] [<ffffffff8106c214>] worker_thread+0x114/0x460
[ 28.020071] [<ffffffff8106c100>] ? process_one_work+0x540/0x540
[ 28.020071] [<ffffffff81071bf8>] kthread+0xf8/0x110
[ 28.020071] [<ffffffff81071b00>] ?kthread_create_on_node+0x200/0x200
[ 28.020071] [<ffffffff81a6522f>] ret_from_fork+0x3f/0x70
[ 28.020071] [<ffffffff81071b00>] ?kthread_create_on_node+0x200/0x200
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
kernel/workqueue.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index bb5f920268d7..bba4e426ccbc 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1468,13 +1468,13 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq,
timer_stats_timer_set_start_info(&dwork->timer);
dwork->wq = wq;
+ /* timer isn't guaranteed to run in this cpu, record earlier */
+ if (cpu == WORK_CPU_UNBOUND)
+ cpu = raw_smp_processor_id();
dwork->cpu = cpu;
timer->expires = jiffies + delay;
- if (unlikely(cpu != WORK_CPU_UNBOUND))
- add_timer_on(timer, cpu);
- else
- add_timer(timer);
+ add_timer_on(timer, cpu);
}
/**
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 100/123] drm/nouveau/fbcon: take runpm reference when userspace has an open fd
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (98 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 099/123] workqueue: make sure delayed work run in local cpu Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 101/123] dm thin: fix missing pool reference count decrement in pool_ctr error path Jiri Slaby
` (24 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Ben Skeggs, Jiri Slaby
From: Ben Skeggs <bskeggs@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit f231976c2e8964ceaa9250e57d27c35ff03825c2 upstream.
We need to do this in order to prevent accesses to the device while it's
powered down. Userspace may have an mmap of the fb, and there's no good
way (that I know of) to prevent it from touching the device otherwise.
This fixes some nasty races between runpm and plymouth on some systems,
which result in the GPU getting very upset and hanging the boot.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/gpu/drm/nouveau/nouveau_fbcon.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index a86ecf65c164..2268dd52f3c6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -183,8 +183,30 @@ nouveau_fbcon_sync(struct fb_info *info)
return 0;
}
+static int
+nouveau_fbcon_open(struct fb_info *info, int user)
+{
+ struct nouveau_fbdev *fbcon = info->par;
+ struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
+ int ret = pm_runtime_get_sync(drm->dev->dev);
+ if (ret < 0 && ret != -EACCES)
+ return ret;
+ return 0;
+}
+
+static int
+nouveau_fbcon_release(struct fb_info *info, int user)
+{
+ struct nouveau_fbdev *fbcon = info->par;
+ struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
+ pm_runtime_put(drm->dev->dev);
+ return 0;
+}
+
static struct fb_ops nouveau_fbcon_ops = {
.owner = THIS_MODULE,
+ .fb_open = nouveau_fbcon_open,
+ .fb_release = nouveau_fbcon_release,
.fb_check_var = drm_fb_helper_check_var,
.fb_set_par = drm_fb_helper_set_par,
.fb_fillrect = nouveau_fbcon_fillrect,
@@ -200,6 +222,8 @@ static struct fb_ops nouveau_fbcon_ops = {
static struct fb_ops nouveau_fbcon_sw_ops = {
.owner = THIS_MODULE,
+ .fb_open = nouveau_fbcon_open,
+ .fb_release = nouveau_fbcon_release,
.fb_check_var = drm_fb_helper_check_var,
.fb_set_par = drm_fb_helper_set_par,
.fb_fillrect = cfb_fillrect,
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 101/123] dm thin: fix missing pool reference count decrement in pool_ctr error path
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (99 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 100/123] drm/nouveau/fbcon: take runpm reference when userspace has an open fd Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 102/123] rbd: fix double free on rbd_dev->header_name Jiri Slaby
` (23 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Mike Snitzer, Jiri Slaby
From: Mike Snitzer <snitzer@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit ba30670f4d5292c4e7f7980bbd5071f7c4794cdd upstream.
Fixes: ac8c3f3df ("dm thin: generate event when metadata threshold passed")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/md/dm-thin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index d2b3563129c2..5ff934102f30 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -2153,7 +2153,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv)
metadata_low_callback,
pool);
if (r)
- goto out_free_pt;
+ goto out_flags_changed;
pt->callbacks.congested_fn = pool_is_congested;
dm_table_add_target_callbacks(ti->table, &pt->callbacks);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 102/123] rbd: fix double free on rbd_dev->header_name
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (100 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 101/123] dm thin: fix missing pool reference count decrement in pool_ctr error path Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 103/123] usb: chipidea: debug: add runtime pm for register access Jiri Slaby
` (22 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Ilya Dryomov, Jiri Slaby
From: Ilya Dryomov <idryomov@gmail.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3ebe138ac642a195c7f2efdb918f464734421fd6 upstream.
If rbd_dev_image_probe() in rbd_dev_probe_parent() fails, header_name
is freed twice: once in rbd_dev_probe_parent() and then in its caller
rbd_dev_image_probe() (rbd_dev_image_probe() is called recursively to
handle parent images).
rbd_dev_probe_parent() is responsible for probing the parent, so it
shouldn't muck with clone's fields.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/block/rbd.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 63ff17fc23df..66f632730969 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4868,7 +4868,6 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev)
out_err:
if (parent) {
rbd_dev_unparent(rbd_dev);
- kfree(rbd_dev->header_name);
rbd_dev_destroy(parent);
} else {
rbd_put_client(rbdc);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 103/123] usb: chipidea: debug: add runtime pm for register access
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (101 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 102/123] rbd: fix double free on rbd_dev->header_name Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 104/123] USB: symbolserial: Correct transferred data size Jiri Slaby
` (21 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Li Jun, Oliver Neukum, Jiri Slaby
From: Li Jun <jun.li@freescale.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit bc24937943d9f71a1e32b5dc4e2f0ef8fcc07b64 upstream.
Add runtime pm operations for registers access to avoid system hang.
Signed-off-by: Li Jun <jun.li@freescale.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/chipidea/debug.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
index 92f0cc442d46..eac6a3212de2 100644
--- a/drivers/usb/chipidea/debug.c
+++ b/drivers/usb/chipidea/debug.c
@@ -62,9 +62,11 @@ static int ci_port_test_show(struct seq_file *s, void *data)
unsigned long flags;
unsigned mode;
+ pm_runtime_get_sync(ci->dev);
spin_lock_irqsave(&ci->lock, flags);
mode = hw_port_test_get(ci);
spin_unlock_irqrestore(&ci->lock, flags);
+ pm_runtime_put_sync(ci->dev);
seq_printf(s, "mode = %u\n", mode);
@@ -94,9 +96,11 @@ static ssize_t ci_port_test_write(struct file *file, const char __user *ubuf,
if (sscanf(buf, "%u", &mode) != 1)
return -EINVAL;
+ pm_runtime_get_sync(ci->dev);
spin_lock_irqsave(&ci->lock, flags);
ret = hw_port_test_set(ci, mode);
spin_unlock_irqrestore(&ci->lock, flags);
+ pm_runtime_put_sync(ci->dev);
return ret ? ret : count;
}
@@ -238,8 +242,10 @@ static ssize_t ci_role_write(struct file *file, const char __user *ubuf,
if (role == CI_ROLE_END || role == ci->role)
return -EINVAL;
+ pm_runtime_get_sync(ci->dev);
ci_role_stop(ci);
ret = ci_role_start(ci, role);
+ pm_runtime_put_sync(ci->dev);
return ret ? ret : count;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 104/123] USB: symbolserial: Correct transferred data size
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (102 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 103/123] usb: chipidea: debug: add runtime pm for register access Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine Jiri Slaby
` (20 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Philipp Hachtmann, Greg Kroah-Hartman,
Oliver Neukum, Jiri Slaby
From: Philipp Hachtmann <hachti@hachti.de>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 8ae25a355b5969e12f3185e8cb8eb08b871c9084 upstream.
The scanner (here DS3508) always returns 64 bytes per urb buffer. The first
byte indicates the data length used in the current buffer. There even was
a comment describing this. But the comment also said that we'll send
everything in the buffer to the tty layer. That means sending the actual
barcode data and lots of trailing zeroes. This patch lets the driver only
send the real data.
Signed-off-by: Philipp Hachtmann <hachti@hachti.de>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/serial/symbolserial.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c
index 1e2d86d4f539..aa6d2bea856b 100644
--- a/drivers/usb/serial/symbolserial.c
+++ b/drivers/usb/serial/symbolserial.c
@@ -61,17 +61,15 @@ static void symbol_int_callback(struct urb *urb)
usb_serial_debug_data(&port->dev, __func__, urb->actual_length, data);
+ /*
+ * Data from the device comes with a 1 byte header:
+ *
+ * <size of data> <data>...
+ */
if (urb->actual_length > 1) {
- data_length = urb->actual_length - 1;
-
- /*
- * Data from the device comes with a 1 byte header:
- *
- * <size of data>data...
- * This is real data to be sent to the tty layer
- * we pretty much just ignore the size and send everything
- * else to the tty layer.
- */
+ data_length = data[0];
+ if (data_length > (urb->actual_length - 1))
+ data_length = urb->actual_length - 1;
tty_insert_flip_string(&port->port, &data[1], data_length);
tty_flip_buffer_push(&port->port);
} else {
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (103 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 104/123] USB: symbolserial: Correct transferred data size Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2016-02-29 14:52 ` Liu [EP], Bin
2015-10-28 13:53 ` [PATCH 3.12 106/123] usb: musb: fix cppi channel teardown for isoch transfer Jiri Slaby
` (19 subsequent siblings)
124 siblings, 1 reply; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Bin Liu, Felipe Balbi, Oliver Neukum, Jiri Slaby
From: Bin Liu <b-liu@ti.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit cb83df77f3ec151d68a1b6be957207e6fc7b7f50 upstream.
1. set AUTOREQ to NONE at the beginning of teardown;
2. add delay for dma pipeline to drain;
3. Do not set USB_TDOWN bit for RX teardown.
The CPPI hw has an issue that when tearing down a RX channel, if
another RX channel is receiving data, the CPPI will lockup.
To workaround the issue, do not set the CPPI TD bit. The steps before
this point ensures the CPPI channel will be torn down properly.
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/musb/musb_cppi41.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
index 77b475a43dad..1c9c626248fd 100644
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -507,10 +507,15 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel)
csr &= ~MUSB_TXCSR_DMAENAB;
musb_writew(epio, MUSB_TXCSR, csr);
} else {
+ cppi41_set_autoreq_mode(cppi41_channel, EP_MODE_AUTOREQ_NONE);
+
csr = musb_readw(epio, MUSB_RXCSR);
csr &= ~(MUSB_RXCSR_H_REQPKT | MUSB_RXCSR_DMAENAB);
musb_writew(epio, MUSB_RXCSR, csr);
+ /* wait to drain cppi dma pipe line */
+ udelay(50);
+
csr = musb_readw(epio, MUSB_RXCSR);
if (csr & MUSB_RXCSR_RXPKTRDY) {
csr |= MUSB_RXCSR_FLUSHFIFO;
@@ -524,13 +529,14 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel)
tdbit <<= 16;
do {
- musb_writel(musb->ctrl_base, USB_TDOWN, tdbit);
+ if (is_tx)
+ musb_writel(musb->ctrl_base, USB_TDOWN, tdbit);
ret = dmaengine_terminate_all(cppi41_channel->dc);
} while (ret == -EAGAIN);
- musb_writel(musb->ctrl_base, USB_TDOWN, tdbit);
-
if (is_tx) {
+ musb_writel(musb->ctrl_base, USB_TDOWN, tdbit);
+
csr = musb_readw(epio, MUSB_TXCSR);
if (csr & MUSB_TXCSR_TXPKTRDY) {
csr |= MUSB_TXCSR_FLUSHFIFO;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* RE: [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine
2015-10-28 13:53 ` [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine Jiri Slaby
@ 2016-02-29 14:52 ` Liu [EP], Bin
2016-03-02 10:28 ` Jiri Slaby
0 siblings, 1 reply; 134+ messages in thread
From: Liu [EP], Bin @ 2016-02-29 14:52 UTC (permalink / raw)
To: Jiri Slaby, stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Oliver Neukum,
Felipe Balbi (balbi@kernel.org), yegorslists@googlemail.com
Hi Jiri,
> -----Original Message-----
> From: Jiri Slaby [mailto:jslaby@suse.cz]
> Sent: Wednesday, October 28, 2015 8:54 AM
> To: stable@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org; Liu, Bin; Balbi, Felipe; Oliver Neukum; Jiri
> Slaby
> Subject: [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort
> routine
>
> From: Bin Liu <b-liu@ti.com>
>
> 3.12-stable review patch. If anyone has any objections, please let me know.
It seems this backport missing the dependency 0149b07 upstream (usb: musb:
cppi41: correct the macro name EP_MODE_AUTOREG_*), which causes the micro
name mismatch.
Sorry for the late response, I just received the regression report.
Thanks,
-Bin.
>
> ===============
>
> commit cb83df77f3ec151d68a1b6be957207e6fc7b7f50 upstream.
>
> 1. set AUTOREQ to NONE at the beginning of teardown;
>
> 2. add delay for dma pipeline to drain;
>
> 3. Do not set USB_TDOWN bit for RX teardown.
>
> The CPPI hw has an issue that when tearing down a RX channel, if
> another RX channel is receiving data, the CPPI will lockup.
>
> To workaround the issue, do not set the CPPI TD bit. The steps before
> this point ensures the CPPI channel will be torn down properly.
>
> Signed-off-by: Bin Liu <b-liu@ti.com>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> Cc: Oliver Neukum <ONeukum@suse.com>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> ---
> drivers/usb/musb/musb_cppi41.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/musb/musb_cppi41.c
> b/drivers/usb/musb/musb_cppi41.c index 77b475a43dad..1c9c626248fd 100644
> --- a/drivers/usb/musb/musb_cppi41.c
> +++ b/drivers/usb/musb/musb_cppi41.c
> @@ -507,10 +507,15 @@ static int cppi41_dma_channel_abort(struct
> dma_channel *channel)
> csr &= ~MUSB_TXCSR_DMAENAB;
> musb_writew(epio, MUSB_TXCSR, csr);
> } else {
> + cppi41_set_autoreq_mode(cppi41_channel,
> EP_MODE_AUTOREQ_NONE);
> +
> csr = musb_readw(epio, MUSB_RXCSR);
> csr &= ~(MUSB_RXCSR_H_REQPKT | MUSB_RXCSR_DMAENAB);
> musb_writew(epio, MUSB_RXCSR, csr);
>
> + /* wait to drain cppi dma pipe line */
> + udelay(50);
> +
> csr = musb_readw(epio, MUSB_RXCSR);
> if (csr & MUSB_RXCSR_RXPKTRDY) {
> csr |= MUSB_RXCSR_FLUSHFIFO;
> @@ -524,13 +529,14 @@ static int cppi41_dma_channel_abort(struct
> dma_channel *channel)
> tdbit <<= 16;
>
> do {
> - musb_writel(musb->ctrl_base, USB_TDOWN, tdbit);
> + if (is_tx)
> + musb_writel(musb->ctrl_base, USB_TDOWN, tdbit);
> ret = dmaengine_terminate_all(cppi41_channel->dc);
> } while (ret == -EAGAIN);
>
> - musb_writel(musb->ctrl_base, USB_TDOWN, tdbit);
> -
> if (is_tx) {
> + musb_writel(musb->ctrl_base, USB_TDOWN, tdbit);
> +
> csr = musb_readw(epio, MUSB_TXCSR);
> if (csr & MUSB_TXCSR_TXPKTRDY) {
> csr |= MUSB_TXCSR_FLUSHFIFO;
> --
> 2.6.2
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine
2016-02-29 14:52 ` Liu [EP], Bin
@ 2016-03-02 10:28 ` Jiri Slaby
0 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2016-03-02 10:28 UTC (permalink / raw)
To: Liu [EP], Bin, stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Oliver Neukum,
Felipe Balbi (balbi@kernel.org), yegorslists@googlemail.com
On 02/29/2016, 03:52 PM, Liu [EP], Bin wrote:
> Hi Jiri,
>
>> -----Original Message-----
>> From: Jiri Slaby [mailto:jslaby@suse.cz]
>> Sent: Wednesday, October 28, 2015 8:54 AM
>> To: stable@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org; Liu, Bin; Balbi, Felipe; Oliver Neukum; Jiri
>> Slaby
>> Subject: [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort
>> routine
>>
>> From: Bin Liu <b-liu@ti.com>
>>
>> 3.12-stable review patch. If anyone has any objections, please let me know.
>
> It seems this backport missing the dependency 0149b07 upstream (usb: musb:
> cppi41: correct the macro name EP_MODE_AUTOREG_*), which causes the micro
> name mismatch.
Ok, thanks, now added.
--
js
suse labs
^ permalink raw reply [flat|nested] 134+ messages in thread
* [PATCH 3.12 106/123] usb: musb: fix cppi channel teardown for isoch transfer
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (104 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 105/123] usb: musb: cppi41: improve rx channel abort routine Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 107/123] HID: apple: Add support for the 2015 Macbook Pro Jiri Slaby
` (18 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Bin Liu, Felipe Balbi, Oliver Neukum, Jiri Slaby
From: Bin Liu <b-liu@ti.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit b431ba8803666e56c1d178a421b3cbc36e8d3d33 upstream.
After a few iterations of start/stop UVC camera streaming, the streaming
stops.
This patch adds 250us delay in the cppi channel abort path to let cppi
drain properly.
Using 50us delay seems to be too aggressive, some webcams are still
broken. 250us is the original value used in TI 3.2 kernel.
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/musb/musb_cppi41.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
index 1c9c626248fd..2ed1695ff5ad 100644
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -509,6 +509,9 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel)
} else {
cppi41_set_autoreq_mode(cppi41_channel, EP_MODE_AUTOREQ_NONE);
+ /* delay to drain to cppi dma pipeline for isoch */
+ udelay(250);
+
csr = musb_readw(epio, MUSB_RXCSR);
csr &= ~(MUSB_RXCSR_H_REQPKT | MUSB_RXCSR_DMAENAB);
musb_writew(epio, MUSB_RXCSR, csr);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 107/123] HID: apple: Add support for the 2015 Macbook Pro
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (105 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 106/123] usb: musb: fix cppi channel teardown for isoch transfer Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 108/123] HID: quirks: add QUIRK_NOGET for an other TPV touchscreen Jiri Slaby
` (17 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Henrik Rydberg, Dmitry Torokhov, Oliver Neukum,
Jiri Slaby
From: Henrik Rydberg <rydberg@bitmath.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a4a2c54560f2c57b88ba0283f141b44f594c2337 upstream.
This patch adds keyboard support for MacbookPro12,1 as WELLSPRING9
(0x0272, 0x0273, 0x0274). The touchpad is handled in a separate
bcm5974 patch, as usual.
Tested-by: John Horan <knasher@gmail.com>
Tested-by: Jochen Radmacher <jradmacher@gmx.de>
Tested-by: Yang Hongyang <burnef@gmail.com>
Tested-by: Yen-Chin, Lee <coldnew.tw@gmail.com>
Tested-by: George Hilios <ghilios@gmail.com>
Tested-by: Janez Urevc <janez@janezurevc.name>
Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Acked-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/hid/hid-apple.c | 6 ++++++
drivers/hid/hid-core.c | 6 ++++++
drivers/hid/hid-ids.h | 3 +++
3 files changed, 15 insertions(+)
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index 6d9649471f28..68fd96a50fc7 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -546,6 +546,12 @@ static const struct hid_device_id apple_devices[] = {
.driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS),
.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI),
+ .driver_data = APPLE_HAS_FN },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO),
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS),
+ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index eb23021390cb..85b0da8c33f4 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1695,6 +1695,9 @@ static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
@@ -2370,6 +2373,9 @@ static const struct hid_device_id hid_mouse_ignore_list[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ }
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 6da09931a987..558c7c3a6c7b 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -139,6 +139,9 @@
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI 0x0290
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0291
#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0292
+#define USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI 0x0272
+#define USB_DEVICE_ID_APPLE_WELLSPRING9_ISO 0x0273
+#define USB_DEVICE_ID_APPLE_WELLSPRING9_JIS 0x0274
#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a
#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b
#define USB_DEVICE_ID_APPLE_IRCONTROL 0x8240
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 108/123] HID: quirks: add QUIRK_NOGET for an other TPV touchscreen
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (106 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 107/123] HID: apple: Add support for the 2015 Macbook Pro Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 109/123] Input: psmouse - add small delay for IBM trackpoint pass-through mode Jiri Slaby
` (16 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Benjamin Tissoires, Jiri Kosina, Oliver Neukum,
Jiri Slaby
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit c9b57724b38d4c1555ee49418be3d76801e3327c upstream.
Looks like 0x8882 needs the same quirk than 0x8883.
Given that both devices claim they are "TPV OpticalTouchScreen" rename
the 0x8883 to add its PID in the #define.
Reported-by: Blaine Lee <blaine.j.lee@medtronic.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/hid/hid-ids.h | 3 ++-
drivers/hid/usbhid/hid-quirks.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 558c7c3a6c7b..50b25fad982d 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -881,7 +881,8 @@
#define USB_DEVICE_ID_TOUCHPACK_RTS 0x1688
#define USB_VENDOR_ID_TPV 0x25aa
-#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN 0x8883
+#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882 0x8882
+#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883 0x8883
#define USB_VENDOR_ID_TURBOX 0x062a
#define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 7bc98db768eb..7166d7fb43de 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -106,7 +106,8 @@ static const struct hid_blacklist {
{ USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET },
- { USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN, HID_QUIRK_NOGET },
+ { USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882, HID_QUIRK_NOGET },
+ { USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT },
{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U, HID_QUIRK_MULTI_INPUT },
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 109/123] Input: psmouse - add small delay for IBM trackpoint pass-through mode
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (107 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 108/123] HID: quirks: add QUIRK_NOGET for an other TPV touchscreen Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 110/123] Input: serio - fix blocking of parport Jiri Slaby
` (15 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Stefan Assmann, Dmitry Torokhov, Oliver Neukum,
Jiri Slaby
From: Stefan Assmann <sassmann@kpanic.de>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 66bc2f51ef7deabc8b8f3baa98ae64b65e5e973a upstream.
There are trackpoint devices that fail to respond to the PS2 command
PSMOUSE_CMD_GETID if immediately queried after the parent device is
deactivated. Add a small delay for the hardware to get in a sane state
before sending any PS2 commands.
One example of such a system is:
Lenovo ThinkPad X120e, model 30515QG
synaptics: Touchpad model: 1, fw: 8.0, id: 0x1e2b1, caps: 0xd001a3/0x940300/0x121c00, board id: 1811, fw id: 797391
Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/input/mouse/psmouse-base.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index cff065f6261c..de3d92077c77 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1441,6 +1441,10 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
if (error)
goto err_clear_drvdata;
+ /* give PT device some time to settle down before probing */
+ if (serio->id.type == SERIO_PS_PSTHRU)
+ usleep_range(10000, 15000);
+
if (psmouse_probe(psmouse) < 0) {
error = -ENODEV;
goto err_close_serio;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 110/123] Input: serio - fix blocking of parport
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (108 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 109/123] Input: psmouse - add small delay for IBM trackpoint pass-through mode Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 111/123] Input: omap4-keypad - fix memory leak Jiri Slaby
` (14 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Sudip Mukherjee, Sudip Mukherjee, Dmitry Torokhov,
Oliver Neukum, Jiri Slaby
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 1a5e251996e1b602f2ddc9261ee9de0ca1875bfa upstream.
If parkbd_allocate_serio() fails to allocate memory we are releasing the
parport but we missed unregistering the device. As a result this device
with exclusive access to that parport remains registered. And no other
device will be able to use that parport even though this driver has
failed to load.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/input/serio/parkbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c
index 26b45936f9fd..1e8cd6f1fe9e 100644
--- a/drivers/input/serio/parkbd.c
+++ b/drivers/input/serio/parkbd.c
@@ -194,6 +194,7 @@ static int __init parkbd_init(void)
parkbd_port = parkbd_allocate_serio();
if (!parkbd_port) {
parport_release(parkbd_dev);
+ parport_unregister_device(parkbd_dev);
return -ENOMEM;
}
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 111/123] Input: omap4-keypad - fix memory leak
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (109 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 110/123] Input: serio - fix blocking of parport Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 112/123] Input: zhenhua - ensure we have BITREVERSE Jiri Slaby
` (13 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Sudip Mukherjee, Sudip Mukherjee, Dmitry Torokhov,
Oliver Neukum, Jiri Slaby
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit d79bdc7f004404204a6ac07785f8d6717070ecdb upstream.
If omap4_keypad_parse_dt() fails we returned the error code but we
missed releasing keypad_data.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/input/keyboard/omap4-keypad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 30acfd49fa6c..1ba3490b9ffe 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -284,7 +284,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
} else {
error = omap4_keypad_parse_dt(&pdev->dev, keypad_data);
if (error)
- return error;
+ goto err_free_keypad;
}
res = request_mem_region(res->start, resource_size(res), pdev->name);
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 112/123] Input: zhenhua - ensure we have BITREVERSE
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (110 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 111/123] Input: omap4-keypad - fix memory leak Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 113/123] [media] usbvision: fix locking error Jiri Slaby
` (12 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Andrew Morton, Dmitry Torokhov, Oliver Neukum,
Jiri Slaby
From: Andrew Morton <akpm@linux-foundation.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit d3b367bc26ea2e07a83fe73f0ccbddd729cb1f9a upstream.
It uses bitrev8(), so it must ensure that lib/bitrev.o gets included in
vmlinux.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/input/joystick/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
index 56eb471b5576..4215b5382092 100644
--- a/drivers/input/joystick/Kconfig
+++ b/drivers/input/joystick/Kconfig
@@ -196,6 +196,7 @@ config JOYSTICK_TWIDJOY
config JOYSTICK_ZHENHUA
tristate "5-byte Zhenhua RC transmitter"
select SERIO
+ select BITREVERSE
help
Say Y here if you have a Zhen Hua PPM-4CH transmitter which is
supplied with a ready to fly micro electric indoor helicopters
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 113/123] [media] usbvision: fix locking error
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (111 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 112/123] Input: zhenhua - ensure we have BITREVERSE Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 114/123] [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FXA_MASK macro Jiri Slaby
` (11 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Hans Verkuil, Mauro Carvalho Chehab, Oliver Neukum,
Jiri Slaby
From: Hans Verkuil <hans.verkuil@cisco.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e2c84ccb0fbe5e524d15bb09c042a6ca634adaed upstream.
If remove_pending is non-zero, then the v4l2_lock is never unlocked.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/media/usb/usbvision/usbvision-video.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index 661f7f2a9e8b..ea5ec8ed67a7 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -435,6 +435,7 @@ static int usbvision_v4l2_close(struct file *file)
usbvision_scratch_free(usbvision);
usbvision->user--;
+ mutex_unlock(&usbvision->v4l2_lock);
if (power_on_at_open) {
/* power off in a little while
@@ -448,7 +449,6 @@ static int usbvision_v4l2_close(struct file *file)
usbvision_release(usbvision);
return 0;
}
- mutex_unlock(&usbvision->v4l2_lock);
PDEBUG(DBG_IO, "success");
return 0;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 114/123] [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FXA_MASK macro
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (112 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 113/123] [media] usbvision: fix locking error Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 115/123] [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FP_MASK macro Jiri Slaby
` (10 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Nobuhiro Iwamatsu, Laurent Pinchart,
Mauro Carvalho Chehab, Oliver Neukum, Jiri Slaby
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 45008ee9295b3ae96d7413ab91871907a671ca82 upstream.
FXA bit of VI6_DPR_mod_ROUTE register starts from 16bit. But VI6_DPR_ROUTE_FXA_MASK
is set to become start from 8bit. This fixes shift size for VI6_DPR_ROUTE_FXA_MASK.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/media/platform/vsp1/vsp1_regs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/vsp1/vsp1_regs.h b/drivers/media/platform/vsp1/vsp1_regs.h
index 1d3304f1365b..46a5a6f16ad2 100644
--- a/drivers/media/platform/vsp1/vsp1_regs.h
+++ b/drivers/media/platform/vsp1/vsp1_regs.h
@@ -304,7 +304,7 @@
#define VI6_DPR_HST_ROUTE 0x2044
#define VI6_DPR_HSI_ROUTE 0x2048
#define VI6_DPR_BRU_ROUTE 0x204c
-#define VI6_DPR_ROUTE_FXA_MASK (0xff << 8)
+#define VI6_DPR_ROUTE_FXA_MASK (0xff << 16)
#define VI6_DPR_ROUTE_FXA_SHIFT 16
#define VI6_DPR_ROUTE_FP_MASK (0xff << 8)
#define VI6_DPR_ROUTE_FP_SHIFT 8
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 115/123] [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FP_MASK macro
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (113 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 114/123] [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FXA_MASK macro Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 116/123] [media] v4l: vsp1: Fix VI6_WPF_SZCLIP_SIZE_MASK macro Jiri Slaby
` (9 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Nobuhiro Iwamatsu, Laurent Pinchart,
Mauro Carvalho Chehab, Oliver Neukum, Jiri Slaby
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 1aa7890324b497f96f07c20673fae58f26fabfe7 upstream.
FP bit of VI6_DPR_mod_ROUTE register is 6bit. But VI6_DPR_ROUTE_FP_MASK is set
to 0xFF, this will mask until the reserve bit.
This fixes size for VI6_DPR_ROUTE_FP_MASK.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/media/platform/vsp1/vsp1_regs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/vsp1/vsp1_regs.h b/drivers/media/platform/vsp1/vsp1_regs.h
index 46a5a6f16ad2..1450fa0b63fe 100644
--- a/drivers/media/platform/vsp1/vsp1_regs.h
+++ b/drivers/media/platform/vsp1/vsp1_regs.h
@@ -306,7 +306,7 @@
#define VI6_DPR_BRU_ROUTE 0x204c
#define VI6_DPR_ROUTE_FXA_MASK (0xff << 16)
#define VI6_DPR_ROUTE_FXA_SHIFT 16
-#define VI6_DPR_ROUTE_FP_MASK (0xff << 8)
+#define VI6_DPR_ROUTE_FP_MASK (0x3f << 8)
#define VI6_DPR_ROUTE_FP_SHIFT 8
#define VI6_DPR_ROUTE_RT_MASK (0x3f << 0)
#define VI6_DPR_ROUTE_RT_SHIFT 0
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 116/123] [media] v4l: vsp1: Fix VI6_WPF_SZCLIP_SIZE_MASK macro
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (114 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 115/123] [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FP_MASK macro Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 117/123] [media] gscpa_m5602: use msecs_to_jiffies for conversions Jiri Slaby
` (8 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Nobuhiro Iwamatsu, Laurent Pinchart,
Mauro Carvalho Chehab, Oliver Neukum, Jiri Slaby
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 03b36e4dcf422a10da8b67bce2ed00b34ec58aac upstream.
Clipping size bit of VI6_WPFn _HSZCLIP and VI6_WPFn _VSZCLIP register are from
0 bit to 11 bit. But VI6_WPF_SZCLIP_SIZE_MASK is set to 0x1FFF, this will mask
until the reserve bits. This fixes size for VI6_WPF_SZCLIP_SIZE_MASK.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/media/platform/vsp1/vsp1_regs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/vsp1/vsp1_regs.h b/drivers/media/platform/vsp1/vsp1_regs.h
index 1450fa0b63fe..72faf593427e 100644
--- a/drivers/media/platform/vsp1/vsp1_regs.h
+++ b/drivers/media/platform/vsp1/vsp1_regs.h
@@ -238,7 +238,7 @@
#define VI6_WPF_SZCLIP_EN (1 << 28)
#define VI6_WPF_SZCLIP_OFST_MASK (0xff << 16)
#define VI6_WPF_SZCLIP_OFST_SHIFT 16
-#define VI6_WPF_SZCLIP_SIZE_MASK (0x1fff << 0)
+#define VI6_WPF_SZCLIP_SIZE_MASK (0xfff << 0)
#define VI6_WPF_SZCLIP_SIZE_SHIFT 0
#define VI6_WPF_OUTFMT 0x100c
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 117/123] [media] gscpa_m5602: use msecs_to_jiffies for conversions
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (115 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 116/123] [media] v4l: vsp1: Fix VI6_WPF_SZCLIP_SIZE_MASK macro Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 14:41 ` Nicholas Mc Guire
2015-10-28 13:53 ` [PATCH 3.12 118/123] usb: core: implement AMD remote wakeup quirk Jiri Slaby
` (7 subsequent siblings)
124 siblings, 1 reply; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Nicholas Mc Guire, Hans de Goede,
Mauro Carvalho Chehab, Oliver Neukum, Jiri Slaby
From: Nicholas Mc Guire <hofrat@osadl.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 63f2f417526fc54191f2b813f72dc1d5322bede8 upstream.
API compliance scanning with coccinelle flagged:
./drivers/media/usb/gspca/m5602/m5602_s5k83a.c:180:9-25:
WARNING: timeout (100) seems HZ dependent
Numeric constants passed to schedule_timeout() make the effective
timeout HZ dependent which makes little sense in a polling loop for
the cameras rotation state.
Fixed up by converting the constant to jiffies with msecs_to_jiffies()
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/media/usb/gspca/m5602/m5602_s5k83a.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/gspca/m5602/m5602_s5k83a.c b/drivers/media/usb/gspca/m5602/m5602_s5k83a.c
index 7cbc3a00bda8..bf6b215438e3 100644
--- a/drivers/media/usb/gspca/m5602/m5602_s5k83a.c
+++ b/drivers/media/usb/gspca/m5602/m5602_s5k83a.c
@@ -177,7 +177,7 @@ static int rotation_thread_function(void *data)
__s32 vflip, hflip;
set_current_state(TASK_INTERRUPTIBLE);
- while (!schedule_timeout(100)) {
+ while (!schedule_timeout(msecs_to_jiffies(100))) {
if (mutex_lock_interruptible(&sd->gspca_dev.usb_lock))
break;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* Re: [PATCH 3.12 117/123] [media] gscpa_m5602: use msecs_to_jiffies for conversions
2015-10-28 13:53 ` [PATCH 3.12 117/123] [media] gscpa_m5602: use msecs_to_jiffies for conversions Jiri Slaby
@ 2015-10-28 14:41 ` Nicholas Mc Guire
0 siblings, 0 replies; 134+ messages in thread
From: Nicholas Mc Guire @ 2015-10-28 14:41 UTC (permalink / raw)
To: Jiri Slaby
Cc: stable, linux-kernel, Nicholas Mc Guire, Hans de Goede,
Mauro Carvalho Chehab, Oliver Neukum
On Wed, Oct 28, 2015 at 02:53:48PM +0100, Jiri Slaby wrote:
> From: Nicholas Mc Guire <hofrat@osadl.org>
>
> 3.12-stable review patch. If anyone has any objections, please let me know.
>
> ===============
>
> commit 63f2f417526fc54191f2b813f72dc1d5322bede8 upstream.
>
> API compliance scanning with coccinelle flagged:
> ./drivers/media/usb/gspca/m5602/m5602_s5k83a.c:180:9-25:
> WARNING: timeout (100) seems HZ dependent
>
> Numeric constants passed to schedule_timeout() make the effective
> timeout HZ dependent which makes little sense in a polling loop for
> the cameras rotation state.
> Fixed up by converting the constant to jiffies with msecs_to_jiffies()
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> Cc: Oliver Neukum <ONeukum@suse.com>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> ---
> drivers/media/usb/gspca/m5602/m5602_s5k83a.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/gspca/m5602/m5602_s5k83a.c b/drivers/media/usb/gspca/m5602/m5602_s5k83a.c
> index 7cbc3a00bda8..bf6b215438e3 100644
> --- a/drivers/media/usb/gspca/m5602/m5602_s5k83a.c
> +++ b/drivers/media/usb/gspca/m5602/m5602_s5k83a.c
> @@ -177,7 +177,7 @@ static int rotation_thread_function(void *data)
> __s32 vflip, hflip;
>
> set_current_state(TASK_INTERRUPTIBLE);
> - while (!schedule_timeout(100)) {
> + while (!schedule_timeout(msecs_to_jiffies(100))) {
> if (mutex_lock_interruptible(&sd->gspca_dev.usb_lock))
> break;
>
Note that there were some concerns regarding using msecs_to_jiffies
rather than explicit conversion where gcc can do constant folding
(so in this case something like (100 * HZ / 1000) this was mitigated by
the following pathes to kbuild see
https://lkml.org/lkml/2015/5/28/524
https://lkml.org/lkml/2015/5/28/525
in this case this does not really apply as the numeric 100 is actually
a bug - but there might be some performance concerns if too many such
conversions are added (there were all together about 30 such cases).
thx!
hofrat
^ permalink raw reply [flat|nested] 134+ messages in thread
* [PATCH 3.12 118/123] usb: core: implement AMD remote wakeup quirk
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (116 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 117/123] [media] gscpa_m5602: use msecs_to_jiffies for conversions Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 119/123] Revert "USB: quirks: add touchscreen that is dazzeled by remote wakeup" Jiri Slaby
` (6 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Huang Rui, Greg Kroah-Hartman, Jiri Slaby
From: Huang Rui <ray.huang@amd.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 7868943db1668fba898cf71bed1506c19d6958aa upstream.
The following patch is required to resolve remote wake issues with
certain devices.
Issue description:
If the remote wake is issued from the device in a specific timing
condition while the system is entering sleep state then it may cause
system to auto wake on subsequent sleep cycle.
Root cause:
Host controller rebroadcasts the Resume signal > 100 µseconds after
receiving the original resume event from the device. For proper
function, some devices may require the rebroadcast of resume event
within the USB spec of 100µS.
Workaroud:
1. Filter the AMD platforms with Yangtze chipset, then judge of all the usb
devices are mouse or not. And get out the port id which attached a mouse
with Pixart controller.
2. Then reset the port which attached issue device during system resume
from S3.
[Q] Why the special devices are only mice? Would high speed devices
such as 3G modem or USB Bluetooth adapter trigger this issue?
- Current this sensitivity is only confined to devices that use Pixart
controllers. This controller is designed for use with LS mouse
devices only. We have not observed any other devices failing. There
may be a small risk for other devices also but this patch (reset
device in resume phase) will cover the cases if required.
[Q] Shouldn’t the resume signal be sent within 100 us for every
device?
- The Host controller may not send the resume signal within 100us,
this our host controller specification change. This is why we
require the patch to prevent side effects on certain known devices.
[Q] Why would clicking mouse INTENSELY to wake the system up trigger
this issue?
- This behavior is specific to the devices that use Pixart controller.
It is timing dependent on when the resume event is triggered during
the sleep state.
[Q] Is it a host controller issue or mouse?
- It is the host controller behavior during resume that triggers the
device incorrect behavior on the next resume.
This patch sets USB_QUIRK_RESET_RESUME flag for these Pixart-based mice
when they attached to platforms with AMD Yangtze chipset.
Signed-off-by: Huang Rui <ray.huang@amd.com>
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/core/hcd-pci.c | 3 +++
drivers/usb/core/quirks.c | 37 +++++++++++++++++++++++++++++++++++++
drivers/usb/host/pci-quirks.c | 12 ++++++++++++
include/linux/usb/hcd.h | 3 +++
4 files changed, 55 insertions(+)
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 5e1a1790c2f6..04b21577e8ed 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -215,6 +215,9 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
goto disable_pci;
}
+ hcd->amd_resume_bug = (usb_hcd_amd_remote_wakeup_quirk(dev) &&
+ driver->flags & (HCD_USB11 | HCD_USB3)) ? 1 : 0;
+
if (driver->flags & HCD_MEMORY) {
/* EHCI, OHCI */
hcd->rsrc_start = pci_resource_start(dev, 0);
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 84d1d4629b8a..ac08ce8fe1e1 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -13,6 +13,7 @@
#include <linux/usb.h>
#include <linux/usb/quirks.h>
+#include <linux/usb/hcd.h>
#include "usb.h"
/* Lists of quirky USB devices, split in device quirks and interface quirks.
@@ -212,6 +213,21 @@ static const struct usb_device_id usb_interface_quirk_list[] = {
{ } /* terminating entry must be last */
};
+static const struct usb_device_id usb_amd_resume_quirk_list[] = {
+ /* Lenovo Mouse with Pixart controller */
+ { USB_DEVICE(0x17ef, 0x602e), .driver_info = USB_QUIRK_RESET_RESUME },
+
+ /* Pixart Mouse */
+ { USB_DEVICE(0x093a, 0x2500), .driver_info = USB_QUIRK_RESET_RESUME },
+ { USB_DEVICE(0x093a, 0x2510), .driver_info = USB_QUIRK_RESET_RESUME },
+ { USB_DEVICE(0x093a, 0x2521), .driver_info = USB_QUIRK_RESET_RESUME },
+
+ /* Logitech Optical Mouse M90/M100 */
+ { USB_DEVICE(0x046d, 0xc05a), .driver_info = USB_QUIRK_RESET_RESUME },
+
+ { } /* terminating entry must be last */
+};
+
static bool usb_match_any_interface(struct usb_device *udev,
const struct usb_device_id *id)
{
@@ -238,6 +254,18 @@ static bool usb_match_any_interface(struct usb_device *udev,
return false;
}
+int usb_amd_resume_quirk(struct usb_device *udev)
+{
+ struct usb_hcd *hcd;
+
+ hcd = bus_to_hcd(udev->bus);
+ /* The device should be attached directly to root hub */
+ if (udev->level == 1 && hcd->amd_resume_bug == 1)
+ return 1;
+
+ return 0;
+}
+
static u32 __usb_detect_quirks(struct usb_device *udev,
const struct usb_device_id *id)
{
@@ -263,6 +291,15 @@ static u32 __usb_detect_quirks(struct usb_device *udev,
void usb_detect_quirks(struct usb_device *udev)
{
udev->quirks = __usb_detect_quirks(udev, usb_quirk_list);
+
+ /*
+ * Pixart-based mice would trigger remote wakeup issue on AMD
+ * Yangtze chipset, so set them as RESET_RESUME flag.
+ */
+ if (usb_amd_resume_quirk(udev))
+ udev->quirks |= __usb_detect_quirks(udev,
+ usb_amd_resume_quirk_list);
+
if (udev->quirks)
dev_dbg(&udev->dev, "USB quirks for this device: %x\n",
udev->quirks);
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 5a45437da097..a47ff42e620a 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -250,6 +250,18 @@ commit:
}
EXPORT_SYMBOL_GPL(usb_amd_find_chipset_info);
+int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev)
+{
+ /* Make sure amd chipset type has already been initialized */
+ usb_amd_find_chipset_info();
+ if (amd_chipset.sb_type.gen != AMD_CHIPSET_YANGTZE)
+ return 0;
+
+ dev_dbg(&pdev->dev, "QUIRK: Enable AMD remote wakeup fix\n");
+ return 1;
+}
+EXPORT_SYMBOL_GPL(usb_hcd_amd_remote_wakeup_quirk);
+
bool usb_amd_hang_symptom_quirk(void)
{
u8 rev;
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index d8ee9fd7ca4e..914ce51fa056 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -140,6 +140,7 @@ struct usb_hcd {
unsigned wireless:1; /* Wireless USB HCD */
unsigned authorized_default:1;
unsigned has_tt:1; /* Integrated TT in root hub */
+ unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */
unsigned int irq; /* irq allocated */
void __iomem *regs; /* device memory/io */
@@ -428,6 +429,8 @@ extern int usb_hcd_pci_probe(struct pci_dev *dev,
extern void usb_hcd_pci_remove(struct pci_dev *dev);
extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
+extern int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev);
+
#ifdef CONFIG_PM
extern const struct dev_pm_ops usb_hcd_pci_pm_ops;
#endif
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 119/123] Revert "USB: quirks: add touchscreen that is dazzeled by remote wakeup"
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (117 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 118/123] usb: core: implement AMD remote wakeup quirk Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 120/123] USB: Add OTG PET device to TPL Jiri Slaby
` (5 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Oliver Neukum, Greg Kroah-Hartman, Jiri Slaby
From: Oliver Neukum <oneukum@suse.de>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e0e6a356a0b41375b729c511caa99d3ec019640e upstream.
This reverts commit 614ced91fc6fbb5a1cdd12f0f1b6c9197d9f1350.
The units on this was seen were prototypes and the issue is
not seen on younger units.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/core/quirks.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index ac08ce8fe1e1..0815263c43cc 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -134,9 +134,6 @@ static const struct usb_device_id usb_quirk_list[] = {
/* Alcor Micro Corp. Hub */
{ USB_DEVICE(0x058f, 0x9254), .driver_info = USB_QUIRK_RESET_RESUME },
- /* MicroTouch Systems touchscreen */
- { USB_DEVICE(0x0596, 0x051e), .driver_info = USB_QUIRK_RESET_RESUME },
-
/* appletouch */
{ USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 120/123] USB: Add OTG PET device to TPL
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (118 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 119/123] Revert "USB: quirks: add touchscreen that is dazzeled by remote wakeup" Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 121/123] Revert "USB: Add device quirk for ASUS T100 Base Station keyboard" Jiri Slaby
` (4 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable
Cc: linux-kernel, Macpaul Lin, Pavankumar Kondeti,
Vijayavardhan Vennapusa, Greg Kroah-Hartman, Jiri Slaby
From: Macpaul Lin <macpaul@gmail.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit e5dff0e80463cc3fa236e898ef1491b40be70b19 upstream.
OTG device shall support this device for allowing compliance automated testing.
The modification is derived from Pavankumar and Vijayavardhans' previous work.
Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Cc: Pavankumar Kondeti <pkondeti@codeaurora.org>
Cc: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/core/otg_whitelist.h | 5 +++++
drivers/usb/core/quirks.c | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/drivers/usb/core/otg_whitelist.h b/drivers/usb/core/otg_whitelist.h
index e8cdce571bb1..2753cec61aaf 100644
--- a/drivers/usb/core/otg_whitelist.h
+++ b/drivers/usb/core/otg_whitelist.h
@@ -59,6 +59,11 @@ static int is_targeted(struct usb_device *dev)
le16_to_cpu(dev->descriptor.idProduct) == 0xbadd))
return 0;
+ /* OTG PET device is always targeted (see OTG 2.0 ECN 6.4.2) */
+ if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a &&
+ le16_to_cpu(dev->descriptor.idProduct) == 0x0200))
+ return 1;
+
/* NOTE: can't use usb_match_id() since interface caches
* aren't set up yet. this is cut/paste from that code.
*/
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 0815263c43cc..7aa445de8413 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -195,6 +195,10 @@ static const struct usb_device_id usb_quirk_list[] = {
{ USB_DEVICE(0x0b05, 0x17e0), .driver_info =
USB_QUIRK_IGNORE_REMOTE_WAKEUP },
+ /* Protocol and OTG Electrical Test Device */
+ { USB_DEVICE(0x1a0a, 0x0200), .driver_info =
+ USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
+
{ } /* terminating entry must be last */
};
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 121/123] Revert "USB: Add device quirk for ASUS T100 Base Station keyboard"
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (119 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 120/123] USB: Add OTG PET device to TPL Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 122/123] ath9k: declare required extra tx headroom Jiri Slaby
` (3 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Jiri Slaby, Lu Baolu, Alan Stern,
Greg Kroah-Hartman
3.12-stable review patch. If anyone has any objections, please let me know.
===============
This reverts commit e25ecd21ffdbf1f8287103ccf97205fc30088344 in 3.12,
upstream commit ddbe1fca0bcb87ca8c199ea873a456ca8a948567 (USB: Add
device quirk for ASUS T100 Base Station keyboard).
It was applied twice to 3.12 and one backport is bogus.
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/usb/core/quirks.c | 4 ----
include/linux/usb/quirks.h | 7 ++-----
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 7aa445de8413..08f321904fb7 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -207,10 +207,6 @@ static const struct usb_device_id usb_interface_quirk_list[] = {
{ USB_VENDOR_AND_INTERFACE_INFO(0x046d, USB_CLASS_VIDEO, 1, 0),
.driver_info = USB_QUIRK_RESET_RESUME },
- /* ASUS Base Station(T100) */
- { USB_DEVICE(0x0b05, 0x17e0), .driver_info =
- USB_QUIRK_IGNORE_REMOTE_WAKEUP },
-
{ } /* terminating entry must be last */
};
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index 3fb428883460..a4abaeb3fb00 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -41,13 +41,10 @@
*/
#define USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL 0x00000080
-/* device generates spurious wakeup, ignore remote wakeup capability */
-#define USB_QUIRK_IGNORE_REMOTE_WAKEUP 0x00000200
+/* device can't handle device_qualifier descriptor requests */
+#define USB_QUIRK_DEVICE_QUALIFIER 0x00000100
/* device generates spurious wakeup, ignore remote wakeup capability */
#define USB_QUIRK_IGNORE_REMOTE_WAKEUP 0x00000200
-/* device can't handle device_qualifier descriptor requests */
-#define USB_QUIRK_DEVICE_QUALIFIER 0x00000100
-
#endif /* __LINUX_USB_QUIRKS_H */
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 122/123] ath9k: declare required extra tx headroom
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (120 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 121/123] Revert "USB: Add device quirk for ASUS T100 Base Station keyboard" Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-28 13:53 ` [PATCH 3.12 123/123] ARM: ux500: cpuidle: fix section mismatch Jiri Slaby
` (2 subsequent siblings)
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Felix Fietkau, Kalle Valo, Jiri Slaby
From: Felix Fietkau <nbd@openwrt.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 029cd0370241641eb70235d205aa0b90c84dce44 upstream.
ath9k inserts padding between the 802.11 header and the data area (to
align it). Since it didn't declare this extra required headroom, this
led to some nasty issues like randomly dropped packets in some setups.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/net/wireless/ath/ath9k/init.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index c9887cb60650..f900dfd551e8 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -893,6 +893,7 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
hw->max_rate_tries = 10;
hw->sta_data_size = sizeof(struct ath_node);
hw->vif_data_size = sizeof(struct ath_vif);
+ hw->extra_tx_headroom = 4;
hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1;
hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1;
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* [PATCH 3.12 123/123] ARM: ux500: cpuidle: fix section mismatch
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (121 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 122/123] ath9k: declare required extra tx headroom Jiri Slaby
@ 2015-10-28 13:53 ` Jiri Slaby
2015-10-29 0:34 ` [PATCH 3.12 000/123] 3.12.50-stable review Guenter Roeck
2015-11-02 9:50 ` Nikolay Borisov
124 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-10-28 13:53 UTC (permalink / raw)
To: stable; +Cc: linux-kernel, Daniel Lezcano, Jiri Slaby
From: Daniel Lezcano <daniel.lezcano@linaro.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 2c2b24d9c3e96d5cf974be4559a936e7f3b50225 upstream.
The dbx500_cpuidle_probe is tagged as an __init section but the variable
dbx500_cpuidle_plat_driver is not.
The dbx500_cpuidle_probe could not be declared as __init because of macro
module_platform_driver builds the exit function, tags as __exit and this one
refers to the dbx500_cpuidle_plat_driver which is an __initdata.
That leads to a section mismatch.
Fix it by removing the __init tag for the probe function.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/cpuidle/cpuidle-ux500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpuidle/cpuidle-ux500.c b/drivers/cpuidle/cpuidle-ux500.c
index e0564652af35..5e35804b1a95 100644
--- a/drivers/cpuidle/cpuidle-ux500.c
+++ b/drivers/cpuidle/cpuidle-ux500.c
@@ -111,7 +111,7 @@ static struct cpuidle_driver ux500_idle_driver = {
.state_count = 2,
};
-static int __init dbx500_cpuidle_probe(struct platform_device *pdev)
+static int dbx500_cpuidle_probe(struct platform_device *pdev)
{
/* Configure wake up reasons */
prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) |
--
2.6.2
^ permalink raw reply related [flat|nested] 134+ messages in thread* Re: [PATCH 3.12 000/123] 3.12.50-stable review
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (122 preceding siblings ...)
2015-10-28 13:53 ` [PATCH 3.12 123/123] ARM: ux500: cpuidle: fix section mismatch Jiri Slaby
@ 2015-10-29 0:34 ` Guenter Roeck
2015-11-02 9:21 ` Jiri Slaby
2015-11-02 9:50 ` Nikolay Borisov
124 siblings, 1 reply; 134+ messages in thread
From: Guenter Roeck @ 2015-10-29 0:34 UTC (permalink / raw)
To: Jiri Slaby; +Cc: stable, shuah.kh, linux-kernel
On Wed, Oct 28, 2015 at 02:51:22PM +0100, Jiri Slaby wrote:
> This is the start of the stable review cycle for the 3.12.50 release.
> There are 123 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 Fri Oct 30 09:39:16 CET 2015.
> Anything received after that time might be too late.
>
Build results:
total: 123 pass: 123 fail: 0
Qemu test results:
total: 77 pass: 77 fail: 0
Details are available at http://server.roeck-us.net:8010/builders.
Guenter
^ permalink raw reply [flat|nested] 134+ messages in thread* Re: [PATCH 3.12 000/123] 3.12.50-stable review
2015-10-29 0:34 ` [PATCH 3.12 000/123] 3.12.50-stable review Guenter Roeck
@ 2015-11-02 9:21 ` Jiri Slaby
0 siblings, 0 replies; 134+ messages in thread
From: Jiri Slaby @ 2015-11-02 9:21 UTC (permalink / raw)
To: Guenter Roeck; +Cc: stable, shuah.kh, linux-kernel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 10/29/2015, 01:34 AM, Guenter Roeck wrote:
> On Wed, Oct 28, 2015 at 02:51:22PM +0100, Jiri Slaby wrote:
>> This is the start of the stable review cycle for the 3.12.50
>> release. There are 123 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 Fri Oct 30 09:39:16 CET 2015.
>> Anything received after that time might be too late.
>>
> Build results: total: 123 pass: 123 fail: 0 Qemu test results:
> total: 77 pass: 77 fail: 0
>
> Details are available at http://server.roeck-us.net:8010/builders.
Thanks for testing!
- --
js
suse labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJWNyskAAoJEL0lsQQGtHBJb/gQAIo9lwawa1sPN8ooYxfaonXR
uUJlJsub0rsZfCjGVJZ6Jqw4mFIdIyGFWXNXVPNe69mUtPnf9EMuC5s5OEr8S5TF
nc4SrCnzMYkjE1OGFkowFApX7y3EyiO0HDex+ut2r98QG22JN/31lZVaMyly07Un
jOdPA3Wsl2RdA0vXetS6HeAX/ixZdH5CKQUBOScogePjIbWhbSqjO1dJCBXQUrxM
SaZc0VsVauXLMLVaM1K7IAhLfo6wLXHUyuCaRFDiXFBBPH3GVXfPkZdhkmEnhbMj
cCO4Ru+yVicq68FwDtwaDxO6VumJGy7QKUnJVoV5qH3GYge1hFgUB7sTLcyTUPED
FmJzPbjqiNZTSQlbwmWnCdUZuye/MX+4Paju8+mZVTYKPfdCxfW/VwaCNSwhq/cA
jyVNkBOTC5TAui7pBwRwRSHdUO7Lpu12u8iNdEpFnlirV+dFbf5V+E2p7qFdNlb3
0zj9VccH9WWaxF9qTMCOcl7MbDOefDUlVBB0ZAut5IYGY6otbNhLTYiQ9vV0FWFT
yOw8pZtlbAv2L1evgXLf7pfbc9EG9+6FLP5hYlRej+AGNvJhyPfStzupc0LTg7dI
UzvamtBVL7/Xz05AzjeEJrH4PoKqSVR7Qbc7OxKkYJLFFGF0/UOb1PzM0mtAhB+s
+f+LF8Gq9bUNQO9pphNm
=SAYR
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 134+ messages in thread
* Re: [PATCH 3.12 000/123] 3.12.50-stable review
2015-10-28 13:51 [PATCH 3.12 000/123] 3.12.50-stable review Jiri Slaby
` (123 preceding siblings ...)
2015-10-29 0:34 ` [PATCH 3.12 000/123] 3.12.50-stable review Guenter Roeck
@ 2015-11-02 9:50 ` Nikolay Borisov
2015-11-03 10:13 ` Jiri Slaby
124 siblings, 1 reply; 134+ messages in thread
From: Nikolay Borisov @ 2015-11-02 9:50 UTC (permalink / raw)
To: Jiri Slaby, stable; +Cc: linux, shuah.kh, linux-kernel
Hello Jiri,
I think you should also add this patch:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2871c69e025e8bc507651d5a9cf81a8a7da9d24b
I hit this on 3.12.47 originally -
http://www.spinics.net/lists/dm-devel/msg24531.html
On 10/28/2015 03:51 PM, Jiri Slaby wrote:
> This is the start of the stable review cycle for the 3.12.50 release.
> There are 123 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 Fri Oct 30 09:39:16 CET 2015.
> 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.50-rc1.xz
> and the diffstat can be found below.
>
> thanks,
> js
>
> ===============
>
>
> Aaron Conole (2):
> af_unix: Convert the unix_sk macro to an inline function for type
> safety
> af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag
>
> Alexander Couzens (1):
> l2tp: protect tunnel->del_work by ref_count
>
> Andreas Schwab (1):
> m68k: Define asmlinkage_protect
>
> Andrew Morton (1):
> Input: zhenhua - ensure we have BITREVERSE
>
> Andrey Vagin (1):
> net/unix: fix logic about sk_peek_offset
>
> Andy Lutomirski (2):
> x86/nmi/64: Fix a paravirt stack-clobbering bug in the NMI code
> x86/paravirt: Replace the paravirt nop with a bona fide empty function
>
> Andy Shevchenko (1):
> dmaengine: dw: properly read DWC_PARAMS register
>
> Ard Biesheuvel (1):
> ARM: 8429/1: disable GCC SRA optimization
>
> Arnaldo Carvalho de Melo (2):
> perf hists: Update the column width for the "srcline" sort key
> perf header: Fixup reading of HEADER_NRCPUS feature
>
> Ben Hutchings (1):
> genirq: Fix race in register_irq_proc()
>
> Ben Skeggs (1):
> drm/nouveau/fbcon: take runpm reference when userspace has an open fd
>
> Benjamin Tissoires (1):
> HID: quirks: add QUIRK_NOGET for an other TPV touchscreen
>
> Bin Liu (2):
> usb: musb: cppi41: improve rx channel abort routine
> usb: musb: fix cppi channel teardown for isoch transfer
>
> Charles Keepax (1):
> asix: Do full reset during ax88772_bind
>
> Chris Mason (1):
> btrfs: fix use after free iterating extrefs
>
> Christoph Hellwig (1):
> 3w-9xxx: don't unmap bounce buffered commands
>
> Daniel Lezcano (1):
> ARM: ux500: cpuidle: fix section mismatch
>
> Daniel Vetter (1):
> drm: Reject DRI1 hw lock ioctl functions for kms drivers
>
> Dave Airlie (1):
> drm/qxl: only report first monitor as connected if we have no state
>
> Dave Kleikamp (1):
> crypto: sparc - initialize blkcipher.ivsize
>
> David Woodhouse (1):
> x86/platform: Fix Geode LX timekeeping in the generic x86 build
>
> Dirk Müller (1):
> Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS
>
> Eric Dumazet (1):
> net: add pfmemalloc check in sk_add_backlog()
>
> Fabiano Fidêncio (1):
> drm/qxl: recreate the primary surface when the bo is not primary
>
> Felix Fietkau (1):
> ath9k: declare required extra tx headroom
>
> Filipe Manana (2):
> Btrfs: fix read corruption of compressed and shared extents
> Btrfs: update fix for read corruption of compressed and shared extents
>
> Grazvydas Ignotas (1):
> ARM: dts: omap5-uevm.dts: fix i2c5 pinctrl offsets
>
> Guenter Roeck (2):
> hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for
> most chips
> spi: Fix documentation of spi_alloc_master()
>
> Guillaume Nault (1):
> ppp: don't override sk->sk_state in pppoe_flush_dev()
>
> Hans Verkuil (1):
> [media] usbvision: fix locking error
>
> Henrik Rydberg (1):
> HID: apple: Add support for the 2015 Macbook Pro
>
> Huang Rui (1):
> usb: core: implement AMD remote wakeup quirk
>
> Ilya Dryomov (1):
> rbd: fix double free on rbd_dev->header_name
>
> James Hogan (1):
> MIPS: dma-default: Fix 32-bit fall back to GFP_DMA
>
> Jan H. Schönherr (1):
> sched: Fix cpu_active_mask/cpu_online_mask race
>
> Jan Kara (1):
> jbd2: avoid infinite loop when destroying aborted journal
>
> Jann Horn (1):
> security: fix typo in security_task_prctl
>
> Jason Wang (1):
> kvm: fix zero length mmio searching
>
> Jeff Mahoney (1):
> btrfs: skip waiting on ordered range for special files
>
> Jenny Derzhavetz (1):
> iser-target: remove command with state ISTATE_REMOVE
>
> Jiri Slaby (1):
> Revert "USB: Add device quirk for ASUS T100 Base Station keyboard"
>
> Joe Perches (1):
> ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings
>
> Joe Stringer (1):
> netfilter: nf_conntrack: Support expectations in different zones
>
> Joe Thornber (2):
> dm btree: add ref counting ops for the leaves of top level btrees
> dm cache: fix NULL pointer when switching from cleaner policy
>
> Joerg Roedel (1):
> iommu/amd: Handle integer overflow in dma_ops_area_alloc
>
> Johan Hovold (1):
> USB: whiteheat: fix potential null-deref at probe
>
> John Flatness (1):
> ALSA: hda - Apply SPDIF pin ctl to MacBookPro 12,1
>
> Joonsoo Kim (1):
> mm/slab: fix unexpected index mapping result of
> kmalloc_size(INDEX_NODE+1)
>
> Julian Anastasov (2):
> ipvs: do not use random local source address for tunnels
> ipvs: fix crash with sync protocol v0 and FTP
>
> Kan Liang (1):
> perf stat: Get correct cpu id for print_aggr
>
> Li Jun (1):
> usb: chipidea: debug: add runtime pm for register access
>
> Linus Torvalds (1):
> Initialize msg/shm IPC objects before doing ipc_addid()
>
> Liu.Zhao (1):
> USB: option: add ZTE PIDs
>
> Macpaul Lin (1):
> USB: Add OTG PET device to TPL
>
> Mark Brown (2):
> regmap: debugfs: Ensure we don't underflow when printing access masks
> regmap: debugfs: Don't bother actually printing when calculating max
> length
>
> Mark Salyzyn (1):
> arm64: readahead: fault retry breaks mmap file read random detection
>
> Martin Schwidefsky (1):
> s390/3270: redraw screen on unsolicited device end
>
> Mathias Nyman (4):
> xhci: Workaround for PME stuck issues in Intel xhci
> xhci: rework cycle bit checking for new dequeue pointers
> xhci: change xhci 1.0 only restrictions to support xhci 1.1
> usb: Use the USB_SS_MULT() macro to get the burst multiplier.
>
> Mel Gorman (1):
> mm: hugetlbfs: skip shared VMAs when unmapping private pages to
> satisfy a fault
>
> Michal Hocko (1):
> scsi: fix scsi_error_handler vs. scsi_host_dev_release race
>
> Michel Stam (1):
> asix: Don't reset PHY on if_up for ASIX 88772
>
> Mika Westerberg (1):
> i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348
>
> Mike Snitzer (1):
> dm thin: fix missing pool reference count decrement in pool_ctr error
> path
>
> Mikulas Patocka (1):
> dm raid: fix round up of default region size
>
> Nicholas Mc Guire (1):
> [media] gscpa_m5602: use msecs_to_jiffies for conversions
>
> Nobuhiro Iwamatsu (3):
> [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FXA_MASK macro
> [media] v4l: vsp1: Fix VI6_DPR_ROUTE_FP_MASK macro
> [media] v4l: vsp1: Fix VI6_WPF_SZCLIP_SIZE_MASK macro
>
> Noel Power (1):
> client MUST ignore EncryptionKeyLength if CAP_EXTENDED_SECURITY is set
>
> Oliver Neukum (1):
> Revert "USB: quirks: add touchscreen that is dazzeled by remote
> wakeup"
>
> Pablo Neira Ayuso (1):
> netfilter: ctnetlink: put back references to master ct and expect
> objects
>
> Paul Bolle (1):
> windfarm: decrement client count when unregistering
>
> Paul E. McKenney (1):
> rcu: Reject memory-order-induced stall-warning false positives
>
> Peter Seiderer (1):
> cifs: use server timestamp for ntlmv2 authentication
>
> Peter Zijlstra (4):
> arch: Clean up asm/barrier.h implementations using
> asm-generic/barrier.h
> arch: Move smp_mb__{before,after}_atomic_{inc,dec}.h into asm/atomic.h
> arc,hexagon: Delete asm/barrier.h
> sched/core: Fix TASK_DEAD race in finish_task_switch()
>
> Philipp Hachtmann (1):
> USB: symbolserial: Correct transferred data size
>
> Pravin B Shelar (2):
> skbuff: Fix skb checksum flag on skb pull
> skbuff: Fix skb checksum partial check.
>
> Reyad Attiyat (1):
> usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers
>
> Richard Weinberger (1):
> UBI: Validate data_size
>
> Robert Jarzmik (2):
> ASoC: pxa: pxa2xx-ac97: fix dma requestor lines
> ASoC: fix broken pxa SoC support
>
> Robert Schlabbach (1):
> usb: core: Fix USB 3.0 devices lost in NOTATTACHED state after a hub
> port reset
>
> Roger Quadros (1):
> usb: xhci: Clear XHCI_STATE_DYING on start
>
> Russell King (2):
> ARM: fix Thumb2 signal handling when ARMv6 is enabled
> crypto: ahash - ensure statesize is non-zero
>
> Sabrina Dubroca (1):
> net: add length argument to skb_copy_and_csum_datagram_iovec
>
> Shaohua Li (2):
> x86/apic: Serialize LVTT and TSC_DEADLINE writes
> workqueue: make sure delayed work run in local cpu
>
> Stefan Assmann (1):
> Input: psmouse - add small delay for IBM trackpoint pass-through mode
>
> Stephen Smalley (1):
> x86/mm: Set NX on gap between __ex_table and rodata
>
> Steve French (1):
> disabling oplocks/leases via module parm enable_oplocks broken for
> SMB3
>
> Sudip Mukherjee (2):
> Input: serio - fix blocking of parport
> Input: omap4-keypad - fix memory leak
>
> T.J. Purtell (1):
> ARM: 7880/1: Clear the IT state independent of the Thumb-2 mode
>
> Takashi Iwai (2):
> ALSA: hda - Control SPDIF out pin on MacBookPro 11,2
> ALSA: synth: Fix conflicting OSS device registration on AWE32
>
> Tan, Jui Nee (1):
> spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is
> disabled
>
> Teunis van Beelen (1):
> USB: usbtmc: add device quirk for Rigol DS6104
>
> Vincent Palatin (1):
> usb: Add device quirk for Logitech PTZ cameras
>
> Vitaly Kuznetsov (1):
> x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
>
> Will Deacon (1):
> arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419
>
> Wolfram Sang (2):
> i2c: rcar: enable RuntimePM before registering to the core
> i2c: s3c2410: enable RuntimePM before registering to the core
>
> Yao-Wen Mao (1):
> USB: Add reset-resume quirk for two Plantronics usb headphones.
>
> Yitian Bu (1):
> ASoC: dwc: correct irq clear method
>
> covici@ccs.covici.com (1):
> staging: speakup: fix speakup-r regression
>
> shengyong (1):
> UBI: return ENOSPC if no enough space available
>
> arch/alpha/include/asm/barrier.h | 25 +----
> arch/arc/include/asm/Kbuild | 1 +
> arch/arc/include/asm/atomic.h | 5 +
> arch/arc/include/asm/barrier.h | 42 -------
> arch/arm/Makefile | 8 ++
> arch/arm/boot/dts/omap5-uevm.dts | 4 +-
> arch/arm/kernel/signal.c | 19 +++-
> arch/arm64/Makefile | 2 +-
> arch/arm64/mm/fault.c | 1 +
> arch/avr32/include/asm/barrier.h | 17 +--
> arch/blackfin/include/asm/barrier.h | 18 +--
> arch/cris/include/asm/Kbuild | 1 +
> arch/cris/include/asm/barrier.h | 25 -----
> arch/frv/include/asm/barrier.h | 8 +-
> arch/hexagon/include/asm/Kbuild | 1 +
> arch/hexagon/include/asm/atomic.h | 6 +-
> arch/hexagon/include/asm/barrier.h | 41 -------
> arch/m32r/include/asm/barrier.h | 80 +-------------
> arch/m68k/include/asm/barrier.h | 14 +--
> arch/m68k/include/asm/linkage.h | 30 +++++
> arch/microblaze/include/asm/Kbuild | 1 +
> arch/microblaze/include/asm/barrier.h | 27 -----
> arch/mips/mm/dma-default.c | 2 +-
> arch/mn10300/include/asm/Kbuild | 1 +
> arch/mn10300/include/asm/barrier.h | 37 -------
> arch/parisc/include/asm/Kbuild | 1 +
> arch/parisc/include/asm/barrier.h | 35 ------
> arch/score/include/asm/Kbuild | 1 +
> arch/score/include/asm/barrier.h | 16 ---
> arch/sh/include/asm/barrier.h | 21 +---
> arch/sparc/crypto/aes_glue.c | 2 +
> arch/sparc/crypto/camellia_glue.c | 1 +
> arch/sparc/crypto/des_glue.c | 2 +
> arch/sparc/include/asm/barrier_32.h | 12 +-
> arch/tile/include/asm/barrier.h | 68 +-----------
> arch/unicore32/include/asm/barrier.h | 11 +-
> arch/x86/kernel/apic/apic.c | 7 ++
> arch/x86/kernel/entry_64.S | 16 ++-
> arch/x86/kernel/paravirt.c | 16 ++-
> arch/x86/kernel/tsc.c | 17 +--
> arch/x86/kvm/svm.c | 2 +-
> arch/x86/mm/init_64.c | 2 +-
> arch/x86/xen/enlighten.c | 23 ++++
> arch/xtensa/include/asm/barrier.h | 9 +-
> crypto/ahash.c | 3 +-
> drivers/base/regmap/regmap-debugfs.c | 5 +-
> drivers/block/rbd.c | 1 -
> drivers/cpuidle/cpuidle-ux500.c | 2 +-
> drivers/dma/dw/core.c | 4 +-
> drivers/gpu/drm/drm_lock.c | 6 +
> drivers/gpu/drm/nouveau/nouveau_fbcon.c | 24 ++++
> drivers/gpu/drm/qxl/qxl_display.c | 14 ++-
> drivers/hid/hid-apple.c | 6 +
> drivers/hid/hid-core.c | 6 +
> drivers/hid/hid-ids.h | 6 +-
> drivers/hid/usbhid/hid-quirks.c | 3 +-
> drivers/hwmon/nct6775.c | 16 ++-
> drivers/i2c/busses/i2c-designware-platdrv.c | 20 ++++
> drivers/i2c/busses/i2c-rcar.c | 7 +-
> drivers/i2c/busses/i2c-s3c2410.c | 8 +-
> drivers/infiniband/ulp/isert/ib_isert.c | 9 +-
> drivers/input/joystick/Kconfig | 1 +
> drivers/input/keyboard/omap4-keypad.c | 2 +-
> drivers/input/mouse/psmouse-base.c | 4 +
> drivers/input/serio/parkbd.c | 1 +
> drivers/iommu/amd_iommu.c | 8 +-
> drivers/macintosh/windfarm_core.c | 2 +-
> drivers/md/dm-cache-policy-cleaner.c | 2 +-
> drivers/md/dm-raid.c | 3 +-
> drivers/md/dm-thin.c | 2 +-
> drivers/md/persistent-data/dm-btree-internal.h | 6 +
> drivers/md/persistent-data/dm-btree-remove.c | 12 +-
> drivers/md/persistent-data/dm-btree-spine.c | 37 +++++++
> drivers/md/persistent-data/dm-btree.c | 7 +-
> drivers/media/platform/vsp1/vsp1_regs.h | 6 +-
> drivers/media/usb/gspca/m5602/m5602_s5k83a.c | 2 +-
> drivers/media/usb/usbvision/usbvision-video.c | 2 +-
> drivers/mtd/ubi/io.c | 5 +
> drivers/mtd/ubi/vtbl.c | 1 +
> drivers/mtd/ubi/wl.c | 1 +
> drivers/net/ppp/pppoe.c | 1 -
> drivers/net/usb/asix_devices.c | 16 +--
> drivers/net/wireless/ath/ath9k/init.c | 1 +
> drivers/s390/char/con3270.c | 4 +
> drivers/s390/char/tty3270.c | 4 +
> drivers/scsi/3w-9xxx.c | 28 +++--
> drivers/scsi/scsi_error.c | 11 +-
> drivers/spi/spi-pxa2xx.c | 4 +
> drivers/spi/spi.c | 3 +-
> drivers/staging/speakup/fakekey.c | 1 +
> drivers/usb/chipidea/debug.c | 6 +
> drivers/usb/class/usbtmc.c | 1 +
> drivers/usb/core/config.c | 5 +-
> drivers/usb/core/hcd-pci.c | 3 +
> drivers/usb/core/hub.c | 82 ++++++--------
> drivers/usb/core/otg_whitelist.h | 5 +
> drivers/usb/core/quirks.c | 59 +++++++++-
> drivers/usb/host/pci-quirks.c | 12 ++
> drivers/usb/host/xhci-mem.c | 6 +-
> drivers/usb/host/xhci-pci.c | 30 +++++
> drivers/usb/host/xhci-ring.c | 145 ++++++++++++++++---------
> drivers/usb/host/xhci.c | 11 +-
> drivers/usb/host/xhci.h | 1 +
> drivers/usb/musb/musb_cppi41.c | 15 ++-
> drivers/usb/serial/option.c | 24 ++++
> drivers/usb/serial/symbolserial.c | 18 ++-
> drivers/usb/serial/whiteheat.c | 31 ++++++
> fs/btrfs/backref.c | 8 +-
> fs/btrfs/extent_io.c | 80 +++++++++++---
> fs/btrfs/inode.c | 3 +-
> fs/cifs/cifsencrypt.c | 52 ++++++++-
> fs/cifs/cifssmb.c | 5 +-
> fs/cifs/smb2ops.c | 8 +-
> fs/jbd2/checkpoint.c | 39 ++++++-
> fs/jbd2/commit.c | 2 +-
> fs/jbd2/journal.c | 11 +-
> include/asm-generic/barrier.h | 42 ++++---
> include/linux/jbd2.h | 3 +-
> include/linux/security.h | 2 +-
> include/linux/skbuff.h | 6 +-
> include/linux/usb/hcd.h | 3 +
> include/linux/usb/quirks.h | 7 +-
> include/net/af_unix.h | 6 +-
> include/net/sock.h | 8 ++
> include/xen/interface/sched.h | 8 ++
> ipc/msg.c | 14 +--
> ipc/shm.c | 12 +-
> ipc/util.c | 8 +-
> kernel/irq/proc.c | 19 +++-
> kernel/rcutree.c | 45 +++++++-
> kernel/sched/core.c | 18 ++-
> kernel/sched/sched.h | 5 +-
> kernel/workqueue.c | 8 +-
> mm/hugetlb.c | 8 ++
> mm/slab.c | 13 ++-
> net/core/datagram.c | 6 +-
> net/core/ethtool.c | 2 +-
> net/core/skbuff.c | 9 +-
> net/ipv4/tcp_input.c | 2 +-
> net/ipv4/udp.c | 2 +-
> net/ipv6/raw.c | 2 +-
> net/ipv6/udp.c | 3 +-
> net/l2tp/l2tp_core.c | 11 +-
> net/netfilter/ipvs/ip_vs_sync.c | 2 +-
> net/netfilter/ipvs/ip_vs_xmit.c | 1 -
> net/netfilter/nf_conntrack_expect.c | 3 +-
> net/netfilter/nf_conntrack_netlink.c | 5 -
> net/rxrpc/ar-recvmsg.c | 3 +-
> net/unix/af_unix.c | 16 ++-
> sound/arm/Kconfig | 15 +--
> sound/pci/hda/patch_cirrus.c | 57 +++++++++-
> sound/soc/dwc/designware_i2s.c | 4 +-
> sound/soc/pxa/Kconfig | 2 -
> sound/soc/pxa/pxa2xx-ac97.c | 4 +-
> sound/synth/emux/emux_oss.c | 3 +-
> tools/perf/builtin-stat.c | 5 +-
> tools/perf/util/header.c | 4 +-
> tools/perf/util/hist.c | 3 +
> virt/kvm/kvm_main.c | 19 +++-
> 159 files changed, 1221 insertions(+), 854 deletions(-)
> delete mode 100644 arch/arc/include/asm/barrier.h
> delete mode 100644 arch/cris/include/asm/barrier.h
> delete mode 100644 arch/hexagon/include/asm/barrier.h
> delete mode 100644 arch/microblaze/include/asm/barrier.h
> delete mode 100644 arch/mn10300/include/asm/barrier.h
> delete mode 100644 arch/parisc/include/asm/barrier.h
> delete mode 100644 arch/score/include/asm/barrier.h
>
^ permalink raw reply [flat|nested] 134+ messages in thread