From cdc2e178646aa2429c8d67eb34a2b23cb0292696 Mon Sep 17 00:00:00 2001 From: TripNRaVeR Date: Wed, 1 Nov 2017 01:53:08 +0100 Subject: [PATCH 1/7] tripndroid: iosched: improve performance (cherry picked from commit 6220496065a0cf6e6ff95e521fa431d88735ee92) (cherry picked from commit 6a8cdeb804b5667379a9c5a5af05ac3d13fdaa91) (cherry picked from commit d5310964cf4dbc533ab38b34fab2d5ed3ec03ef0) (cherry picked from commit c0923e0b70835befbe6b8d327956eac1d526f563) (cherry picked from commit 88ae6ae346d8c3aed0daf686ab180ecd444d4f10) (cherry picked from commit 113b511330dcf7aaffd531e94b762290c52ec2cf) (cherry picked from commit 4f7d333bdb8dcbcc2204c77ee4bfd36dced9ed39) --- block/tripndroid-iosched.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/block/tripndroid-iosched.c b/block/tripndroid-iosched.c index 54ac0fdefa248..c716735c17533 100644 --- a/block/tripndroid-iosched.c +++ b/block/tripndroid-iosched.c @@ -24,14 +24,13 @@ enum { ASYNC, SYNC }; -static const int sync_read_expire = 1 * HZ; /* max time before a sync read is submitted. */ -static const int sync_write_expire = 1 * HZ; /* max time before a sync write is submitted. */ -static const int async_read_expire = 2 * HZ; /* ditto for async, these limits are SOFT! */ -static const int async_write_expire = 2 * HZ; /* ditto for async, these limits are SOFT! */ +static const int sync_read_expire = HZ / 3; /* max time before a sync read is submitted. */ +static const int sync_write_expire = 2 * HZ; /* max time before a sync write is submitted. */ +static const int async_read_expire = HZ / 6; /* ditto for async, these limits are SOFT! */ +static const int async_write_expire = 4 * HZ; /* ditto for async, these limits are SOFT! */ static const int writes_starved = 1; /* max times reads can starve a write */ -static const int fifo_batch = 1; /* # of sequential requests treated as one - by the above parameters. For throughput. */ +static const int fifo_batch = 3; /* sequential requests treated as one, for throughput. */ struct tripndroid_data { @@ -92,20 +91,18 @@ static struct request *tripndroid_choose_expired_request(struct tripndroid_data { struct request *rq; - /* Asynchronous requests have priority over synchronous. - * Write requests have priority over read. */ - - rq = tripndroid_expired_request(td, ASYNC, WRITE); + /* synchronous priority over asynchronous, write priority over read. */ + rq = tripndroid_expired_request(td, SYNC, WRITE); if (rq) return rq; - rq = tripndroid_expired_request(td, ASYNC, READ); + rq = tripndroid_expired_request(td, SYNC, READ); if (rq) return rq; - rq = tripndroid_expired_request(td, SYNC, WRITE); + rq = tripndroid_expired_request(td, ASYNC, WRITE); if (rq) return rq; - rq = tripndroid_expired_request(td, SYNC, READ); + rq = tripndroid_expired_request(td, ASYNC, READ); if (rq) return rq; From ddbfff72db27fecad5dd168bb9a43e099e20e4b6 Mon Sep 17 00:00:00 2001 From: anupritaisno1 Date: Tue, 18 Dec 2018 13:26:33 +0000 Subject: [PATCH 2/7] tripndroid: set fifo_batch to 16 Signed-off-by: anupritaisno1 --- block/tripndroid-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/tripndroid-iosched.c b/block/tripndroid-iosched.c index c716735c17533..b23da3e67e3d5 100644 --- a/block/tripndroid-iosched.c +++ b/block/tripndroid-iosched.c @@ -30,7 +30,7 @@ static const int async_read_expire = HZ / 6; /* ditto for async, these limits static const int async_write_expire = 4 * HZ; /* ditto for async, these limits are SOFT! */ static const int writes_starved = 1; /* max times reads can starve a write */ -static const int fifo_batch = 3; /* sequential requests treated as one, for throughput. */ +static const int fifo_batch = 16; /* sequential requests treated as one, for throughput. */ struct tripndroid_data { From c8291ed494fa610d08abbe672137ecdd665f0d2d Mon Sep 17 00:00:00 2001 From: Archana Sriram Date: Wed, 4 Jan 2017 14:54:24 +0530 Subject: [PATCH 3/7] msm: kgsl: Increase GPU fault detection threshold value The current value is leading to spurious fault interrupts from the GPU. Increase the threshold so that hardware fault detection won't be triggered as quickly. CRs-Fixed: 1105559 Change-Id: I88cf7efc553f6bcb1026b7e86d4600490b36e332 Signed-off-by: Archana Sriram Signed-off-by: Srinivasarao P Signed-off-by: mydongistiny Signed-off-by: Joe Maples Signed-off-by: Shreyansh Lodha Signed-off-by: anupritaisno1 --- drivers/gpu/msm/adreno_a4xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/msm/adreno_a4xx.c b/drivers/gpu/msm/adreno_a4xx.c index 195e14e872d66..0fe8314def7cf 100644 --- a/drivers/gpu/msm/adreno_a4xx.c +++ b/drivers/gpu/msm/adreno_a4xx.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2015,2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -714,7 +714,7 @@ static void a4xx_start(struct adreno_device *adreno_dev) set_bit(ADRENO_DEVICE_HANG_INTR, &adreno_dev->priv); gpudev->irq->mask |= (1 << A4XX_INT_MISC_HANG_DETECT); kgsl_regwrite(device, A4XX_RBBM_INTERFACE_HANG_INT_CTL, - (1 << 30) | 0xFFFF); + (1 << 30) | 0x1FFFF); /* Set the GMEM/OCMEM base address for A4XX */ kgsl_regwrite(device, A4XX_RB_GMEM_BASE_ADDR, From 07c9800edb8250c5039171f555db44d21836a8d9 Mon Sep 17 00:00:00 2001 From: anarkia1976 Date: Sat, 24 Mar 2018 00:36:34 +0530 Subject: [PATCH 4/7] arm: dts: msm8994: Correct regulator timing Documentation describe slew-rate as "time in us it takes for the regulator to change votlage value in one step". 2s seems a lot and qpnp-lab-slew-rate is only 5000us. So correct it as if a 1000 factor was added. This reduce the kernel boot time of the karin windy Signed-off-by: Shreyansh Lodha Signed-off-by: anupritaisno1 --- arch/arm/boot/dts/qcom/msm-pmi8994.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/qcom/msm-pmi8994.dtsi b/arch/arm/boot/dts/qcom/msm-pmi8994.dtsi index 76dde833f6893..a6e857e63423e 100644 --- a/arch/arm/boot/dts/qcom/msm-pmi8994.dtsi +++ b/arch/arm/boot/dts/qcom/msm-pmi8994.dtsi @@ -521,7 +521,7 @@ qcom,qpnp-lab-min-voltage = <4600000>; qcom,qpnp-lab-step-size = <100000>; - qcom,qpnp-lab-slew-rate = <5000>; + qcom,qpnp-lab-slew-rate = <2000>; qcom,qpnp-lab-use-default-voltage; qcom,qpnp-lab-init-voltage = <5500000>; qcom,qpnp-lab-init-amoled-voltage = <4600000>; From f5269cd45acc204338be2db03c6e30f0f73cac04 Mon Sep 17 00:00:00 2001 From: Wang Han <416810799@qq.com> Date: Fri, 5 May 2017 07:09:53 -0700 Subject: [PATCH 5/7] power: Introduce Oneplus 3 fingerprintd thaw hack Taken from Oneplus 3, this hack will make fingerprintd recovery from suspend quickily. Signed-off-by: Shreyansh Lodha Signed-off-by: anupritaisno1 --- kernel/power/process.c | 20 ++++++++++++++++++++ kernel/power/suspend.c | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/kernel/power/process.c b/kernel/power/process.c index d1ccce3cfee8e..86109f36929cc 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -212,6 +212,26 @@ int freeze_kernel_threads(void) return error; } +void thaw_fingerprintd(void) +{ + struct task_struct *p; + + pm_freezing = false; + pm_nosig_freezing = false; + + read_lock(&tasklist_lock); + for_each_process(p) { + if (!memcmp(p->comm, "fingerprintd", 13)) { + __thaw_task(p); + break; + } + } + read_unlock(&tasklist_lock); + + pm_freezing = true; + pm_nosig_freezing = true; +} + void thaw_processes(void) { struct task_struct *g, *p; diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index c9821251d28ab..dcb10fe4804e5 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -48,6 +48,8 @@ static bool need_suspend_ops(suspend_state_t state) static DECLARE_WAIT_QUEUE_HEAD(suspend_freeze_wait_head); static bool suspend_freeze_wake; +extern void thaw_fingerprintd(void); + static void freeze_begin(void) { suspend_freeze_wake = false; @@ -252,6 +254,8 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) if (need_suspend_ops(state) && suspend_ops->wake) suspend_ops->wake(); + thaw_fingerprintd(); + dpm_resume_start(PMSG_RESUME); Platform_finish: From 2cd91c12df29f83f03d18311f7c88d54fb766411 Mon Sep 17 00:00:00 2001 From: Shreyansh Lodha Date: Sun, 30 Sep 2018 12:45:16 +0530 Subject: [PATCH 6/7] Update FP thaw and FP nice as per FP HAL Signed-off-by: Shreyansh Lodha Signed-off-by: anupritaisno1 --- drivers/input/misc/fpc1020_tee.c | 2 +- kernel/power/process.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/fpc1020_tee.c b/drivers/input/misc/fpc1020_tee.c index 26a929ef0b98c..513075bd48cd5 100755 --- a/drivers/input/misc/fpc1020_tee.c +++ b/drivers/input/misc/fpc1020_tee.c @@ -930,7 +930,7 @@ static void set_fingerprintd_nice(int nice) read_lock(&tasklist_lock); for_each_process(p) { - if (!memcmp(p->comm, "fingerprintd", 13)) { + if (!memcmp(p->comm, "fingerprint@2.0", 16) || !memcmp(p->comm, "fingerprintd", 13)) { set_user_nice(p, nice); break; } diff --git a/kernel/power/process.c b/kernel/power/process.c index 86109f36929cc..f7dcc2a55e86f 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -221,7 +221,7 @@ void thaw_fingerprintd(void) read_lock(&tasklist_lock); for_each_process(p) { - if (!memcmp(p->comm, "fingerprintd", 13)) { + if (!memcmp(p->comm, "fingerprint@2.0", 16) || !memcmp(p->comm, "fingerprintd", 13)) { __thaw_task(p); break; } From 250b7a2324c5b5698b5d9bd1f3b76825123af6aa Mon Sep 17 00:00:00 2001 From: jollaman999 Date: Sat, 24 Mar 2018 00:26:29 +0530 Subject: [PATCH 7/7] misc: fpc1020: Check low power state in fb notifier There is a low power state in the mdss. This mode is used when the device get an alarm and turn on the screen with black and white. If user enabled auto unlock screen feature, there will be a problem when mdss turn on the screen in low power state. The driver will not go into the resume state. So it must be check this low power state in fb notifier. Signed-off-by: Shreyansh Lodha Signed-off-by: anupritaisno1 --- drivers/input/misc/fpc1020_tee.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/input/misc/fpc1020_tee.c b/drivers/input/misc/fpc1020_tee.c index 513075bd48cd5..dc5f02d08d6a5 100755 --- a/drivers/input/misc/fpc1020_tee.c +++ b/drivers/input/misc/fpc1020_tee.c @@ -963,12 +963,16 @@ static int fb_notifier_callback(struct notifier_block *self, unsigned long event if (event != FB_EARLY_EVENT_BLANK) return 0; - if (*blank == FB_BLANK_UNBLANK) { - fpc1020->screen_state = 1; - queue_work(system_highpri_wq, &fpc1020->pm_work); - } else if (*blank == FB_BLANK_POWERDOWN) { - fpc1020->screen_state = 0; - queue_work(system_highpri_wq, &fpc1020->pm_work); + switch (*blank) { + case FB_BLANK_UNBLANK: + case FB_BLANK_VSYNC_SUSPEND: + fpc1020->screen_state = 1; + queue_work(system_highpri_wq, &fpc1020->pm_work); + break; + case FB_BLANK_POWERDOWN: + fpc1020->screen_state = 0; + queue_work(system_highpri_wq, &fpc1020->pm_work); + break; } return 0;