4.19.34-stable review
Subsystems (7)
Greg Kroah-Hartman
maintainerPATCH 141/187 ARM: avoid Cortex-A9 livelock on tight dmb loops
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 5388a5b82199facacd3d7ac0d05aca6e8f902fed ]
machine_crash_nonpanic_core() does this:
while (1) cpu_relax();
because the kernel has crashed, and we have no known safe way to deal with the CPU. So, we place the CPU into an infinite loop which we expect it to never exit - at least not until the system as a whole is reset by some method.
In the absence of erratum 754327, this code assembles to:
b .
In other words, an infinite loop. When erratum 754327 is enabled, this becomes:
1: dmb
b 1b
It has been observed that on some systems (eg, OMAP4) where, if a crash is triggered, the system tries to kexec into the panic kernel, but fails after taking the secondary CPU down - placing it into one of these loops. This causes the system to livelock, and the most noticable effect is the system stops after issuing:
Loading crashdump kernel...
to the system console.
The tested as working solution I came up with was to add wfe() to these infinite loops thusly:
while (1) {
cpu_relax();
wfe();
}which, without 754327 builds to:
1: wfe
b 1b
or with 754327 is enabled:
1: dmb
wfe b 1b
Adding "wfe" does two things depending on the environment we're running under:
- where we're running on bare metal, and the processor implements "wfe", it stops us spinning endlessly in a loop where we're never going to do any useful work.
- if we're running in a VM, it allows the CPU to be given back to the hypervisor and rescheduled for other purposes (maybe a different VM) rather than wasting CPU cycles inside a crashed VM.
However, in light of erratum 794072, Will Deacon wanted to see 10 nops as well - which is reasonable to cover the case where we have erratum 754327 enabled _and_ we have a processor that doesn't implement the wfe hint.
So, we now end up with:
1: wfe
b 1b
when erratum 754327 is disabled, or:
1: dmb
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
wfe
b 1b
when erratum 754327 is enabled. We also get the dmb + 10 nop sequence elsewhere in the kernel, in terminating loops.
This is reasonable - it means we get the workaround for erratum 794072 when erratum 754327 is enabled, but still relinquish the dead processor - either by placing it in a lower power mode when wfe is implemented as such or by returning it to the hypervisior, or in the case where wfe is a no-op, we use the workaround specified in erratum 794072 to avoid the problem.
These as two entirely orthogonal problems - the 10 nops addresses erratum 794072, and the wfe is an optimisation that makes the system more efficient when crashed either in terms of power consumption or by allowing the host/other VMs to make use of the CPU.
I don't see any reason not to use kexec() inside a VM - it has the potential to provide automated recovery from a failure of the VMs kernel with the opportunity for saving a crashdump of the failure. A panic() with a reboot timeout won't do that, and reading the libvirt documentation, setting on_reboot to "preserve" won't either (the documentation states "The preserve action for an on_reboot event is treated as a destroy".) Surely it has to be a good thing to avoiding having CPUs spinning inside a VM that is doing no useful work.
--- arch/arm/include/asm/barrier.h | 2 ++ arch/arm/include/asm/processor.h | 6 +++++- arch/arm/kernel/machine_kexec.c | 5 ++++- arch/arm/kernel/smp.c | 4 +++- arch/arm/mach-omap2/prm_common.c | 4 +++- 5 files changed, 17 insertions(+), 4 deletions(-)
arch/arm/include/asm/barrier.h +2 -0
@@ -11,6 +11,8 @@#define sev () __asm__ __volatile__ ("sev" : : : "memory")#define wfe () __asm__ __volatile__ ("wfe" : : : "memory")#define wfi () __asm__ __volatile__ ("wfi" : : : "memory") +#else +#define wfe () do { } while (0)#endif #if __LINUX_ARM_ARCH__ >=7
arch/arm/include/asm/processor.h +5 -1
@@ -95,7 +95,11 @@ extern void release_thread(struct task_struct *);unsigned long get_wchan (struct task_struct *p);#if __LINUX_ARM_ARCH__ ==6 || defined(CONFIG_ARM_ERRATA_754327 ) -#define cpu_relax () smp_mb() +#define cpu_relax () \ + do { \ + smp_mb(); \ + __asm__ __volatile__("nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;"); \ + } while (0)#else #define cpu_relax () barrier()#endif
arch/arm/kernel/machine_kexec.c +4 -1
@@ -91,8 +91,11 @@ void machine_crash_nonpanic_core(void *unused)set_cpu_online (smp_processor_id (), false);atomic_dec (&waiting_for_crash_ipi); -while (1 ) + +while (1 ) {cpu_relax (); +wfe (); + } }void crash_smp_send_stop (void )
arch/arm/kernel/smp.c +3 -1
@@ -604,8 +604,10 @@ static void ipi_cpu_stop(unsigned int cpu)local_fiq_disable ();local_irq_disable (); -while (1 ) +while (1 ) {cpu_relax (); +wfe (); + } } static DEFINE_PER_CPU(struct completion *, cpu_completion);
arch/arm/mach-omap2/prm_common.c +3 -1
@@ -523,8 +523,10 @@ void omap_prm_reset_system(void) prm_ll_data->reset_system (); -while (1 ) +while (1 ) {cpu_relax (); +wfe (); + } }/**
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 142/187 block, bfq: fix in-service-queue check for queue merging
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 058fdecc6de7cdecbf4c59b851e80eb2d6c5295f ]
When a new I/O request arrives for a bfq_queue, say Q, bfq checks whether that request is close to
(a) the head request of some other queue waiting to be served, or
(b) the last request dispatched for the in-service queue (in case Q itself is not the in-service queue)
If a queue, say Q2, is found for which the above condition holds, then bfq merges Q and Q2, to hopefully get a more sequential I/O in the resulting merged queue, and thus a possibly higher throughput.
Case (b) is checked by comparing the new request for Q with the last request dispatched, assuming that the latter necessarily belonged to the in-service queue. Unfortunately, this assumption is no longer always correct, since commit d0edc2473be9 ("block, bfq: inject other-queue I/O into seeky idle queues on NCQ flash").
When the assumption does not hold, queues that must not be merged may be merged, causing unexpected loss of control on per-queue service guarantees.
This commit solves this problem by adding an extra field, which stores the actual last request dispatched for the in-service queue, and by using this new field to correctly check case (b).
--- block/bfq-iosched.c | 5 ++++- block/bfq-iosched.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-)
block/bfq-iosched.c +4 -1
@@ -2215,7 +2215,8 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq,if (in_service_bfqq && in_service_bfqq != bfqq &&likely (in_service_bfqq != &bfqd->oom_bfqq) && -bfq_rq_close_to_sector (io_struct, request, bfqd->last_position) && +bfq_rq_close_to_sector (io_struct, request, + bfqd->in_serv_last_pos) && bfqq->entity.parent == in_service_bfqq->entity.parent &&bfq_may_be_close_cooperator (bfqq, in_service_bfqq)) { new_bfqq =bfq_setup_merge (bfqq, in_service_bfqq);
@@ -2755,6 +2756,8 @@ update_rate_and_reset:bfq_update_rate_reset (bfqd, rq); update_last_values: bfqd->last_position =blk_rq_pos (rq) +blk_rq_sectors (rq); +if (RQ_BFQQ (rq) == bfqd->in_service_queue) + bfqd->in_serv_last_pos = bfqd->last_position; bfqd->last_dispatch = now_ns; }
block/bfq-iosched.h +3 -0
@@ -469,6 +469,9 @@ struct bfq_data {/* on-disk position of the last served request */ sector_t last_position; +/* position of the last served request for the in-service queue */ +sector_t in_serv_last_pos; +/* time of last request completion (ns) */ u64 last_completion;
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 143/187 bpf: fix missing prototype warnings
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 116bfa96a255123ed209da6544f74a4f2eaca5da ]
Compiling with W=1 generates warnings:
CC kernel/bpf/core.okernel/bpf/core.c:721:12: warning: no previous prototype for ?bpf_jit_alloc_exec_limit? [-Wmissing-prototypes]
721 | u64 __weak bpf_jit_alloc_exec_limit(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/core.c:757:14: warning: no previous prototype for ?bpf_jit_alloc_exec? [-Wmissing-prototypes]
757 | void *__weak bpf_jit_alloc_exec(unsigned long size)
| ^~~~~~~~~~~~~~~~~~
kernel/bpf/core.c:762:13: warning: no previous prototype for ?bpf_jit_free_exec? [-Wmissing-prototypes]
762 | void __weak bpf_jit_free_exec(void *addr)
| ^~~~~~~~~~~~~~~~~All three are weak functions that archs can override, provide proper prototypes for when a new arch provides their own.
--- include/linux/filter.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/filter.h +3 -1
@@ -844,7 +844,9 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr,unsigned int alignment, bpf_jit_fill_hole_t bpf_fill_ill_insns);void bpf_jit_binary_free (struct bpf_binary_header *hdr); - +u64 bpf_jit_alloc_exec_limit (void ); +void *bpf_jit_alloc_exec (unsigned long size); +void bpf_jit_free_exec (void *addr);void bpf_jit_free (struct bpf_prog *fp);struct bpf_prog *bpf_jit_blind_constants (struct bpf_prog *fp);
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 144/187 selftests/bpf: skip verifier tests for unsupported program types
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 8184d44c9a577a2f1842ed6cc844bfd4a9981d8e ]
Use recently introduced bpf_probe_prog_type() to skip tests in the test_verifier() if bpf_verify_program() fails. The skipped test is indicated in the output.
Example:
...
679/p bpf_get_stack return R0 within range SKIP (unsupported program type 5)
680/p ld_abs: invalid op 1 OK
...
Summary: 863 PASSED, 165 SKIPPED, 3 FAILED
--- tools/testing/selftests/bpf/test_verifier.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/test_verifier.c +8 -1
@@ -32,6 +32,7 @@#include <linux/if_ether.h> #include <bpf/bpf.h> +#include <bpf/libbpf.h> #ifdef HAVE_GENHDR # include "autoconf.h"
@@ -56,6 +57,7 @@#define UNPRIV_SYSCTL "kernel/unprivileged_bpf_disabled"static bool unpriv_disabled = false; +static int skips;struct bpf_test {const char *descr;
@@ -12770,6 +12772,11 @@ static void do_test_single(struct bpf_test *test, bool unpriv, fd_prog =bpf_verify_program (prog_type ? :BPF_PROG_TYPE_SOCKET_FILTER , prog, prog_len, test->flags &F_LOAD_WITH_STRICT_ALIGNMENT ,"GPL" ,0 , bpf_vlog,sizeof (bpf_vlog),1 ); +if (fd_prog <0 && !bpf_probe_prog_type (prog_type,0 )) { +printf ("SKIP (unsupported program type %d)\n" , prog_type); + skips++; + goto close_fds; + } expected_ret = unpriv && test->result_unpriv !=UNDEF ? test->result_unpriv : test->result;
@@ -12905,7 +12912,7 @@ static void get_unpriv_disabled()static int do_test (bool unpriv,unsigned int from,unsigned int to) { -int i, passes =0 , errors =0 , skips =0 ; +int i, passes =0 , errors =0 ;for (i = from; i < to; i++) {struct bpf_test *test = &tests[i];
Signature · 1 line
2.19.1
Re: [PATCH 4.19 144/187] selftests/bpf: skip verifier tests for unsupported program types
Quoted 10 lines · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit
8184d44c9a577a2f1842ed6cc844bfd4a9981d8e]Use recently introduced
bpf_probe_prog_type()to skip tests in thetest_verifier()ifbpf_verify_program()fails. The skipped test is indicated in the output.
Hi, this patch added in 4.19.34 causes test_verifier build failure, as bpf_probe_prog_type() is not available:
gcc -Wall -O2 -I../../../include/uapi -I../../../lib -I../../../lib/bpf -I../../../../include/generated -DHAVE_GENHDR
-I../../../include test_verifier.c /root/linux-
4.19.44/tools/testing/selftests/bpf/libbpf.a -lcap -lelf -lrt -lpthread -o /root/linux-4.19.44/tools/testing/selftests/bpf/test_verifier test_verifier.c: In function ‘do_test_single’:
test_verifier.c:12775:22: warning: implicit declaration of function ‘bpf_probe_prog_type’; did you mean ‘bpf_program__set_type’? [- Wimplicit-function-declaration]
if (fd_prog < 0 && !bpf_probe_prog_type(prog_type, 0)) {
^~~~~~~~~~~~~~~~~~~
bpf_program__set_type/usr/bin/ld: /tmp/ccEtyLhk.o: in function `do_test_single':
test_verifier.c:(.text+0xa19): undefined reference to `bpf_probe_prog_type'
collect2: error: ld returned 1 exit status make[1]: *** [../lib.mk:152: /root/linux- 4.19.44/tools/testing/selftests/bpf/test_verifier] Error 1
- Tommi
Quoted 63 lines
Example:
...
679/pbpf_get_stackreturn R0 within range SKIP (unsupported program type 5)
680/pld_abs: invalid op 1 OK
...
Summary: 863 PASSED, 165 SKIPPED, 3 FAILEDSigned-off-by Stanislav Fomichev <[email protected]>Signed-off-by Daniel Borkmann <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- tools/testing/selftests/bpf/test_verifier.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)tools/testing/selftests/bpf/test_verifier.c +2
-0@@ -32,6 +32,7 @@#include <linux/if_ether.h> #include <bpf/bpf.h> +#include <bpf/libbpf.h> #ifdef HAVE_GENHDR # include "autoconf.h" @@ -56,6 +57,7 @@#define UNPRIV_SYSCTL "kernel/unprivileged_bpf_disabled"static bool unpriv_disabled = false; +static int skips;struct bpf_test {const char *descr;@@ -12770,6 +12772,11 @@ static void do_test_single(struct bpf_test *test, bool unpriv, fd_prog = bpf_verify_program(prog_type ? : BPF_PROG_TYPE_SOCKET_FILTER, prog, prog_len, test->flags & F_LOAD_WITH_STRICT_ALIGNMENT, "GPL", 0, bpf_vlog,
sizeof(bpf_vlog), 1);tools/testing/selftests/bpf/test_verifier.c +2
-0+if (fd_prog <0 && !bpf_probe_prog_type (prog_type,0 )) { + printf("SKIP (unsupported program type %d)\n",
prog_type);tools/testing/selftests/bpf/test_verifier.c +4
-1+ skips++; + goto close_fds; + } expected_ret = unpriv && test->result_unpriv !=UNDEF ? test->result_unpriv : test->result;@@ -12905,7 +12912,7 @@ static void get_unpriv_disabled()static int do_test (bool unpriv,unsigned int from,unsigned int to) { -int i, passes =0 , errors =0 , skips =0 ; +int i, passes =0 , errors =0 ;for (i = from; i < to; i++) {struct bpf_test *test = &tests[i];
Re: [PATCH 4.19 144/187] selftests/bpf: skip verifier tests for unsupported program types
Quoted 27 lines · Tommi T. (Nokia - FI/Espoo)
Quoted 10 lines · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit
8184d44c9a577a2f1842ed6cc844bfd4a9981d8e]Use recently introduced
bpf_probe_prog_type()to skip tests in thetest_verifier()ifbpf_verify_program()fails. The skipped test is indicated in the output.Hi, this patch added in 4.19.34 causes
test_verifierbuild failure, asbpf_probe_prog_type()is not available:gcc -Wall -O2 -I../../../include/uapi -I../../../lib -I../../../lib/bpf
(quoted diff) +0
-2-I../../../../include/generated -DHAVE_GENHDR -I../../../include test_verifier.c /root/linux-4.19.44/tools/testing/selftests/bpf/libbpf.a -lcap -lelf -lrt -lpthread -o
/root/linux-4.19.44/tools/testing/selftests/bpf/test_verifiertest_verifier.c: In function ‘do_test_single’:
test_verifier.c:12775:22: warning: implicit declaration of function ‘bpf_probe_prog_type’; did you mean ‘bpf_program__set_type’? [- Wimplicit-function-declaration]if (fd_prog < 0 && !bpf_probe_prog_type(prog_type, 0)) { ^~~~~~~~~~~~~~~~~~~ bpf_program__set_type
Quoted 6 lines
/usr/bin/ld:/tmp/ccEtyLhk.o: in function `do_test_single':
test_verifier.c:(.text+0xa19): undefined reference to `bpf_probe_prog_type'
collect2: error: ld returned 1 exit status make[1]: *** [../lib.mk:152:/root/linux-4.19.44/tools/testing/selftests/bpf/test_verifier] Error 1
Looks like this kselftest one got auto-selected for stable? It's not strictly needed, so totally fine to drop.
Thanks,
Daniel
[email protected]
maintainerRe: [PATCH 4.19 144/187] selftests/bpf: skip verifier tests for unsupported program types
Quoted 29 lines · Daniel Borkmann
Quoted 28 lines · Tommi T. (Nokia - FI/Espoo)
Quoted 10 lines · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit
8184d44c9a577a2f1842ed6cc844bfd4a9981d8e]Use recently introduced
bpf_probe_prog_type()to skip tests in thetest_verifier()ifbpf_verify_program()fails. The skipped test is indicated in the output.Hi, this patch added in 4.19.34 causes
test_verifierbuild failure, asbpf_probe_prog_type()is not available:gcc -Wall -O2 -I../../../include/uapi -I../../../lib -I../../../lib/bpf
(quoted diff) +0
-2-I../../../../include/generated -DHAVE_GENHDR -I../../../include test_verifier.c /root/linux-4.19.44/tools/testing/selftests/bpf/libbpf.a -lcap -lelf -lrt -lpthread -o
/root/linux-4.19.44/tools/testing/selftests/bpf/test_verifiertest_verifier.c: In function ‘do_test_single’:
test_verifier.c:12775:22: warning: implicit declaration of function ‘bpf_probe_prog_type’; did you mean ‘bpf_program__set_type’? [- Wimplicit-function-declaration]if (fd_prog < 0 && !bpf_probe_prog_type(prog_type, 0)) { ^~~~~~~~~~~~~~~~~~~ bpf_program__set_type
/usr/bin/ld:/tmp/ccEtyLhk.o: in function `do_test_single':
Quoted 8 lines
Quoted 5 lines
test_verifier.c:(.text+0xa19): undefined reference to `bpf_probe_prog_type'
collect2: error: ld returned 1 exit status make[1]: *** [../lib.mk:152:/root/linux-4.19.44/tools/testing/selftests/bpf/test_verifier] Error 1Looks like this kselftest one got auto-selected for stable? It's not strictly needed, so totally fine to drop.
Ok, will go revert this, sorry for the breakage.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 145/187 powerpc/64s: Clear on-stack exception marker upon exception return
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit eddd0b332304d554ad6243942f87c2fcea98c56b ]
The ppc64 specific implementation of the reliable stacktracer, save_stack_trace_tsk_reliable(), bails out and reports an "unreliable trace" whenever it finds an exception frame on the stack. Stack frames are classified as exception frames if the STACK_FRAME_REGS_MARKER magic, as written by exception prologues, is found at a particular location.
However, as observed by Joe Lawrence, it is possible in practice that non-exception stack frames can alias with prior exception frames and thus, that the reliable stacktracer can find a stale STACK_FRAME_REGS_MARKER on the stack. It in turn falsely reports an unreliable stacktrace and blocks any live patching transition to finish. Said condition lasts until the stack frame is overwritten/initialized by function call or other means.
In principle, we could mitigate this by making the exception frame classification condition in save_stack_trace_tsk_reliable() stronger:
in addition to testing for STACK_FRAME_REGS_MARKER, we could also take into account that for all exceptions executing on the kernel stack
- their stack frames's backlink pointers always match what is saved
in their pt_regs instance's ->gpr[1] slot and that
- their exception frame size equals STACK_INT_FRAME_SIZE, a value uncommonly large for non-exception frames.
However, while these are currently true, relying on them would make the reliable stacktrace implementation more sensitive towards future changes in the exception entry code. Note that false negatives, i.e. not detecting exception frames, would silently break the live patching consistency model.
Furthermore, certain other places (diagnostic stacktraces, perf, xmon) rely on STACK_FRAME_REGS_MARKER as well.
Make the exception exit code clear the on-stack STACK_FRAME_REGS_MARKER for those exceptions running on the "normal" kernel stack and returning to kernelspace: because the topmost frame is ignored by the reliable stack tracer anyway, returns to userspace don't need to take care of clearing the marker.
Furthermore, as I don't have the ability to test this on Book 3E or 32 bits, limit the change to Book 3S and 64 bits.
--- arch/powerpc/kernel/entry_64.S | 7 +++++++ 1 file changed, 7 insertions(+)
arch/powerpc/kernel/entry_64.S +7 -0
@@ -994,6 +994,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) ld r2,_NIP(r1) mtspr SPRN_SRR0,r2 + /* + * Leaving a stale exception_marker on the stack can confuse + * the reliable stack unwinder later on. Clear it. + */ + li r2,0 + std r2,STACK_FRAME_OVERHEAD-16(r1) + ld r0,GPR0(r1) ld r2,GPR2(r1) ld r3,GPR3(r1)
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 146/187 cgroup/pids: turn cgroup_subsys->free() into cgroup_subsys->release() to fix the accounting
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 51bee5abeab2058ea5813c5615d6197a23dbf041 ]
The only user of cgroup_subsys->free() callback is pids_cgrp_subsys which needs pids_free() to uncharge the pid.
However, ->free() is called from __put_task_struct()->cgroup_free() and this is too late. Even the trivial program which does
for (;;) {
int pid = fork();
assert(pid >= 0);
if (pid)
wait(NULL);
else
exit(0);
}can run out of limits because release_task()->call_rcu(delayed_put_task_struct) implies an RCU gp after the task/pid goes away and before the final put().
Test-case:
mkdir -p /tmp/CG
mount -t cgroup2 none /tmp/CG
echo '+pids' > /tmp/CG/cgroup.subtree_control
mkdir /tmp/CG/PID
echo 2 > /tmp/CG/PID/pids.max
perl -e 'while ($p = fork) { wait; } $p // die "fork failed: $!\n"' & echo $! > /tmp/CG/PID/cgroup.procs
Without this patch the forking process fails soon after migration.
Rename cgroup_subsys->free() to cgroup_subsys->release() and move the callsite into the new helper, cgroup_release(), called by release_task() which actually frees the pid(s).
--- include/linux/cgroup-defs.h | 2 +- include/linux/cgroup.h | 2 ++ kernel/cgroup/cgroup.c | 15 +++++++++------ kernel/cgroup/pids.c | 4 ++-- kernel/exit.c | 1 + 5 files changed, 15 insertions(+), 9 deletions(-)
include/linux/cgroup-defs.h +1 -1
@@ -597,7 +597,7 @@ struct cgroup_subsys {void (*cancel_fork)(struct task_struct *task);void (*fork)(struct task_struct *task);void (*exit)(struct task_struct *task); -void (*free)(struct task_struct *task); +void (*release)(struct task_struct *task);void (*bind)(struct cgroup_subsys_state *root_css); bool early_init:1;
include/linux/cgroup.h +2 -0
@@ -119,6 +119,7 @@ extern int cgroup_can_fork(struct task_struct *p);extern void cgroup_cancel_fork (struct task_struct *p);extern void cgroup_post_fork (struct task_struct *p);void cgroup_exit (struct task_struct *p); +void cgroup_release (struct task_struct *p);void cgroup_free (struct task_struct *p);int cgroup_init_early (void );
@@ -699,6 +700,7 @@ static inline int cgroup_can_fork(struct task_struct *p) { return 0; }static inline void cgroup_cancel_fork (struct task_struct *p) {}static inline void cgroup_post_fork (struct task_struct *p) {}static inline void cgroup_exit (struct task_struct *p) {} +static inline void cgroup_release (struct task_struct *p) {}static inline void cgroup_free (struct task_struct *p) {}static inline int cgroup_init_early (void ) {return 0 ; }
kernel/cgroup/cgroup.c +9 -6
@@ -195,7 +195,7 @@ static u64 css_serial_nr_next = 1;*/ static u16 have_fork_callback__read_mostly ;static u16 have_exit_callback__read_mostly ; -static u16 have_free_callback__read_mostly ; +static u16 have_release_callback__read_mostly ;static u16 have_canfork_callback__read_mostly ;/* cgroup namespace for init task */
@@ -5240,7 +5240,7 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss, bool early) have_fork_callback |= (bool )ss->fork << ss->id; have_exit_callback |= (bool )ss->exit << ss->id; - have_free_callback |= (bool )ss->free << ss->id; + have_release_callback |= (bool )ss->release << ss->id; have_canfork_callback |= (bool )ss->can_fork << ss->id;/* At system boot, before all subsystems have been
@@ -5676,16 +5676,19 @@ void cgroup_exit(struct task_struct *tsk) }while_each_subsys_mask (); } -void cgroup_free (struct task_struct *task) +void cgroup_release (struct task_struct *task) { -struct css_set *cset =task_css_set (task);struct cgroup_subsys *ss;int ssid; - do_each_subsys_mask(ss, ssid, have_free_callback) { - ss->free (task); + do_each_subsys_mask(ss, ssid, have_release_callback) { + ss->release (task); }while_each_subsys_mask (); +} +void cgroup_free (struct task_struct *task) +{ +struct css_set *cset =task_css_set (task);put_css_set (cset); }
kernel/cgroup/pids.c +2 -2
@@ -247,7 +247,7 @@ static void pids_cancel_fork(struct task_struct *task)pids_uncharge (pids,1 ); } -static void pids_free (struct task_struct *task) +static void pids_release (struct task_struct *task) {struct pids_cgroup *pids =css_pids (task_css (task, pids_cgrp_id));
@@ -342,7 +342,7 @@ struct cgroup_subsys pids_cgrp_subsys = { .cancel_attach = pids_cancel_attach, .can_fork = pids_can_fork, .cancel_fork = pids_cancel_fork, - .free = pids_free, + .release = pids_release, .legacy_cftypes = pids_files, .dfl_cftypes = pids_files, .threaded = true,
kernel/exit.c +1 -0
@@ -219,6 +219,7 @@ repeat: }write_unlock_irq (&tasklist_lock); +cgroup_release (p);release_thread (p);call_rcu (&p->rcu, delayed_put_task_struct);
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 147/187 backlight: pwm_bl: Use gpiod_get_value_cansleep() to get initial state
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit cec2b18832e26bc866bef2be22eff4e25bbc4034 ]
gpiod_get_value() gives out a warning if access to the underlying gpiochip requires sleeping, which is common for I2C based chips:
WARNING: CPU: 0 PID: 77 at drivers/gpio/gpiolib.c:2500 gpiod_get_value+0xd0/0x100
Modules linked in:
CPU: 0 PID: 77 Comm: kworker/0:2 Not tainted 4.14.0-rc3-00589-gf32897915d48-dirty #90
Hardware name: Allwinner sun4i/sun5i Families
Workqueue: events deferred_probe_work_func
[<c010ec50>] (unwind_backtrace) from [<c010b784>] (show_stack+0x10/0x14)
[<c010b784>] (show_stack) from [<c0797224>] (dump_stack+0x88/0x9c)
[<c0797224>] (dump_stack) from [<c0125b08>] (__warn+0xe8/0x100)
[<c0125b08>] (__warn) from [<c0125bd0>] (warn_slowpath_null+0x20/0x28)
[<c0125bd0>] (warn_slowpath_null) from [<c037069c>] (gpiod_get_value+0xd0/0x100)
[<c037069c>] (gpiod_get_value) from [<c03778d0>] (pwm_backlight_probe+0x238/0x508)
[<c03778d0>] (pwm_backlight_probe) from [<c0411a2c>] (platform_drv_probe+0x50/0xac)
[<c0411a2c>] (platform_drv_probe) from [<c0410224>] (driver_probe_device+0x238/0x2e8)
[<c0410224>] (driver_probe_device) from [<c040e820>] (bus_for_each_drv+0x44/0x94)
[<c040e820>] (bus_for_each_drv) from [<c040ff0c>] (__device_attach+0xb0/0x114)
[<c040ff0c>] (__device_attach) from [<c040f4f8>] (bus_probe_device+0x84/0x8c)
[<c040f4f8>] (bus_probe_device) from [<c040f944>] (deferred_probe_work_func+0x50/0x14c)
[<c040f944>] (deferred_probe_work_func) from [<c013be84>] (process_one_work+0x1ec/0x414)
[<c013be84>] (process_one_work) from [<c013ce5c>] (worker_thread+0x2b0/0x5a0)
[<c013ce5c>] (worker_thread) from [<c0141908>] (kthread+0x14c/0x154)
[<c0141908>] (kthread) from [<c0107ab0>] (ret_from_fork+0x14/0x24)This was missed in commit 0c9501f823a4 ("backlight: pwm_bl: Handle gpio that can sleep"). The code was then moved to a separate function in commit 7613c922315e ("backlight: pwm_bl: Move the checks for initial power state to a separate function").
The only usage of gpiod_get_value() is during the probe stage, which is safe to sleep in. Switch to gpiod_get_value_cansleep().
--- drivers/video/backlight/pwm_bl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/backlight/pwm_bl.c +1 -1
@@ -425,7 +425,7 @@ static int pwm_backlight_initial_power_state(const struct pwm_bl_data *pb)*/ /* if the enable GPIO is disabled, do not enable the backlight */ -if (pb->enable_gpio &&gpiod_get_value (pb->enable_gpio) ==0 ) +if (pb->enable_gpio &&gpiod_get_value_cansleep (pb->enable_gpio) ==0 )return FB_BLANK_POWERDOWN ;/* The regulator is disabled, do not enable the backlight */
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 148/187 tty: increase the default flip buffer limit to 2*640K
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 7ab57b76ebf632bf2231ccabe26bea33868118c6 ]
We increase the default limit for buffer memory allocation by a factor of 10 to 640K to prevent data loss when using fast serial interfaces.
For example when using RS485 without flow-control at speeds of 1Mbit/s an upwards we've run into problems such as applications being too slow to read out this buffer (on embedded devices based on imx53 or imx6).
If you want to write transmitted data to a slow SD card and thus have realtime requirements, this limit can become a problem.
That shouldn't be the case and 640K buffers fix such problems for us.
This value is a maximum limit for allocation only. It has no effect on systems that currently run fine. When transmission is slow enough applications and hardware can keep up and increasing this limit doesn't change anything.
It only _allows_ to allocate more than 2*64K in cases we currently fail to allocate memory despite having some.
--- drivers/tty/tty_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/tty_buffer.c +1 -1
@@ -26,7 +26,7 @@* Byte threshold to limit memory consumption for flip buffers. * The actual memory limit is > 2x this amount. */ -#define TTYB_DEFAULT_MEM_LIMIT 65536 +#define TTYB_DEFAULT_MEM_LIMIT (640 * 1024UL)/* * We default to dicing tty buffer allocations to this many characters
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 149/187 powerpc/pseries: Perform full re-add of CPU for topology update post-migration
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 81b61324922c67f73813d8a9c175f3c153f6a1c6 ]
On pseries systems, performing a partition migration can result in altering the nodes a CPU is assigned to on the destination system. For exampl, pre-migration on the source system CPUs are in node 1 and 3, post-migration on the destination system CPUs are in nodes 2 and 3.
Handling the node change for a CPU can cause corruption in the slab cache if we hit a timing where a CPUs node is changed while cache_reap() is invoked. The corruption occurs because the slab cache code appears to rely on the CPU and slab cache pages being on the same node.
The current dynamic updating of a CPUs node done in arch/powerpc/mm/numa.c does not prevent us from hitting this scenario.
Changing the device tree property update notification handler that recognizes an affinity change for a CPU to do a full DLPAR remove and add of the CPU instead of dynamically changing its node resolves this issue.
--- arch/powerpc/include/asm/topology.h | 2 ++ arch/powerpc/mm/numa.c | 9 +-------- arch/powerpc/platforms/pseries/hotplug-cpu.c | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 8 deletions(-)
arch/powerpc/include/asm/topology.h +2 -0
@@ -132,6 +132,8 @@ static inline void shared_proc_topology_init(void) {}#define topology_sibling_cpumask (cpu) (per_cpu(cpu_sibling_map, cpu))#define topology_core_cpumask (cpu) (per_cpu(cpu_core_map, cpu))#define topology_core_id (cpu) (cpu_to_core_id(cpu)) + +int dlpar_cpu_readd (int cpu);#endif #endif
arch/powerpc/mm/numa.c +1 -8
@@ -1461,13 +1461,6 @@ static void reset_topology_timer(void)#ifdef CONFIG_SMP -static void stage_topology_update (int core_id) -{ -cpumask_or (&cpu_associativity_changes_mask, - &cpu_associativity_changes_mask,cpu_sibling_mask (core_id)); -reset_topology_timer (); -} -static int dt_update_callback (struct notifier_block *nb,unsigned long action,void *data) {
@@ -1480,7 +1473,7 @@ static int dt_update_callback(struct notifier_block *nb, !of_prop_cmp(update->prop->name, "ibm,associativity")) {u32 core_id;of_property_read_u32 (update->dn,"reg" , &core_id); -stage_topology_update (core_id); + rc =dlpar_cpu_readd (core_id); rc =NOTIFY_OK ; }break ;
arch/powerpc/platforms/pseries/hotplug-cpu.c +19 -0
@@ -802,6 +802,25 @@ static int dlpar_cpu_add_by_count(u32 cpus_to_add)return rc; } +int dlpar_cpu_readd (int cpu) +{ +struct device_node *dn; +struct device *dev; +u32 drc_index; +int rc; + + dev =get_cpu_device (cpu); + dn = dev->of_node; + + rc =of_property_read_u32 (dn,"ibm,my-drc-index" , &drc_index); + + rc =dlpar_cpu_remove_by_index (drc_index); +if (!rc) + rc =dlpar_cpu_add (drc_index); + +return rc; +} +int dlpar_cpu (struct pseries_hp_errorlog *hp_elog) {u32 count, drc_index;
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 150/187 drm/amd/display: Enable vblank interrupt during CRC capture
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 428da2bdb05d76c48d0bd8fbfa2e4c102685be08 ]
[Why]
In order to read CRC events when CRC capture is enabled the vblank interrput handler needs to be running for the CRTC. The handler is enabled while there is an active vblank reference.
When running IGT tests there will often be no active vblank reference but the test expects to read a CRC value. This is valid usage (and works on i915 since they have a CRC interrupt handler) so the reference to the vblank should be grabbed while capture is active.
This issue was found running:
igt@kms_plane_multiple@atomic-pipe-b-tiling-none
The pipe-b is the only one in the initial commit and was not previously active so no vblank reference is grabbed. The vblank interrupt is not enabled and the test times out.
[How]
Keep a reference to the vblank as long as CRC capture is enabled. If userspace never explicitly disables it then the reference is also dropped when removing the CRTC from the context (stream = NULL).
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++- .../drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c | 42 +++++++++---------- 2 files changed, 34 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +13 -1
@@ -4390,10 +4390,22 @@ static int amdgpu_dm_atomic_commit(struct drm_device *dev,*/ for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) {struct dm_crtc_state *dm_old_crtc_state =to_dm_crtc_state (old_crtc_state); +struct dm_crtc_state *dm_new_crtc_state =to_dm_crtc_state (new_crtc_state);struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc); -if (drm_atomic_crtc_needs_modeset (new_crtc_state) && dm_old_crtc_state->stream) +if (drm_atomic_crtc_needs_modeset (new_crtc_state) + && dm_old_crtc_state->stream) { +/* +* CRC capture was enabled but not disabled. +* Release the vblank reference. +*/ +if (dm_new_crtc_state->crc_enabled) { +drm_crtc_vblank_put (crtc); + dm_new_crtc_state->crc_enabled = false; + } +manage_dm_interrupts (adev, acrtc, false); + } }/* Add check here for SoC's that support hardware cursor plane, to * unset legacy_cursor_update */
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +21 -21
55 lines not on this page · raw message
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 151/187 ALSA: dice: add support for Solid State Logic Duende Classic/Mini
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit b2e9e1c8810ee05c95f4d55800b8afae70ab01b4 ]
Duende Classic was produced by Solid State Logic in 2006, as a first model of Duende DSP series. The following model, Duende Mini was produced in 2008. They are designed to receive isochronous packets for PCM frames via IEEE 1394 bus, perform signal processing by downloaded program, then transfer isochronous packets for converted PCM frames.
These two models includes the same embedded board, consists of several ICs below:
- Texus Instruments Inc, TSB41AB3 for physical layer of IEEE 1394 bus
- WaveFront semiconductor, DICE II STD ASIC for link/protocol layer
- Altera MAX 3000A CPLD for programs
- Analog devices, SHARC ADSP-21363 for signal processing (4 chips)
This commit adds support for the two models to ALSA dice driver. Like support for the other devices, packet streaming is just available. Userspace applications should be developed if full features became available; e.g. program uploader and parameter controller.
$ ./hinawa-config-rom-printer /dev/fw1
{ 'bus-info': { 'adj': False,
'bmc': False,
'chip_ID': 349771402425,
'cmc': True,
'cyc_clk_acc': 255,
'generation': 1,
'imc': True,
'isc': True,
'link_spd': 2,
'max_ROM': 1,
'max_rec': 512,
'name': '1394',
'node_vendor_ID': 20674,
'pmc': False},
'root-directory': [ ['VENDOR', 20674],
['DESCRIPTOR', 'Solid State Logic'],
['MODEL', 112],
['DESCRIPTOR', 'Duende board'],
[ 'NODE_CAPABILITIES',
{ 'addressing': {'64': True, 'fix': True, 'prv': True},
'misc': {'int': False, 'ms': False, 'spt': True},
'state': { 'atn': False,
'ded': False,
'drq': True,
'elo': False,
'init': False,
'lst': True,
'off': False},
'testing': {'bas': False, 'ext': False}}],
[ 'UNIT',
[ ['SPECIFIER_ID', 20674],
['VERSION', 1],
['MODEL', 112],
['DESCRIPTOR', 'Duende board']]]]}--- sound/firewire/dice/dice.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
sound/firewire/dice/dice.c +11 -1
@@ -18,6 +18,7 @@ MODULE_LICENSE("GPL v2");#define OUI_ALESIS 0x000595#define OUI_MAUDIO 0x000d6c#define OUI_MYTEK 0x001ee8 +#define OUI_SSL 0x0050c2 // Actually ID reserved by IEEE.#define DICE_CATEGORY_ID 0x04#define WEISS_CATEGORY_ID 0x00
@@ -216,7 +217,7 @@ static int dice_probe(struct fw_unit *unit,struct snd_dice *dice;int err; -if (!entry->driver_data) { +if (!entry->driver_data && entry->vendor_id !=OUI_SSL ) { err =check_dice_category (unit);if (err <0 )return -ENODEV ;
@@ -382,6 +383,15 @@ static const struct ieee1394_device_id dice_id_table[] = { .model_id = 0x000002, .driver_data = (kernel_ulong_t)snd_dice_detect_mytek_formats, }, +// Solid State Logic, Duende Classic and Mini. +// NOTE: each field of GUID in config ROM is not compliant to standard +// DICE scheme. + { + .match_flags = IEEE1394_MATCH_VENDOR_ID | + IEEE1394_MATCH_MODEL_ID, + .vendor_id = OUI_SSL, + .model_id = 0x000070, + }, { .match_flags = IEEE1394_MATCH_VERSION, .version = DICE_INTERFACE,
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 152/187 usb: dwc3: gadget: Fix OTG events when gadget driver isnt loaded
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 169e3b68cadb5775daca009ced4faf01ffd97dcf ]
On v3.10a in dual-role mode, if port is in device mode and gadget driver isn't loaded, the OTG event interrupts don't come through.
It seems that if the core is configured to be OTG2.0 only, then we can't leave the DCFG.DEVSPD at Super-speed (default) if we expect OTG to work properly. It must be set to High-speed.
Fix this issue by configuring DCFG.DEVSPD to the supported maximum speed at gadget init. Device tree still needs to provide correct supported maximum speed for this to work.
This issue wasn't present on v2.40a but is seen on v3.10a. It doesn't cause any side effects on v2.40a.
--- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/dwc3/gadget.c +2 -0
@@ -3233,6 +3233,8 @@ int dwc3_gadget_init(struct dwc3 *dwc) goto err4; } +dwc3_gadget_set_speed (&dwc->gadget, dwc->maximum_speed); +return 0 ; err4:
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 153/187 platform/x86: intel-hid: Missing power button release on some Dell models
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit e97a34563d18606ee5db93e495382a967f999cd4 ]
Power button suspend for some Dell models was added in:
commit 821b85366284 ("platform/x86: intel-hid: Power button suspend on Dell Latitude 7275")
by checking against the power button press notification (0xCE) to report the power button press event. The corresponding power button release notification (0xCF) was caught and ignored to stop it from being reported as an "unknown event" in the logs.
The missing button release event is creating issues on Android-x86, as reported on the project mailing list for a Dell Latitude 5175 model, since the events are expected in down/up pairs.
Report the power button release event to fix this issue.
--- drivers/platform/x86/intel-hid.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/platform/x86/intel-hid.c +5 -2
@@ -373,7 +373,7 @@ wakeup:* the 5-button array, but still send notifies with power button * event code to this device object on power button actions. * -* Report the power button press; catch and ignore the button release. +* Report the power button press and release. */ if (!priv->array) {if (event ==0xce ) {
@@ -382,8 +382,11 @@ wakeup:return ; } -if (event ==0xcf ) +if (event ==0xcf ) { +input_report_key (priv->input_dev,KEY_POWER ,0 ); +input_sync (priv->input_dev);return ; + } }/* 0xC0 is for HID events, other values are for 5 button array */
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 154/187 perf script python: Use PyBytes for attr in trace-event-python
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 72e0b15cb24a497d7d0d4707cf51ff40c185ae8c ]
With Python3. PyUnicode_FromStringAndSize is unsafe to call on attr and will return NULL. Use _PyBytes_FromStringAndSize (as with raw_buf).
Below is the observed behavior without the fix. Note it is first necessary to apply the prior fix (Add trace_context extension module to sys,modules):
# ldd /usr/bin/perf | grep -i python
libpython3.6m.so.1.0 => /usr/lib64/libpython3.6m.so.1.0 (0x00007f8e1dfb2000)# perf record -e raw_syscalls:sys_enter /bin/false [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.018 MB perf.data (21 samples) ]
# perf script -g python | cat generated Python script: perf-script.py
# perf script -s ./perf-script.py in trace_begin Segmentation fault (core dumped)
--- tools/perf/util/scripting-engines/trace-event-python.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/perf/util/scripting-engines/trace-event-python.c +1 -2
@@ -733,8 +733,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample,Py_FatalError ("couldn't create Python dictionary" );pydict_set_item_string_decref (dict,"ev_name" ,_PyUnicode_FromString (perf_evsel__name (evsel))); -pydict_set_item_string_decref (dict,"attr" ,_PyUnicode_FromStringAndSize ( - (const char *)&evsel->attr,sizeof (evsel->attr))); +pydict_set_item_string_decref (dict,"attr" ,_PyBytes_FromStringAndSize ((const char *)&evsel->attr,sizeof (evsel->attr)));pydict_set_item_string_decref (dict_sample,"pid" ,_PyLong_FromLong (sample->pid));
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 155/187 perf script python: Add trace_context extension module to sys.modules
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit cc437642255224e4140fed1f3e3156fc8ad91903 ]
In Python3, the result of PyModule_Create (called from scripts/python/Perf-Trace-Util/Context.c) is not automatically added to sys.modules. See: https://bugs.python.org/issue4592
Below is the observed behavior without the fix:
# ldd /usr/bin/perf | grep -i python libpython3.6m.so.1.0 => /usr/lib64/libpython3.6m.so.1.0 (0x00007f8e1dfb2000)
# perf record /bin/false [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.015 MB perf.data (17 samples) ]
# perf script -g python | cat generated Python script: perf-script.py
# perf script -s ./perf-script.py
Traceback (most recent call last):
File "./perf-script.py", line 18, in <module>
from perf_trace_context import *
ModuleNotFoundError: No module named 'perf_trace_context'
Error running python script ./perf-script.py
#Committer notes:
To build with python3 use:
$ make -C tools/perf PYTHON=python3
Use a non-const variable to pass the 'name' arg to PyImport_AppendInittab(), as python2.6 has that as 'char *', which ends up trowing this in some environments:
CC /tmp/build/perf/util/parse-branch-options.o
util/scripting-engines/trace-event-python.c: In function 'python_start_script':
util/scripting-engines/trace-event-python.c:1520:2: error: passing argument 1 of 'PyImport_AppendInittab' discards 'const' qualifier from pointer target type [-Werror]
PyImport_AppendInittab("perf_trace_context", initfunc);
^
In file included from /usr/include/python2.6/Python.h:130:0,
from util/scripting-engines/trace-event-python.c:22:
/usr/include/python2.6/import.h:54:17: note: expected 'char *' but argument is of type 'const char *'
PyAPI_FUNC(int) PyImport_AppendInittab(char *name, void (*initfunc)(void));
^cc1: all warnings being treated as errors
--- .../perf/util/scripting-engines/trace-event-python.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
tools/perf/util/scripting-engines/trace-event-python.c +9 -3
@@ -1493,34 +1493,40 @@ static void _free_command_line(wchar_t **command_line, int num)static int python_start_script (const char *script,int argc,const char **argv) {struct tables *tables = &tables_global; +PyMODINIT_FUNC (*initfunc)(void);#if PY_MAJOR_VERSION <3 const char **command_line;#else wchar_t **command_line;#endif -char buf[PATH_MAX ]; +/* +* Use a non-const name variable to cope with python 2.6's +* PyImport_AppendInittab prototype +*/ +char buf[PATH_MAX ], name[19 ] ="perf_trace_context" ;int i, err =0 ;FILE *fp;#if PY_MAJOR_VERSION <3 + initfunc = initperf_trace_context; command_line =malloc ((argc +1 ) *sizeof (const char *)); command_line[0 ] = script;for (i =1 ; i < argc +1 ; i++) command_line[i] = argv[i -1 ];#else + initfunc = PyInit_perf_trace_context; command_line =malloc ((argc +1 ) *sizeof (wchar_t *)); command_line[0 ] =Py_DecodeLocale (script,NULL );for (i =1 ; i < argc +1 ; i++) command_line[i] =Py_DecodeLocale (argv[i -1 ],NULL );#endif +PyImport_AppendInittab (name, initfunc);Py_Initialize ();#if PY_MAJOR_VERSION <3 -initperf_trace_context ();PySys_SetArgv (argc +1 , (char **)command_line);#else -PyInit_perf_trace_context ();PySys_SetArgv (argc +1 , command_line);#endif
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 156/187 media: mt9m111: set initial frame size other than 0x0
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 29856308137de1c21eda89411695f4fc6e9780ff ]
This driver sets initial frame width and height to 0x0, which is invalid. So set it to selection rectangle bounds instead.
This is detected by v4l2-compliance detected.
--- drivers/media/i2c/mt9m111.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/i2c/mt9m111.c +2 -0
@@ -1014,6 +1014,8 @@ static int mt9m111_probe(struct i2c_client *client, mt9m111->rect.top =MT9M111_MIN_DARK_ROWS ; mt9m111->rect.width =MT9M111_MAX_WIDTH ; mt9m111->rect.height =MT9M111_MAX_HEIGHT ; + mt9m111->width = mt9m111->rect.width; + mt9m111->height = mt9m111->rect.height; mt9m111->fmt = &mt9m111_colour_fmts[0 ]; mt9m111->lastpage =-1 ;mutex_init (&mt9m111->power_lock);
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 157/187 hwrng: virtio - Avoid repeated init of completion
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit aef027db48da56b6f25d0e54c07c8401ada6ce21 ]
The virtio-rng driver uses a completion called have_data to wait for a virtio read to be fulfilled by the hypervisor. The completion is reset before placing a buffer on the virtio queue and completed by the virtio callback once data has been written into the buffer.
Prior to this commit, the driver called init_completion on this completion both during probe as well as when registering virtio buffers as part of a hwrng read operation. The second of these init_completion calls should instead be reinit_completion because the have_data completion has already been inited by probe. As described in Documentation/scheduler/completion.txt, "Calling init_completion() twice on the same completion object is most likely a bug".
This bug was present in the initial implementation of virtio-rng in f7f510ec1957 ("virtio: An entropy device, as suggested by hpa"). Back then the have_data completion was a single static completion rather than a member of one of potentially multiple virtrng_info structs as implemented later by 08e53fbdb85c ("virtio-rng: support multiple virtio-rng devices"). The original driver incorrectly used init_completion rather than INIT_COMPLETION to reset have_data during read.
Tested by running head -c48 /dev/random | hexdump within crosvm, the Chrome OS virtual machine monitor, and confirming that the virtio-rng driver successfully produces random bytes from the host.
--- drivers/char/hw_random/virtio-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/hw_random/virtio-rng.c +1 -1
@@ -73,7 +73,7 @@ static int virtio_read(struct hwrng *rng, void *buf, size_t size, bool wait)if (!vi->busy) { vi->busy = true; -init_completion (&vi->have_data); +reinit_completion (&vi->have_data);register_buffer (vi, buf, size); }
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 158/187 soc/tegra: fuse: Fix illegal free of IO base address
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 51294bf6b9e897d595466dcda5a3f2751906a200 ]
On cases where device tree entries for fuse and clock provider are in different order, fuse driver needs to defer probing. This leads to freeing incorrect IO base address as the fuse->base variable gets overwritten once during first probe invocation. This leads to the following spew during boot:
[ 3.082285] Trying to vfree() nonexistent vm area (00000000cfe8fd94) [ 3.082308] WARNING: CPU: 5 PID: 126 at /hdd/l4t/kernel/stable/mm/vmalloc.c:1511 __vunmap+0xcc/0xd8 [ 3.082318] Modules linked in: [ 3.082330] CPU: 5 PID: 126 Comm: kworker/5:1 Tainted: G S 4.19.7-tegra-gce119d3 #1 [ 3.082340] Hardware name: quill (DT) [ 3.082353] Workqueue: events deferred_probe_work_func [ 3.082364] pstate: 40000005 (nZcv daif -PAN -UAO) [ 3.082372] pc : __vunmap+0xcc/0xd8 [ 3.082379] lr : __vunmap+0xcc/0xd8 [ 3.082385] sp : ffff00000a1d3b60 [ 3.082391] x29: ffff00000a1d3b60 x28: 0000000000000000 [ 3.082402] x27: 0000000000000000 x26: ffff000008e8b610 [ 3.082413] x25: 0000000000000000 x24: 0000000000000009 [ 3.082423] x23: ffff000009221a90 x22: ffff000009f6d000 [ 3.082432] x21: 0000000000000000 x20: 0000000000000000 [ 3.082442] x19: ffff000009f6d000 x18: ffffffffffffffff [ 3.082452] x17: 0000000000000000 x16: 0000000000000000 [ 3.082462] x15: ffff0000091396c8 x14: 0720072007200720 [ 3.082471] x13: 0720072007200720 x12: 0720072907340739 [ 3.082481] x11: 0764076607380765 x10: 0766076307300730 [ 3.082491] x9 : 0730073007300730 x8 : 0730073007280720 [ 3.082501] x7 : 0761076507720761 x6 : 0000000000000102 [ 3.082510] x5 : 0000000000000000 x4 : 0000000000000000 [ 3.082519] x3 : ffffffffffffffff x2 : ffff000009150ff8 [ 3.082528] x1 : 3d95b1429fff5200 x0 : 0000000000000000 [ 3.082538] Call trace: [ 3.082545] __vunmap+0xcc/0xd8 [ 3.082552] vunmap+0x24/0x30 [ 3.082561] __iounmap+0x2c/0x38 [ 3.082569] tegra_fuse_probe+0xc8/0x118 [ 3.082577] platform_drv_probe+0x50/0xa0 [ 3.082585] really_probe+0x1b0/0x288 [ 3.082593] driver_probe_device+0x58/0x100 [ 3.082601] __device_attach_driver+0x98/0xf0 [ 3.082609] bus_for_each_drv+0x64/0xc8 [ 3.082616] __device_attach+0xd8/0x130 [ 3.082624] device_initial_probe+0x10/0x18 [ 3.082631] bus_probe_device+0x90/0x98 [ 3.082638] deferred_probe_work_func+0x74/0xb0 [ 3.082649] process_one_work+0x1e0/0x318 [ 3.082656] worker_thread+0x228/0x450 [ 3.082664] kthread+0x128/0x130 [ 3.082672] ret_from_fork+0x10/0x18 [ 3.082678] ---[ end trace 0810fe6ba772c1c7 ]---
Fix this by retaining the value of fuse->base until driver has successfully probed.
--- drivers/soc/tegra/fuse/fuse-tegra.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/soc/tegra/fuse/fuse-tegra.c +9 -3
@@ -137,13 +137,17 @@ static int tegra_fuse_probe(struct platform_device *pdev) res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); fuse->phys = res->start; fuse->base =devm_ioremap_resource (&pdev->dev, res); -if (IS_ERR (fuse->base)) -return PTR_ERR (fuse->base); +if (IS_ERR (fuse->base)) { + err =PTR_ERR (fuse->base); + fuse->base = base; +return err; + } fuse->clk =devm_clk_get (&pdev->dev,"fuse" );if (IS_ERR (fuse->clk)) {dev_err (&pdev->dev,"failed to get FUSE clock: %ld" ,PTR_ERR (fuse->clk)); + fuse->base = base;return PTR_ERR (fuse->clk); }
@@ -152,8 +156,10 @@ static int tegra_fuse_probe(struct platform_device *pdev)if (fuse->soc->probe) { err = fuse->soc->probe (fuse); -if (err <0 ) +if (err <0 ) { + fuse->base = base;return err; + } } if (tegra_fuse_create_sysfs(&pdev->dev, fuse->soc->info->size,
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 159/187 HID: intel-ish: ipc: handle PIMR before ish_wakeup also clear PISR busy_clear bit
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 2edefc056e4f0e6ec9508dd1aca2c18fa320efef ]
Host driver should handle interrupt mask register earlier than wake up ish FW else there will be conditions when FW interrupt comes, host PIMR register still not set ready, so move the interrupt mask setting before ish_wakeup.
Clear PISR busy_clear bit in ish_irq_handler. If not clear, there will be conditions host driver received a busy_clear interrupt (before the busy_clear mask bit is ready), it will return IRQ_NONE after check_generated_interrupt, the interrupt will never be cleared, causing the DEVICE not sending following IRQ.
Since PISR clear should not be called for the CHV device we do this change. After the change, both ISH2HOST interrupt and busy_clear interrupt will be considered as interrupt from ISH, busy_clear interrupt will return IRQ_HANDLED from IPC_IS_BUSY check.
--- drivers/hid/intel-ish-hid/ipc/ipc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/hid/intel-ish-hid/ipc/ipc.c +6 -3
@@ -91,7 +91,10 @@ static bool check_generated_interrupt(struct ishtp_device *dev)IPC_INT_FROM_ISH_TO_HOST_CHV_AB (pisr_val); }else { pisr_val =ish_reg_read (dev,IPC_REG_PISR_BXT ); - interrupt_generated =IPC_INT_FROM_ISH_TO_HOST_BXT (pisr_val); + interrupt_generated = !!pisr_val; +/* only busy-clear bit is RW, others are RO */ +if (pisr_val) +ish_reg_write (dev,IPC_REG_PISR_BXT , pisr_val); }return interrupt_generated;
@@ -843,11 +846,11 @@ int ish_hw_start(struct ishtp_device *dev) {ish_set_host_rdy (dev); +set_host_ready (dev); +/* After that we can enable ISH DMA operation and wakeup ISHFW */ ish_wakeup (dev); -set_host_ready (dev); -/* wait for FW-initiated reset flow */ if (!dev->recvd_hw_ready) wait_event_interruptible_timeout(dev->wait_hw_ready,
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 160/187 f2fs: UBSAN: set boolean value iostat_enable correctly
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit ac92985864e187a1735502f6a02f54eaa655b2aa ]
When setting /sys/fs/f2fs/<DEV>/iostat_enable with non-bool value, UBSAN reports the following warning.
[ 7562.295484] ================================================================================ [ 7562.296531] UBSAN: Undefined behaviour in fs/f2fs/f2fs.h:2776:10 [ 7562.297651] load of value 64 is not a valid value for type '_Bool' [ 7562.298642] CPU: 1 PID: 7487 Comm: dd Not tainted 4.20.0-rc4+ #79 [ 7562.298653] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 7562.298662] Call Trace: [ 7562.298760] dump_stack+0x46/0x5b [ 7562.298811] ubsan_epilogue+0x9/0x40 [ 7562.298830] __ubsan_handle_load_invalid_value+0x72/0x90 [ 7562.298863] f2fs_file_write_iter+0x29f/0x3f0 [ 7562.298905] __vfs_write+0x115/0x160 [ 7562.298922] vfs_write+0xa7/0x190 [ 7562.298934] ksys_write+0x50/0xc0 [ 7562.298973] do_syscall_64+0x4a/0xe0 [ 7562.298992] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 7562.299001] RIP: 0033:0x7fa45ec19c00 [ 7562.299004] Code: 73 01 c3 48 8b 0d 88 92 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d dd eb 2c 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ce 8f 01 00 48 89 04 24 [ 7562.299044] RSP: 002b:00007ffca52b49e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 7562.299052] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa45ec19c00 [ 7562.299059] RDX: 0000000000000400 RSI: 000000000093f000 RDI: 0000000000000001 [ 7562.299065] RBP: 000000000093f000 R08: 0000000000000004 R09: 0000000000000000 [ 7562.299071] R10: 00007ffca52b47b0 R11: 0000000000000246 R12: 0000000000000400 [ 7562.299077] R13: 000000000093f000 R14: 000000000093f400 R15: 0000000000000000 [ 7562.299091] ================================================================================
So, if iostat_enable is enabled, set its value as true.
--- fs/f2fs/sysfs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
fs/f2fs/sysfs.c +9 -3
@@ -273,10 +273,16 @@ out:return count; } - *ui = t; -if (!strcmp (a->attr.name,"iostat_enable" ) && *ui ==0 ) -f2fs_reset_iostat (sbi); +if (!strcmp (a->attr.name,"iostat_enable" )) { + sbi->iostat_enable = !!t; +if (!sbi->iostat_enable) +f2fs_reset_iostat (sbi); +return count; + } + + *ui = (unsigned int )t; +return count; }
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 161/187 hpet: Fix missing = character in the __setup() code of hpet_mmap_enable
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 24d48a61f2666630da130cc2ec2e526eacf229e3 ]
Commit '3d035f580699 ("drivers/char/hpet.c: allow user controlled mmap for user processes")' introduced a new kernel command line parameter hpet_mmap, that is required to expose the memory map of the HPET registers to user-space. Unfortunately the kernel command line parameter 'hpet_mmap' is broken and never takes effect due to missing '=' character in the __setup() code of hpet_mmap_enable.
Before this patch:
dmesg output with the kernel command line parameter hpet_mmap=1
[ 0.204152] HPET mmap disabled
dmesg output with the kernel command line parameter hpet_mmap=0
[ 0.204192] HPET mmap disabled
After this patch:
dmesg output with the kernel command line parameter hpet_mmap=1
[ 0.203945] HPET mmap enabled
dmesg output with the kernel command line parameter hpet_mmap=0
[ 0.204652] HPET mmap disabled
--- drivers/char/hpet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/hpet.c +1 -1
@@ -377,7 +377,7 @@ static __init int hpet_mmap_enable(char *str)pr_info ("HPET mmap %s\n" , hpet_mmap_enabled ?"enabled" :"disabled" );return 1 ; } -__setup ("hpet_mmap" , hpet_mmap_enable); +__setup ("hpet_mmap=" , hpet_mmap_enable);static int hpet_mmap (struct file *file,struct vm_area_struct *vma) {
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 162/187 cpu/hotplug: Mute hotplug lockdep during init
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit ce48c457b95316b9a01b5aa9d4456ce820df94b4 ]
Since we've had:
commit cb538267ea1e ("jump_label/lockdep: Assert we hold the hotplug lock for _cpuslocked() operations")
we've been getting some lockdep warnings during init, such as on HiKey960:
[ 0.820495] WARNING: CPU: 4 PID: 0 at kernel/cpu.c:316 lockdep_assert_cpus_held+0x3c/0x48 [ 0.820498] Modules linked in: [ 0.820509] CPU: 4 PID: 0 Comm: swapper/4 Tainted: G S 4.20.0-rc5-00051-g4cae42a #34 [ 0.820511] Hardware name: HiKey960 (DT) [ 0.820516] pstate: 600001c5 (nZCv dAIF -PAN -UAO) [ 0.820520] pc : lockdep_assert_cpus_held+0x3c/0x48 [ 0.820523] lr : lockdep_assert_cpus_held+0x38/0x48 [ 0.820526] sp : ffff00000a9cbe50 [ 0.820528] x29: ffff00000a9cbe50 x28: 0000000000000000 [ 0.820533] x27: 00008000b69e5000 x26: ffff8000bff4cfe0 [ 0.820537] x25: ffff000008ba69e0 x24: 0000000000000001 [ 0.820541] x23: ffff000008fce000 x22: ffff000008ba70c8 [ 0.820545] x21: 0000000000000001 x20: 0000000000000003 [ 0.820548] x19: ffff00000a35d628 x18: ffffffffffffffff [ 0.820552] x17: 0000000000000000 x16: 0000000000000000 [ 0.820556] x15: ffff00000958f848 x14: 455f3052464d4d34 [ 0.820559] x13: 00000000769dde98 x12: ffff8000bf3f65a8 [ 0.820564] x11: 0000000000000000 x10: ffff00000958f848 [ 0.820567] x9 : ffff000009592000 x8 : ffff00000958f848 [ 0.820571] x7 : ffff00000818ffa0 x6 : 0000000000000000 [ 0.820574] x5 : 0000000000000000 x4 : 0000000000000001 [ 0.820578] x3 : 0000000000000000 x2 : 0000000000000001 [ 0.820582] x1 : 00000000ffffffff x0 : 0000000000000000 [ 0.820587] Call trace: [ 0.820591] lockdep_assert_cpus_held+0x3c/0x48 [ 0.820598] static_key_enable_cpuslocked+0x28/0xd0 [ 0.820606] arch_timer_check_ool_workaround+0xe8/0x228 [ 0.820610] arch_timer_starting_cpu+0xe4/0x2d8 [ 0.820615] cpuhp_invoke_callback+0xe8/0xd08 [ 0.820619] notify_cpu_starting+0x80/0xb8 [ 0.820625] secondary_start_kernel+0x118/0x1d0
We've also had a similar warning in sched_init_smp() for every asymmetric system that would enable the sched_asym_cpucapacity static key, although that was singled out in:
commit 40fa3780bac2 ("sched/core: Take the hotplug lock in sched_init_smp()")
Those warnings are actually harmless, since we cannot have hotplug operations at the time they appear. Instead of starting to sprinkle useless hotplug lock operations in the init codepaths, mute the warnings until they start warning about real problems.
--- kernel/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+)
kernel/cpu.c +9 -0
@@ -313,6 +313,15 @@ void cpus_write_unlock(void)void lockdep_assert_cpus_held (void ) { +/* +* We can't have hotplug operations before userspace starts running, +* and some init codepaths will knowingly not take the hotplug lock. +* This is all valid, so mute lockdep until it makes sense to report +* unheld locks. +*/ +if (system_state <SYSTEM_RUNNING ) +return ; +percpu_rwsem_assert_held (&cpu_hotplug_lock); }
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 163/187 dmaengine: imx-dma: fix warning comparison of distinct pointer types
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 9227ab5643cb8350449502dd9e3168a873ab0e3b ]
The warning got introduced by commit 930507c18304 ("arm64: add basic Kconfig symbols for i.MX8"). Since it got enabled for arm64. The warning haven't been seen before since size_t was 'unsigned int' when built on arm32.
../drivers/dma/imx-dma.c: In function ‘imxdma_sg_next’:../include/linux/kernel.h:846:29: warning: comparison of distinct pointer types lacks a cast
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
^~
../include/linux/kernel.h:860:4: note: in expansion of macro ‘__typecheck’
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~
../include/linux/kernel.h:870:24: note: in expansion of macro ‘__safe_cmp’
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~
../include/linux/kernel.h:879:19: note: in expansion of macro ‘__careful_cmp’
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~
../drivers/dma/imx-dma.c:288:8: note: in expansion of macro ‘min’
now = min(d->len, sg_dma_len(sg));
^~~Rework so that we use min_t and pass in the size_t that returns the minimum of two values, using the specified type.
--- drivers/dma/imx-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/imx-dma.c +1 -1
@@ -284,7 +284,7 @@ static inline int imxdma_sg_next(struct imxdma_desc *d)struct scatterlist *sg = d->sg;unsigned long now; - now =min (d->len,sg_dma_len (sg)); + now =min_t (size_t, d->len,sg_dma_len (sg));if (d->len !=IMX_DMA_LENGTH_LOOP ) d->len -= now;
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 164/187 dmaengine: qcom_hidma: assign channel cookie correctly
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 546c0547555efca8ba8c120716c325435e29df1b ]
When dma_cookie_complete() is called in hidma_process_completed(), dma_cookie_status() will return DMA_COMPLETE in hidma_tx_status(). Then, hidma_txn_is_success() will be called to use channel cookie mchan->last_success to do additional DMA status check. Current code assigns mchan->last_success after dma_cookie_complete(). This causes a race condition of dma_cookie_status() returns DMA_COMPLETE before mchan->last_success is assigned correctly. The race will cause hidma_tx_status() return DMA_ERROR but the transaction is actually a success. Moreover, in async_tx case, it will cause a timeout panic in async_tx_quiesce().
Kernel panic - not syncing: async_tx_quiesce: DMA error waiting for transaction ... Call trace: [<ffff000008089994>] dump_backtrace+0x0/0x1f4 [<ffff000008089bac>] show_stack+0x24/0x2c [<ffff00000891e198>] dump_stack+0x84/0xa8 [<ffff0000080da544>] panic+0x12c/0x29c [<ffff0000045d0334>] async_tx_quiesce+0xa4/0xc8 [async_tx] [<ffff0000045d03c8>] async_trigger_callback+0x70/0x1c0 [async_tx] [<ffff0000048b7d74>] raid_run_ops+0x86c/0x1540 [raid456] [<ffff0000048bd084>] handle_stripe+0x5e8/0x1c7c [raid456] [<ffff0000048be9ec>] handle_active_stripes.isra.45+0x2d4/0x550 [raid456] [<ffff0000048beff4>] raid5d+0x38c/0x5d0 [raid456] [<ffff000008736538>] md_thread+0x108/0x168 [<ffff0000080fb1cc>] kthread+0x10c/0x138 [<ffff000008084d34>] ret_from_fork+0x10/0x18
--- drivers/dma/qcom/hidma.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/dma/qcom/hidma.c +9 -8
@@ -138,24 +138,25 @@ static void hidma_process_completed(struct hidma_chan *mchan) desc = &mdesc->desc; last_cookie = desc->cookie; + llstat =hidma_ll_status (mdma->lldev, mdesc->tre_ch); +spin_lock_irqsave (&mchan->lock, irqflags); +if (llstat ==DMA_COMPLETE ) { + mchan->last_success = last_cookie; + result.result =DMA_TRANS_NOERROR ; + }else { + result.result =DMA_TRANS_ABORTED ; + } +dma_cookie_complete (desc);spin_unlock_irqrestore (&mchan->lock, irqflags); - llstat =hidma_ll_status (mdma->lldev, mdesc->tre_ch);dmaengine_desc_get_callback (desc, &cb);dma_run_dependencies (desc);spin_lock_irqsave (&mchan->lock, irqflags);list_move (&mdesc->node, &mchan->free); - -if (llstat ==DMA_COMPLETE ) { - mchan->last_success = last_cookie; - result.result =DMA_TRANS_NOERROR ; - }else - result.result =DMA_TRANS_ABORTED ; -spin_unlock_irqrestore (&mchan->lock, irqflags);dmaengine_desc_callback_invoke (&cb, &result);
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 165/187 dmaengine: qcom_hidma: initialize tx flags in hidma_prep_dma_*
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 875aac8a46424e5b73a9ff7f40b83311b609e407 ]
In async_tx_test_ack(), it uses flags in struct dma_async_tx_descriptor to check the ACK status. As hidma reuses the descriptor in a free list when hidma_prep_dma_*(memcpy/memset) is called, the flag will keep ACKed if the descriptor has been used before. This will cause a BUG_ON in async_tx_quiesce().
kernel BUG at crypto/async_tx/async_tx.c:282!
Internal error: Oops - BUG: 0 1 SMP ... task: ffff8017dd3ec000 task.stack: ffff8017dd3e8000 PC is at async_tx_quiesce+0x54/0x78 [async_tx] LR is at async_trigger_callback+0x98/0x110 [async_tx]
This patch initializes flags in dma_async_tx_descriptor by the flags passed from the caller when hidma_prep_dma_*(memcpy/memset) is called.
--- drivers/dma/qcom/hidma.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/dma/qcom/hidma.c +2 -0
@@ -416,6 +416,7 @@ hidma_prep_dma_memcpy(struct dma_chan *dmach, dma_addr_t dest, dma_addr_t src,if (!mdesc)return NULL ; + mdesc->desc.flags = flags;hidma_ll_set_transfer_params (mdma->lldev, mdesc->tre_ch, src, dest, len, flags,HIDMA_TRE_MEMCPY );
@@ -448,6 +449,7 @@ hidma_prep_dma_memset(struct dma_chan *dmach, dma_addr_t dest, int value,if (!mdesc)return NULL ; + mdesc->desc.flags = flags;hidma_ll_set_transfer_params (mdma->lldev, mdesc->tre_ch, value, dest, len, flags,HIDMA_TRE_MEMSET );
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 166/187 netfilter: physdev: relax br_netfilter dependency
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 8e2f311a68494a6677c1724bdcb10bada21af37c ]
Following command:
iptables -D FORWARD -m physdev ...
causes connectivity loss in some setups.
Reason is that iptables userspace will probe kernel for the module revision of the physdev patch, and physdev has an artificial dependency on br_netfilter (xt_physdev use makes no sense unless a br_netfilter module is loaded).
This causes the "phydev" module to be loaded, which in turn enables the "call-iptables" infrastructure.
bridged packets might then get dropped by the iptables ruleset.
The better fix would be to change the "call-iptables" defaults to 0 and enforce explicit setting to 1, but that breaks backwards compatibility.
This does the next best thing: add a request_module call to checkentry. This was a stray '-D ... -m physdev' won't activate br_netfilter anymore.
--- include/net/netfilter/br_netfilter.h | 1 - net/bridge/br_netfilter_hooks.c | 5 ----- net/netfilter/xt_physdev.c | 9 +++++++-- 3 files changed, 7 insertions(+), 8 deletions(-)
include/net/netfilter/br_netfilter.h +0 -1
@@ -49,7 +49,6 @@ static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) }struct net_device *setup_pre_routing (struct sk_buff *skb); -void br_netfilter_enable (void );#if IS_ENABLED (CONFIG_IPV6 )int br_validate_ipv6 (struct net *net,struct sk_buff *skb);
net/bridge/br_netfilter_hooks.c +0 -5
@@ -884,11 +884,6 @@ static const struct nf_br_ops br_ops = { .br_dev_xmit_hook = br_nf_dev_xmit, }; -void br_netfilter_enable (void ) -{ -} -EXPORT_SYMBOL_GPL (br_netfilter_enable); -/* For br_nf_post_routing, we need (prio = NF_BR_PRI_LAST), because * br_dev_queue_push_xmit is called afterwards */ static const struct nf_hook_ops br_nf_ops[] = {
net/netfilter/xt_physdev.c +7 -2
@@ -96,8 +96,7 @@ match_outdev:static int physdev_mt_check (const struct xt_mtchk_param *par) {const struct xt_physdev_info *info = par->matchinfo; - -br_netfilter_enable (); +static bool brnf_probed__read_mostly ;if (!(info->bitmask &XT_PHYSDEV_OP_MASK ) || info->bitmask & ~XT_PHYSDEV_OP_MASK )
@@ -111,6 +110,12 @@ static int physdev_mt_check(const struct xt_mtchk_param *par)if (par->hook_mask & (1 <<NF_INET_LOCAL_OUT ))return -EINVAL ; } + +if (!brnf_probed) { + brnf_probed = true; +request_module ("br_netfilter" ); + } +return 0 ; }
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 167/187 media: rcar-vin: Allow independent VIN link enablement
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit c5ff0edb8e2270a75935c73217fb0de1abd2d910 ]
There is a block of code in rvin_group_link_notify() that prevents enabling a link to a VIN node if any entity in the media graph is in use. This prevents enabling a VIN link even if there is an in-use entity somewhere in the graph that is independent of the link's pipeline.
For example, the code block will prevent enabling a link from the first rcar-csi2 receiver to a VIN node even if there is an enabled link somewhere far upstream on the second independent rcar-csi2 receiver pipeline.
If this code block is meant to prevent modifying a link if any entity in the graph is actively involved in streaming (because modifying the CHSEL register fields can disrupt any/all running streams), then the entities stream counts should be checked rather than the use counts.
(There is already such a check in __media_entity_setup_link() that verifies the stream_count of the link's source and sink entities are both zero, but that is insufficient, since there should be no running streams in the entire graph).
Modify the code block to check the entity stream_count instead of the use_count (and elaborate on the comment). VIN node links can now be enabled even if there are other independent in-use entities that are not streaming.
--- drivers/media/platform/rcar-vin/rcar-core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/media/platform/rcar-vin/rcar-core.c +6 -2
@@ -131,9 +131,13 @@ static int rvin_group_link_notify(struct media_link *link, u32 flags, !is_media_entity_v4l2_video_device(link->sink->entity))return 0 ; -/* If any entity is in use don't allow link changes. */ +/* +* Don't allow link changes if any entity in the graph is +* streaming, modifying the CHSEL register fields can disrupt +* running streams. +*/ media_device_for_each_entity (entity, &group->mdev) -if (entity->use_count) +if (entity->stream_count)return -EBUSY ;mutex_lock (&group->lock);
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 168/187 media: s5p-jpeg: Check for fmt_ver_flag when doing fmt enumeration
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 49710c32cd9d6626a77c9f5f978a5f58cb536b35 ]
Previously when doing format enumeration, it was returning all
formats supported by driver, even if they're not supported by hw.
Add missing check for fmt_ver_flag, so it'll be fixed and only those
supported by hw will be returned. Similar thing is already done in s5p_jpeg_find_format.
It was found by using v4l2-compliance tool and checking result
of VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS test
and using v4l2-ctl to get list of all supported formats.
Tested on s5pv210-galaxys (Samsung i9000 phone).
--- drivers/media/platform/s5p-jpeg/jpeg-core.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/media/platform/s5p-jpeg/jpeg-core.c +11 -8
@@ -1293,13 +1293,16 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,return 0 ; } -static int enum_fmt (struct s5p_jpeg_fmt *sjpeg_formats,int n, +static int enum_fmt (struct s5p_jpeg_ctx *ctx, +struct s5p_jpeg_fmt *sjpeg_formats,int n,struct v4l2_fmtdesc *f,u32 type) {int i, num =0 ; +unsigned int fmt_ver_flag = ctx->jpeg->variant->fmt_ver_flag;for (i =0 ; i < n; ++i) { -if (sjpeg_formats[i].flags & type) { +if (sjpeg_formats[i].flags & type && + sjpeg_formats[i].flags & fmt_ver_flag) {/* index-th format of type type found ? */ if (num == f->index)break ;
@@ -1326,11 +1329,11 @@ static int s5p_jpeg_enum_fmt_vid_cap(struct file *file, void *priv,struct s5p_jpeg_ctx *ctx =fh_to_ctx (priv);if (ctx->mode ==S5P_JPEG_ENCODE ) -return enum_fmt (sjpeg_formats,SJPEG_NUM_FORMATS , f, +return enum_fmt (ctx, sjpeg_formats,SJPEG_NUM_FORMATS , f,SJPEG_FMT_FLAG_ENC_CAPTURE ); -return enum_fmt (sjpeg_formats,SJPEG_NUM_FORMATS , f, -SJPEG_FMT_FLAG_DEC_CAPTURE ); +return enum_fmt (ctx, sjpeg_formats,SJPEG_NUM_FORMATS , f, +SJPEG_FMT_FLAG_DEC_CAPTURE ); } static int s5p_jpeg_enum_fmt_vid_out(struct file *file, void *priv,
@@ -1339,11 +1342,11 @@ static int s5p_jpeg_enum_fmt_vid_out(struct file *file, void *priv,struct s5p_jpeg_ctx *ctx =fh_to_ctx (priv);if (ctx->mode ==S5P_JPEG_ENCODE ) -return enum_fmt (sjpeg_formats,SJPEG_NUM_FORMATS , f, +return enum_fmt (ctx, sjpeg_formats,SJPEG_NUM_FORMATS , f,SJPEG_FMT_FLAG_ENC_OUTPUT ); -return enum_fmt (sjpeg_formats,SJPEG_NUM_FORMATS , f, -SJPEG_FMT_FLAG_DEC_OUTPUT ); +return enum_fmt (ctx, sjpeg_formats,SJPEG_NUM_FORMATS , f, +SJPEG_FMT_FLAG_DEC_OUTPUT ); } static struct s5p_jpeg_q_data *get_q_data(struct s5p_jpeg_ctx *ctx,
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 169/187 regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit f01a7beb6791f1c419424c1a6958b7d0a289c974 ]
The act8600_sudcdc_voltage_ranges setting does not match the datasheet.
The problems in below entry:
REGULATOR_LINEAR_RANGE(19000000, 191, 255, 400000),
1. The off-by-one min_sel causes wrong volatage calculation. The min_sel should be 192.
2. According to the datasheet[1] Table 7. (on page 43):
The selector 248 (0b11111000) ~ 255 (0b11111111) are 41.400V.
Also fix off-by-one for ACT8600_SUDCDC_VOLTAGE_NUM.
[1] https://active-semi.com/wp-content/uploads/ACT8600_Datasheet.pdf
--- drivers/regulator/act8865-regulator.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/regulator/act8865-regulator.c +3 -2
@@ -131,7 +131,7 @@* ACT8865 voltage number */ #define ACT8865_VOLTAGE_NUM 64 -#define ACT8600_SUDCDC_VOLTAGE_NUM 255 +#define ACT8600_SUDCDC_VOLTAGE_NUM 256struct act8865 {struct regmap *regmap;
@@ -222,7 +222,8 @@ static const struct regulator_linear_range act8600_sudcdc_voltage_ranges[] = {REGULATOR_LINEAR_RANGE (3000000 ,0 ,63 ,0 ),REGULATOR_LINEAR_RANGE (3000000 ,64 ,159 ,100000 ),REGULATOR_LINEAR_RANGE (12600000 ,160 ,191 ,200000 ), - REGULATOR_LINEAR_RANGE(19000000, 191, 255, 400000), +REGULATOR_LINEAR_RANGE (19000000 ,192 ,247 ,400000 ), + REGULATOR_LINEAR_RANGE(41400000, 248, 255, 0), }; static struct regulator_ops act8865_ops = {
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 170/187 pinctrl: meson: meson8b: add the eth_rxd2 and eth_rxd3 pins
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 6daae00243e622dd3feec7965bfe421ad6dd317e ]
Gigabit Ethernet requires the Ethernet TXD0..3 and RXD0..3 data lines. Add the missing eth_rxd2 and eth_rxd3 definitions so we don't have to rely on the bootloader to set them up correctly.
The vendor u-boot sources for Odroid-C1 use the following Ethernet pinmux configuration:
SET_CBUS_REG_MASK(PERIPHS_PIN_MUX_6, 0x3f4f); SET_CBUS_REG_MASK(PERIPHS_PIN_MUX_7, 0xf00000);
This translates to the following pin groups in the mainline kernel:
- register 6 bit 0: eth_rxd1 (DIF_0_P) - register 6 bit 1: eth_rxd0 (DIF_0_N) - register 6 bit 2: eth_rx_dv (DIF_1_P) - register 6 bit 3: eth_rx_clk (DIF_1_N) - register 6 bit 6: eth_tx_en (DIF_3_P) - register 6 bit 8: eth_ref_clk (DIF_3_N) - register 6 bit 9: eth_mdc (DIF_4_P)
- register 6 bit 10: eth_mdio_en (DIF_4_N)
- register 6 bit 11: eth_tx_clk (GPIOH_9)
- register 6 bit 12: eth_txd2 (GPIOH_8)
- register 6 bit 13: eth_txd3 (GPIOH_7)
- register 7 bit 20: eth_txd0_0 (GPIOH_6)
- register 7 bit 21: eth_txd1_0 (GPIOH_5)
- register 7 bit 22: eth_rxd3 (DIF_2_P)
- register 7 bit 23: eth_rxd2 (DIF_2_N)
All functions except eth_rxd2 and eth_rxd3 are already supported by the pinctrl-meson8b driver.
--- drivers/pinctrl/meson/pinctrl-meson8b.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/pinctrl/meson/pinctrl-meson8b.c +5 -1
@@ -346,6 +346,8 @@ static const unsigned int eth_rx_dv_pins[] = { DIF_1_P };static const unsigned int eth_rx_clk_pins[] = {DIF_1_N };static const unsigned int eth_txd0_1_pins[] = {DIF_2_P };static const unsigned int eth_txd1_1_pins[] = {DIF_2_N }; +static const unsigned int eth_rxd3_pins[] = {DIF_2_P }; +static const unsigned int eth_rxd2_pins[] = {DIF_2_N };static const unsigned int eth_tx_en_pins[] = {DIF_3_P };static const unsigned int eth_ref_clk_pins[] = {DIF_3_N };static const unsigned int eth_mdc_pins[] = {DIF_4_P };
@@ -571,6 +573,8 @@ static struct meson_pmx_group meson8b_cbus_groups[] = {GROUP (eth_ref_clk,6 ,8 ),GROUP (eth_mdc,6 ,9 ),GROUP (eth_mdio_en,6 ,10 ), +GROUP (eth_rxd3,7 ,22 ), + GROUP(eth_rxd2, 7, 23), }; static struct meson_pmx_group meson8b_aobus_groups[] = {
@@ -720,7 +724,7 @@ static const char * const ethernet_groups[] = {"eth_tx_clk" ,"eth_tx_en" ,"eth_txd1_0" ,"eth_txd1_1" ,"eth_txd0_0" ,"eth_txd0_1" ,"eth_rx_clk" ,"eth_rx_dv" ,"eth_rxd1" ,"eth_rxd0" ,"eth_mdio_en" ,"eth_mdc" ,"eth_ref_clk" , -"eth_txd2" ,"eth_txd3" +"eth_txd2" ,"eth_txd3" ,"eth_rxd3" ,"eth_rxd2" }; static const char * const i2c_a_groups[] = {
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 171/187 drm: Auto-set allow_fb_modifiers when given modifiers at plane init
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 890880ddfdbe256083170866e49c87618b706ac7 ]
When drivers pass non-empty lists of modifiers for initializing their planes, we can infer that they allow framebuffer modifiers and set the driver's allow_fb_modifiers mode config element.
In case the allow_fb_modifiers element was not set (some drivers tend to set them after registering planes), the modifiers will still be registered but won't be available to userspace unless the flag is set later. However in that case, the IN_FORMATS blob won't be created.
In order to avoid this case and generally reduce the trouble associated with the flag, always set allow_fb_modifiers when a non-empty list of format modifiers is passed at plane init.
--- drivers/gpu/drm/drm_plane.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_plane.c +3 -0
@@ -211,6 +211,9 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, format_modifier_count++; } +if (format_modifier_count) + config->allow_fb_modifiers = true; + plane->modifier_count = format_modifier_count; plane->modifiers = kmalloc_array(format_modifier_count, sizeof(format_modifiers[0]),
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 172/187 drm/nouveau: Stop using drm_crtc_force_disable
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 934c5b32a5e43d8de2ab4f1566f91d7c3bf8cb64 ]
The correct way for legacy drivers to update properties that need to do a full modeset, is to do a full modeset.
Note that we don't need to call the drm_mode_config_internal helper because we're not changing any of the refcounted paramters.
v2: Fixup error handling (Ville). Since the old code didn't bother I decided to just delete it instead of adding even more code for just error handling.
--- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +3 -1
@@ -750,7 +750,9 @@ static int nv17_tv_set_property(struct drm_encoder *encoder,/* Disable the crtc to ensure a full modeset is * performed whenever it's turned on again. */ if (crtc) -drm_crtc_force_disable (crtc); +drm_crtc_helper_set_mode (crtc, &crtc->mode, + crtc->x, crtc->y, + crtc->primary->fb); }return 0 ;
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 173/187 x86/build: Specify elf_i386 linker emulation explicitly for i386 objects
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 927185c124d62a9a4d35878d7f6d432a166b74e3 ]
The kernel uses the OUTPUT_FORMAT linker script command in it's linker scripts. Most of the time, the -m option is passed to the linker with correct architecture, but sometimes (at least for x86_64) the -m option contradicts the OUTPUT_FORMAT directive.
Specifically, arch/x86/boot and arch/x86/realmode/rm produce i386 object files, but are linked with the -m elf_x86_64 linker flag when building for x86_64.
The GNU linker manpage doesn't explicitly state any tie-breakers between -m and OUTPUT_FORMAT. But with BFD and Gold linkers, OUTPUT_FORMAT overrides the emulation value specified with the -m option.
LLVM lld has a different behavior, however. When supplied with contradicting -m and OUTPUT_FORMAT values it fails with the following error message:
ld.lld: error: arch/x86/realmode/rm/header.o is incompatible with elf_x86_64
Therefore, just add the correct -m after the incorrect one (it overrides it), so the linker invocation looks like this:
ld -m elf_x86_64 -z max-page-size=0x200000 -m elf_i386 --emit-relocs -T \
realmode.lds header.o trampoline_64.o stack.o reboot.o -o realmode.elfThis is not a functional change for GNU ld, because (although not explicitly documented) OUTPUT_FORMAT overrides -m EMULATION.
Tested by building x86_64 kernel with GNU gcc/ld toolchain and booting it in QEMU.
[ bp: massage and clarify text. ]
--- arch/x86/boot/Makefile | 2 +- arch/x86/realmode/rm/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/boot/Makefile +1 -1
@@ -100,7 +100,7 @@ $(obj)/zoffset.h: $(obj)/compressed/vmlinux FORCE AFLAGS_header.o += -I$(objtree)/$(obj) $(obj)/header.o: $(obj)/zoffset.h -LDFLAGS_setup.elf := -T +LDFLAGS_setup.elf := -m elf_i386 -T $(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE $(call if_changed,ld)
arch/x86/realmode/rm/Makefile +1 -1
@@ -47,7 +47,7 @@ $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE targets += realmode.lds $(obj)/realmode.lds: $(obj)/pasyms.h -LDFLAGS_realmode.elf := --emit-relocs -T +LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj) targets += realmode.elf
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 174/187 selinux: do not override context on context mounts
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 53e0c2aa9a59a48e3798ef193d573ade85aa80f5 ]
Ignore all selinux_inode_notifysecctx() calls on mounts with SBLABEL_MNT flag unset. This is achived by returning -EOPNOTSUPP for this case in selinux_inode_setsecurtity() (because that function should not be called in such case anyway) and translating this error to 0 in selinux_inode_notifysecctx().
This fixes behavior of kernfs-based filesystems when mounted with the 'context=' option. Before this patch, if a node's context had been explicitly set to a non-default value and later the filesystem has been remounted with the 'context=' option, then this node would show up as having the manually-set context and not the mount-specified one.
Steps to reproduce:
# mount -t cgroup2 cgroup2 /sys/fs/cgroup/unified
# chcon unconfined_u:object_r:user_home_t:s0 /sys/fs/cgroup/unified/cgroup.stat
# ls -lZ /sys/fs/cgroup/unified
total 0
-r--r--r--. 1 root root system_u:object_r:cgroup_t:s0 0 Dec 13 10:41 cgroup.controllers
-rw-r--r--. 1 root root system_u:object_r:cgroup_t:s0 0 Dec 13 10:41 cgroup.max.depth
-rw-r--r--. 1 root root system_u:object_r:cgroup_t:s0 0 Dec 13 10:41 cgroup.max.descendants
-rw-r--r--. 1 root root system_u:object_r:cgroup_t:s0 0 Dec 13 10:41 cgroup.procs
-r--r--r--. 1 root root unconfined_u:object_r:user_home_t:s0 0 Dec 13 10:41 cgroup.stat
-rw-r--r--. 1 root root system_u:object_r:cgroup_t:s0 0 Dec 13 10:41 cgroup.subtree_control
-rw-r--r--. 1 root root system_u:object_r:cgroup_t:s0 0 Dec 13 10:41 cgroup.threads
# umount /sys/fs/cgroup/unified
# mount -o context=system_u:object_r:tmpfs_t:s0 -t cgroup2 cgroup2 /sys/fs/cgroup/unifiedResult before:
# ls -lZ /sys/fs/cgroup/unified
total 0
-r--r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.controllers
-rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.max.depth
-rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.max.descendants
-rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.procs
-r--r--r--. 1 root root unconfined_u:object_r:user_home_t:s0 0 Dec 13 10:41 cgroup.stat
-rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.subtree_control
-rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.threadsResult after:
# ls -lZ /sys/fs/cgroup/unified
total 0
-r--r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.controllers
-rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.max.depth
-rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.max.descendants
-rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.procs
-r--r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.stat
-rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.subtree_control
-rw-r--r--. 1 root root system_u:object_r:tmpfs_t:s0 0 Dec 13 10:41 cgroup.threads--- security/selinux/hooks.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
security/selinux/hooks.c +8 -1
@@ -3458,12 +3458,16 @@ static int selinux_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags) { struct inode_security_struct *isec = inode_security_novalidate(inode); +struct superblock_security_struct *sbsec = inode->i_sb->s_security;u32 newsid;int rc;if (strcmp (name,XATTR_SELINUX_SUFFIX ))return -EOPNOTSUPP ; +if (!(sbsec->flags &SBLABEL_MNT )) +return -EOPNOTSUPP ; +if (!value || !size)return -EACCES ;
@@ -6612,7 +6616,10 @@ static void selinux_inode_invalidate_secctx(struct inode *inode)*/ static int selinux_inode_notifysecctx (struct inode *inode,void *ctx,u32 ctxlen) { -return selinux_inode_setsecurity (inode,XATTR_SELINUX_SUFFIX , ctx, ctxlen,0 ); +int rc =selinux_inode_setsecurity (inode,XATTR_SELINUX_SUFFIX , + ctx, ctxlen,0 ); +/* Do not return error when suppressing label (SBLABEL_MNT not set). */ +return rc == -EOPNOTSUPP ?0 : rc; }/*
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 175/187 brcmfmac: Use firmware_request_nowarn for the clm_blob
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 4ad0be160544ffbdafb7cec39bb8e6dd0a97317a ]
The linux-firmware brcmfmac firmware files contain an embedded table with per country allowed channels and strength info.
For recent hardware these versions of the firmware are specially build for linux-firmware, the firmware files directly available from Cypress rely on a separate clm_blob file for this info.
For some unknown reason Cypress refuses to provide the standard firmware files + clm_blob files it uses elsewhere for inclusion into linux-firmware, instead relying on these special builds with the clm_blob info embedded. This means that the linux-firmware firmware versions often lag behind, but I digress.
The brcmfmac driver does support the separate clm_blob file and always tries to load this. Currently we use request_firmware for this. This means that on any standard install, using the standard combo of linux-kernel + linux-firmware, we will get a warning:
"Direct firmware load for ... failed with error -2"
On top of this, brcmfmac itself prints: "no clm_blob available (err=-2), device may have limited channels available".
This commit switches to firmware_request_nowarn, fixing almost any brcmfmac device logging the warning (it leaves the brcmfmac info message in place).
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +1 -1
@@ -149,7 +149,7 @@ static int brcmf_c_process_clm_blob(struct brcmf_if *ifp)return err; } - err =request_firmware (&clm, clm_name, bus->dev); + err =firmware_request_nowarn (&clm, clm_name, bus->dev);if (err) {brcmf_info ("no clm_blob available (err=%d), device may have limited channels available\n" , err);
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 176/187 wlcore: Fix memory leak in case wl12xx_fetch_firmware failure
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit ba2ffc96321c8433606ceeb85c9e722b8113e5a7 ]
Release fw_status, raw_fw_status, and tx_res_if when wl12xx_fetch_firmware failed instead of meaningless goto out to avoid the following memory leak reports(Only the last one listed):
unreferenced object 0xc28a9a00 (size 512):
comm "kworker/0:4", pid 31298, jiffies 2783204 (age 203.290s) hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<6624adab>] kmemleak_alloc+0x40/0x74
[<500ddb31>] kmem_cache_alloc_trace+0x1ac/0x270
[<db4d731d>] wl12xx_chip_wakeup+0xc4/0x1fc [wlcore]
[<76c5db53>] wl1271_op_add_interface+0x4a4/0x8f4 [wlcore]
[<cbf30777>] drv_add_interface+0xa4/0x1a0 [mac80211]
[<65bac325>] ieee80211_reconfig+0x9c0/0x1644 [mac80211]
[<2817c80e>] ieee80211_restart_work+0x90/0xc8 [mac80211]
[<7e1d425a>] process_one_work+0x284/0x42c
[<55f9432e>] worker_thread+0x2fc/0x48c
[<abb582c6>] kthread+0x148/0x160
[<63144b13>] ret_from_fork+0x14/0x2c
[< (null)>] (null)
[<1f6e7715>] 0xffffffff--- drivers/net/wireless/ti/wlcore/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/ti/wlcore/main.c +5 -2
@@ -1084,8 +1084,11 @@ static int wl12xx_chip_wakeup(struct wl1271 *wl, bool plt) goto out; ret =wl12xx_fetch_firmware (wl, plt); -if (ret <0 ) - goto out; +if (ret <0 ) { +kfree (wl->fw_status); +kfree (wl->raw_fw_status); +kfree (wl->tx_res_if); + } out:return ret;
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 177/187 x86/build: Mark per-CPU symbols as absolute explicitly for LLD
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit d071ae09a4a1414c1433d5ae9908959a7325b0ad ]
Accessing per-CPU variables is done by finding the offset of the variable in the per-CPU block and adding it to the address of the respective CPU's block.
Section 3.10.8 of ld.bfd's documentation states:
For expressions involving numbers, relative addresses and absolute addresses, ld follows these rules to evaluate terms:
Other binary operations, that is, between two relative addresses not in the same section, or between a relative address and an absolute address, first convert any non-absolute term to an absolute address before applying the operator."
Note that LLVM's linker does not adhere to the GNU ld's implementation and as such requires implicitly-absolute terms to be explicitly marked as absolute in the linker script. If not, it fails currently with:
ld.lld: error: ./arch/x86/kernel/vmlinux.lds:153: at least one side of the expression must be absolute ld.lld: error: ./arch/x86/kernel/vmlinux.lds:154: at least one side of the expression must be absolute Makefile:1040: recipe for target 'vmlinux' failed
This is not a functional change for ld.bfd which converts the term to an absolute symbol anyways as specified above.
Based on a previous submission by Tri Vo <[email protected]>.
--- arch/x86/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/vmlinux.lds.S +1 -1
@@ -411,7 +411,7 @@ SECTIONS * Per-cpu symbols which need to be offset from __per_cpu_load * for the boot processor. */ -#define INIT_PER_CPU(x) init_per_cpu__##x = x + __per_cpu_load +#define INIT_PER_CPU(x) init_per_cpu__##x = ABSOLUTE(x) + __per_cpu_load INIT_PER_CPU(gdt_page); INIT_PER_CPU(irq_stack_union);
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 178/187 drm/fb-helper: fix leaks in error path of drm_fb_helper_fbdev_setup
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 00eb5b0da8d27b3c944bfc959c3344d665caae26 ]
After drm_fb_helper_fbdev_setup calls drm_fb_helper_init, "dev->fb_helper" will be initialized (and thus drm_fb_helper_fini will have some effect). After that, drm_fb_helper_initial_config is called which may call the "fb_probe" driver callback.
This driver callback may call drm_fb_helper_defio_init (as is done by drm_fb_helper_generic_probe) or set a framebuffer (as is done by bochs) as documented. These are normally cleaned up on exit by drm_fb_helper_fbdev_teardown which also calls drm_fb_helper_fini.
If an error occurs after "fb_probe", but before setup is complete, then calling just drm_fb_helper_fini will leak resources. This was triggered by df2052cc922 ("bochs: convert to drm_fb_helper_fbdev_setup/teardown"):
[ 50.008030] bochsdrmfb: enable CONFIG_FB_LITTLE_ENDIAN to support this framebuffer
[ 50.009436] bochs-drm 0000:00:02.0: [drm:drm_fb_helper_fbdev_setup] *ERROR* fbdev: Failed to set configuration (ret=-38)
[ 50.011456] [drm] Initialized bochs-drm 1.0.0 20130925 for 0000:00:02.0 on minor 2
[ 50.013604] WARNING: CPU: 1 PID: 1 at drivers/gpu/drm/drm_mode_config.c:477 drm_mode_config_cleanup+0x280/0x2a0
[ 50.016175] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G T 4.20.0-rc7 #1
[ 50.017732] EIP: drm_mode_config_cleanup+0x280/0x2a0
...
[ 50.023155] Call Trace:
[ 50.023155] ? bochs_kms_fini+0x1e/0x30
[ 50.023155] ? bochs_unload+0x18/0x40This can be reproduced with QEMU and CONFIG_FB_LITTLE_ENDIAN=n.
--- drivers/gpu/drm/drm_fb_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_fb_helper.c +1 -1
@@ -2877,7 +2877,7 @@ int drm_fb_helper_fbdev_setup(struct drm_device *dev,return 0 ; err_drm_fb_helper_fini: -drm_fb_helper_fini (fb_helper); +drm_fb_helper_fbdev_teardown (dev);return ret; }
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 179/187 clk: meson: clean-up clock registration
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 8d9981efbcab066d17af4d3c85c169200f6f78df ]
Order, ids and size between the table of regmap clocks and the onecell data table could be different.
Set regmap pointer in all the regmap clocks before starting the registration using the onecell data, to make sure we don't get into an incoherent situation.
--- drivers/clk/meson/meson-aoclk.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/clk/meson/meson-aoclk.c +10 -5
@@ -65,15 +65,20 @@ int meson_aoclkc_probe(struct platform_device *pdev)return ret; } -/* -* Populate regmap and register all clks -*/ -for (clkid =0 ; clkid < data->num_clks; clkid++) { +/* Populate regmap */ +for (clkid =0 ; clkid < data->num_clks; clkid++) data->clks[clkid]->map = regmap; +/* Register all clks */ +for (clkid =0 ; clkid < data->hw_data->num; clkid++) { +if (!data->hw_data->hws[clkid]) +continue ; + ret =devm_clk_hw_register (dev, data->hw_data->hws[clkid]); -if (ret) +if (ret) { +dev_err (dev,"Clock registration failed\n" );return ret; + } } return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 180/187 clk: rockchip: fix frac settings of GPLL clock for rk3328
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit a0e447b0c50240a90ab84b7126b3c06b0bab4adc ]
This patch fixes settings of GPLL frequency in fractional mode for rk3328. In this mode, FOUTVCO is calcurated by following formula:
FOUTVCO = FREF * FBDIV / REFDIV + ((FREF * FRAC / REFDIV) >> 24)
The problem is in FREF * FRAC >> 24 term. This result always lacks one from target value is specified by rate member. For example first itme of rk3328_pll_frac_rate originally has
- rate : 1016064000
- refdiv: 3
- fbdiv : 127
- frac : 134217
- FREF * FBDIV / REFDIV = 1016000000
- (FREF * FRAC / REFDIV) >> 24 = 63999
Thus calculated rate is 1016063999. It seems wrong.
If frac has 134218 (it is increased 1 from original value), second term is 64000. All other items have same situation. So this patch adds 1 to frac member in all items of rk3328_pll_frac_rate.
--- drivers/clk/rockchip/clk-rk3328.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/clk/rockchip/clk-rk3328.c +6 -6
@@ -78,17 +78,17 @@ static struct rockchip_pll_rate_table rk3328_pll_rates[] = {static struct rockchip_pll_rate_table rk3328_pll_frac_rates[] = {/* _mhz, _refdiv, _fbdiv, _postdiv1, _postdiv2, _dsmpd, _frac */ -RK3036_PLL_RATE (1016064000 ,3 ,127 ,1 ,1 ,0 ,134217 ), +RK3036_PLL_RATE (1016064000 ,3 ,127 ,1 ,1 ,0 ,134218 ),/* vco = 1016064000 */ -RK3036_PLL_RATE (983040000 ,24 ,983 ,1 ,1 ,0 ,671088 ), +RK3036_PLL_RATE (983040000 ,24 ,983 ,1 ,1 ,0 ,671089 ),/* vco = 983040000 */ -RK3036_PLL_RATE (491520000 ,24 ,983 ,2 ,1 ,0 ,671088 ), +RK3036_PLL_RATE (491520000 ,24 ,983 ,2 ,1 ,0 ,671089 ),/* vco = 983040000 */ -RK3036_PLL_RATE (61440000 ,6 ,215 ,7 ,2 ,0 ,671088 ), +RK3036_PLL_RATE (61440000 ,6 ,215 ,7 ,2 ,0 ,671089 ),/* vco = 860156000 */ -RK3036_PLL_RATE (56448000 ,12 ,451 ,4 ,4 ,0 ,9797894 ), +RK3036_PLL_RATE (56448000 ,12 ,451 ,4 ,4 ,0 ,9797895 ),/* vco = 903168000 */ -RK3036_PLL_RATE (40960000 ,12 ,409 ,4 ,5 ,0 ,10066329 ), +RK3036_PLL_RATE (40960000 ,12 ,409 ,4 ,5 ,0 ,10066330 ),/* vco = 819200000 */ {/* sentinel */ }, };
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 181/187 dmaengine: tegra: avoid overflow of byte tracking
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit e486df39305864604b7e25f2a95d51039517ac57 ]
The dma_desc->bytes_transferred counter tracks the number of bytes moved by the DMA channel. This is then used to calculate the information passed back in the in the tegra_dma_tx_status callback, which is usually fine.
When the DMA channel is configured as continous, then the bytes_transferred counter will increase over time and eventually overflow to become negative so the residue count will become invalid and the ALSA sound-dma code will report invalid hardware pointer values to the application. This results in some users becoming confused about the playout position and putting audio data in the wrong place.
To fix this issue, always ensure the bytes_transferred field is modulo the size of the request. We only do this for the case of the cyclic transfer done ISR as anyone attempting to move 2GiB of DMA data in one transfer is unlikely.
Note, we don't fix the issue that we should /never/ transfer a negative number of bytes so we could make those fields unsigned.
--- drivers/dma/tegra20-apb-dma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/dma/tegra20-apb-dma.c +4 -1
@@ -636,7 +636,10 @@ static void handle_cont_sngl_cycle_dma_done(struct tegra_dma_channel *tdc, sgreq =list_first_entry (&tdc->pending_sg_req,typeof (*sgreq), node); dma_desc = sgreq->dma_desc; - dma_desc->bytes_transferred += sgreq->req_len; +/* if we dma for long enough the transfer count will wrap */ + dma_desc->bytes_transferred = + (dma_desc->bytes_transferred + sgreq->req_len) % + dma_desc->bytes_requested;/* Callback need to be call */ if (!dma_desc->cb_count)
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 182/187 Input: soc_button_array - fix mapping of the 5th GPIO in a PNP0C40 device
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit e9eb788f9442d1b5d93efdb30c3be071ce8a22b1 ]
The Microsoft documenation for the PNP0C40 device aka the "Windows-compatible button array" describes the 5th GpioInt listed in the resources as: '5. Interrupt corresponding to the "Rotation Lock" button, if supported'.
Notice this describes the 5th entry as a button while we sofar have been mapping it to EV_SW, SW_ROTATE_LOCK. On my Point of View TAB P1006W-232 which actually comes with a rotation-lock button, the button indeed is a button and not a slider/switch. An image search for other Windows tablets has found 2 more models with a rotation-lock button and on both of those it too is a push-button and not a slider/switch.
Further evidence can be found in the HUT extension HUTRR52 from Microsoft which adds rotation lock support to the HUT, which describes 2 different
usages: "0xC9 System Display Rotation Lock Button" and
"0xCA System Display Rotation Lock Slider Switch" note that switch is seen as a separate thing here and the non switch wording is an exact match for the "Windows-compatible button array" spec wording.
TL;DR: our current mapping of the 5th GPIO to SW_ROTATE_LOCK is wrong because the 5th GPIO is for a push-button not a switch.
This commit fixes this by maping the 5th GPIO to KEY_ROTATE_LOCK_TOGGLE.
--- drivers/input/misc/soc_button_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/soc_button_array.c +1 -1
@@ -373,7 +373,7 @@ static struct soc_button_info soc_button_PNP0C40[] = { { "home", 1, EV_KEY, KEY_LEFTMETA, false, true }, { "volume_up", 2, EV_KEY, KEY_VOLUMEUP, true, false }, { "volume_down", 3, EV_KEY, KEY_VOLUMEDOWN, true, false }, - { "rotation_lock", 4, EV_SW, SW_ROTATE_LOCK, false, false }, + { "rotation_lock", 4, EV_KEY, KEY_ROTATE_LOCK_TOGGLE, false, false }, { } };
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 183/187 drm/dp/mst: Configure no_stop_bit correctly for remote i2c xfers
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit c978ae9bde582e82a04c63a4071701691dd8b35c ]
We aren't supposed to force a stop+start between every i2c msg when performing multi message transfers. This should eg. cause the DDC segment address to be reset back to 0 between writing the segment address and reading the actual EDID extension block.
To quote the E-DDC spec:
"... this standard requires that the segment pointer be
reset to 00h when a NO ACK or a STOP condition is received."
Since we're going to touch this might as well consult the I2C_M_STOP flag to determine whether we want to force the stop or not.
Cc: Brian Vincent <[email protected]>
References: https://bugs.freedesktop.org/show_bug.cgi?id=108081
--- drivers/gpu/drm/drm_dp_mst_topology.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_dp_mst_topology.c +1 -0
@@ -3278,6 +3278,7 @@ static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs msg.u.i2c_read.transactions[i].i2c_dev_id = msgs[i].addr; msg.u.i2c_read.transactions[i].num_bytes = msgs[i].len; msg.u.i2c_read.transactions[i].bytes = msgs[i].buf; + msg.u.i2c_read.transactions[i].no_stop_bit = !(msgs[i].flags &I2C_M_STOP ); } msg.u.i2c_read.read_i2c_device_id = msgs[num -1 ].addr; msg.u.i2c_read.num_bytes_read = msgs[num -1 ].len;
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 184/187 net: stmmac: Avoid one more sometimes uninitialized Clang warning
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 1f5d861f7fefa971b2c6e766f77932c86419a319 ]
When building with -Wsometimes-uninitialized, Clang warns:
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:111:2: error: variable 'ns' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:111:2: error: variable 'ns' is used uninitialized whenever '&&' condition is false [-Werror,-Wsometimes-uninitialized]
Clang is concerned with the use of stmmac_do_void_callback (which stmmac_get_systime wraps), as it may fail to initialize these values if the if condition was ever false (meaning the callback doesn't exist). It's not wrong because the callback is what initializes ns. While it's unlikely that the callback is going to disappear at some point and make that condition false, we can easily avoid this warning by zero initializing the variable.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +1 -1
@@ -105,7 +105,7 @@ static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec64 *ts)struct stmmac_priv *priv = container_of(ptp, struct stmmac_priv, ptp_clock_ops);unsigned long flags; -u64 ns; +u64 ns =0 ;spin_lock_irqsave (&priv->ptp_lock, flags);stmmac_get_systime (priv, priv->ptpaddr, &ns);
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 185/187 ACPI / video: Extend chassis-type detection with a "Lunch Box" check
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit d693c008e3ca04db5916ff72e68ce661888a913b ]
Commit 53fa1f6e8a59 ("ACPI / video: Only default only_lcd to true on Win8-ready _desktops_") introduced chassis type detection, limiting the lcd_only check for the backlight to devices where the chassis-type indicates their is no builtin LCD panel.
The purpose of the lcd_only check is to avoid advertising a backlight interface on desktops, since skylake and newer machines seem to always have a backlight interface even if there is no LCD panel. The limiting of this check to desktops only was done to avoid breaking backlight support on some laptops which do not have the lcd flag set.
The Fujitsu ESPRIMO Q910 which is a compact (NUC like) desktop machine has a chassis type of 0x10 aka "Lunch Box". Without the lcd_only check we end up falsely advertising backlight/brightness control on this device. This commit extend the dmi_is_desktop check to return true for type 0x10 to fix this.
--- drivers/acpi/acpi_video.c | 1 + 1 file changed, 1 insertion(+)
drivers/acpi/acpi_video.c +1 -0
@@ -2143,6 +2143,7 @@ static bool dmi_is_desktop(void)case 0x05 :/* Pizza Box */ case 0x06 :/* Mini Tower */ case 0x07 :/* Tower */ +case 0x10 :/* Lunch Box */ case 0x11 :/* Main Server Chassis */ return true; }
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 186/187 bcache: fix potential div-zero error of writeback_rate_p_term_inverse
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 5b5fd3c94eef69dcfaa8648198e54c92e5687d6d ]
Current code already uses d_strtoul_nonzero() to convert input string to an unsigned integer, to make sure writeback_rate_p_term_inverse won't be zero value. But overflow may happen when converting input string to an unsigned integer value by d_strtoul_nonzero(), then dc->writeback_rate_p_term_inverse can still be set to 0 even if the sysfs file input value is not zero, e.g. 4294967296 (a.k.a UINT_MAX+1).
If dc->writeback_rate_p_term_inverse is set to 0, it might cause a dev-zero error in following code from __update_writeback_rate(),
int64_t proportional_scaled = div_s64(error, dc->writeback_rate_p_term_inverse);
This patch replaces d_strtoul_nonzero() by sysfs_strtoul_clamp() and limit the value range in [1, UINT_MAX]. Then the unsigned integer overflow and dev-zero error can be avoided.
--- drivers/md/bcache/sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/bcache/sysfs.c +3 -1
@@ -286,7 +286,9 @@ STORE(__cached_dev)sysfs_strtoul_clamp (writeback_rate_i_term_inverse, dc->writeback_rate_i_term_inverse,1 ,UINT_MAX ); -d_strtoul_nonzero (writeback_rate_p_term_inverse); +sysfs_strtoul_clamp (writeback_rate_p_term_inverse, + dc->writeback_rate_p_term_inverse, +1 ,UINT_MAX );d_strtoul_nonzero (writeback_rate_minimum);sysfs_strtoul_clamp (io_error_limit, dc->error_limit,0 ,INT_MAX );
Signature · 1 line
2.19.1
Greg Kroah-Hartman
maintainerPATCH 187/187 kprobes/x86: Blacklist non-attachable interrupt functions
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit a50480cb6d61d5c5fc13308479407b628b6bc1c5 ]
These interrupt functions are already non-attachable by kprobes. Blacklist them explicitly so that they can show up in /sys/kernel/debug/kprobes/blacklist and tools like BCC can use this additional information.
--- arch/x86/entry/entry_64.S | 4 ++++ 1 file changed, 4 insertions(+)
arch/x86/entry/entry_64.S +4 -0
@@ -627,6 +627,7 @@ ENTRY(interrupt_entry) ret END(interrupt_entry) +_ASM_NOKPROBE(interrupt_entry) /* Interrupt entry/exit. */
@@ -826,6 +827,7 @@ native_irq_return_ldt: jmp native_irq_return_iret #endif END(common_interrupt) +_ASM_NOKPROBE(common_interrupt) /* * APIC interrupts.
@@ -840,6 +842,7 @@ ENTRY(\sym) call \do_sym /* rdi points to pt_regs */ jmp ret_from_intr END(\sym) +_ASM_NOKPROBE(\sym) .endm /* Make sure APIC interrupt handlers end up in the irqentry section: */
@@ -984,6 +987,7 @@ ENTRY(\sym) jmp error_exit .endif +_ASM_NOKPROBE(\sym) END(\sym) .endm
Signature · 1 line
2.19.1
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.34 release. There are 187 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 Sat Apr 6 08:44:30 UTC 2019. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.34-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
Summary
------------------------------------------------------------------------
kernel: 4.19.34-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.19.y
git commit: 4b338ef616b3d99a0c49c952acec89b827db9c1b
git describe: v4.19.33-187-g4b338ef616b3
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.19-oe/build/v4.19.33-187-g4b338ef616b3
No regressions (compared to build v4.19.32-323-g8822c8438169)
No fixes (compared to build v4.19.32-323-g8822c8438169)
Ran 23543 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c - arm64
- hi6220-hikey - arm64
- i386
- juno-r2 - arm64
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15 - arm
- x86_64
Test Suites
-----------
* boot
* install-android-platform-tools-r2600
* kselftest
* libhugetlbfs
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-cpuhotplug-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-timers-tests
* perf
* spectre-meltdown-checker-test
* v4l2-compliance
* ltp-open-posix-tests
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
stable-rc/linux-4.19.y boot: 120 boots: 13 failed, 90 passed with 16 offline, 1 untried/unknown (v4.19.33-187-g4b338ef616b3)
stable-rc/linux-4.19.y boot: 120 boots: 13 failed, 90 passed with 16 offline, 1 untried/unknown (v4.19.33-187-g4b338ef616b3)
Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/branch/linux-4.19.y/kernel/v4.19.33-187-g4b338ef616b3/
Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-4.19.y/kernel/v4.19.33-187-g4b338ef616b3/
Tree: stable-rc
Branch: linux-4.19.y
Git Describe: v4.19.33-187-g4b338ef616b3
Git Commit: 4b338ef616b3d99a0c49c952acec89b827db9c1b
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Tested: 66 unique boards, 23 SoC families, 14 builds out of 206
Boot Regressions Detected:
arm64:
defconfig:
gcc-7:
meson-gxbb-nanopi-k2:
lab-baylibre: failing since 1 day (last pass: v4.19.32-135-g01a3983fac4e - first fail: v4.19.32-323-g8822c8438169)
meson-gxbb-odroidc2:
lab-baylibre-seattle: failing since 1 day (last pass: v4.19.32-135-g01a3983fac4e - first fail: v4.19.32-323-g8822c8438169)
meson-gxbb-p200:
lab-baylibre-seattle: failing since 1 day (last pass: v4.19.32-135-g01a3983fac4e - first fail: v4.19.32-323-g8822c8438169)
meson-gxl-s805x-p241:
lab-baylibre: failing since 3 days (last pass: v4.19.32-135-g64b7b716f98c - first fail: v4.19.32-135-gd6e41cce5aee)
meson-gxl-s905d-p230:
lab-baylibre-seattle: failing since 1 day (last pass: v4.19.32-135-g01a3983fac4e - first fail: v4.19.32-323-g8822c8438169)
meson-gxl-s905x-khadas-vim:
lab-baylibre-seattle: failing since 1 day (last pass: v4.19.32-135-g01a3983fac4e - first fail: v4.19.32-323-g8822c8438169)
meson-gxl-s905x-libretech-cc:
lab-baylibre: failing since 1 day (last pass: v4.19.32-135-g01a3983fac4e - first fail: v4.19.32-323-g8822c8438169)
lab-baylibre-seattle: failing since 1 day (last pass: v4.19.32-135-g01a3983fac4e - first fail: v4.19.32-323-g8822c8438169)
meson-gxl-s905x-nexbox-a95x:
lab-baylibre-seattle: failing since 1 day (last pass: v4.19.32-135-g01a3983fac4e - first fail: v4.19.32-323-g8822c8438169)
meson-gxl-s905x-p212:
lab-baylibre-seattle: failing since 1 day (last pass: v4.19.32-135-g01a3983fac4e - first fail: v4.19.32-323-g8822c8438169)
meson-gxm-nexbox-a1:
lab-baylibre-seattle: failing since 1 day (last pass: v4.19.32-135-g01a3983fac4e - first fail: v4.19.32-323-g8822c8438169)Boot Failures Detected:
arm64:
defconfig:
gcc-7:
meson-gxbb-nanopi-k2: 1 failed lab
meson-gxbb-odroidc2: 1 failed lab
meson-gxbb-p200: 1 failed lab
meson-gxl-s805x-p241: 1 failed lab
meson-gxl-s905d-p230: 1 failed lab meson-gxl-s905x-khadas-vim: 1 failed lab meson-gxl-s905x-libretech-cc: 1 failed lab meson-gxl-s905x-nexbox-a95x: 1 failed lab
meson-gxl-s905x-p212: 1 failed lab
meson-gxm-nexbox-a1: 1 failed lab
Offline Platforms:
arm:
bcm2835_defconfig:
gcc-7
bcm2835-rpi-b: 1 offline lab
multi_v7_defconfig:
gcc-7
alpine-db: 1 offline lab
at91-sama5d4_xplained: 1 offline lab
qcom-apq8064-cm-qs600: 1 offline lab
qcom-apq8064-ifc6410: 1 offline lab
socfpga_cyclone5_de0_sockit: 1 offline lab
sun5i-r8-chip: 1 offline lab
tegra124-jetson-tk1: 1 offline lab
tegra_defconfig:
gcc-7
tegra124-jetson-tk1: 1 offline lab
sunxi_defconfig:
gcc-7
sun5i-r8-chip: 1 offline lab
sama5_defconfig:
gcc-7
at91-sama5d4_xplained: 1 offline lab
qcom_defconfig:
gcc-7
qcom-apq8064-cm-qs600: 1 offline lab
qcom-apq8064-ifc6410: 1 offline labarm64:
defconfig:
gcc-7
apq8016-sbc: 1 offline lab
juno-r2: 1 offline lab
mt7622-rfb1: 1 offline lab---
For more info write to <[email protected]>
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.34 release. There are 187 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 Sat Apr 6 08:44:30 UTC 2019. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.34-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.34 release. There are 187 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 Sat Apr 6 08:44:30 UTC 2019. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.34-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
All tests are passing for Tegra ...
Test results for stable-v4.19:
11 builds: 11 pass, 0 fail
22 boots: 22 pass, 0 fail
30 tests: 30 pass, 0 failLinux version: 4.19.34-rc1-g8822c84
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra30-cardhu-a04Cheers
Jon
Signature · 1 line
nvpublic
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.34 release. There are 187 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 Sat Apr 6 08:44:30 UTC 2019. Anything received after that time might be too late.
For v4.19.33-187-g4b338ef616b3:
Build results:
total: 156 pass: 156 fail: 0 Qemu test results: total: 345 pass: 345 fail: 0
Guenter