OSDN Git Service
Demon Singur [Mon, 9 Apr 2018 04:26:02 +0000 (04:26 +0000)]
synaptics_dsx_force: do not spam dmesg for button presses
Change-Id: Ia10ab0db050cf1d1fd4fc73e99a1c46b923281fa
Demon Singur [Sat, 31 Mar 2018 10:56:42 +0000 (10:56 +0000)]
synaptics_dsx_force: guard test reporting
Change-Id: I4cae16efcae5d1fa7aa1b1a6f7851e4fe9200edd
Demon000 [Sun, 12 Feb 2017 21:23:11 +0000 (23:23 +0200)]
synaptics_dsx_force: symlink input device to /proc/touchpanel
Change-Id: I5bf1291aa22b889522585a3faeab5f96ff6612e2
Louis Popi [Wed, 29 Nov 2017 21:16:12 +0000 (23:16 +0200)]
synaptics_dsx_force: allow reversing back and menu keys
Change-Id: I8b6c6afd85e82dd1e05d95702e7071d3eedbbb9a
Demon000 [Sun, 9 Apr 2017 15:14:25 +0000 (18:14 +0300)]
synaptics_dsx_force: check if buttons are enabled before reporting touch event
Change-Id: I5483fc47dc76bb8f00b921261fcc48fa923e860d
Demon000 [Thu, 16 Nov 2017 19:37:33 +0000 (21:37 +0200)]
synpatics_dsx_force: alias sysfs nodes
Change-Id: I79cd5267da895e2f8535e73fd13bf7691897eb74
Demon000 [Fri, 10 Nov 2017 17:26:10 +0000 (19:26 +0200)]
touchscreen: import synaptics_dsx_force driver
Change-Id: Ib7bc0dd2cda6e68ce6739153406afe6081ca0476
Demon000 [Sun, 12 Nov 2017 17:02:23 +0000 (19:02 +0200)]
clk: mdss: silence slave PLL unavailable message
Change-Id: Ife6dc30ef6e498915af38661c4c8450363cf7a04
Demon000 [Sun, 12 Nov 2017 09:22:07 +0000 (11:22 +0200)]
mdss: add hooks for touchscreen
Change-Id: I9b840a18e2443975bf90c0332cfc2fec5e022fbc
Demon Singur [Sat, 28 Apr 2018 07:15:53 +0000 (07:15 +0000)]
qpnp-wled: disable ovp irq after handling
From Xiaomi kernel.
Change-Id: I82a972b39e13a10f32159f592ce7e9872da6c269
Demon000 [Fri, 10 Nov 2017 18:18:07 +0000 (20:18 +0200)]
qpnp-wled: add 600kHz freq
Change-Id: I35be564e7e2b84dd01bafe74355672ebb47024a6
Demon000 [Sat, 11 Nov 2017 20:26:46 +0000 (22:26 +0200)]
rc: import peelir driver
Change-Id: I658e2787245d8588502a4464b6cb2ee44170c83e
Demon000 [Sun, 12 Nov 2017 09:54:42 +0000 (11:54 +0200)]
arm64: add functions to get the hw version
Change-Id: I71142017007b10c3e0c67832a4d4736f4caf3b2f
Demon Singur [Fri, 22 Jun 2018 16:52:49 +0000 (16:52 +0000)]
dts: xiaomi: msm8998: mount cust partition as /vendor
Change-Id: Ib18364354e7d6ac58c4d89e81cdf6859a31e68b5
Demon Singur [Fri, 1 Jun 2018 07:41:29 +0000 (07:41 +0000)]
dts: xiaomi: msm8998: enable soc linearization
Change-Id: I11e338d903af802e7dc14979d24c896a9afd90a5
Demon Singur [Sat, 28 Apr 2018 07:04:57 +0000 (07:04 +0000)]
dts: xiaomi: msm8998: disable wled auto calibration
Xiaomi reverted the auto calibration support in their kernel, but we can
disable it in a more elegant way.
Change-Id: I6addcb637ff44e4841dffa1520d0a7202ddd3b14
Demon Singur [Mon, 18 Jun 2018 18:06:40 +0000 (18:06 +0000)]
dts: xiaomi: msm8998: limit led current
Xiaomi limits this current in userspace by setting the max_brightness
to 64 out of 256. This means that the default current is reduced 4
times.
Do this kernel-side because we're smarter.
Change-Id: I2facc5da9e2e6aad4c00e8732ce07e1fc550ed88
Demon000 [Thu, 16 Nov 2017 19:21:20 +0000 (21:21 +0200)]
dts: xiaomi: msm8998: rewrite notification led configuration
Taken from sambar.
* smooth out duty percents
* increase low and high duration
* lower ramp step duration
* allow reverse, high, and low configuration
Change-Id: I9727a923351a3e3403ecfbafb993121bb74112ad
Demon000 [Sun, 19 Nov 2017 20:43:36 +0000 (22:43 +0200)]
dts: xiaomi: msm8998: add ramoops memory regions
Change-Id: I6c7f2e1545251857d83ccd7783f647dee2412c97
Demon [Tue, 28 Nov 2017 06:46:47 +0000 (06:46 +0000)]
dts: xiaomi: msm8998: cleanup panel properties
Change-Id: I3b11f67e7ff195a70984ffb160b9b3305f36ef72
Vol Zhdanov [Wed, 26 Sep 2018 16:48:46 +0000 (16:48 +0000)]
dts: xiaomi: msm8998: update chiron batterydata
* extracted from MIMIX2Global_V10.0.2.0 DTS
* fixes bug with battery drops on firmware > 8.4.19
Change-Id: If2526d8a43dd19a90efe88bf94f4e0c70b40de6b
Demon000 [Sat, 11 Nov 2017 19:52:30 +0000 (21:52 +0200)]
dts: qcom: add xiaomi msm8998 support
Change-Id: I6466699830f0ff060c65ad4c9fa7683bcaa20cae
Demon000 [Sat, 11 Nov 2017 16:43:15 +0000 (18:43 +0200)]
platform: add xiaomi board selection
Change-Id: Ied4baa79fe62cb1ee5c671de8ca69402050e884c
Ethan Chen [Thu, 29 Nov 2018 07:04:39 +0000 (23:04 -0800)]
Revert "Android.bp: Initial header export bp for Android (qseecom only)"
This reverts commit
1a0aae2861c1836573eeb937a6450d0a8e065058.
Change-Id: I7788582bdc3576d25c64e5c9ab3d7a51340a1eba
Mohammed Javid [Fri, 7 Sep 2018 11:56:21 +0000 (17:26 +0530)]
msm: ipa3: Return if RT table size is 0
If RT table size is zero, retrun to prevent
further process.
Change-Id: Ic671b1760969e6a5f5e896f5334289061b02d256
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
Daniel Micay [Tue, 16 May 2017 21:51:48 +0000 (17:51 -0400)]
add toggle for disabling newly added USB devices
Based on the public grsecurity patches.
Change-Id: I2cbea91b351cda7d098f4e1aa73dff1acbd23cce
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Vikram Mulukutla [Fri, 31 Mar 2017 23:29:59 +0000 (16:29 -0700)]
sched: hmp: Reduce number of load reports in a window
There's no use reporting load more than once in a window
via the cpufreq_update_util path (unless there's a migration).
Set the load_reported_window flag in sched_get_cpus_busy
to remove these redundant updates.
Change-Id: If43dd5abc7e0e52a8e0f0df3a20ca99ed92f5361
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Vikram Mulukutla [Mon, 20 Mar 2017 20:41:37 +0000 (13:41 -0700)]
sched: cpufreq: HMP load reporting changes
Since HMP uses WALT, ensure that load is reported just once per window,
with the exception of intercluster migrations. Further, try to report load
whenever WALT stats are updated.
Change-Id: I6539f8c916f6f271cf26f03249de7f953d5b12c2
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Pavankumar Kondeti [Mon, 16 Oct 2017 08:39:29 +0000 (14:09 +0530)]
core_ctl: Consider high irq loaded CPU as busy
Currently a CPU is considered as busy if it's utilization in
the last window exceeds busy threshold. A CPU loaded with
hardirqs/softirqs does not necessarily have high utilization.
Isolating such CPUs may hurt performance as it involves waking
up the CPU frequently from deep c-state. Prevent isolating
high irq loaded CPUs by considering them as busy.
Change-Id: I169b69f6003eb59a126c8a16b67b65be2aa7af40
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Peter Collingbourne [Wed, 7 Nov 2018 00:39:13 +0000 (16:39 -0800)]
FROMLIST: arm64: Build vDSO with -ffixed-x18
The vDSO needs to be build with x18 reserved in order to accommodate
userspace platform ABIs built on top of Linux that use the register
to carry inter-procedural state, as provided for by the AAPCS.
An example of such a platform ABI is the one that will be used by an
upcoming version of Android.
Although this change is currently a no-op due to the fact that the vDSO
is currently implemented in pure assembly on arm64, it is necessary
in order to prepare for another change [1] that will add C code to
the vDSO.
[1] https://patchwork.kernel.org/patch/
10044501/
Change-Id: Icaac4b1c9127d81d754d3b8688274e9afc781760
Signed-off-by: Peter Collingbourne <pcc@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Mark Salyzyn <salyzyn@google.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Mark Salyzyn [Wed, 24 Jan 2018 22:00:19 +0000 (14:00 -0800)]
ANDROID: clock_gettime(CLOCK_BOOTTIME,) slows down >20x
clock_gettime(CLOCK_BOOTTIME,) slows down after significant
accumulation of suspend time creating a large offset between it and
CLOCK_MONOTONIC time. The __iter_div_u64_rem() is only for the usage
of adding a few second+nanosecond times and saving cycles on more
expensive remainder and division operations, but iterates one second
at a time which quickly goes out of scale in CLOCK_BOOTTIME's case
since it was specified as nanoseconds only.
The fix is to split off seconds from the boot time and cap the
nanoseconds so that __iter_div_u64_rem does not iterate.
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug:
72406285
Change-Id: Ia647ef1e76b7ba3b0c003028d4b3b955635adabb
Nathan Chancellor [Tue, 22 May 2018 21:59:35 +0000 (14:59 -0700)]
FROMLIST: arm64: vdso32: Use full path to Clang instead of relying on PATH
Currently, in order to build the compat VDSO with Clang, this format
has to be used:
PATH=${BIN_FOLDER}:${PATH} make CC=clang
Prior to the addition of this file, this format would also be
acceptable:
make CC=${BIN_FOLDER}/clang
This is because the vdso32 Makefile uses cc-name instead of CC. After
this path, CC will still evaluate to clang for the first case as
expected but now the second case will use the specified Clang, rather
than the host's copy, which may not be compatible as shown below.
/usr/bin/as: unrecognized option '-mfloat-abi=soft'
clang-6.0: error: assembler command failed with exit code 1
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
(cherry picked from https://patchwork.kernel.org/patch/
10419665)
Bug:
80184372
Change-Id: If90a5a4edbc2b5883b4c78161081ebeafbebdcde
Mark Salyzyn [Wed, 10 Jan 2018 00:55:17 +0000 (16:55 -0800)]
ANDROID: arm64: vdso32: fix CC=clang build
clang build had wrong --gcc-toolchain for cross compiler.
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug:
63737556
Change-Id: Ib0c3bbb250943a0309da021ba5335a8320b584f4
Mark Salyzyn [Tue, 28 Mar 2017 21:11:02 +0000 (14:11 -0700)]
ANDROID: CROSS_COMPILE_ARM32 must work if CONFIG_COMPAT_VDSO
Prevent surprise loss of vdso32 support.
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug:
63737556
Bug:
20045882
Bug:
19198045
Change-Id: I8b381f7649b95b298ea9e1a99aa3794c7bc08d09
Kevin Brodsky [Fri, 13 May 2016 08:59:28 +0000 (09:59 +0100)]
FROMLIST: BACKPORT: [PATCH 6/6] arm64: Wire up and expose the new compat vDSO
(cherry pick from url https://patchwork.kernel.org/patch/
10060447/)
Expose the new compat vDSO via the COMPAT_VDSO config option.
The option is not enabled in defconfig because we really need a 32-bit
compiler this time, and we rely on the user to provide it themselves
by setting CROSS_COMPILE_ARM32. Therefore enabling the option by
default would make little sense, since the user must explicitly set a
non-standard environment variable anyway.
CONFIG_COMPAT_VDSO is not directly used in the code, because we want
to ignore it (build as if it were not set) if the user didn't set
CROSS_COMPILE_ARM32. If the variable has been set to a valid prefix,
CONFIG_VDSO32 will be set; this is the option that the code and
Makefiles test.
For more flexibility, like CROSS_COMPILE, CROSS_COMPILE_ARM32 can also
be set via CONFIG_CROSS_COMPILE_ARM32 (the environment variable
overrides the config option, as expected).
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Also needs to set CONFIG_ARM_ARCH_TIMER_VCT_ACCESS when CONFIG_VDSO32
is selected.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug:
63737556
Bug:
20045882
Change-Id: Ie8a7d6c2b5ba3edca591a9a953ce99ec792da882
Kevin Brodsky [Thu, 8 Sep 2016 13:25:04 +0000 (14:25 +0100)]
FROMLIST: BACKPORT: [PATCH 5/6] arm64: compat: 32-bit vDSO setup
(cherry pick from url https://patchwork.kernel.org/patch/
10060459/)
If the compat vDSO is enabled, install it in compat processes. In this
case, the compat vDSO replaces the sigreturn page (it provides its own
sigreturn trampolines).
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug:
63737556
Bug:
20045882
Change-Id: Ia6acf4c3ffea636bc750ac00853ea762c182e5b5
Kevin Brodsky [Wed, 11 May 2016 10:42:22 +0000 (11:42 +0100)]
FROMLIST: [PATCH 4/6] arm64: compat: Add a 32-bit vDSO
(cherry pick from url https://patchwork.kernel.org/patch/
10060445/)
Provide the files necessary for building a compat (AArch32) vDSO in
kernel/vdso32.
This is mostly an adaptation of the arm vDSO. The most significant
change in vgettimeofday.c is the use of the arm64 vdso_data struct,
allowing the vDSO data page to be shared between the 32 and 64-bit
vDSOs. Additionally, a different set of barrier macros is used (see
aarch32-barrier.h), as we want to support old 32-bit compilers that
may not support ARMv8 and its new barrier arguments (*ld).
In addition to the time functions, sigreturn trampolines are also
provided, aiming at replacing those in the sigreturn page as the
latter don't provide any unwinding information (and it's easier to
have just one "user code" page). arm-specific unwinding directives are
used, based on glibc's implementation. Symbol offsets are made
available to the kernel using the same method as the 64-bit vDSO.
There is unfortunately an important caveat: we cannot get away with
hand-coding 32-bit instructions like in kernel/kuser32.S, this time we
really need a 32-bit compiler. The compat vDSO Makefile relies on
CROSS_COMPILE_ARM32 to provide a 32-bit compiler, appropriate logic
will be added to the arm64 Makefile later on to ensure that an attempt
to build the compat vDSO is made only if this variable has been set
properly.
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug:
63737556
Bug:
20045882
Change-Id: I3fb9d21b29bd9fec1408f2274d090e6def546b0d
Kevin Brodsky [Tue, 10 May 2016 12:51:54 +0000 (13:51 +0100)]
FROMLIST: [PATCH 3/6] arm64: Refactor vDSO init/setup
(cherry pick from url https://patchwork.kernel.org/patch/
10060439/)
Move the logic for setting up mappings and pages for the vDSO into
static functions. This makes the vDSO setup code more consistent with
the compat side and will allow to reuse it for the future compat vDSO.
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug:
63737556
Bug:
20045882
Change-Id: I13e84479591091669190360f2a7f4d04462e6344
Kevin Brodsky [Thu, 12 May 2016 08:53:26 +0000 (09:53 +0100)]
FROMLIST: [PATCH 2/6] arm64: elf: Set AT_SYSINFO_EHDR in compat processes
(cherry pick from url https://patchwork.kernel.org/patch/
10060431/)
If the compat vDSO is enabled, we need to set AT_SYSINFO_EHDR in the
auxiliary vector of compat processes to the address of the vDSO code
page, so that the dynamic linker can find it (just like the regular vDSO).
Note that we cast context.vdso to Elf64_Off, instead of elf_addr_t,
because elf_addr_t is Elf32_Off in compat_binfmt_elf.c, and casting
context.vdso to u32 would trigger a pointer narrowing warning.
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug:
63737556
Bug:
20045882
Change-Id: I5d0b191d3b2f4c0b2ec31fe9faef0246253635ce
Kevin Brodsky [Thu, 12 May 2016 09:55:47 +0000 (10:55 +0100)]
FROMLIST: [PATCH 1/6] arm64: compat: Use vDSO sigreturn trampolines if available
(cherry pick from url https://patchwork.kernel.org/patch/
10060449/)
If the compat vDSO is enabled, it replaces the sigreturn page.
Therefore, we use the sigreturn trampolines the vDSO provides instead.
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Bug:
63737556
Bug:
20045882
Change-Id: Ic0933741e321e1bf66409b7e190a776f12948024
Mark Salyzyn [Fri, 27 Oct 2017 15:58:18 +0000 (08:58 -0700)]
FROMLIST: lib: vdso: add support for time
(cherry pick from url https://patchwork.kernel.org/patch/
10053549/)
Add time() vdso support to match up with existing support in the x86's
vdso. Currently benefitting arm and arm64 which uses the common
vgettimeofday.c implementation. On arm provides about a ~14 fold
improvement in speed over the straight syscall, and about a ~5 fold
improvement in speed over an alternate library implementation that
relies on the vdso call to gettimeofday to fulfill the request.
We can provide __vdso_time even if we can not provide a speed
enhanced __vdso_gettimeofday.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Bug:
63737556
Bug:
20045882
Change-Id: I0bb3c6bafe57f9ed69350e2dd54edaae58316e8f
Kevin Brodsky [Tue, 10 May 2016 12:32:58 +0000 (13:32 +0100)]
FROMLIST: [PATCH] arm64: compat: Expose offset to registers in sigframes
(cherry picked from url https://patchwork.kernel.org/patch/
10006025/)
This will be needed to provide unwinding information in compat
sigreturn trampolines, part of the future compat vDSO. There is no
obvious header the compat_sig* struct's should be moved to, so let's
put them in signal32.h.
Also fix minor style issues reported by checkpatch.
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Bug:
63737556
Bug:
20045882
Change-Id: I9c23dd6b56ca48c0953cbf78ccb7b49ded906052
Mark Salyzyn [Fri, 27 Oct 2017 15:58:18 +0000 (08:58 -0700)]
FROMLIST: [PATCH v5 12/12] lib: vdso: do not expose gettimeofday, if no arch supported timer
(cherry pick from url https://patchwork.kernel.org/patch/
10044539/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
If ARCH_PROVIDES_TIMER is not defined, do not expose gettimeofday.
libc will default directly to syscall. Also ifdef clock_gettime
switch cases and stubs if not supported and other unused components.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: I362a7114db0aac800e16eb90d14a8739e18f42e4
Mark Salyzyn [Thu, 24 Aug 2017 20:35:24 +0000 (13:35 -0700)]
FROMLIST: [PATCH v5 11/12] lib: vdso: Add support for CLOCK_BOOTTIME
(cherry pick from url https://patchwork.kernel.org/patch/
10044503/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
Add a case for CLOCK_BOOTTIME as it is popular for measuring
relative time on systems expected to suspend() or hibernate().
Android uses CLOCK_BOOTTIME for all relative time measurements
and timeouts. Switching to vdso reduced CPU utilization and improves
accuracy. There is also a desire by some partners to switch all
logging over to CLOCK_BOOTTIME, and thus this operation alone would
contribute to a near percentile CPU load.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: I76c26b054baf7f1100e03c65d6b16fe649b883b1
Mark Salyzyn [Fri, 4 Aug 2017 16:58:40 +0000 (09:58 -0700)]
FROMLIST: [PATCH v5 10/12] arm64: vdso: replace gettimeofday.S with global vgettimeofday.C
(cherry picked from url https://patchwork.kernel.org/patch/
10044501/)
Take an effort from the previous 9 patches to recode the arm64 vdso
code from assembler to C previously submitted by
Andrew Pinski <apinski@cavium.com>, rework it for use in both arm and
arm64, overlapping any optimizations for each architecture. But
instead of landing it in arm64, land the result into lib/vdso and
unify both implementations to simplify future maintenance.
apinski@cavium.com makes the following claims in the original patch:
This allows the compiler to optimize the divide by 1000 and remove
the other divides.
On ThunderX, gettimeofday improves by 32%. On ThunderX 2,
gettimeofday improves by 18%.
Note I noticed a bug in the old (arm64) implementation of
__kernel_clock_getres; it was checking only the lower 32bits of the
pointer; this would work for most cases but could fail in a few.
<end of claim>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: I71ff27ff5bfa323354fda6867b01ec908d8d6cbd
Mark Salyzyn [Thu, 12 Oct 2017 22:13:07 +0000 (15:13 -0700)]
FROMLIST: [PATCH v5 09/12] arm: vdso: move vgettimeofday.c to lib/vdso/
(cherry pick from url https://patchwork.kernel.org/patch/
10044497/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
Declare arch/arm/vdso/vgettimeofday.c to be a candidate for a global
implementation of the vdso timer calls. The hope is that new
architectures can take advantage of the current unification of
arm and arm64 implementations.
We urge future efforts to merge their implementations into the
global vgettimeofday.c file and thus provide functional parity.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: If7da1d8144684d52ed9520a581e6023c623df931
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 08/12] arm: vdso: Add ARCH_CLOCK_FIXED_MASK
(cherry picked from url https://patchwork.kernel.org/patch/
10044543/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
Add ARCH_CLOCK_FIXED_MASK as an efficiency since arm64 has no
purpose for cs_mask vdso_data variable.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20057882
Change-Id: Iadf94bed6166d2ee43bb46bdf54636618e4b8854
Mark Salyzyn [Thu, 12 Oct 2017 22:13:07 +0000 (15:13 -0700)]
FROMLIST: [PATCH v5 07/12] arm: vdso: disable profiling
(cherry pick from url https://patchwork.kernel.org/patch/
10044491/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
Make sure kasan and ubsan profiling, and kcov instrumentation,
is turned off for VDSO code.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: I2b44c1edd81665b8bb235a65ba642767c35f1e61
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 06/12] arm: vdso: add support for clock_getres
(cherry picked from url https://patchwork.kernel.org/patch/
10044545/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
Add clock_getres vdso support to match up with existing support in
the arm64's vdso.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: Ie37bf76d2992027f06a2cdd001d8654a860d2aac
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v6 05/12] arm: vdso: Add support for CLOCK_MONOTONIC_RAW
(cherry pick from url https://patchwork.kernel.org/patch/
10052099/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
Add a case for CLOCK_MONOTONIC_RAW to match up with support that
is available in arm64's vdso.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: If9c09d131e236ba4a483dbc122e6b876f471df72
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 04/12] arm: vdso: do calculations outside reader loops
(cherry picked from url https://patchwork.kernel.org/patch/
10044477/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
In variable timer reading loops, pick up just the values until all
are synchronized, then outside of loop pick up cntvct and perform
calculations to determine final offset, shifted and multiplied
output value.
This replaces get_ns with get_clock_shifted_nsec as cntvct reader.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: I8008197f08485ef89b267128e41624ff69c33f6b
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 03/12] arm: vdso: inline assembler operations to compiler.h
(cherry picked from commit https://patchwork.kernel.org/patch/
10044507/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
Move compiler-specific code to a local compiler.h file:
- CONFIG_AEABI dependency check.
- System call fallback functions standardized into a
DEFINE_FALLBACK macro.
- Replace arch_counter_get_cntvct() with arch_vdso_read_counter.
- Deal with architecture specific unresolved references emitted
by GCC.
- Optimize handling of fallback calls in callers.
- For time functions that always return success, do not waste time
checking return value for switch to fallback.
- Optimize unlikely nullptr checking in __vdso_gettimeofday,
if tv null no need to proceed to fallback, as vdso is still
capable of filling in the tv values.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: I468e4c32b5136d199982bf25df8967321e384d90
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 02/12] arm: vdso: add include file defining __get_datapage()
(cherry picked from url https://patchwork.kernel.org/patch/
10044481/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
Define the prototype for __get_datapage() in local datapage.h header.
Rename all vdata variable that point to the datapage shortened to vd
to relect a consistent and concise style. Make sure that all
references to the datapage in vdso operations are readonly (const).
Make sure datapage is first parameter to all subroutines to also
be consistent.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: I9512b49d36d53ca1b71d3ff82219a7c64e0fc613
Mark Salyzyn [Thu, 17 Aug 2017 16:16:27 +0000 (09:16 -0700)]
FROMLIST: [PATCH v5 01/12] arm: vdso: rename vdso_datapage variables
(cherry picked from url https://patchwork.kernel.org/patch/
10044505/)
Take an effort to recode the arm64 vdso code from assembler to C
previously submitted by Andrew Pinski <apinski@cavium.com>, rework
it for use in both arm and arm64, overlapping any optimizations
for each architecture. But instead of landing it in arm64, land the
result into lib/vdso and unify both implementations to simplify
future maintenance.
Rename seq_count to tb_seq_count. Rename tk_is_cntvct to use_syscall.
Rename cs_mult to cs_mono_mult. All to align with the variables in the
arm64 vdso datapage. Rework vdso_read_begin() and vdso_read_retry()
functions to reflect modern access patterns for tb_seq_count field.
Update copyright message to reflect the start of the contributions in
this series.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Cc: James Morse <james.morse@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Andrew Pinski <apinski@cavium.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Bug:
63737556
Bug:
20045882
Change-Id: I13f16e71b1ecba3d72b999caafef72e3c7f48dfe
Kevin Brodsky [Wed, 23 Nov 2016 15:41:15 +0000 (15:41 +0000)]
FROMLIST: [PATCH v2 3/3] arm64: compat: Add CONFIG_KUSER_HELPERS
(cherry picked from url http://lkml.iu.edu/hypermail/linux/kernel/1709.1/01903.html)
Make it possible to disable the kuser helpers by adding a KUSER_HELPERS
config option (enabled by default). When disabled, all kuser
helpers-related code is removed from the kernel and no mapping is done
at the fixed high address (0xffff0000); any attempt to use a kuser
helper from a 32-bit process will result in a segfault.
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Bug:
9674955
Bug:
63737556
Bug:
20045882
Change-Id: Ie8c543301d39bfe88ef71fb6a669e571914b117b
Kevin Brodsky [Wed, 23 Nov 2016 15:41:15 +0000 (15:41 +0000)]
FROMLIST: [PATCH v2 2/3] arm64: compat: Split the sigreturn trampolines and kuser helpers (assembler sources)
(cherry picked from url http://lkml.iu.edu/hypermail/linux/kernel/1709.1/01902.html)
AArch32 processes are currently installed a special [vectors] page that
contains the sigreturn trampolines and the kuser helpers, at the fixed
address mandated by the kuser helpers ABI.
Having both functionalities in the same page has become problematic,
because:
* It makes it impossible to disable the kuser helpers (the sigreturn
trampolines cannot be removed), which is possible on arm.
* A future 32-bit vDSO would provide the sigreturn trampolines itself,
making those in [vectors] redundant.
This patch addresses the problem by moving the sigreturn trampolines
sources to its own file. Wrapped the comments to reduce the wrath of
checkpatch.pl.
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Bug:
9674955
Bug:
63737556
Bug:
20045882
Change-Id: I1d7b96e7cfbe979ecf4cb4996befd1f3ae0e64fd
Kevin Brodsky [Wed, 23 Nov 2016 14:01:10 +0000 (14:01 +0000)]
FROMLIST: [PATCH v2 1/3] arm64: compat: Split the sigreturn trampolines and kuser helpers (C sources)
(cherry picked from url http://lkml.iu.edu/hypermail/linux/kernel/1709.1/01901.html)
AArch32 processes are currently installed a special [vectors] page that
contains the sigreturn trampolines and the kuser helpers, at the fixed
address mandated by the kuser helpers ABI.
Having both functionalities in the same page has become problematic,
because:
* It makes it impossible to disable the kuser helpers (the sigreturn
trampolines cannot be removed), which is possible on arm.
* A future 32-bit vDSO would provide the sigreturn trampolines itself,
making those in [vectors] redundant.
This patch addresses the problem by moving the sigreturn trampolines to
a separate [sigpage] page, mirroring [sigpage] on arm.
Even though [vectors] has always been a misnomer on arm64/compat, as
there is no AArch32 vector there (and now only the kuser helpers),
its name has been left unchanged, for compatibility with arm (there
are reports of software relying on [vectors] being there as the last
mapping in /proc/maps).
mm->context.vdso used to point to the [vectors] page, which is
unnecessary (as its address is fixed). It now points to the [sigpage]
page (whose address is randomized like a vDSO).
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Bug:
9674955
Bug:
63737556
Bug:
20045882
Change-Id: I52a56ea71d7326df8c784f90eb73b5c324fe9d20
Chris Fries [Tue, 7 Mar 2017 21:37:47 +0000 (15:37 -0600)]
posix_cpu_timer: check return on cpu_timer_sample_group
If error, don't trust "now" time that it should be setting
kernel/time/posix-cpu-timers.c:1269:13: warning: 'now' may be used uninitialized in this function [-Wmaybe-uninitialized]
Change-Id: I679d99c335494bae50fd926663fad37aedb1487a
Signed-off-by: Chris Fries <cfries@google.com>
Michael Bestas [Sun, 22 Jul 2018 19:05:13 +0000 (22:05 +0300)]
power: reset: Move in_panic handling out of dload mode
* Some devices might want to use that logic
without enabling download mode
Change-Id: Idd4a2cc8a47041740f8d4e9f43bffd84fae5830d
Park Ju Hyung [Sun, 23 Dec 2018 21:55:20 +0000 (06:55 +0900)]
msm_thermal: initialize later than arch drivers
If OSM driver is initialized later than msm_thermal, it will fail:
[ 0.226183] cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19)
[ 0.227931] msm_thermal:get_cpu_freq_plan_len Error reading CPU0 freq table len. error:-19
[ 0.227955] cpu cpu4: dev_pm_opp_get_opp_count: OPP table not found (-19)
[ 0.229631] msm_thermal:get_cpu_freq_plan_len Error reading CPU4 freq table len. error:-19
[ 0.229652] cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19)
[ 0.231380] msm_thermal:get_cpu_freq_plan_len Error reading CPU0 freq table len. error:-19
[ 0.231404] cpu cpu4: dev_pm_opp_get_opp_count: OPP table not found (-19)
[ 0.233095] msm_thermal:get_cpu_freq_plan_len Error reading CPU4 freq table len. error:-19
Change-Id: I98be9d37701f1f9366cef1427cfdd9082b8fb24c
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
Wei Wang [Mon, 2 Apr 2018 02:18:25 +0000 (02:18 +0000)]
dts: msm8998: disable hotplug in BCL mitigation
Bug:
63165849
Test: boot
Change-Id: Icc1131578be0a02542376d34e4f5cc7c53156bd9
Signed-off-by: Wei Wang <wvw@google.com>
Signed-off-by: joshuous <joshuous@gmail.com>
Zhao Wei Liew [Thu, 1 Nov 2018 10:05:30 +0000 (10:05 +0000)]
soc: qcom: haptic: Correct return value of show() methods
By convention, these methods should return the number of bytes
actually written into the buffer, not the number of bytes that
would have been written.
Change-Id: Iab8b292397bf3cbbf4a59a72812d3831ac7722c4
Signed-off-by: Zhao Wei Liew <zhaoweiliew@gmail.com>
dianlujitao [Fri, 1 Jul 2016 14:17:42 +0000 (22:17 +0800)]
msm: qpnp-haptic: set up sysfs interface for common cmhw implementation
* Export vmax_mv as vtg_level
* Add min/max/default voltage sysfs entries
* Make min/max voltage adjustable via DT
Change-Id: Iefa3accdb75fcef9bcb2d4c730ca0a72763994f3
Sultanxda [Wed, 3 Aug 2016 06:59:42 +0000 (23:59 -0700)]
msm: qpnp-haptic: Process haptics asynchronously
Blocking the timed_output sysfs node due to mutex contention causes severe
device wake-up latency, as a process crucial to system resume writes to the
timed_output vibrator node every time the device is resumed via the
fingerprint reader (fingerprint reader triggers a haptic response on
success).
By processing haptics asynchronously via a worker, the timed_output sysfs
won't get stalled for long periods of time (>30ms), and thus the device
will consistently wake from sleep faster.
Change-Id: I248ff11b79482cea804252c199b4a8935ad45fc1
Signed-off-by: Sultanxda <sultanxda@gmail.com>
Daniel Vetter [Tue, 18 Jul 2017 08:21:10 +0000 (10:21 +0200)]
net/sch_generic: Shut up noise
We can't allow spam in CI.
Upate 26th June 2018: This is still an issue:
[ 224.739686] ------------[ cut here ]------------
[ 224.739712] WARNING: CPU: 3 PID: 2982 at net/sched/sch_generic.c:461 dev_watchdog+0x1fd/0x210
[ 224.739714] Modules linked in: vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_pcm i915 asix usbnet mii mei_me mei prime_numbers i2c_hid pinctrl_sunrisepoint pinctrl_intel btusb btrtl btbcm btintel bluetooth ecdh_generic
[ 224.739775] CPU: 3 PID: 2982 Comm: gem_exec_suspen Tainted: G U W 4.18.0-rc2-CI-Patchwork_9414+ #1
[ 224.739777] Hardware name: Dell Inc. XPS 13 9350/, BIOS 1.4.12 11/30/2016
[ 224.739780] RIP: 0010:dev_watchdog+0x1fd/0x210
[ 224.739781] Code: 49 63 4c 24 f0 eb 92 4c 89 ef c6 05 21 46 ad 00 01 e8 77 ee fc ff 89 d9 48 89 c2 4c 89 ee 48 c7 c7 88 4c 14 82 e8 a3 fe 84 ff <0f> 0b eb be 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 c7 47
[ 224.739866] RSP: 0018:
ffff88027dd83e40 EFLAGS:
00010286
[ 224.739869] RAX:
0000000000000000 RBX:
0000000000000000 RCX:
0000000000000102
[ 224.739871] RDX:
0000000080000102 RSI:
ffffffff820c8c6c RDI:
00000000ffffffff
[ 224.739873] RBP:
ffff8802644c1540 R08:
0000000071be9b33 R09:
0000000000000000
[ 224.739874] R10:
ffff88027dd83dc0 R11:
0000000000000000 R12:
ffff8802644c1588
[ 224.739876] R13:
ffff8802644c1160 R14:
0000000000000001 R15:
ffff88026a5dc728
[ 224.739878] FS:
00007f18f4887980(0000) GS:
ffff88027dd80000(0000) knlGS:
0000000000000000
[ 224.739880] CS: 0010 DS: 0000 ES: 0000 CR0:
0000000080050033
[ 224.739881] CR2:
00007f4c627ae548 CR3:
000000022ca1a002 CR4:
00000000003606e0
[ 224.739883] DR0:
0000000000000000 DR1:
0000000000000000 DR2:
0000000000000000
[ 224.739885] DR3:
0000000000000000 DR6:
00000000fffe0ff0 DR7:
0000000000000400
[ 224.739886] Call Trace:
[ 224.739888] <IRQ>
[ 224.739892] ? qdisc_reset+0xe0/0xe0
[ 224.739894] ? qdisc_reset+0xe0/0xe0
[ 224.739897] call_timer_fn+0x93/0x360
[ 224.739903] expire_timers+0xc1/0x1d0
[ 224.739908] run_timer_softirq+0xc7/0x170
[ 224.739916] __do_softirq+0xd9/0x505
[ 224.739923] irq_exit+0xa9/0xc0
[ 224.739926] smp_apic_timer_interrupt+0x9c/0x2d0
[ 224.739929] apic_timer_interrupt+0xf/0x20
[ 224.739931] </IRQ>
[ 224.739934] RIP: 0010:delay_tsc+0x2e/0xb0
[ 224.739936] Code: 49 89 fc 55 53 bf 01 00 00 00 e8 6d 2c 78 ff e8 88 9d b6 ff 41 89 c5 0f ae e8 0f 31 48 c1 e2 20 48 09 c2 48 89 d5 eb 16 f3 90 <bf> 01 00 00 00 e8 48 2c 78 ff e8 63 9d b6 ff 44 39 e8 75 36 0f ae
[ 224.740021] RSP: 0018:
ffffc900002f7d48 EFLAGS:
00000286 ORIG_RAX:
ffffffffffffff13
[ 224.740024] RAX:
0000000080000000 RBX:
0000000649565ca9 RCX:
0000000000000001
[ 224.740026] RDX:
0000000080000001 RSI:
ffffffff820c8c6c RDI:
00000000ffffffff
[ 224.740027] RBP:
00000006493ea9ce R08:
000000005e81e2ee R09:
0000000000000000
[ 224.740029] R10:
0000000000000120 R11:
0000000000000000 R12:
00000000002ad8d6
[ 224.740030] R13:
0000000000000003 R14:
0000000000000004 R15:
ffff88025caf5408
[ 224.740040] ? delay_tsc+0x66/0xb0
[ 224.740045] hibernation_debug_sleep+0x1c/0x30
[ 224.740048] hibernation_snapshot+0x2c1/0x690
[ 224.740053] hibernate+0x142/0x2a4
[ 224.740057] state_store+0xd0/0xe0
[ 224.740063] kernfs_fop_write+0x104/0x190
[ 224.740068] __vfs_write+0x31/0x180
[ 224.740072] ? rcu_read_lock_sched_held+0x6f/0x80
[ 224.740075] ? rcu_sync_lockdep_assert+0x29/0x50
[ 224.740078] ? __sb_start_write+0x152/0x1f0
[ 224.740080] ? __sb_start_write+0x168/0x1f0
[ 224.740084] vfs_write+0xbd/0x1a0
[ 224.740088] ksys_write+0x50/0xc0
[ 224.740094] do_syscall_64+0x55/0x190
[ 224.740097] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[ 224.740099] RIP: 0033:0x7f18f400a281
[ 224.740100] Code: c3 0f 1f 84 00 00 00 00 00 48 8b 05 59 8d 20 00 c3 0f 1f 84 00 00 00 00 00 8b 05 8a d1 20 00 85 c0 75 16 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 57 f3 c3 0f 1f 44 00 00 41 54 55 49 89 d4 53
[ 224.740186] RSP: 002b:
00007fffd1f4fec8 EFLAGS:
00000246 ORIG_RAX:
0000000000000001
[ 224.740189] RAX:
ffffffffffffffda RBX:
0000000000000000 RCX:
00007f18f400a281
[ 224.740190] RDX:
0000000000000004 RSI:
00007f18f448069a RDI:
0000000000000006
[ 224.740192] RBP:
00007fffd1f4fef0 R08:
0000000000000000 R09:
0000000000000000
[ 224.740194] R10:
0000000000000000 R11:
0000000000000246 R12:
000055e795d03400
[ 224.740195] R13:
00007fffd1f50500 R14:
0000000000000000 R15:
0000000000000000
[ 224.740205] irq event stamp:
1582591
[ 224.740207] hardirqs last enabled at (
1582590): [<
ffffffff810f9f9c>] vprintk_emit+0x4bc/0x4d0
[ 224.740210] hardirqs last disabled at (
1582591): [<
ffffffff81a0111c>] error_entry+0x7c/0x100
[ 224.740212] softirqs last enabled at (
1582568): [<
ffffffff81c0034f>] __do_softirq+0x34f/0x505
[ 224.740215] softirqs last disabled at (
1582571): [<
ffffffff8108c959>] irq_exit+0xa9/0xc0
[ 224.740218] WARNING: CPU: 3 PID: 2982 at net/sched/sch_generic.c:461 dev_watchdog+0x1fd/0x210
[ 224.740219] ---[ end trace
6e41d690e611c338 ]---
Change-Id: Ie3cc947a719d91ae7c9b7d93513b1728aa603211
References: https://bugzilla.kernel.org/show_bug.cgi?id=196399
Acked-by: Martin Peres <martin.peres@linux.intel.com>
Cc: Martin Peres <martin.peres@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170718082110.12524-1-daniel.vetter@ffwll.ch
Wei Wang [Sun, 10 Sep 2017 21:27:05 +0000 (14:27 -0700)]
do not call trace_printk on non-debug build
trace_printk will cause trace_printk_init_buffers executed in kernel
start. Remove them from non-debug build.
Test: see nasty message gone in dmesg
Bug:
64215528
Change-Id: I82b8435a3cf36123608aae572c843db8ad86ac8a
Signed-off-by: Wei Wang <wvw@google.com>
Thierry Strudel [Tue, 14 Mar 2017 20:00:33 +0000 (13:00 -0700)]
remove calls to trace_printk
Removes boot warning:
trace_printk() being used. Allocating extra memory.
Change-Id: I3347379da302fc273e9b1d2787863cb244837ce8
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Sultanxda [Mon, 1 Jan 2018 05:34:03 +0000 (21:34 -0800)]
devfreq: Don't force compilation of userspace governor
Change-Id: I540ed4fe4bef8f059e577c59a839b27ddee78345
Signed-off-by: Sultanxda <sultanxda@gmail.com>
Jean Delvare [Mon, 11 Jan 2016 16:43:02 +0000 (17:43 +0100)]
cpuidle: Don't enable all governors by default
Since commit
d6f346f2d2 (cpuidle: improve governor Kconfig options)
the best cpuidle governor is selected automatically. There is little
point in additionally selecting the other one as it will not be used,
so don't select both governors by default.
Being able to select more than one governor is still good for
developers booting with cpuidle_sysfs_switch, though.
This fixes the second half of kernel BZ #65531.
Change-Id: I8757624f6bdc2d418b12ffcad294d273b9aca26d
Link: https://bugzilla.kernel.org/show_bug.cgi?id=65531
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Harsh Shandilya <harsh@prjkt.io>
Wei Wang [Wed, 28 Feb 2018 21:34:22 +0000 (13:34 -0800)]
ANDROID: mm: add config for default readahead size
Change the VM_MAX_READAHED value from the default 128KB to a
configurable value. This will allow the readahead window to grow to a
maximum size bigger than 128KB, which greatly benefits to sequential
read throughput and thus boot performance.
Bug:
62413151
Test: boot walleye 100ms faster
Change-Id: Iad448cf1198056de46654dcb409466802b3b908d
Signed-off-by: Wei Wang <wvw@google.com>
Eric Biggers [Wed, 25 Jan 2017 23:17:01 +0000 (15:17 -0800)]
security: pfk: fix build when ecryptfs is disabled
To avoid compile errors and warnings when the pfk module is enabled
without ecryptfs, the ecryptfs stubs need to be static inline.
Bug:
34712722
Change-Id: I39d715fcac1ff2f7781230cc2d1da2a8d803e974
Signed-off-by: Eric Biggers <ebiggers@google.com>
Neeraj Soni [Tue, 6 Feb 2018 16:25:50 +0000 (08:25 -0800)]
scsi: ufs: Increase crypto thread priority
Crypto work is used to program file keys into
the Crypto HW. Some times the thread is scheduled
but is not executed and is preempted oftenly by
block i/o kworker. This causes same requests to be
requeued leading to timeout and cpu overload issues.
Change-Id: Icd9b5108018b85d60d72858c92673e1f2feddbd4
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
Johannes Berg [Thu, 4 Feb 2016 12:31:20 +0000 (13:31 +0100)]
ipv6: add option to drop unsolicited neighbor advertisements
In certain 802.11 wireless deployments, there will be NA proxies
that use knowledge of the network to correctly answer requests.
To prevent unsolicitd advertisements on the shared medium from
being a problem, on such deployments wireless needs to drop them.
Enable this by providing an option called "drop_unsolicited_na".
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit
aec215e7aa380fe5f85eb6948766b58bf78cb6c3)
Change-Id: Iad429a767a786087b0985632be44932b2e3fd1a8
Johannes Berg [Thu, 4 Feb 2016 12:31:18 +0000 (13:31 +0100)]
ipv4: add option to drop gratuitous ARP packets
In certain 802.11 wireless deployments, there will be ARP proxies
that use knowledge of the network to correctly answer requests.
To prevent gratuitous ARP frames on the shared medium from being
a problem, on such deployments wireless needs to drop them.
Enable this by providing an option called "drop_gratuitous_arp".
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit
4078228159c9f54cca7347a8bdace29f2abdef65)
Change-Id: I8772dbd7471085878f8b4161eb2a056d79b8b232
Johannes Berg [Thu, 4 Feb 2016 12:31:19 +0000 (13:31 +0100)]
ipv6: add option to drop unicast encapsulated in L2 multicast
In order to solve a problem with 802.11, the so-called hole-196 attack,
add an option (sysctl) called "drop_unicast_in_l2_multicast" which, if
enabled, causes the stack to drop IPv6 unicast packets encapsulated in
link-layer multi- or broadcast frames. Such frames can (as an attack)
be created by any member of the same wireless network and transmitted
as valid encrypted frames since the symmetric key for broadcast frames
is shared between all stations.
Reviewed-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit
dede82143bf1bbf92ea73a519bb0298b19c56cb9)
Change-Id: I76c8f84b53e95c40ad3c2b5adac0ec4964cc920c
Johannes Berg [Thu, 4 Feb 2016 12:31:17 +0000 (13:31 +0100)]
ipv4: add option to drop unicast encapsulated in L2 multicast
In order to solve a problem with 802.11, the so-called hole-196 attack,
add an option (sysctl) called "drop_unicast_in_l2_multicast" which, if
enabled, causes the stack to drop IPv4 unicast packets encapsulated in
link-layer multi- or broadcast frames. Such frames can (as an attack)
be created by any member of the same wireless network and transmitted
as valid encrypted frames since the symmetric key for broadcast frames
is shared between all stations.
Additionally, enabling this option provides compliance with a SHOULD
clause of RFC 1122.
Change-Id: I8de9fa5bdbea0556802f2ee553d0e73c1349213e
Reviewed-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Andrea Arcangeli [Tue, 25 Jul 2017 20:22:45 +0000 (22:22 +0200)]
fs/exec: fix use after free in execve
"file" can be already freed if bprm->file is NULL after
exec_binprm() return. binfmt_script will do exactly that for
example. If the VM reuses the file after fput run(), this will result in
a use ater free.
So obtain d_is_su before exec_binprm() runs.
This should explain this crash:
[25333.009554] Unable to handle kernel NULL pointer dereference at virtual address
00000185
[..]
[25333.009918] [2: am:21861] PC is at do_execve+0x354/0x474
Change-Id: I2a8a814d1c0aa75625be83cb30432cf13f1a0681
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
Tom Marshall [Thu, 18 May 2017 23:50:22 +0000 (23:50 +0000)]
kernel: Fix potential refcount leak in su check
Change-Id: I8d2c8bed65a01eb0928308df638a04449a5bd881
Tom Marshall [Wed, 25 Jan 2017 17:01:03 +0000 (18:01 +0100)]
kernel: Only expose su when daemon is running
It has been claimed that the PG implementation of 'su' has security
vulnerabilities even when disabled. Unfortunately, the people that
find these vulnerabilities often like to keep them private so they
can profit from exploits while leaving users exposed to malicious
hackers.
In order to reduce the attack surface for vulnerabilites, it is
therefore necessary to make 'su' completely inaccessible when it
is not in use (except by the root and system users).
Change-Id: I79716c72f74d0b7af34ec3a8054896c6559a181d
Jerry Zhang [Fri, 23 Mar 2018 23:23:34 +0000 (16:23 -0700)]
Revert "f_fs: set maxburst to one before enabling endpoints"
This reverts commit
e3c2d0c27e3bd3df4b66bba9e9b47c7e0a442eb8.
This was severely slowing down usb transfer speeds.
Bug:
76154677
Test: mtp and adb speeds return to normal
Change-Id: I70e7a45b3d71a66a4191637891d145a86495aab6
Signed-off-by: Jerry Zhang <zhangjerry@google.com>
Jerry Zhang [Thu, 22 Feb 2018 19:25:05 +0000 (11:25 -0800)]
ANDROID: usb: gadget: f_accessory: Also zero out rx_req on unbind
Prevents crash in the following sequence:
successful bind initializes all elements of rx_req
unbind frees all elements of rx_req but doesn't zero out rx_req
bind() -> failed create_bulk_endpoints() on allocating rx_req[0], tries
to free all elements of rx_req, double free on rx_req[1]
Bug:
73769117
Test: no crash
Change-Id: I69c538450ea52a1aa718d27a2a48629f66a7e8b6
Signed-off-by: Jerry Zhang <zhangjerry@google.com>
Jerry Zhang [Tue, 20 Feb 2018 19:00:06 +0000 (11:00 -0800)]
ANDROID: usb: gadget: f_accessory: Fix double-free
Set the request to null to avoid double free in
retry_rx_alloc.
Bug:
73645054
Test: no double free
Change-Id: Iecf22c807a4a23b4b2ba7ebee53c53502c616ec5
Signed-off-by: Jerry Zhang <zhangjerry@google.com>
Jerry Zhang [Wed, 11 Oct 2017 18:26:43 +0000 (11:26 -0700)]
ANDROID: usb: gadget: f_accessory: Increase buffer size and max burst
Requests begin with large buffers for performance, and
the buffers are halved if allocation fails.
Bug:
67683483
Change-Id: I63d9f18385ca8e86894fd75d80c1702ee3e4e25f
Signed-off-by: Jerry Zhang <zhangjerry@google.com>
Baolin Wang [Thu, 8 Dec 2016 11:55:22 +0000 (19:55 +0800)]
usb: gadget: f_fs: Fix possibe deadlock
commit
b3ce3ce02d146841af012d08506b4071db8ffde3 upstream.
When system try to close /dev/usb-ffs/adb/ep0 on one core, at the same
time another core try to attach new UDC, which will cause deadlock as
below scenario. Thus we should release ffs lock before issuing
unregister_gadget_item().
[ 52.642225] c1 ======================================================
[ 52.642228] c1 [ INFO: possible circular locking dependency detected ]
[ 52.642236] c1 4.4.6+ #1 Tainted: G W O
[ 52.642241] c1 -------------------------------------------------------
[ 52.642245] c1 usb ffs open/2808 is trying to acquire lock:
[ 52.642270] c0 (udc_lock){+.+.+.}, at: [<
ffffffc00065aeec>]
usb_gadget_unregister_driver+0x3c/0xc8
[ 52.642272] c1 but task is already holding lock:
[ 52.642283] c0 (ffs_lock){+.+.+.}, at: [<
ffffffc00066b244>]
ffs_data_clear+0x30/0x140
[ 52.642285] c1 which lock already depends on the new lock.
[ 52.642287] c1
the existing dependency chain (in reverse order) is:
[ 52.642295] c0
-> #1 (ffs_lock){+.+.+.}:
[ 52.642307] c0 [<
ffffffc00012340c>] __lock_acquire+0x20f0/0x2238
[ 52.642314] c0 [<
ffffffc000123b54>] lock_acquire+0xe4/0x298
[ 52.642322] c0 [<
ffffffc000aaf6e8>] mutex_lock_nested+0x7c/0x3cc
[ 52.642328] c0 [<
ffffffc00066f7bc>] ffs_func_bind+0x504/0x6e8
[ 52.642334] c0 [<
ffffffc000654004>] usb_add_function+0x84/0x184
[ 52.642340] c0 [<
ffffffc000658ca4>] configfs_composite_bind+0x264/0x39c
[ 52.642346] c0 [<
ffffffc00065b348>] udc_bind_to_driver+0x58/0x11c
[ 52.642352] c0 [<
ffffffc00065b49c>] usb_udc_attach_driver+0x90/0xc8
[ 52.642358] c0 [<
ffffffc0006598e0>] gadget_dev_desc_UDC_store+0xd4/0x128
[ 52.642369] c0 [<
ffffffc0002c14e8>] configfs_write_file+0xd0/0x13c
[ 52.642376] c0 [<
ffffffc00023c054>] vfs_write+0xb8/0x214
[ 52.642381] c0 [<
ffffffc00023cad4>] SyS_write+0x54/0xb0
[ 52.642388] c0 [<
ffffffc000085ff0>] el0_svc_naked+0x24/0x28
[ 52.642395] c0
-> #0 (udc_lock){+.+.+.}:
[ 52.642401] c0 [<
ffffffc00011e3d0>] print_circular_bug+0x84/0x2e4
[ 52.642407] c0 [<
ffffffc000123454>] __lock_acquire+0x2138/0x2238
[ 52.642412] c0 [<
ffffffc000123b54>] lock_acquire+0xe4/0x298
[ 52.642420] c0 [<
ffffffc000aaf6e8>] mutex_lock_nested+0x7c/0x3cc
[ 52.642427] c0 [<
ffffffc00065aeec>] usb_gadget_unregister_driver+0x3c/0xc8
[ 52.642432] c0 [<
ffffffc00065995c>] unregister_gadget_item+0x28/0x44
[ 52.642439] c0 [<
ffffffc00066b34c>] ffs_data_clear+0x138/0x140
[ 52.642444] c0 [<
ffffffc00066b374>] ffs_data_reset+0x20/0x6c
[ 52.642450] c0 [<
ffffffc00066efd0>] ffs_data_closed+0xac/0x12c
[ 52.642454] c0 [<
ffffffc00066f070>] ffs_ep0_release+0x20/0x2c
[ 52.642460] c0 [<
ffffffc00023dbe4>] __fput+0xb0/0x1f4
[ 52.642466] c0 [<
ffffffc00023dd9c>] ____fput+0x20/0x2c
[ 52.642473] c0 [<
ffffffc0000ee944>] task_work_run+0xb4/0xe8
[ 52.642482] c0 [<
ffffffc0000cd45c>] do_exit+0x360/0xb9c
[ 52.642487] c0 [<
ffffffc0000cf228>] do_group_exit+0x4c/0xb0
[ 52.642494] c0 [<
ffffffc0000dd3c8>] get_signal+0x380/0x89c
[ 52.642501] c0 [<
ffffffc00008a8f0>] do_signal+0x154/0x518
[ 52.642507] c0 [<
ffffffc00008af00>] do_notify_resume+0x70/0x78
[ 52.642512] c0 [<
ffffffc000085ee8>] work_pending+0x1c/0x20
[ 52.642514] c1
other info that might help us debug this:
[ 52.642517] c1 Possible unsafe locking scenario:
[ 52.642518] c1 CPU0 CPU1
[ 52.642520] c1 ---- ----
[ 52.642525] c0 lock(ffs_lock);
[ 52.642529] c0 lock(udc_lock);
[ 52.642533] c0 lock(ffs_lock);
[ 52.642537] c0 lock(udc_lock);
[ 52.642539] c1
*** DEADLOCK ***
[ 52.642543] c1 1 lock held by usb ffs open/2808:
[ 52.642555] c0 #0: (ffs_lock){+.+.+.}, at: [<
ffffffc00066b244>]
ffs_data_clear+0x30/0x140
[ 52.642557] c1 stack backtrace:
[ 52.642563] c1 CPU: 1 PID: 2808 Comm: usb ffs open Tainted: G
[ 52.642565] c1 Hardware name: Spreadtrum SP9860g Board (DT)
[ 52.642568] c1 Call trace:
[ 52.642573] c1 [<
ffffffc00008b430>] dump_backtrace+0x0/0x170
[ 52.642577] c1 [<
ffffffc00008b5c0>] show_stack+0x20/0x28
[ 52.642583] c1 [<
ffffffc000422694>] dump_stack+0xa8/0xe0
[ 52.642587] c1 [<
ffffffc00011e548>] print_circular_bug+0x1fc/0x2e4
[ 52.642591] c1 [<
ffffffc000123454>] __lock_acquire+0x2138/0x2238
[ 52.642595] c1 [<
ffffffc000123b54>] lock_acquire+0xe4/0x298
[ 52.642599] c1 [<
ffffffc000aaf6e8>] mutex_lock_nested+0x7c/0x3cc
[ 52.642604] c1 [<
ffffffc00065aeec>] usb_gadget_unregister_driver+0x3c/0xc8
[ 52.642608] c1 [<
ffffffc00065995c>] unregister_gadget_item+0x28/0x44
[ 52.642613] c1 [<
ffffffc00066b34c>] ffs_data_clear+0x138/0x140
[ 52.642618] c1 [<
ffffffc00066b374>] ffs_data_reset+0x20/0x6c
[ 52.642621] c1 [<
ffffffc00066efd0>] ffs_data_closed+0xac/0x12c
[ 52.642625] c1 [<
ffffffc00066f070>] ffs_ep0_release+0x20/0x2c
[ 52.642629] c1 [<
ffffffc00023dbe4>] __fput+0xb0/0x1f4
[ 52.642633] c1 [<
ffffffc00023dd9c>] ____fput+0x20/0x2c
[ 52.642636] c1 [<
ffffffc0000ee944>] task_work_run+0xb4/0xe8
[ 52.642640] c1 [<
ffffffc0000cd45c>] do_exit+0x360/0xb9c
[ 52.642644] c1 [<
ffffffc0000cf228>] do_group_exit+0x4c/0xb0
[ 52.642647] c1 [<
ffffffc0000dd3c8>] get_signal+0x380/0x89c
[ 52.642651] c1 [<
ffffffc00008a8f0>] do_signal+0x154/0x518
[ 52.642656] c1 [<
ffffffc00008af00>] do_notify_resume+0x70/0x78
[ 52.642659] c1 [<
ffffffc000085ee8>] work_pending+0x1c/0x20
Change-Id: I4f084295389670cab0f7b7ee2d866e263f09f6da
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Jerry Zhang <zhangjerry@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Petri Gynther [Thu, 31 May 2018 17:57:30 +0000 (17:57 +0000)]
Revert "serial: msm_serial_hs: Protect spurious irqs after wakeup irq enablement"
This reverts commit
545339b82c446a0509e775722b675115241c9f57.
This workaround is no longer needed because pinctrl IRQ chip driver has been fixed
to clear spurious interrupts:
https://partner-android-review.googlesource.com/c/kernel/private/msm-google/+/
1070357/
Bug:
68261352
Bug:
77429706
Change-Id: I66400003a04f50f22033f80fe31ef81ce622cfc1
Signed-off-by: Petri Gynther <pgynther@google.com>
Tim Murray [Tue, 27 Mar 2018 18:34:01 +0000 (11:34 -0700)]
Revert "Revert "select: use freezable blocking call""
This reverts commit
59612d187912750f416fbffe0c00bc0811c54ab5.
Android doesn't need to worry about buggy i686 implementations, which
was the reason behind the original revert.
See https://bugzilla.kernel.org/show_bug.cgi?id=61781.
Test: device enters suspend and everything works fine
bug
77139736
Change-Id: I84dd94d3cc8624293f10d0904c189ca63ecbe3d8
Signed-off-by: Tim Murray <timmurray@google.com>
Thierry Strudel [Wed, 9 May 2018 18:36:40 +0000 (11:36 -0700)]
Revert "usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1"
Certain USB-C devices are failing to enumerate if the bus
transitions from active to suspend between connection and enumeration.
When a USB-C accessory is inserted in a phone and is detected by the
CC lines, the controller driver is loaded and the only devices present
on the bus are the root hubs, until the device enumerations.
As a result, a suspend transition between device connection and
enumeration is very likely.
This change leaves the hub autosuspend set to the usbcore.autosuspend
value so a value can be set high enough to prevent this race.
This reverts:
commit
bdd405d2a528 ("usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1")
If user specifies that USB autosuspend must be disabled by module
parameter "usbcore.autosuspend=-1" then we must prevent
autosuspend of USB hub devices as well.
commit
596d789a211d introduced in v3.8 changed the original behaivour
and stopped respecting the usbcore.autosuspend parameter for hubs.
Bug:
71936484
Change-Id: Ie20471b9e8d44f92f9eff97ed12ccd903c98c272
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Signed-off-by: Andrew Chant <achant@google.com>
Badhri Jagan Sridharan [Sat, 16 Sep 2017 02:17:27 +0000 (19:17 -0700)]
BACKPORT: usb: host: plat: Enable xHCI plat runtime PM
Enable the xHCI plat runtime PM for parent device to
suspend/resume xHCI.
https://patchwork.kernel.org/patch/
9679003/
Leaving out the pm_runtime_forbid() as autosuspend
seems to be enabled in qualcomm's code.
BUG:
63697798
Change-Id: I5c1ce3ccc0a70cddce9c68def30c7bc54165f479
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Banajit Goswami [Tue, 23 May 2017 08:02:50 +0000 (01:02 -0700)]
ASoC: msm: q6dspv2: vote for Glink Rx thread priority upgrade
For Low-latency audio playback usecase, vote for a priority
upgrade for Glink Rx thread, to avoid any performance issue.
Bug:
38234822
Change-Id: I8332c80eedd7325700e695f341fc4b92f65fd77c
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Kelly Rossmoyer [Mon, 20 Nov 2017 23:07:23 +0000 (15:07 -0800)]
genirq: Add generic action name for chained IRQs
Chained IRQs (the local device IRQs for chips that relay other IRQs)
are all initialized in the kernel using a shared generic irqaction
struct called "chained_action". Since the action is shared, the API
for registering chained IRQ handlers does not allow a unique name to
be specified, whereas non-chained IRQ handlers can have unique names.
Unfortunately, the name of an IRQ handler action is included in resume
logging, both in the kernel and in batterystats, and the name of the
shared action for chained IRQ handlers is left null. So when a chained
IRQ is detected as part of the wakeup reason during resume flow, we
currently see log content like "10 triggered null" and "Resume caused
by IRQ 10" in the kernel log and wakeup reason substrings like ":10:"
in batterystats.
To reduce confusion when troubleshooting and improve the clarity of
logs, this change adds a generic name ("chained-irq") to the shared
action. This name will show up in resume logging whenever any chained
IRQ handler is part of the wakeup reason. In the kernel log:
"10 triggered null" will become "10 triggered chained-irq"
"... caused by IRQ 199" will become "... caused by IRQ 199 chained-irq"
And in batterystats wakeup reasons:
":10:" will become ":10:chained-irq"
This change does not (and cannot) provide any clarity in the logs
about which chip is associated with which chained IRQ number; that
information - if needed - must be obtained through other means.
Bug:
63899519
Test:Ran on walleye and taimen devices and observed kernel logging
and dumpsys batterystats logging changes.
Signed-off-by: Kelly Rossmoyer <krossmo@google.com>
Change-Id: I807f385fe64573cb3962cd25089fbc8e270a2377
Maggie White [Wed, 12 Apr 2017 22:52:05 +0000 (15:52 -0700)]
power: Improved/fixed logs for PM wakeups
PM wakeups were reporting in kernel and BatteryStats logs as abort
suspends due to the PM IRQ handler logging a suspend abort, which
prevented the normal wakeup resume messaging. Suspend abort reasons
are already logged in pm_wakeup_pending() in
drivers/base/power/wakeup.c.
Bug:
34225014
Change-Id: I8b9ab597caef61b0d6f5b853b2947d6afc13d693
Signed-off-by: Maggie White <maggiewhite@google.com>
jonghyun26.kim [Mon, 24 Jul 2017 22:39:48 +0000 (15:39 -0700)]
power_supply: Fix unbalanced the power supplies
If a driver invokes multiple power_supply_register(), the each supply
will not be saved in the supplied_from[] with the correct index.
supplied_from[0] = "dc"
num_supplies = 1;
supplied_from[0] = "usb"
num_supplies = 2;
supplied_from[0] = "battery"
num_supplies = 3;
...
It results in NPE when iterating the supplied_from[] with num_supplies on
__power_supply_is_supplied_by()
Bug:
63785418
Change-Id: Ifd14ca7c6e2df247e1090e4fa8d8c66bd2912180
Signed-off-by; Devin Kim <dojip.kim@lge.com>
Signed-off-by: Steve Pfetsch <spfetsch@google.com>
Kelly Rossmoyer [Thu, 19 Oct 2017 20:24:10 +0000 (13:24 -0700)]
fs: Improve eventpoll logging to stop indicting timerfd
timerfd doesn't create any wakelocks; eventpoll can, and is creating the
wakelocks we see called "[timerfd]". eventpoll creates two kinds of
wakelocks: a single top-level lock associated with the eventpoll fd
itself, and one additional lock for each fd it is polling that needs such
a lock (e.g. those using EPOLLWAKEUP). Current code names the per-fd
locks using the undecorated names of the fds' associated files (hence
"[timerfd]"), and is naming the top-level lock after the PID of the caller
and the name of the file behind the first fd for which a per-fd lock is
created. To make things clearer, the top-level lock is now named using
the caller PID and an "epollfd" designation, while the per-fd locks are
also named with the caller's PID (to associate them with the top-level
lock) and their respective fds' file names.
Bug:
63622255
Bug:
38042165
Test: Ran on device and observed new wakelock naming in bugreport, dumpsys
batterystats, /d/tracing/trace, and d/wakeup_reasons.
Change-Id: I32bfe5fe6766bb569329a450cc7163d52d59ed34
Signed-off-by: Kelly Rossmoyer <krossmo@google.com>
John Dias [Thu, 20 Oct 2016 17:28:32 +0000 (10:28 -0700)]
fs: add useful debug info to eventpoll string
Add pid and file to facilitate debugging when eventpoll wakeup
prevents sleeping.
Bug:
32180327
Change-Id: I34bada5ddab04cf3830762c745f46bfcd1549cb8
Signed-off-by: John Dias <joaodias@google.com>
Patrick Tjin [Tue, 5 Dec 2017 22:55:14 +0000 (14:55 -0800)]
PM: wakeup_reasons: Fix formatting for printk
current output looks like this:
[ 133.772467] Abort: Wakeup IRQ 730 wdog-bark pending[ 133.777343] PM: suspend exit 2017-11-30 19:05:34.
974168313 UTC
Change it to this:
[ 133.772467] Abort: Wakeup IRQ 730 wdog-bark pending
[ 133.777343] PM: suspend exit 2017-11-30 19:05:34.
974168313 UTC
Change-Id: Ic38338a3274b83256788077db6f1040605b79603
Signed-off-by: Patrick Tjin <pattjin@google.com>
Maggie White [Mon, 17 Apr 2017 18:32:46 +0000 (11:32 -0700)]
power: Add detailed suspend abort reason
Test: dumpsys batterystats
Bug:
30874086
(cherry picked from commit
a9d6bead120dab67e00bfe5500a616f83b94cf44)
Change-Id: I9feae71693b4addd45550b19ecab7dfd7371c378
Signed-off-by: Maggie White <maggiewhite@google.com>
Wei Wang [Thu, 27 Oct 2016 18:03:12 +0000 (11:03 -0700)]
power: wakeup_reason: make log function work in interrupt context
If log_suspend_abort_reason called in interrupt context, the spinlock
may deadlock.
With https://lkml.org/lkml/2014/9/1/404, wakeup mechanism changed, so
log_suspend_abort_reason can be placed in interrupt context to retrieve
the abort reasons.
Bug:
32371978
Change-Id: I6902770e54b663d21b47289daec19401fc0dbed4
Signed-off-by: Wei Wang <wvw@google.com>
Thierry Strudel [Wed, 13 Jul 2016 16:58:11 +0000 (09:58 -0700)]
irqchip: msm: log wakeup interrupts
set msm_show_resume_irq_mask to log wakeup reasons for batterystats
Bug:
28383208
Change-Id: I00b856c691d9da7ed6452704db9b0f3f56f49581
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Wei Wang [Thu, 5 Jan 2017 20:30:27 +0000 (12:30 -0800)]
pinctrl: qcom: unconditionally mark handled in msm_gpio_irq_handler
Current accounting is innaccurate for lazy irq masking and may
cause handle_bad_irq triggered in such case.
Bug:
30604869
Change-Id: If805e10c724b755323004da1e1fe18d315e81df2
Signed-off-by: Wei Wang <wvw@google.com>
Thierry Strudel [Fri, 8 Jul 2016 01:13:23 +0000 (18:13 -0700)]
pinctrl: qcom: log wakeup reason
Bug:
29697729
Change-Id: Id25487ba6ba4f141dff3653089a100931bd4fb71
Signed-off-by: Thierry Strudel <tstrudel@google.com>