799800 Commits

Author SHA1 Message Date
YiHo Cheng
6f9748b14f
drivers: thermal: lmh_dcvs: Correct limits initial value
The lmh_dcvs limits initial value is U32_MAX which is unreasonable high.
Set initial limits value as cluster maximum frequency which is readable.

Bug: 130617766
Test: adb shell cat /sys/bus/platform/drivers/msm_lmh_dcvs/18*/lmh*

Change-Id: I3cff40fa70d51876f66f79c2936a37a02d9cbcf3
Signed-off-by: YiHo Cheng <yihocheng@google.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:31 +07:00
davidchao
7b9052f16f
thermal: core: Use high value to init low temp tracking thermal_zone
When the thermal_zone property is set to “tracks-low” we should init with
THERMAL_TEMP_INVALID_LOW (274000), not THERMAL_TEMP_INVALID (-274000).

Bug: 111683694
Test: Build and thermal mitigation works properly.
Change-Id: I2824809fdfb47c544d30fde6e4866c3ee4e7b25c
Signed-off-by: davidchao <davidchao@google.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:31 +07:00
Wei Wang
66349815cd
thermal: core: skip update disabled thermal zones after suspend
It is unnecessary to update disabled thermal zones post suspend and
sometimes leads error/warning in bad behaved thermal drivers.

Bug: 129435616
Change-Id: If5d3bfe84879779ec1ee024c0cf388ea3b4be2ea
Signed-off-by: Wei Wang <wvw@google.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:31 +07:00
George Lee
21506c6a13
Thermal: Added VIRT_COUNT_THRESHOLD to virtual sensor
VIRT_COUNT_THRESHOLD added to qti_virtual_sensor for combining multiple
sensors triggered condition.

Bug: 128625129
Change-Id: Ib0dcb753180f0cec72b1cc4e5c3b2b899abbb9ea
Signed-off-by: George Lee <geolee@google.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:30 +07:00
Manaf Meethalavalappu Pallikunhi
04d1f8d2fa
drivers: thermal: Ignore spurious BCL interrupts whenever BCL is in polling
Whenever BCL interrupt triggers, it notifies thermal framework.
The framework disables the BCL interrupt and initiates a passive
polling to monitor clear threshold. But BCL peripheral interrupts
are lazy IRQ disable in nature by default. Even if BCL has initiated
disable interrupt, there is a chance it may take some time to disable
in hardware. During this time hardware can trigger interrupt again.
But BCL driver assumes it as spurious interrupt and disables the
interrupt again which will cause permanent disablement of that
interrupt.

If BCL interrupt is triggering again post BCL interrupt
disable, just ignore that interrupt to avoid nested interrupt
disablement. From above scenario, BCL is already in polling mode,
ignoring this spurious interrupt doesn't cause any issue.

Bug: 118493676
Change-Id: Ia77fc66eaf66f97bacee96906cc6a5735a6ed158
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Signed-off-by: Wei Wang <wvw@google.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:30 +07:00
Miguel de Dios
73c5284a46
thermal: fix lockdep splat from qcom driver
The attribute dynamically allocated should be initialized
with sysfs_attr_init. Otherwise, lockdep slaps us.

Bug: 122096541
Bug: 123720375
Change-Id: I5f8aa327729fb51b955b148b7fb5dc0f85d3fbbb
Signed-off-by: Minchan Kim <minchan@google.com>
Signed-off-by: Miguel de Dios <migueldedios@google.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:30 +07:00
Wei Wang
dea0b48d06
drivers: arch_topology: wire up thermal limit for arch_scale_max_freq_capacity
before patch and "echo 50000 > /sys/class/thermal/tz-by-name/sdm-therm/emul_temp"
com.android.uibench.janktests.UiBenchJankTests#testInvalidateTree: PASSED (02m6.247s)
        gfx-avg-slow-ui-thread: 0.07110321338664297
        gfx-avg-missed-vsync: 0.0
        gfx-avg-high-input-latency: 74.25140826299423
        gfx-max-frame-time-50: 12
        gfx-min-total-frames: 2250
        gfx-avg-frame-time-99: 11.8
        gfx-avg-num-frame-deadline-missed: 1.6
        gfx-avg-frame-time-50: 9.6
        gfx-max-high-input-latency: 99.86666666666667
        gfx-avg-frame-time-90: 11.0
        gfx-avg-frame-time-95: 11.0
        gfx-max-frame-time-95: 13
        gfx-max-frame-time-90: 13
        gfx-max-slow-draw: 0.0
        gfx-max-frame-time-99: 13
        gfx-avg-slow-draw: 0.0
        gfx-max-total-frames: 2251
        gfx-avg-jank: 43.678000000000004
        gfx-max-slow-bitmap-uploads: 0.0
        gfx-max-missed-vsync: 0.0
        gfx-avg-total-frames: 2250
        gfx-max-jank: 96.67
        gfx-max-slow-ui-thread: 0.13333333333333333
        gfx-max-num-frame-deadline-missed: 3
        gfx-avg-slow-bitmap-uploads: 0.0

aefore patch and "echo 50000 > /sys/class/thermal/tz-by-name/sdm-therm/emul_temp"
google/perf/jank/UIBench/UIBench (1 Test)
----------------------------------------
[1/1] com.android.uibench.janktests.UiBenchJankTests#testInvalidateTree: PASSED (02m7.027s)
        gfx-avg-slow-ui-thread: 0.0
        gfx-avg-missed-vsync: 0.0
        gfx-avg-high-input-latency: 11.53777777777778
        gfx-max-frame-time-50: 7
        gfx-min-total-frames: 2250
        gfx-avg-frame-time-99: 8.0
        gfx-avg-num-frame-deadline-missed: 0.0
        gfx-avg-frame-time-50: 7.0
        gfx-max-high-input-latency: 41.15555555555556
        gfx-avg-frame-time-90: 7.2
        gfx-avg-frame-time-95: 7.8
        gfx-max-frame-time-95: 8
        gfx-max-frame-time-90: 8
        gfx-max-slow-draw: 0.0
        gfx-max-frame-time-99: 8
        gfx-avg-slow-draw: 0.0
        gfx-max-total-frames: 2250
        gfx-avg-jank: 0.0
        gfx-max-slow-bitmap-uploads: 0.0
        gfx-max-missed-vsync: 0.0
        gfx-avg-total-frames: 2250
        gfx-max-jank: 0.0
        gfx-max-slow-ui-thread: 0.0
        gfx-max-num-frame-deadline-missed: 0
        gfx-avg-slow-bitmap-uploads: 0.0

Bug: 143162654
Test: use emul_temp to change thermal condition and see capacity changed
Change-Id: Idbf943f9c831c288db40d820682583ade3bbf05e
Signed-off-by: Wei Wang <wvw@google.com>
(cherry picked from commit 1a1b85b536651daa3dc7dab4fcd155c8cfe1b9a0)
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:30 +07:00
Sultan Alsawaf
6361b50b4a
thermal: tsens: Fix exported function marked as static
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: Nauval Rizky <enuma.alrizky@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:30 +07:00
Julian Liu
7bfb73a864
thermal: Don't register for non-existing thermal zone
Signed-off-by: Julian Liu <wlootlxt123@gmail.com>
Signed-off-by: Nauval Rizky <enuma.alrizky@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:30 +07:00
Yaroslav Furman
ba961c1309
drivers: thermal_core: add sysfs nodes to silence mi_thermald
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:30 +07:00
azrim
3040d40e3a
[SQUASH] Drop current thermal implementation
Revert "drivers: thermal: limits-dcvs: Always build driver"

This reverts commit 04d77a1dabb861a1fc336f3d96cfb0bdaa19b7ac.

Revert "FROMLIST: thermal: make thermal_cooling_device_register accepts const string"

This reverts commit eecebe489a4fa25ec79ef84a7697cb508931f610.

Revert "drivers: thermal: lmh_dcvs: Correct limits initial value"

This reverts commit 1445cfc8152fd5ddf261acd06429fdd22eaba6e7.

Revert "thermal: core: Use high value to init low temp tracking thermal_zone"

This reverts commit 76c26384028935881db42c3a6418c69c84f81b51.

Revert "Thermal: Added VIRT_COUNT_THRESHOLD to virtual sensor"

This reverts commit 29a70471713e25c40b04a02dfce74a9a9c4da0b6.

Revert "thermal: fix lockdep splat from qcom driver"

This reverts commit b601a8d3477a167e74b1bd46c975f86ab1befe54.

Revert "drivers: thermal: Use platform mitigation for mithermal helper"

This reverts commit cf4a5702ea77837300bdef232ced2d5cc9ba232b.

Revert "Revert "thermal: core: Workaround for xiaomi thermal mitigation""

This reverts commit 9f3d735d89024483f6adc44f6f2d22a7bd2b8b95.

Revert "thermal: Don't register for non-existing thermal zone"

This reverts commit a54ab1729d1563c6ab638966a5d5571f64c4ac9a.

Revert "thermal: adc_tm: Remove HIGHPRI flag on workqueue"

This reverts commit e61d7f97a667748d0de2953fb312d937f1a1daa4.

Revert "arch_topology: Wire up thermal limit for arch_scale_max_freq_capacity"

This reverts commit 67fefd15de4c5baf1fb27678353ae8a6566cd912.

Revert "thermal: core: Skip update disabled thermal zones after suspend"

This reverts commit a9a4b482f43b1daa6bcc69e0fadcd5344fc16445.

Revert "thermal: cpu_cooling: Fix a throttling bug"

This reverts commit 9c9056f434f5a7d33ddc319819242901f60936f9.

Revert "thermal: core: Workaround for xiaomi thermal mitigation"

This reverts commit 58a67f0647e416e1ab8fc2731ae523db55b2e7e8.

Revert "thermal: core: Fix snprintf usage"

This reverts commit b5f8c5ae020936a2c7ab09cc4c20984e4691602d.

Revert "thermal: qcom: bcl: Return before thermal trip evaluates"

This reverts commit ef66548bf00599d6a40686ea6776cf7f01f3b768.

Revert "thermal: tsens: Comment out tsens_mtc_reset_history_counter"

This reverts commit ce62bc1f9a798321cb6658bbbe52fc4509edbaf1.

Revert "drivers: thermal: Don't qualify thermal polling as high priority"

This reverts commit ebc063413f9ec507a6c5ee6f52acdca945858cf9.

Revert "thermal: cpu_cooling: Simplify cpu_limits_set_level"

This reverts commit e4a675d89044858ea313bf6c1bcecb6401e8c5bf.

Revert "thermal: core: Use qcom drm notifier"

This reverts commit df79851c1789bbad5bd7f4f3cf7ff3cdaaba8252.

Revert "thermal: core: Import Xiaomi board_sensor and thermal message changes"

This reverts commit 9e53ddbe2075dc1d28dab5dfe1c59fcf9488de90.

Revert "thermal: core: Custom thermal limits handling"

This reverts commit 01054d5c600cdcc7d4f96e3134401714ab04874c.

Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:58:29 +07:00
azrim
be2d2172fb
configs: surya: Regenerate full defconfig 2022-04-26 14:57:18 +07:00
John Galt
bae84108a0
kernel: affine surfaceflinger to big cluster
oneplus did something similar in sched that was killed. There are often migrations occurring upon
interactions.

Signed-off-by: alanndz <alanndz7@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:56:18 +07:00
Panchajanya1999
281475b0ae
power: process: Use lesser time to enter sleep
Revise
803b0f827c

Signed-off-by: Panchajanya1999 <rsk52959@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:56:18 +07:00
myfluxi
d79806e11a
msm: kgsl: Report correct GPU frequency in sysfs
Change-Id: I1aac90d0554b9de0511ffb78042177a5a23855ce
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
Signed-off-by: atndko <z1281552865@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:56:17 +07:00
Park Ju Hyung
49feb90ede
drm/msm: use kmem_cache pool for struct vblank_work
These get allocated and freed millions of times on this kernel tree.

Use a dedicated kmem_cache pool and avoid costly dynamic memory allocations.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: Nauval Rizky <enuma.alrizky@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:56:17 +07:00
azrim
241a81ebcb
Revert "msm: adreno: Relax CPU latency requirements to save power"
This reverts commit 582b23590ceba71b1ed78982db6b880e1da0ee6c.

Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:45 +07:00
Park Ju Hyung
3a36008952
zram: use crc32c instead of jhash in dedup
crc32c is accelerated in arm64 and is faster than jhash.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Change-Id: Ic4040e5ee941dca61fbfa6ac3b0f8d9a5f22a3dc
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:45 +07:00
Cosmin Tanislav
9a640a495a
display: sde: do not pass around offset string
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:26 +07:00
Vaisakh Murali
4aac8ab4db
input/fp: goodix: Inline resume, suspend and cleanup functions
These functions are small and queried extensively, making them inlined
and static should speed up the function

[ghostrider-reborn]: Silence logging while we're at it

Signed-off-by: Vaisakh Murali <mvaisakh@statixos.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:26 +07:00
azrim
0ab970b946
msm: dsi-staging: Force enable ULPS
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:26 +07:00
Yaroslav Furman
62ef810a0b
msm: npu_dev: Initialize mutex_lock earlier
It's needed in npu_hw_info_init.
Warning is a bit dirty, idk why.

[    7.090579] ------------[ cut here ]------------
[    7.095339] WARNING: CPU: 6 PID: 1 at __mutex_lock_common+0xcc0/0x102c
[    7.096826] i2c_geni 884000.i2c: i2c error :-107
[    7.102045] CPU: 6 PID: 1 Comm: swapper/0 Tainted: G S      W       4.14.207-F1xy-Q-surya/6feb547eb0 #148
[    7.102046] Hardware name: Qualcomm Technologies, Inc. SDMMAGPIE PM6150 IDP (DT)
[    7.102049] task: 00000000a1ec88c7 task.stack: 00000000efa6f57d
[    7.106801] aw8624_i2c_read: i2c_read cnt=0 error=-107
[    7.116611] pc : __mutex_lock_common+0xcc0/0x102c
[    7.116613] lr : __mutex_lock_common+0xcc0/0x102c
[    7.116615] sp : ffffff801005b940 pstate : 60c00005
[    7.124400] aw8624_read_chipid  reg 24
[    7.130287] x29: ffffff801005b9a0 x28: ffffffdbf090f800
[    7.130290] x27: 0000000000000012 x26: 0000000000000002
[    7.135573] aw8624_read_chipid aw8624 detected
[    7.140398] x25: ffffff976fe6cf8c x24: 0000000000000000
[    7.140401] x23: 0000000000000000
[    7.150052] aw8624_haptic 3-005a: aw8624_i2c_probe: aw8624_read_chipid ret=0
[    7.150239] x22: ffffff976f3cc67c
[    7.154365] aw8624_interrupt_setup: reg SYSINT=0x0
[    7.159642] x21: 0000000000000000 x20: 0000000000000000
[    7.159645] x19: ffffffdbecfb4080 x18: ffffff977081a8d0
[    7.166825] genirq: irq_chip msmgpio-dc did not update eff. affinity mask of irq 259
[    7.213125] x17: ffffff977166d000 x16: 0000000000000001
[    7.218586] x15: ffffff97702c6d99 x14: 0000000000003739
[    7.224049] x13: 0000000000000004 x12: 00000000081cb39f
[    7.229512] x11: 0000000000000015 x10: ffffff97705a6d48
[    7.234973] x9 : f74f7dd9b21f2400 x8 : f74f7dd9b21f2400
[    7.240435] x7 : ffffff976eb2c544 x6 : 0000000000000000
[    7.245897] x5 : ffffff976eb2f0d8 x4 : ffffff976eb2c6f8
[    7.251359] x3 : ffffff976eb2be08 x2 : ffffff976eae9b04
[    7.256822] x1 : 0000000000000000 x0 : 0000000000000028
[    7.262285]
[    7.262285] PC: 0xffffff976fc6583c:
[    7.267388] 583c  97fff55d 17ffff38 12800e39 17ffff37 d4210000 17fffe30 97c8920c 34ff9f40
[    7.275797] 585c  f000d188 b94a7908 35ff9ee8 b0001520 910d1400 900011e1 9123c821 97bb14de
[    7.284198] 587c  d4210000 17fffcf0 91002276 aa1603e0 94000a20 f0004dda b943b748 340000a8
[    7.292595] 589c  91008260 12800001 97bad64f 340019c0 aa1303fb f8458f77 eb1b02ff 54001400
[    7.300995]
[    7.300995] LR: 0xffffff976fc6583c:
[    7.306096] 583c  97fff55d 17ffff38 12800e39 17ffff37 d4210000 17fffe30 97c8920c 34ff9f40
[    7.314504] 585c  f000d188 b94a7908 35ff9ee8 b0001520 910d1400 900011e1 9123c821 97bb14de
[    7.322902] 587c  d4210000 17fffcf0 91002276 aa1603e0 94000a20 f0004dda b943b748 340000a8
[    7.331300] 589c  91008260 12800001 97bad64f 340019c0 aa1303fb f8458f77 eb1b02ff 54001400
[    7.339699]
[    7.339699] SP: 0xffffff801005b900:
[    7.340283] aw8624_haptic_get_f0 t_f0_trace_ms:136
[    7.344800] b900  6fc6587c ffffff97 60c00005 00000000 ffffffc8 ffffff80 b21f2400 f74f7dd9
[    7.351282] aw8624->f0_calib_data=60
[    7.358218] b920  ffffffff ffffffff 6fc6587c ffffff97 1005b9a0 ffffff80 6fc6587c ffffff97
[    7.362196] aw8624_haptic_f0_calibration final trim_lra=0x3c
[    7.370297] b940  1005b960 ffffff80 6eb5ce38 ffffff97 00000028 00000000 6fc68208 ffffff97
[    7.378898] input: aw8624_haptic as /devices/platform/soc/884000.i2c/i2c-3/3-005a/input/input2
[    7.384505] b960  1005b990 ffffff80 6eae9bf0 ffffff97 aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
[    7.393448] aw8624_i2c_probe probe completed successfully!
[    7.401750]
[    7.401752] Call trace:
[    7.401754] __mutex_lock_common+0xcc0/0x102c
[    7.401756] mutex_lock_nested+0x24/0x2c
[    7.408320] i2c_geni a8c000.i2c: Bus frequency not specified, default to 400KHz.
[    7.408927] npu_enable_core_power+0x1c/0x258
[    7.409192] nq-nci 0-0028: nqx_probe: probing NFCC NQxxx exited successfully
[    7.411990] wl2866d_probe,enrty
[    7.415909] npu_probe+0x3ac/0xc0c
[    7.415915] platform_drv_probe+0x64/0xb8
[    7.415918] driver_probe_device+0x418/0x450
[    7.415920] __driver_attach+0xd0/0x108
[    7.420223] wl2866d_init: en_gpio is 1262
[    7.427538] bus_for_each_dev+0x88/0xd0
[    7.427540] driver_attach+0x20/0x28
[    7.427542] bus_add_driver+0x11c/0x1d8
[    7.427544] driver_register+0xa4/0xf0
[    7.427546] __platform_driver_register+0x40/0x48
[    7.433565] wl2866d_get_id:wl2866d id is 85
[    7.439247] npu_init+0x1c/0x44
[    7.439250] do_one_initcall+0x138/0x210
[    7.453560] wl2866d_print_reg:wl2866d info is reg 3, value 85
[    7.454476] kernel_init_freeable+0x1f8/0x288
[    7.458595] wl2866d_print_reg:wl2866d info is reg 4, value 85
[    7.462536] kernel_init+0x10/0x1f8
[    7.462540] ret_from_fork+0x10/0x18
[    7.462542] ---[ end trace bce58fa0c97bea72 ]---

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:26 +07:00
Tyler Nijmeh
994baac2fd
media: v4l: Use interruptible waits
Allow these tasks to be preempted in order to reduce latency.

Signed-off-by: Tyler Nijmeh <tylernij@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:26 +07:00
Park Ju Hyung
de3664c9ac
msm: camera: Use kmem_cache pool for struct sync_user_payload
These get allocated and freed millions of times on this kernel tree.

Use a dedicated kmem_cache pool and avoid costly dynamic memory allocations.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:25 +07:00
Park Ju Hyung
ee048b3737
msm: vidc: Use kmem_cache pool for struct msm_vidc_buffer
These get allocated and freed millions of times on this kernel tree.

Use a dedicated kmem_cache pool and avoid costly dynamic memory allocations.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:25 +07:00
Sultan Alsawaf
ea3f44576c
msm/sde/rotator: Remove unneeded PM QoS requests
When the rotator is actually used (still an unsolved question in
computer science), these PM QoS requests block some CPUs in the LITTLE
cluster from entering deep idle because the driver assumes that display
rotating work occurs on a hardcoded set of CPUs, which is false. We
already have the IRQ PM QoS machinery for display rendering operations
that actually matter, so this cruft is unneeded.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:25 +07:00
Anil Kumar Kanakanti
cb757e702d
msm: camera: cci: Fix logic to update cci clk freq
When multiple frequency slaves running on a same I2C bus,
then there is a chance of overriding I2C bus frequency
even if another I2C operation is running. This could lead
to CCI timeout at driver level. Updated synchronization logic,
to properly update I2C clock frequency, only when no other
I2C operation running.

CRs-Fixed: 2800250
Change-Id: Ia341d7cda118497bf1acea8ea59f7f03124f31c3
Signed-off-by: Anil Kumar Kanakanti <akanakan@codeaurora.org>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:25 +07:00
guocx4
c3db76993d
msm: camera: Fix out of memory issue
When initialize front sensor, allocating i2c_list failed sometimes
Then camera showed blank screen, so change kzalloc to kvzalloc to
ensure request memory success.

Change-Id: Ifcc5911c5a7eeb05641deed44edb4d96f4aa7e4b
Signed-off-by: guocx4 <guocx4@mt.com>
Reviewed-on: https://gerrit.mot.com/1300923
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jian Zhang <zhangjo@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:25 +07:00
a7301c
b484580a6f
Revert "msm: camera: eeprom: Fix OOB read/write in EEPROM"
This reverts commit 53a55fb72a89684035b6b5533943f8c1769f439d.
Which causes camera failed to launch.

Change-Id: I3ab3d41cbdb8d48945319adc17a06b9368646245
Signed-off-by: a7301c <a7301c@motorola.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:25 +07:00
a7301c
1da57ea806
Revert "msm: camera: eeprom: Fix OOB condition for memory map count"
This reverts commit b3fd77235fa23e048ca94bd1048876aa9b432030.
So that it can pick up:
8303c7e (CR) Revert "msm: camera: eeprom: Fix OOB read/write in EEPROM"

Change-Id: Ifa8cfe4fe6876420e2cdd2e702dcc2670cd66538
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:24 +07:00
chenglong1
127dff4f94
msm: camera: Fix EEPROM device handle leak.
When EEPROM read failed, the EEPROM device handle was created,
but not released. That will cause EEPROM device acquire be rejected
till phone reboot.

Change-Id: Ife5ea9b4866f33aee137a60328530a3b4c7cb08b
Signed-off-by: chenglong1 <chenglong1@mt.com>
Reviewed-on: https://gerrit.mot.com/1313487
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Long Cheng <chengl1@motorola.com>
Reviewed-by: Zilong Zhang <zhangzl7@mt.com>
Reviewed-by: Dawei Wang <wangdw10@motorola.com>
Reviewed-by: Chuanxin Guo <guocx4@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:24 +07:00
Chris Ye
42d78d3fb6
msm-camera: Enable initial skip for dual camera synchronization
For portrait mode with dual camera synchronization, enable initial skip
to make sure two sensors both start streaming with synchronization
signal.  This fixed the portrait mode switching stability issue.

Bug: 136756925
Change-Id: I2e6e8c463bffd04da441f3da3033e6596f30e72a
Signed-off-by: Chris Ye <lzye@google.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:24 +07:00
UtsavBalar1231
158bcde7fc
msm: vidc: Remove pm_qos usage
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: alk3pInjection <webmaster@raspii.tech>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:24 +07:00
Demon000
13df79bc1f
Revert "msm: vidc: Inline HAL_FLIP value with omx counterpart"
This break screenshot taking, by generating an image with
the wrong metadata.

The commit mentions that this patch inlines the available
image flip values with the OMX component, but the only
place I could find similar values defined are display HAL,
and they followed the old values.

enum struct DRMRotation {
  FLIP_H = 0x1,
  FLIP_V = 0x2,
  ROT_180 = FLIP_H | FLIP_V,
  ROT_90 = 0x4,
};

Bring back the old values to fix this.

This reverts commit 6601e4f5a2a2ce0040291b8ab2c9893e634a2e9f.

Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:24 +07:00
Park Ju Hyung
4f6a1ad205
msm: vidc: Avoid dynamic memory allocation for small voting data
Most voting data are rather small and can fit on the stack,
eliminating the need to allocate them dynamically. Reserve a
stack buffer for this purpose to avoid the overhead of dynamic
memory allocation.

Co-authored-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Vishalcj17 <vishalcj@aospa.co>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:24 +07:00
Vincent Palomares
16e7a86bce
msm:sde:rotator Async suspend/resume callbacks.
Make rotator suspend/resume callbacks asynchronous, improving
suspend/resume latency.

Bug: 134703102
Change-Id: I13b306478241369acec4d1e70392f66e7a10ced9
Signed-off-by: Vincent Palomares <paillon@google.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:23 +07:00
Sultan Alsawaf
6725661568
ASoC: dsp: amrwb_in: Fix AUDIO_GET_AMRWB_ENC_CONFIG ioctl
The non-blocking if-statement here causes the AUDIO_GET_AMRWB_ENC_CONFIG
ioctl to always return -EFAULT, even upon success. Fix it by correctly
guarding the -EFAULT return value.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:23 +07:00
Panchajanya1999
417551edae
techpack/codecs: aac: Hardcode max_bitrate to 384k
Our DSP is supposed to support this.

Change-Id: Ib93ee2ec1b0c1a2fd1269f64d5f133db65d1b4a0
Suggested-by: Steve Kondik <shade@chemlab.org>
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:23 +07:00
Panchajanya1999
c580d005af
techpack/audio: tas256x: Provide correct samplerates to switch cases
Seems like Texas guys made a mistake which went un-noticed.

Change-Id: Ibff21be4040a769ab3b6466a4619fa7f4daa0d71
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:23 +07:00
celtare21
bacc1c814d
techpack: audio: Remove pm_qos usage
Signed-off-by: celtare21 <celtare21@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:23 +07:00
Panchajanya1999
cc1e0becea
techpack/audio: sm6150: Remove pm_qos usage
Change-Id: I69e6010b20f895faf61951d97e9028c8909bada7
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:23 +07:00
Rick Yiu
752da5ea14
sched: use sysctl to control energy aware feature
Energy aware feature control is previously done through debugfs,
which will be deprecated, so move the control to sysctl.

Bug: 141333728
Test: function works as expected
Change-Id: I55411d3bb2669ba1fae3225d67cdf1cf8b3b3a7f
Signed-off-by: Rick Yiu <rickyiu@google.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:55:23 +07:00
Andrzej Perczak
759fa2eaf2
dts: sdmmagpie: Fixup ddr freqs for Xiaomi devices
Our sdmmagpie variant has different CPU freqs which should be reflected
in ddr configs. Most of these aren't harmful as frequencies will be
rounded up, however, it is not a case for max freq scenario.

This commit was made upon atoll and sm6150 configs.

Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:54:47 +07:00
Eric Dumazet
023c7cdcef
net: increase SOMAXCONN to 4096
SOMAXCONN is /proc/sys/net/core/somaxconn default value.

It has been defined as 128 more than 20 years ago.

Since it caps the listen() backlog values, the very small value has
caused numerous problems over the years, and many people had
to raise it on their hosts after beeing hit by problems.

Google has been using 1024 for at least 15 years, and we increased
this to 4096 after TCP listener rework has been completed, more than
4 years ago. We got no complain of this change breaking any
legacy application.

Many applications indeed setup a TCP listener with listen(fd, -1);
meaning they let the system select the backlog.

Raising SOMAXCONN lowers chance of the port being unavailable under
even small SYNFLOOD attack, and reduces possibilities of side channel
vulnerabilities.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Yue Cao <ycao009@ucr.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:54:47 +07:00
Maciej Żenczykowski
81092382f5
net-tcp: extend tcp_tw_reuse sysctl to enable loopback only optimization
This changes the /proc/sys/net/ipv4/tcp_tw_reuse from a boolean
to an integer.

It now takes the values 0, 1 and 2, where 0 and 1 behave as before,
while 2 enables timewait socket reuse only for sockets that we can
prove are loopback connections:
  ie. bound to 'lo' interface or where one of source or destination
  IPs is 127.0.0.0/8, ::ffff:127.0.0.0/104 or ::1.

This enables quicker reuse of ephemeral ports for loopback connections
- where tcp_tw_reuse is 100% safe from a protocol perspective
(this assumes no artificially induced packet loss on 'lo').

This also makes estblishing many loopback connections *much* faster
(allocating ports out of the first half of the ephemeral port range
is significantly faster, then allocating from the second half)

Without this change in a 32K ephemeral port space my sample program
(it just establishes and closes [::1]:ephemeral -> [::1]:server_port
connections in a tight loop) fails after 32765 connections in 24 seconds.
With it enabled 50000 connections only take 4.7 seconds.

This is particularly problematic for IPv6 where we only have one local
address and cannot play tricks with varying source IP from 127.0.0.0/8
pool.

Signed-off-by: Maciej Żenczykowski <maze@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Wei Wang <weiwan@google.com>
Change-Id: I0377961749979d0301b7b62871a32a4b34b654e1
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:54:47 +07:00
Eric Dumazet
72f63196e2
tcp: increase tcp_max_syn_backlog max value
tcp_max_syn_backlog default value depends on memory size
and TCP ehash size. Before this patch, the max value
was 2048 [1], which is considered too small nowadays.

Increase it to 4096 to match the recent SOMAXCONN change.

[1] This is with TCP ehash size being capped to 524288 buckets.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Yue Cao <ycao009@ucr.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:54:46 +07:00
Petri Gynther
d7d60fe052
defconfig: Simplify log buffer allocation
Switch to 1 MiB static log buffer in __log_buf[]:
  define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT)
  static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN);

instead of having the log buffer reallocated at boot by:
  setup_log_buf()
    log_buf_add_cpu()
      log_buf_len_update()
    new_log_buf = memblock_virt_alloc_nopanic()

There is no need to do this reallocation for the log buffer.

Signed-off-by: Petri Gynther <pgynther@google.com>
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:54:25 +07:00
Kuniyuki Iwashima
99bbec5617
BACKPORT: af_unix: Cut unix_validate_addr() out of unix_mkname().
unix_mkname() tests socket address length and family and does some
processing based on the address type.  It is called in the early stage,
and therefore some instructions are redundant and can end up in vain.

The address length/family tests are done twice in unix_bind().  Also, the
address type is rechecked later in unix_bind() and unix_find_other(), where
we can do the same processing.  Moreover, in the BSD address case, the hash
is set to 0 but never used and confusing.

This patch moves the address tests out of unix_mkname(), and the following
patches move the other part into appropriate places and remove
unix_mkname() finally.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[cyberknight777: backport to 4.14]
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:54:17 +07:00
Kuniyuki Iwashima
15c720d53f
BACKPORT: af_unix: Pass struct sock to unix_autobind().
We do not use struct socket in unix_autobind() and pass struct sock to
unix_bind_bsd() and unix_bind_abstract().  Let's pass it to unix_autobind()
as well.

Also, this patch fixes these errors by checkpatch.pl.

  ERROR: do not use assignment in if condition
  #1795: FILE: net/unix/af_unix.c:1795:
  +	if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr

  CHECK: Logical continuations should be on the previous line
  #1796: FILE: net/unix/af_unix.c:1796:
  +	if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr
  +	    && (err = unix_autobind(sock)) != 0)

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[cyberknight777: backport to 4.14]
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:54:17 +07:00
Kuniyuki Iwashima
22f18e1dff
BACKPORT: af_unix: Use offsetof() instead of sizeof().
The length of the AF_UNIX socket address contains an offset to the member
sun_path of struct sockaddr_un.

Currently, the preceding member is just sun_family, and its type is
sa_family_t and resolved to short.  Therefore, the offset is represented by
sizeof(short).  However, it is not clear and fragile to changes in struct
sockaddr_storage or sockaddr_un.

This commit makes it clear and robust by rewriting sizeof() with
offsetof().

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[cyberknight777: backport to 4.14]
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-04-26 14:54:17 +07:00