OSDN Git Service

sagit-ice-cold/kernel_xiaomi_msm8998.git
4 years ago{chiron,sagit}_defconfig: enable bfq
Demon Singur [Sat, 19 May 2018 15:22:19 +0000 (15:22 +0000)]
{chiron,sagit}_defconfig: enable bfq

Change-Id: I010beeb949a021f345c1deb6f4629236ccff69de

4 years ago{chiron,sagit}_defconfig: CONFIG_HZ_300=y
Wei Wang [Sat, 6 May 2017 01:14:09 +0000 (18:14 -0700)]
{chiron,sagit}_defconfig: CONFIG_HZ_300=y

Bug: 38045690
Test: Build
Change-Id: I54f53347358a052cdc11825092a7e94e5f17271c
Signed-off-by: Wei Wang <wvw@google.com>
4 years ago{chiron,sagit}_defconfig: enable F2FS configs
Ziqi Chen [Tue, 19 Jun 2018 11:34:52 +0000 (19:34 +0800)]
{chiron,sagit}_defconfig: enable F2FS configs

Enable F2FS related configs for MSM8998.

Change-Id: Id52e93ee54e65e558a21a9280456f05b0c9bf9c5
Signed-off-by: Ziqi Chen <ziqichen@codeaurora.org>
4 years ago{chiron,sagit}_defconfig: turn on VDSO
Mark Salyzyn [Tue, 28 Mar 2017 21:11:02 +0000 (14:11 -0700)]
{chiron,sagit}_defconfig: turn on VDSO

Turn on the vdso32 feature on an arm64 kernel.

Results in roughly a 4 fold speedup for clock_gettime() and other
timekeeping functions for arm32 executables in the environment.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 20045882
Bug: 19198045
Bug: 63737556
Change-Id: If39bfad8b287a5455dc8240a73dcc8951e4bc13f
Signed-off-by: Vol Zhdanov <wight554@gmail.com>
4 years ago{chiron,sagit}_defconfig: set default readahead to 2048KB
Wei Wang [Wed, 28 Feb 2018 22:05:47 +0000 (14:05 -0800)]
{chiron,sagit}_defconfig: set default readahead to 2048KB

Android has been benefiting quicker boot from bigger readahead during
boottime than runtime. However, the boottime readahead setting is set
when init is established after treble early mount. This patch will make
readahead bigger by default so early boot can benefit from it. Readahead
will be reset by init on boot_complete.

Bug: 62413151
Test: boot walleye 100ms faster
Change-Id: Ic9dad5666ce3d4836d73afbcee04cfb875f64f5d
Signed-off-by: Wei Wang <wvw@google.com>
4 years ago{chiron,sagit}_defconfig: preserve memory on restart
Bruno Martins [Wed, 31 Oct 2018 11:57:41 +0000 (11:57 +0000)]
{chiron,sagit}_defconfig: preserve memory on restart

Change-Id: I34e38bb4ab456d9573b5b5d2bba4bb6e42cd4c85

4 years ago{chiron,sagit}_defconfig: disable unused ecrypt fs
Vol Zhdanov [Sat, 20 Oct 2018 22:42:10 +0000 (22:42 +0000)]
{chiron,sagit}_defconfig: disable unused ecrypt fs

Change-Id: Ica03eb70f8e9b27a8fb98cf7400f841f6514f9ef

4 years ago{chiron,sagit}_defconfig: enable CONFIG_MEMORY_STATE_TIME
Thierry Strudel [Tue, 14 Mar 2017 16:04:33 +0000 (09:04 -0700)]
{chiron,sagit}_defconfig: enable CONFIG_MEMORY_STATE_TIME

Change-Id: Ic4d6e76e3d7a14e9ced9ec389f4253a596169b63
Signed-off-by: Thierry Strudel <tstrudel@google.com>
4 years ago{chiron,sagit}_defconfig: enable JUMP_LABEL
joshuous [Fri, 5 Jan 2018 16:58:42 +0000 (00:58 +0800)]
{chiron,sagit}_defconfig: enable JUMP_LABEL

This option enables a transparent branch optimization
that makes certain almost-always-true or almost-always-false
branch conditions even cheaper to execute within the kernel.

Certain performance-sensitive kernel code, such as trace points,
scheduler functionality, networking code and KVM have such
branches and include support for this optimization technique.

If it is detected that the compiler has support for "asm goto",
the kernel will compile such branches with just a nop instruction.
When the condition flag is toggled to true, the nop will be
converted to a jump instruction to execute the conditional
block of instructions.

This technique lowers overhead and stress on the branchprediction
of the processor and generally makes the kernel faster.
The update of the condition is slower, but those are always
very rare.

Change-Id: I90657cf7ef3b9d116eb019da87dd62e1806e0e87
Signed-off-by: joshuous <joshuous@gmail.com>
4 years ago{chiron,sagit}_defconfig: enable LZ4 ZRAM
Wei Wang [Fri, 2 Feb 2018 21:22:46 +0000 (13:22 -0800)]
{chiron,sagit}_defconfig: enable LZ4 ZRAM

Bug: 69685432
Test: Build
Change-Id: I894bd86c76e7c5668e1535dfc7bf3a20fa233488
Signed-off-by: Wei Wang <wvw@google.com>
4 years ago{chiron,sagit}_defconfig: enable CONFIG_DETECT_HUNG_TASK
Hridya Valsaraju [Fri, 13 Apr 2018 04:43:28 +0000 (21:43 -0700)]
{chiron,sagit}_defconfig: enable CONFIG_DETECT_HUNG_TASK

Test: device boots and /proc/sys/hung_task_* files
exist
Bug: 77842593

Change-Id: I5761cfc09a36bf275f9f09ec55158c0a6e8fb71c
Signed-off-by: Hridya Valsaraju <hridya@google.com>
4 years ago{chiron,sagit}_defconfig: enable pstore
Oleg Matcovschi [Wed, 31 Jan 2018 01:56:02 +0000 (17:56 -0800)]
{chiron,sagit}_defconfig: enable pstore

Bug: 72662019
Signed-off-by: Oleg Matcovschi <omatcovschi@google.com>
Change-Id: Ifd3f5f50cd6c496a7be637547223850a5e1f89c2

4 years ago{chiron,sagit}_defconfig: enable various HID drivers
Patrick Tjin [Mon, 24 Jul 2017 19:07:38 +0000 (12:07 -0700)]
{chiron,sagit}_defconfig: enable various HID drivers

Bug: 62808409
Change-Id: Ic049d6c03aaeaf53a0ba43ac7bd62ee52bcf7704
Signed-off-by: Patrick Tjin <pattjin@google.com>
4 years ago{chiron,sagit}_defconfig: enable qcacld-3.0
Demon Singur [Sat, 19 May 2018 13:16:04 +0000 (13:16 +0000)]
{chiron,sagit}_defconfig: enable qcacld-3.0

All the configs from stock, except
CONFIG_WLAN_OFFLOAD_PACKETS=y
which didn't seem to be enabled in 8.4.19's qcacld.ko.

Change-Id: I1da7e60dd4a14c3abdd0c32b2a2bb8505b17b810

4 years ago{chiron,sagit}_defconfig: enable specific device config
Demon Singur [Sat, 19 May 2018 14:59:03 +0000 (14:59 +0000)]
{chiron,sagit}_defconfig: enable specific device config

Change-Id: I069d2a8e0f912abd6af95696e829ed27c80b7b49

4 years ago{chiron,sagit}_defconfig: disable PAN emulation
Bruno Martins [Tue, 27 Feb 2018 18:38:16 +0000 (18:38 +0000)]
{chiron,sagit}_defconfig: disable PAN emulation

 * This is a workaround to a bad implementation around
   the Elliptic Labs' proximity sensor.

Change-Id: Iea8e3314d1cda85249145b5361b5b5db00877d9e

4 years ago{chiron,sagit}_defconfig: disable cgroup debugging
Sultan Alsawaf [Sat, 18 Aug 2018 19:24:58 +0000 (12:24 -0700)]
{chiron,sagit}_defconfig: disable cgroup debugging

Change-Id: I3ac04919fc45eee87af91dfa9fdde599b6f4a4bd

4 years ago{chiron,sagit}_defconfig: disable SCHED_AUTOGROUP
John Dias [Tue, 11 Jul 2017 19:04:08 +0000 (12:04 -0700)]
{chiron,sagit}_defconfig: disable SCHED_AUTOGROUP

Under some workloads, we're seeing periods of freezing
and excessive jank that appear to be partially improved
by disabling the autogroup feature.

Bug: 63331203
Signed-off-by: John Dias <joaodias@google.com>
Change-Id: If61dd69f6a1930158ca7e8c53240042381bc7c77

4 years ago{chiron,sagit}_defconfig: disable mdss xlog debug
Adrian Salido [Tue, 8 Aug 2017 18:45:09 +0000 (11:45 -0700)]
{chiron,sagit}_defconfig: disable mdss xlog debug

Bug: 62470966
Change-Id: Ib12674f38fb109ea467729eeeff283299ace2e63
Signed-off-by: Adrian Salido <salidoa@google.com>
4 years ago{chiron,sagit}_defconfig: disable MSM_11AD
Thierry Strudel [Tue, 7 Mar 2017 00:20:26 +0000 (16:20 -0800)]
{chiron,sagit}_defconfig: disable MSM_11AD

Change-Id: I01399642ab5d2e6405cf8dbb23caa140fcf71b56
Signed-off-by: Thierry Strudel <tstrudel@google.com>
4 years ago{chiron,sagit}_defconfig: disable BRIDGE_NETFILTER
Chris Fries [Thu, 26 Apr 2018 15:49:23 +0000 (10:49 -0500)]
{chiron,sagit}_defconfig: disable BRIDGE_NETFILTER

CONFIG_BRIDGE_NETFILTER is default=m and we don't use it.

Bug: 78574169
Change-Id: Ie8aa5e2a7adc64679e142f931b8da03999b08a43
Signed-off-by: Chris Fries <cfries@google.com>
4 years ago{chiron,sagit}_defconfig: disable QBT1000
Chris Fries [Mon, 5 Feb 2018 22:38:59 +0000 (16:38 -0600)]
{chiron,sagit}_defconfig: disable QBT1000

Remove Qualcomm's fingerprint solution.

Change-Id: I6782ee5413ac28a1bc338943fc7732dafd41da75
Signed-off-by: Chris Fries <cfries@google.com>
4 years ago{chiron,sagit}_defconfig: disable unused power drivers
Patrick Tjin [Mon, 30 Oct 2017 21:48:42 +0000 (14:48 -0700)]
{chiron,sagit}_defconfig: disable unused power drivers

Change-Id: Idb250458ed3f36b2134ca584813c63106ee12de2
Signed-off-by: Patrick Tjin <pattjin@google.com>
4 years ago{chiron,sagit}_defconfig: remove remaining unused configs
Demon Singur [Sat, 19 May 2018 13:19:43 +0000 (13:19 +0000)]
{chiron,sagit}_defconfig: remove remaining unused configs

 * disable seemp core
 * remove unused platform support
 * remove STMVL53L0 support
 * disable debug options
 * disable unneded filesystems
 * disable useless modules
 * disable mmc support
 * disable unused regulators

Change-Id: I467c9df894597c0c434dcd0b1a1365651e6dca28
Signed-off-by: Vol Zhdanov <wight554@gmail.com>
4 years ago{chiron,sagit}_defconfig: remove unused kernel config
Wei Wang [Wed, 20 Sep 2017 22:26:09 +0000 (15:26 -0700)]
{chiron,sagit}_defconfig: remove unused kernel config

Bug: 66228430
Test: boot
Change-Id: Ib779822633f700a4378b8ea3293fc6f8cb9f7175
Signed-off-by: Wei Wang <wvw@google.com>
4 years ago{chiron,sagit}_defconfig: remove various debug configs
Thierry Strudel [Fri, 21 Jul 2017 00:37:21 +0000 (17:37 -0700)]
{chiron,sagit}_defconfig: remove various debug configs

Disable remaining DEBUG configuration for shipping ROM

Bug: 62470966
Bug: 62235647
Change-Id: Id32f7ca9bc3585235826b32dd0d5719283a1c465
Signed-off-by: Thierry Strudel <tstrudel@google.com>
4 years ago{chiron,sagit}_defconfig: clean up configs
Patrick Tjin [Tue, 20 Jun 2017 02:42:27 +0000 (19:42 -0700)]
{chiron,sagit}_defconfig: clean up configs

Remove SCSI media changer support
Remove Ethernet plug in card support
Remove Qualcomm HBTP driver
Remove PPP sync support
Remove Linux Logo
Remove PCI and SPI sound card support
Remove Serial based input device support
Remove Elecom BT mouse support
Remove USB touch screen support
Remove X-Gene Phy support
Remove Non-USB Mouse, Joystick support

Enable Wacom input
Enable Realtek USB Ethernet support
Enable Announce USB device

Test: Keyboard, Mouse, Ethernet(USB3GIGV1), Headset
Test: Power/Volume Up/Down hard keys work
Change-Id: Icfdcc6ee0479c8d943a330d724aa29e0f0ca47ee
Signed-off-by: Patrick Tjin <pattjin@google.com>
4 years ago{chiron,sagit}_defconfig: start clean from msmcortex-perf_defconfig
Demon Singur [Sat, 19 May 2018 10:17:18 +0000 (10:17 +0000)]
{chiron,sagit}_defconfig: start clean from msmcortex-perf_defconfig

* use msmcortex-perf_defconfig from latest tag

Change-Id: I0c902d56f256f5e334ef4866810afd82f1d3b4a8
Signed-off-by: Vol Zhdanov <wight554@gmail.com>
Signed-off-by: Arian <arian.kulmer@web.de>
4 years agoclk: msm8998: remove gcc_mss_q6_bimc_axi_clk
Demon Singur [Sun, 17 Jun 2018 07:42:26 +0000 (07:42 +0000)]
clk: msm8998: remove gcc_mss_q6_bimc_axi_clk

Fails to enable and will generate a warning at init.

[    0.422228] gcc_mss_q6_bimc_axi_clk: status stuck off
[    0.422322] ------------[ cut here ]------------
[    0.422346] WARNING: at
/home/aicpdevs/lineage-15.1/kernel/xiaomi/msm8998/drivers/clk/msm/clock-local2.c:670
[    0.422359]
[    0.422381] CPU: 4 PID: 6 Comm: kworker/u16:0 Not tainted
4.4.78-perf+ #31
[    0.422397] Hardware name: Qualcomm Technologies, Inc. MSM 8998 v2.1
MTP (DT)
[    0.422432] Workqueue: deferwq deferred_probe_work_func
[    0.422458] task: fffffffb76524380 ti: fffffffb76558000 task.ti:
fffffffb76558000
[    0.422482] PC is at branch_clk_halt_check+0x114/0x164
[    0.422500] LR is at branch_clk_halt_check+0x114/0x164
[    0.422518] pc : [<ffffff91afb14500>] lr : [<ffffff91afb14500>]
pstate: 600000c5
[    0.422532] sp : fffffffb7655b9c0
[    0.422546] x29: fffffffb7655b9c0 x28: fffffffb76548100
[    0.422577] x27: fffffffb76416000 x26: 00000000000000a0
[    0.422605] x25: ffffff91b0f53078 x24: ffffff91b05df050
[    0.422632] x23: 00000000d0000000 x22: 0000000080000000
[    0.422658] x21: ffffff8008e8a040 x20: 0000000000000000
[    0.422684] x19: 0000000000000000 x18: fffffffb76507930
[    0.422710] x17: 0000000000000001 x16: 0000000000000007
[    0.422736] x15: 0000000000000001 x14: 0ffffffffffffffe
[    0.422761] x13: 0000000000000018 x12: 7aadf1b97e533910
[    0.422787] x11: 0000000000000006 x10: fffffffb7655b7a0
[    0.422813] x9 : 00000000ffffffd0 x8 : ffffff91af0fb3ac
[    0.422838] x7 : ffffff91b0e4ce60 x6 : 0000000000000038
[    0.422863] x5 : 0000000000000000 x4 : 0000000000000000
[    0.422889] x3 : 0000000000000000 x2 : 7aadf1b97e533910
[    0.422914] x1 : 7aadf1b97e533910 x0 : 0000000000000029
[    0.422941] \x0aPC: 0xffffff91afb144c0:
[    0.422958] 44c0  a94153f3 a9425bf5 a94363f7 a8c57bfd d65f03c0
aa1903e0 d2800001 94001d1e
[    0.423037] 44e0  b4000219 b140073f 540001c8 f9400b21 b0005be0
aa1803e2 913dc000 97d1c0da
[    0.423114] 4500  d4210000 12800da0 f94023f9 a94153f3 a9425bf5
a94363f7 a8c57bfd d65f03c0
[    0.423190] 4520  90004d81 91142021 17fffff2 b0002fc1 b0005be0
91262021 913e2000 91010021
[    0.423269] \x0aLR: 0xffffff91afb144c0:
[    0.423284] 44c0  a94153f3 a9425bf5 a94363f7 a8c57bfd d65f03c0
aa1903e0 d2800001 94001d1e
[    0.423361] 44e0  b4000219 b140073f 540001c8 f9400b21 b0005be0
aa1803e2 913dc000 97d1c0da
[    0.423437] 4500  d4210000 12800da0 f94023f9 a94153f3 a9425bf5
a94363f7 a8c57bfd d65f03c0
[    0.423512] 4520  90004d81 91142021 17fffff2 b0002fc1 b0005be0
91262021 913e2000 91010021
[    0.423590] \x0aSP: 0xfffffffb7655b980:
[    0.423605] b980  afb14500 ffffff91 7655b9c0 fffffffb afb14500
ffffff91 600000c5 00000000
[    0.423681] b9a0  b0f53078 ffffff91 00000000 00000000 ffffffff
ffffffff b0e4ce60 ffffff91
[    0.423757] b9c0  7655ba10 fffffffb afb156bc ffffff91 b0f53070
ffffff91 b13cc158 ffffff91
[    0.423833] b9e0  b0f53078 ffffff91 00000040 00000000 b0692df0
ffffff91 00000000 00000000
[    0.423908]
[    0.423941] ---[ end trace 4d957e9333d6dbf1 ]---
[    0.423955] Call trace:
[    0.423973] Exception stack(0xfffffffb7655b7d0 to 0xfffffffb7655b900)
[    0.423993] b7c0:                                   0000000000000000
0000008000000000
[    0.424015] b7e0: fffffffb7655b9c0 ffffff91afb14500 00000000600000c5
00000000000000c0
[    0.424035] b800: ffffff91b04cde08 ffffff91b0e26b98 0000000000000000
ffffff91b1035148
[    0.424055] b820: fffffffb7655b830 ffffff91aef0cfcc fffffffb7655b8d0
ffffff91aef0d354
[    0.424076] b840: ffffff91b0e06000 ffffff91aef0d31c ffffff8008e8a040
0000000080000000
[    0.424095] b860: 00000000d0000000 ffffff91b05df050 ffffff91b0f53078
00000000000000a0
[    0.424115] b880: fffffffb76416000 7aadf1b97e533910 0000000000000029
7aadf1b97e533910
[    0.424134] b8a0: 7aadf1b97e533910 0000000000000000 0000000000000000
0000000000000000
[    0.424154] b8c0: 0000000000000038 ffffff91b0e4ce60 ffffff91af0fb3ac
00000000ffffffd0
[    0.424173] b8e0: fffffffb7655b7a0 0000000000000006 7aadf1b97e533910
0000000000000018
[    0.424193] [<ffffff91afb14500>] branch_clk_halt_check+0x114/0x164
[    0.424214] [<ffffff91afb156bc>] branch_clk_enable+0x80/0xe4
[    0.424237] [<ffffff91afb11360>] clk_enable+0x90/0x1cc
[    0.424259] [<ffffff91afb11fbc>] __handoff_clk.part.3+0x290/0x318
[    0.424280] [<ffffff91afb12070>] __handoff_clk+0x2c/0x5c
[    0.424301] [<ffffff91afb12474>] msm_clock_register+0x130/0x2c4
[    0.424322] [<ffffff91afb12684>] of_msm_clock_register+0x7c/0xa4
[    0.424345] [<ffffff91afb1c154>] msm_gcc_8998_probe+0x1a0/0x380
[    0.424366] [<ffffff91af452e5c>] platform_drv_probe+0x40/0xc4
[    0.424385] [<ffffff91af4514ec>] driver_probe_device+0x1f0/0x2ec
[    0.424403] [<ffffff91af45170c>] __device_attach_driver+0x84/0xb0
[    0.424420] [<ffffff91af44f9d4>] bus_for_each_drv+0x60/0xb0
[    0.424438] [<ffffff91af4511e8>] __device_attach+0xd0/0x124
[    0.424456] [<ffffff91af451770>] device_initial_probe+0x10/0x18
[    0.424473] [<ffffff91af44fc98>] bus_probe_device+0x90/0x98
[    0.424491] [<ffffff91af450b94>] deferred_probe_work_func+0x78/0xac
[    0.424515] [<ffffff91aeeba2e8>] process_one_work+0x144/0x440
[    0.424536] [<ffffff91aeeba720>] worker_thread+0x13c/0x440
[    0.424555] [<ffffff91aeec0a40>] kthread+0xec/0x100
[    0.424575] [<ffffff91aee82ef0>] ret_from_fork+0x10/0x20
[    0.424633] failed to enable always-on clock gcc_mss_q6_bimc_axi_clk

Change-Id: I449d2876d12e065127c13380eaf36a1ddb5de79d

4 years agocamera_v2: import xiaomi changes
Demon Singur [Wed, 28 Feb 2018 19:40:09 +0000 (19:40 +0000)]
camera_v2: import xiaomi changes

Change-Id: I1c63e5f13cfea310256e173c1164cc68198304d6

4 years agoASoC: msm8998: kill logspam if max wsa devices property is set to 0
Volodymyr Zhdanov [Sun, 17 Mar 2019 21:31:18 +0000 (21:31 +0000)]
ASoC: msm8998: kill logspam if max wsa devices property is set to 0

* I'm not sure it's a good idea to print this messages dozens of times
* Also remove useless xiaomi's hack (it acts the same as property anyway)

Change-Id: Ib12e7c793aa53e757356edefec950906641d8f1a

4 years agotfa98xx: fix self assigment errors
Demon Singur [Sat, 10 Mar 2018 20:47:56 +0000 (20:47 +0000)]
tfa98xx: fix self assigment errors

Change-Id: Ie87226c26ea07a5284fdb61fee6802817c00006b

4 years agosound: Import polaris changes for USB audio
Bruno Martins [Mon, 18 Jun 2018 20:05:03 +0000 (21:05 +0100)]
sound: Import polaris changes for USB audio

Change-Id: I4dbf44995e2bc05dd632fc33f543f56415f9b33f
Signed-off-by: Volodymyr Zhdanov <wight554@gmail.com>
4 years agosound: elliptic: update from sagit-p-oss
Volodymyr Zhdanov [Fri, 12 Jul 2019 12:24:04 +0000 (15:24 +0300)]
sound: elliptic: update from sagit-p-oss

Change-Id: I77d8c6756d8c4e853b23593c5aabfccd9a34c36d

4 years agosound: properly include elliptic drivers headers
Demon Singur [Mon, 12 Mar 2018 08:32:46 +0000 (08:32 +0000)]
sound: properly include elliptic drivers headers

Change-Id: I6d6b14e9bf1fc50ff74ca167ff36b42f4e5a253b

4 years agosound: import xiaomi changes
Demon000 [Fri, 10 Nov 2017 20:18:06 +0000 (22:18 +0200)]
sound: import xiaomi changes

Change-Id: I1305495c4d591d27d380ba61a553bb924d2ce6a8

4 years agopower: smb2: remove xiaomi's typeC try.snk implementation
dianlujitao [Fri, 19 Oct 2018 08:57:41 +0000 (16:57 +0800)]
power: smb2: remove xiaomi's typeC try.snk implementation

 * Qualcomm introduced a SW implementation of try.SNK and enabled by default.

Change-Id: Ib3faf2f283e90974399b2d26302f5eac3a37509c

4 years agopower: ignore IRQs while system is suspended
Demon Singur [Wed, 16 May 2018 15:49:37 +0000 (15:49 +0000)]
power: ignore IRQs while system is suspended

There's no reason to handle IRQs for SoC changes while system is
suspended.

Change-Id: I0dee8baa49addb808b3d6d5a2d467b48a405df9e

4 years agopower: add charging current limitting
Demon Singur [Sat, 24 Mar 2018 17:27:51 +0000 (17:27 +0000)]
power: add charging current limitting

Charging at 3200mA while using the phone makes it quite hot.
Decrease the charging current to ~1600mA to prevent bad user
experience and complaints.

After 90 seconds with screen on, vote USB ICL to lower current
to 1600mA.
After 5 seconds with screen off, unvote USB ICL so the current
goes back to 3200mA.

Also, add compatibility with stock hvdcp service that writes to
the system_temp_level property to trigger thermal throttling.

Values taken from MIUI kernel, rewritten to look better and avoid
locking in framebuffer notifiers.

Change-Id: Iedf2789304356221283472ba242211d3ea6256d8

4 years agopower: import xiaomi changes
Demon Singur [Wed, 7 Feb 2018 15:34:41 +0000 (15:34 +0000)]
power: import xiaomi changes

* import voltage limits
* enable try sink mode
* wait more for typec detection
* do device wakeup before smb probe logic

Change-Id: I3dfd28cd005c03e7001fa51fe1df332e4d330236

4 years agoof_batterydata: add fallback to generic node
dianlujitao [Sat, 22 Sep 2018 12:02:56 +0000 (20:02 +0800)]
of_batterydata: add fallback to generic node

Change-Id: Ic8b1c163a20a787e3d485a8ec27eebb6b0c25d32

4 years agonfc: import xiaomi sagit-p-oss changes
wloot [Fri, 12 Jul 2019 17:08:43 +0000 (01:08 +0800)]
nfc: import xiaomi sagit-p-oss changes

Change-Id: Ib320f9d088e7be28ef0986d88071256dd80fd2e4

4 years agogoodix_ta: respect capacitive keys state
dianlujitao [Fri, 2 Feb 2018 09:31:04 +0000 (17:31 +0800)]
goodix_ta: respect capacitive keys state

 * Only report key event when capacitive keys enabled

Change-Id: Id30ba1fd7a589b2fce7bd3d2f433a6b1d756b37d

4 years agogoodix_ta: boost fingerprint hal priority when screen is off
Demon Singur [Fri, 4 May 2018 15:29:57 +0000 (15:29 +0000)]
goodix_ta: boost fingerprint hal priority when screen is off

Give fingerprint hal the priority -1 when the screen is off to
speed up fingerprint processing, and then reset its priority back to
normal when the screen is on.

Change-Id: I0e144fdfcef8c96478593a4396a51a431af83989

4 years agogoodix_ta: clean up everything
Demon Singur [Thu, 22 Mar 2018 20:22:47 +0000 (20:22 +0000)]
goodix_ta: clean up everything

 * get rid of spi bus support, we only need platform bus
 * move fingerprint detection wakelock time to a define
 * do not dynamically allocate minors, there's only one
   minor needed, 0
 * move wakelock declaration to gf_dev
 * merge enable/disable irq methods
 * remove spi clk control
 * remove nav event support
 * remove unused input events
 * remove unused ioctls
 * remove ioctl type checking, copy_from/to_user already
   handles this
 * remove fasync support
 * move netlink message sending out of notifier, inside
   dedicated worker
 * register platform_driver directly
 * move event handling to a high priority worker
 * do not use conflicting names for struct and instance of it

Change-Id: Iac4951f65d533befe1362a718ce4ce8773d7973c

4 years agofpc1268: respect capacitive keys state
dianlujitao [Fri, 2 Feb 2018 10:59:59 +0000 (18:59 +0800)]
fpc1268: respect capacitive keys state

 * Implement a key handler with the simple purpose of filtering
   the key events sent by the fingerprint HAL.
 * Only report key event when capacitive keys enabled.
 * Input handler taken from bgcngm's implementation for Xiaomi msm8996.

Change-Id: I091eb514fee291b7625193496c217c0b966fa518

4 years agofingerprint: add fpc1020_tee and goodix_ta drivers
Demon000 [Fri, 10 Nov 2017 17:19:29 +0000 (19:19 +0200)]
fingerprint: add fpc1020_tee and goodix_ta drivers

Change-Id: Iebb57cea163fdd93824d884bfe8e5f95894fcc18
Signed-off-by: Volodymyr Zhdanov <wight554@gmail.com>
4 years agosynaptics_dsx_force: export capacitive keys state
dianlujitao [Fri, 2 Feb 2018 09:21:25 +0000 (17:21 +0800)]
synaptics_dsx_force: export capacitive keys state

Change-Id: I9d92311d52dc170dd5b2a9770072a57eff038f2c

4 years agosynaptics_dsx_force: do not reinit the device upon suspend/resume
Xiaonian Wang [Fri, 15 Apr 2016 11:34:12 +0000 (19:34 +0800)]
synaptics_dsx_force: do not reinit the device upon suspend/resume

There is no need to reinit the device when suspend, resume or even an
spontaneous reset is detected, touch will recover by itself.

CRs-Fixed: 1003951
Change-Id: Ifb5b134d0fbeb2f55f16af8806abb9c8e51c35e0

4 years agosynaptics_dsx_force: do not spam dmesg for button presses
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

4 years agosynaptics_dsx_force: guard test reporting
Demon Singur [Sat, 31 Mar 2018 10:56:42 +0000 (10:56 +0000)]
synaptics_dsx_force: guard test reporting

Change-Id: I4cae16efcae5d1fa7aa1b1a6f7851e4fe9200edd

4 years agosynaptics_dsx_force: symlink input device to /proc/touchpanel
Demon000 [Sun, 12 Feb 2017 21:23:11 +0000 (23:23 +0200)]
synaptics_dsx_force: symlink input device to /proc/touchpanel

Change-Id: I5bf1291aa22b889522585a3faeab5f96ff6612e2

4 years agosynaptics_dsx_force: allow reversing back and menu keys
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

4 years agosynaptics_dsx_force: check if buttons are enabled before reporting touch event
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

4 years agosynpatics_dsx_force: alias sysfs nodes
Demon000 [Thu, 16 Nov 2017 19:37:33 +0000 (21:37 +0200)]
synpatics_dsx_force: alias sysfs nodes

Change-Id: I79cd5267da895e2f8535e73fd13bf7691897eb74

4 years agotouchscreen: import synaptics_dsx_force driver
Demon000 [Fri, 10 Nov 2017 17:26:10 +0000 (19:26 +0200)]
touchscreen: import synaptics_dsx_force driver

Change-Id: Ib7bc0dd2cda6e68ce6739153406afe6081ca0476

4 years agoclk: mdss: silence slave PLL unavailable message
Demon000 [Sun, 12 Nov 2017 17:02:23 +0000 (19:02 +0200)]
clk: mdss: silence slave PLL unavailable message

Change-Id: Ife6dc30ef6e498915af38661c4c8450363cf7a04

4 years agomdss: add hooks for touchscreen
Demon000 [Sun, 12 Nov 2017 09:22:07 +0000 (11:22 +0200)]
mdss: add hooks for touchscreen

Change-Id: I9b840a18e2443975bf90c0332cfc2fec5e022fbc

4 years agoqpnp-wled: disable ovp irq after handling
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

4 years agoqpnp-wled: add 600kHz freq
Demon000 [Fri, 10 Nov 2017 18:18:07 +0000 (20:18 +0200)]
qpnp-wled: add 600kHz freq

Change-Id: I35be564e7e2b84dd01bafe74355672ebb47024a6

4 years agorc: import peelir driver
Demon000 [Sat, 11 Nov 2017 20:26:46 +0000 (22:26 +0200)]
rc: import peelir driver

Change-Id: I658e2787245d8588502a4464b6cb2ee44170c83e

4 years agoarm64: add functions to get the hw version
Demon000 [Sun, 12 Nov 2017 09:54:42 +0000 (11:54 +0200)]
arm64: add functions to get the hw version

Change-Id: I71142017007b10c3e0c67832a4d4736f4caf3b2f

4 years agodts: xiaomi: msm8998: mount cust partition as /vendor
Demon Singur [Fri, 22 Jun 2018 16:52:49 +0000 (16:52 +0000)]
dts: xiaomi: msm8998: mount cust partition as /vendor

Change-Id: Ib18364354e7d6ac58c4d89e81cdf6859a31e68b5

4 years agodts: xiaomi: msm8998: enable soc linearization
Demon Singur [Fri, 1 Jun 2018 07:41:29 +0000 (07:41 +0000)]
dts: xiaomi: msm8998: enable soc linearization

Change-Id: I11e338d903af802e7dc14979d24c896a9afd90a5

4 years agodts: xiaomi: msm8998: disable wled auto calibration
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

4 years agodts: xiaomi: msm8998: limit led current
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

4 years agodts: xiaomi: msm8998: rewrite notification led configuration
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

4 years agodts: xiaomi: msm8998: add ramoops memory regions
Demon000 [Sun, 19 Nov 2017 20:43:36 +0000 (22:43 +0200)]
dts: xiaomi: msm8998: add ramoops memory regions

Change-Id: I6c7f2e1545251857d83ccd7783f647dee2412c97

4 years agodts: xiaomi: msm8998: cleanup panel properties
Demon [Tue, 28 Nov 2017 06:46:47 +0000 (06:46 +0000)]
dts: xiaomi: msm8998: cleanup panel properties

Change-Id: I3b11f67e7ff195a70984ffb160b9b3305f36ef72

4 years agodts: xiaomi: msm8998: update chiron batterydata
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

4 years agodts: qcom: add xiaomi msm8998 support
Demon000 [Sat, 11 Nov 2017 19:52:30 +0000 (21:52 +0200)]
dts: qcom: add xiaomi msm8998 support

Change-Id: I6466699830f0ff060c65ad4c9fa7683bcaa20cae

4 years agoplatform: add xiaomi board selection
Demon000 [Sat, 11 Nov 2017 16:43:15 +0000 (18:43 +0200)]
platform: add xiaomi board selection

Change-Id: Ied4baa79fe62cb1ee5c671de8ca69402050e884c

4 years agoRevert "Android.bp: Initial header export bp for Android (qseecom only)"
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

4 years agomsm: ipa3: Return if RT table size is 0
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>
4 years agoadd toggle for disabling newly added USB devices
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>
4 years agosched: hmp: Reduce number of load reports in a window
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>
4 years agosched: cpufreq: HMP load reporting changes
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>
4 years agocore_ctl: Consider high irq loaded CPU as busy
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>
4 years agoFROMLIST: arm64: Build vDSO with -ffixed-x18
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
4 years agoANDROID: clock_gettime(CLOCK_BOOTTIME,) slows down >20x
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

4 years agoFROMLIST: arm64: vdso32: Use full path to Clang instead of relying on PATH
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

4 years agoANDROID: arm64: vdso32: fix CC=clang build
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

4 years agoANDROID: CROSS_COMPILE_ARM32 must work if CONFIG_COMPAT_VDSO
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

4 years agoFROMLIST: BACKPORT: [PATCH 6/6] arm64: Wire up and expose the new compat vDSO
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

4 years agoFROMLIST: BACKPORT: [PATCH 5/6] arm64: compat: 32-bit vDSO setup
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

4 years agoFROMLIST: [PATCH 4/6] arm64: compat: Add a 32-bit vDSO
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

4 years agoFROMLIST: [PATCH 3/6] arm64: Refactor vDSO init/setup
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

4 years agoFROMLIST: [PATCH 2/6] arm64: elf: Set AT_SYSINFO_EHDR in compat processes
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

4 years agoFROMLIST: [PATCH 1/6] arm64: compat: Use vDSO sigreturn trampolines if available
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

4 years agoFROMLIST: lib: vdso: add support for time
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

4 years agoFROMLIST: [PATCH] arm64: compat: Expose offset to registers in sigframes
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

4 years agoFROMLIST: [PATCH v5 12/12] lib: vdso: do not expose gettimeofday, if no arch supporte...
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

4 years agoFROMLIST: [PATCH v5 11/12] lib: vdso: Add support for CLOCK_BOOTTIME
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

4 years agoFROMLIST: [PATCH v5 10/12] arm64: vdso: replace gettimeofday.S with global vgettimeof...
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

4 years agoFROMLIST: [PATCH v5 09/12] arm: vdso: move vgettimeofday.c to lib/vdso/
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

4 years agoFROMLIST: [PATCH v5 08/12] arm: vdso: Add ARCH_CLOCK_FIXED_MASK
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

4 years agoFROMLIST: [PATCH v5 07/12] arm: vdso: disable profiling
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

4 years agoFROMLIST: [PATCH v5 06/12] arm: vdso: add support for clock_getres
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

4 years agoFROMLIST: [PATCH v6 05/12] arm: vdso: Add support for CLOCK_MONOTONIC_RAW
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

4 years agoFROMLIST: [PATCH v5 04/12] arm: vdso: do calculations outside reader loops
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