Commit Graph

16402 Commits

Author SHA1 Message Date
Huang, Tao
1ca180425c Merge tag 'lsk-v3.10-android-15.02'
LSK Android 15.02 v3.10

Conflicts:
	drivers/Kconfig
	drivers/regulator/core.c
	include/linux/of.h
2015-03-05 17:11:40 +08:00
Mark Brown
def31719e1 Merge remote-tracking branch 'lsk/v3.10/topic/aosp' into linux-linaro-lsk-android
Conflicts:
	drivers/Kconfig
	drivers/Makefile
	fs/pstore/inode.c
	fs/pstore/ram.c
2015-02-20 14:29:33 +09:00
Amit Pundir
ecfe0b5f15 Merge branch 'android-3.10' of https://android.googlesource.com/kernel/common into linaro-android-3.10-lsk
* android-3.10: (60 commits)
  kbuild: make it possible to specify the module output dir
  xt_qtaguid: Use sk_callback_lock read locks before reading sk->sk_socket
  ipv6: clean up anycast when an interface is destroyed
  usb: gadget: check for accessory device before disconnecting HIDs
  staging: android: ashmem: add missing include
  usb: gadget: android: Save/restore ep0 completion function
  selinux: Remove obsolete selinux_audit_data initialization.
  selinux: make the netif cache namespace aware
  selinux: correctly label /proc inodes in use before the policy is loaded
  selinux: fix inode security list corruption
  selinux: put the mmap() DAC controls before the MAC controls
  selinux: reduce the number of calls to synchronize_net() when flushing caches
  [PATCH 5/5] pstore: selinux: add security in-core xattr support for pstore and debugfs
  SELinux: Update policy version to support constraints info
  [PATCH v4 4/5] pstore: add pmsg
  [PATCH 3/5] pstore: handle zero-sized prz in series
  [PATCH v2 2/5] pstore: remove superfluous memory size check
  [PATCH v4 1/5] pstore: use snprintf
  pstore: clarify clearing of _read_cnt in ramoops_context
  prctl: make PR_SET_TIMERSLACK_PID pid namespace aware
  ...

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

Conflicts:
	drivers/staging/android/Kconfig
2015-02-12 16:39:41 +08:00
Huang, Tao
089c13477b Merge tag 'lsk-v3.10-android-15.01'
LSK Android 15.01 v3.10

Conflicts:
	arch/arm/Kconfig.debug
	arch/arm64/mm/init.c
	drivers/Makefile
	drivers/cpufreq/cpufreq_interactive.c
2015-02-10 16:24:25 +08:00
Mark Brown
e3b5dc5d8b Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
Conflicts:
	arch/arm/mm/mmu.c
2015-02-09 14:13:09 +08:00
Mark Brown
ceafc84623 Merge tag 'v3.10.68' into linux-linaro-lsk
This is the 3.10.68 stable release
2015-02-09 14:11:45 +08:00
Tejun Heo
85be16bad7 workqueue: fix subtle pool management issue which can stall whole worker_pool
commit 29187a9eea upstream.

A worker_pool's forward progress is guaranteed by the fact that the
last idle worker assumes the manager role to create more workers and
summon the rescuers if creating workers doesn't succeed in timely
manner before proceeding to execute work items.

This manager role is implemented in manage_workers(), which indicates
whether the worker may proceed to work item execution with its return
value.  This is necessary because multiple workers may contend for the
manager role, and, if there already is a manager, others should
proceed to work item execution.

Unfortunately, the function also indicates that the worker may proceed
to work item execution if need_to_create_worker() is false at the head
of the function.  need_to_create_worker() tests the following
conditions.

	pending work items && !nr_running && !nr_idle

The first and third conditions are protected by pool->lock and thus
won't change while holding pool->lock; however, nr_running can change
asynchronously as other workers block and resume and while it's likely
to be zero, as someone woke this worker up in the first place, some
other workers could have become runnable inbetween making it non-zero.

If this happens, manage_worker() could return false even with zero
nr_idle making the worker, the last idle one, proceed to execute work
items.  If then all workers of the pool end up blocking on a resource
which can only be released by a work item which is pending on that
pool, the whole pool can deadlock as there's no one to create more
workers or summon the rescuers.

This patch fixes the problem by removing the early exit condition from
maybe_create_worker() and making manage_workers() return false iff
there's already another manager, which ensures that the last worker
doesn't start executing work items.

We can leave the early exit condition alone and just ignore the return
value but the only reason it was put there is because the
manage_workers() used to perform both creations and destructions of
workers and thus the function may be invoked while the pool is trying
to reduce the number of workers.  Now that manage_workers() is called
only when more workers are needed, the only case this early exit
condition is triggered is rare race conditions rendering it pointless.

Tested with simulated workload and modified workqueue code which
trigger the pool deadlock reliably without this patch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Eric Sandeen <sandeen@sandeen.net>
Link: http://lkml.kernel.org/g/54B019F4.8030009@sandeen.net
Cc: Dave Chinner <david@fromorbit.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-05 22:35:40 -08:00
Mark Brown
43b74bf7c6 Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2015-02-02 11:29:26 +00:00
Mark Brown
692d96aa22 Merge tag 'v3.10.67' into linux-linaro-lsk
This is the 3.10.67 stable release
2015-02-02 11:29:07 +00:00
Sasha Levin
2497402c9a time: adjtimex: Validate the ADJ_FREQUENCY values
commit 5e5aeb4367 upstream.

Verify that the frequency value from userspace is valid and makes sense.

Unverified values can cause overflows later on.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[jstultz: Fix up bug for negative values and drop redunent cap check]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-29 17:40:56 -08:00
Sasha Levin
7336dcc213 time: settimeofday: Validate the values of tv from user
commit 6ada1fc0e1 upstream.

An unvalidated user input is multiplied by a constant, which can result in
an undefined behaviour for large values. While this is validated later,
we should avoid triggering undefined behaviour.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[jstultz: include trivial milisecond->microsecond correction noticed
by Andy]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-29 17:40:56 -08:00
Mark Brown
17d1e25c88 Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2015-01-22 11:00:04 +00:00
Mark Brown
709d228228 Merge remote-tracking branch 'lsk/v3.10/topic/hrtimer' into linux-linaro-lsk
Conflicts:
	kernel/time/clockevents.c
	kernel/time/tick-broadcast.c
	kernel/time/tick-common.c
	kernel/time/tick-internal.h
2015-01-21 22:27:49 +00:00
Preeti U Murthy
eab6f41c54 tick: Fixup more fallout from hrtimer broadcast mode
The hrtimer mode of broadcast is supported only when
GENERIC_CLOCKEVENTS_BROADCAST and TICK_ONESHOT config options
are enabled. Hence compile in the functions for hrtimer mode
of broadcast only when these options are selected.
Also fix max_delta_ticks value for the pseudo clock device.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/52F719EE.9010304@linux.vnet.ibm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit 849401b66d)
Signed-off-by: Mark Brown <broonie@kernel.org>

Conflicts:
	kernel/time/Makefile
2015-01-21 22:08:58 +00:00
Thomas Gleixner
a8db4f03c3 time: Fixup fallout from recent clockevent/tick changes
Make the stub function static inline instead of static and move the
clockevents related function into the proper ifdeffed section.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Soren Brinkmann <soren.brinkmann@xilinx.com>
Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
(cherry picked from commit f1689bb7ab)
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-21 22:08:21 +00:00
Preeti U Murthy
fe20b8ebfd tick: Introduce hrtimer based broadcast
On some architectures, in certain CPU deep idle states the local timers stop.
An external clock device is used to wakeup these CPUs. The kernel support for the
wakeup of these CPUs is provided by the tick broadcast framework by using the
external clock device as the wakeup source.

However not all implementations of architectures provide such an external
clock device. This patch includes support in the broadcast framework to handle
the wakeup of the CPUs in deep idle states on such systems by queuing a hrtimer
on one of the CPUs, which is meant to handle the wakeup of CPUs in deep idle states.

This patchset introduces a pseudo clock device which can be registered by the
archs as tick_broadcast_device in the absence of a real external clock
device. Once registered, the broadcast framework will work as is for these
architectures as long as the archs take care of the BROADCAST_ENTER
notification failing for one of the CPUs. This CPU is made the stand by CPU to
handle wakeup of the CPUs in deep idle and it *must not enter deep idle states*.

The CPU with the earliest wakeup is chosen to be this CPU. Hence this way the
stand by CPU dynamically moves around and so does the hrtimer which is queued
to trigger at the next earliest wakeup time. This is consistent with the case where
an external clock device is present. The smp affinity of this clock device is
set to the CPU with the earliest wakeup. This patchset handles the hotplug of
the stand by CPU as well by moving the hrtimer on to the CPU handling the CPU_DEAD
notification.

Originally-from: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: deepthi@linux.vnet.ibm.com
Cc: paulmck@linux.vnet.ibm.com
Cc: fweisbec@gmail.com
Cc: paulus@samba.org
Cc: srivatsa.bhat@linux.vnet.ibm.com
Cc: svaidy@linux.vnet.ibm.com
Cc: peterz@infradead.org
Cc: benh@kernel.crashing.org
Cc: rafael.j.wysocki@intel.com
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/20140207080632.17187.80532.stgit@preeti.in.ibm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit 5d1638acb9)
Signed-off-by: Mark Brown <broonie@kernel.org>

Conflicts:
	kernel/time/Makefile
2015-01-21 22:08:01 +00:00
Preeti U Murthy
05c2671739 time: Change the return type of clockevents_notify() to integer
The broadcast framework can potentially be made use of by archs which do not have an
external clock device as well. Then, it is required that one of the CPUs need
to handle the broadcasting of wakeup IPIs to the CPUs in deep idle. As a
result its local timers should remain functional all the time. For such
a CPU, the BROADCAST_ENTER notification has to fail indicating that its clock
device cannot be shutdown. To make way for this support, change the return
type of tick_broadcast_oneshot_control() and hence clockevents_notify() to
indicate such scenarios.

Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: deepthi@linux.vnet.ibm.com
Cc: paulmck@linux.vnet.ibm.com
Cc: fweisbec@gmail.com
Cc: paulus@samba.org
Cc: srivatsa.bhat@linux.vnet.ibm.com
Cc: svaidy@linux.vnet.ibm.com
Cc: peterz@infradead.org
Cc: benh@kernel.crashing.org
Cc: rafael.j.wysocki@intel.com
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/20140207080606.17187.78306.stgit@preeti.in.ibm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit da7e6f45c3)
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-21 21:57:00 +00:00
Thomas Gleixner
32f45d57f4 clockevents: Move the tick_notify() switch case to clockevents_notify()
No need to call another function and have duplicated cases.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Link: http://lkml.kernel.org/r/20130425143436.235746557@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit 8c53daf63f)
Signed-off-by: Mark Brown <broonie@kernel.org>

Conflicts:
	kernel/time/tick-common.c
2015-01-21 21:54:18 +00:00
Thomas Gleixner
6ad33af5f2 clockevents: Get rid of the notifier chain
7+ years and still a single user. Kill it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Link: http://lkml.kernel.org/r/20130425143436.098520211@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit 7172a286ce)
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-21 21:50:31 +00:00
Mark Brown
69487098cc Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android 2015-01-16 22:07:03 +00:00
Mark Brown
c293f79246 Merge tag 'v3.10.65' into linux-linaro-lsk
This is the 3.10.65 stable release
2015-01-16 22:06:35 +00:00
Jiri Olsa
d525563b50 perf: Fix events installation during moving group
commit 9fc81d8742 upstream.

We allow PMU driver to change the cpu on which the event
should be installed to. This happened in patch:

  e2d37cd213 ("perf: Allow the PMU driver to choose the CPU on which to install events")

This patch also forces all the group members to follow
the currently opened events cpu if the group happened
to be moved.

This and the change of event->cpu in perf_install_in_context()
function introduced in:

  0cda4c0231 ("perf: Introduce perf_pmu_migrate_context()")

forces group members to change their event->cpu,
if the currently-opened-event's PMU changed the cpu
and there is a group move.

Above behaviour causes problem for breakpoint events,
which uses event->cpu to touch cpu specific data for
breakpoints accounting. By changing event->cpu, some
breakpoints slots were wrongly accounted for given
cpu.

Vinces's perf fuzzer hit this issue and caused following
WARN on my setup:

   WARNING: CPU: 0 PID: 20214 at arch/x86/kernel/hw_breakpoint.c:119 arch_install_hw_breakpoint+0x142/0x150()
   Can't find any breakpoint slot
   [...]

This patch changes the group moving code to keep the event's
original cpu.

Reported-by: Vince Weaver <vince@deater.net>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vince@deater.net>
Cc: Yan, Zheng <zheng.z.yan@intel.com>
Link: http://lkml.kernel.org/r/1418243031-20367-3-git-send-email-jolsa@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-16 06:59:03 -08:00
Micha Kalfon
2e09fe094a prctl: make PR_SET_TIMERSLACK_PID pid namespace aware
Make PR_SET_TIMERSLACK_PID consider pid namespace and resolve the
target pid in the caller's namespace. Otherwise, calls from pid
namespace other than init would fail or affect the wrong task.

Change-Id: I1da15196abc4096536713ce03714e99d2e63820a
Signed-off-by: Micha Kalfon <micha@cellrox.com>
Acked-by: Oren Laadan <orenl@cellrox.com>
2015-01-13 23:35:55 +00:00
Micha Kalfon
e1a60cbe03 prctl: fix misplaced PR_SET_TIMERSLACK_PID case
The case clause for the PR_SET_TIMERSLACK_PID option was placed inside
the an internal switch statement for PR_MCE_KILL (see commits 37a591d4
and 8ae872f1) . This commit moves it to the right place.

Change-Id: I63251669d7e2f2aa843d1b0900e7df61518c3dea
Signed-off-by: Micha Kalfon <micha@cellrox.com>
Acked-by: Oren Laadan <orenl@cellrox.com>
2015-01-13 23:35:16 +00:00
Dmitry Shmidt
c0d201a31f irq: pm: Remove unused variable
Change-Id: Ie4311b554628af878cd80fd0abc03b2be294f0bf
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2015-01-13 13:52:49 -08:00