Restore original wheel index calculation for GKI builds.
Change-Id: Ia1afd393e1e33e6c1038159b0bf920775103cb92
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
The speculative page fault path does not sync the
rss in task_struct to mm_struct leading to large
variance in the RSS values observed by userspace
tools and also in the OOM task dump.
Change-Id: Id45f1b9b0a51a9afffbaf8e65f5ef747d409d0d7
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Libabigail learned to accept 'symbol_list' as a valid suffix for symbol
list sections. Hence make use of it consistently.
Bug: 162536543
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I1454b0068769c9e57a533dafb6267e63adb7ceb0
Release qmi handle after server exit which will help
cnss2 driver to bail out pending qmi transactions gracefully.
QMI server calls server exit whenever a client tries to
release qmi handle and calls server arrive whenever a
client tries to register for service and service is up.
This change also ensures the next server arrive is processed
only when earlier server exit has been processed successfully.
Change-Id: Ia3332694c769731a36bfdb6d7136a3115f5159e4
Signed-off-by: Sandeep Singh <sandsing@codeaurora.org>
Some USB host PCs switch the downstream port mode from
CDP to SDP if the device does not pull DP up within certain
duration (~2s).
This limits the current drawn by the device to 500mA(or 900mA)
as opposed to the possible 1.5A resulting in slow charging of
the battery.
Fix this by driving a DP pulse when there is a connect
notification from PMIC and detected the charger type as CDP.
The ser current call also leads to the same failure, hence
limit the set current call only to the case where the device
is connected to a Standard Downstream Port.
Change-Id: I2c737c68de57bc4126fb3e6e1c291b83d681fb13
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
Array index of memblock and the client_id of memshare clients
confused usage can cause issue. Correct the usage by properly
defining variable names.
Change-Id: I29a0c6a01d63e92774e11fd258d018c03769ca50
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
There have been situations where the remote boots up far enough to
establish glink communication to other remote processors but not far
enough that APPS recognizes that the remote proc has been brought
out of reset.
The remote procs that have established connection with the
"boot failed" remote proc will crash from having a stale state once the
"boot failed" remote proc is restarted.
Send a cleanup message on powerup failure so remote procs can cleanup
their state with the remote proc that failed to start.
Change-Id: If6fae349bb5f45fb544275a4ba2320d5f12fe4fc
Signed-off-by: Chris Lew <clew@codeaurora.org>
Link needs to be in L0 before Gen switching is performed. Programming
target link speed to HW does not take effect in L0s. After disabling
L0s perform a EP config read if the link is in L0s in order to bring
the link to L0 for Gen speed switch.
Change-Id: Iabe790b90b1da0421c2d59a7f2e053e5e8fe77c9
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Currently, when an ADC7 channel is read, there is a wait time of
10 ms where an EOC (end of conversion) interrupt should happen
thereby completing the wait for ADC conversion. However, if this
wait times out, it is not handled and stale data can be read. Add
error logs to print when this wait times out as well as if EOC
bit is not set and return an error.
Also, this 10 ms wait time for EOC after requesting for a channel
conversion is not sufficient. As per the hardware recommendation
when multiple subsystems requests PMIC HW arbiter to read same
or different channels on different PMICs simultaneously, it could
take 15 ms for a good case i.e. where all the conversion requests
went through successfully. However, for a worst case where this
conversion request times out, it could take up to 500 ms before
an EOC interrupt is sent by PBS to SW. Hence, increase conversion
wait time to 501 ms so that no other channel reads can be made in
the worst case. Also print a warning when the wait time for EOC
is more than 15 ms.
Change-Id: I69eeade3e85f740af10cd7a3d668e67f67f6617d
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
If L0s link state is enabled, API to disallow L1 also needs
to poll for L0s while checking for L0. It is possible that
link goes to L0s from L0 by the time LTSSM state is checked
again.
Change-Id: Ib614860dad8c92a55f993cdb1c38bf8ebfca17a2
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
updating runtime bytes trasferred and available with time stamp
copied total is not needed.
Change-Id: I4eebf3eb98c61523d8f872427be29f8ed351c285
Signed-off-by: Akhil Karuturi <akarutur@codeaurora.org>
Modify fsa4480 driver to enable AATC on holi.
Switch to iio apis instead of powersupply apis.
Change-Id: Ie8ac623f2a0b3bf54caed5c7e77160221b6b20b6
Signed-off-by: Vangala, Amarnath <avangala@codeaurora.org>
Currently, we call dma_buf_map_attachment() with dma direction
DMA_TO_DEVICE and DMA_FROM_DEVICE while calling
dma_buf_unmap_attachment(). A mismatch of DMA direction during map,
unmap or sync of a buffer triggers a warning when CONFIG_DMA_API_DEBUG
is enabled like the below one:
[6.994847] WARNING: CPU: 7 PID: 785 at /buildbot/src/partner-android/r-dev-msm-4.14/private/msm-google/lib/dma-debug.c:1153 check_unmap+0x664/0xd3c
[6.994852] Kernel panic - not syncing: panic_on_warn set ...
[6.994852]
[6.994859] CPU: 7 PID: 785 Comm: android.hardwar Tainted: G S O 4.14.117-g3254dd9dae41-ab6213388 #1
[6.994862] Hardware name: Qualcomm Technologies, Inc.
[6.994866] Call trace:
[6.994873] dump_backtrace+0x0/0x1f0
[6.994877] show_stack+0x14/0x1c
[6.994883] dump_stack+0xa8/0xe0
[6.994887] panic+0x1ac/0x3a4
[6.994890] __stack_chk_fail+0x0/0x18
[6.994893] report_bug+0x148/0x184
[6.994896] bug_handler+0x28/0x84
[6.994899] brk_handler+0x80/0x13c
[6.994902] do_debug_exception+0xc4/0x14c
[6.994905] el1_dbg+0x18/0x74
[6.994907] check_unmap+0x664/0xd3c
[6.994911] debug_dma_unmap_sg+0x8c/0x160
[6.994916] ion_unmap_dma_buf+0x1f4/0x270
[6.994920] dma_buf_unmap_attachment+0x24/0x38
[6.994925] kgsl_destroy_ion+0xa8/0xd0
[6.994928] kgsl_mem_entry_destroy+0x8c/0x14c
[6.994932] kgsl_ioctl_gpuobj_free+0x388/0x420
[6.994936] kgsl_ioctl_helper+0x118/0x148
[6.994939] kgsl_ioctl+0x30/0xbc
[6.994942] do_vfs_ioctl+0x5cc/0x910
[6.994945] SyS_ioctl+0x88/0x94
[6.994948] el0_svc_naked+0x34/0x38
We can fix these warnings by using a consistent DMA direction during
map, unmap and sync which is DMA_BIDIRECTIONAL because GPU may read
or write from this buffer.
Change-Id: I3f9c7c27418e5e7d0db44761fa68d27560aa8aaf
Signed-off-by: Akhil P Oommen <akhilpo@codeaurora.org>
Currently __set_oom_adj loops through all processes in the system to
keep oom_score_adj and oom_score_adj_min in sync between processes
sharing their mm. This is done for any task with more that one mm_users,
which includes processes with multiple threads (sharing mm and signals).
However for such processes the loop is unnecessary because their signal
structure is shared as well.
Android updates oom_score_adj whenever a tasks changes its role
(background/foreground/...) or binds to/unbinds from a service, making
it more/less important. Such operation can happen frequently.
We noticed that updates to oom_score_adj became more expensive and after
further investigation found out that the patch mentioned in "Fixes"
introduced a regression. Using Pixel 4 with a typical Android workload,
write time to oom_score_adj increased from ~3.57us to ~362us. Moreover
this regression linearly depends on the number of multi-threaded
processes running on the system.
Mark the mm with a new MMF_MULTIPROCESS flag bit when task is created with
(CLONE_VM && !CLONE_THREAD && !CLONE_VFORK). Change __set_oom_adj to use
MMF_MULTIPROCESS instead of mm_users to decide whether oom_score_adj
update should be synchronized between multiple processes. To prevent
races between clone() and __set_oom_adj(), when oom_score_adj of the
process being cloned might be modified from userspace, we use
oom_adj_mutex. Its scope is changed to global. The combination of
(CLONE_VM && !CLONE_THREAD) is rarely used except for the case of vfork().
To prevent performance regressions of vfork(), we skip taking oom_adj_mutex
and setting MMF_MULTIPROCESS when CLONE_VFORK is specified. Clearing the
MMF_MULTIPROCESS flag (when the last process sharing the mm exits) is left
out of this patch to keep it simple and because it is believed that this
threading model is rare. Should there ever be a need for optimizing that
case as well, it can be done by hooking into the exit path, likely
following the mm_update_next_owner pattern.
With the combination of (CLONE_VM && !CLONE_THREAD && !CLONE_VFORK) being
quite rare, the regression is gone after the change is applied.
Fixes: 44a70adec9 ("mm, oom_adj: make sure processes sharing mm have same view of oom_score_adj")
Reported-by: Tim Murray <timmurray@google.com>
Debugged-by: Minchan Kim <minchan@kernel.org>
Suggested-by: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Bug: 168521639
Link: https://lore.kernel.org/linux-fsdevel/20200902012558.2335613-1-surenb@google.com/
[isaacm: upstream bound, no cherry-pick info because patch is in mm tree]
Change-Id: I20352a77815fbc358c36e686bb1503fdeea658ed
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Git-commit: 40f057fb2d
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This change propagates the missing fixes in synatics dsx touch
driver from msm-4.19 to msm-5.4.
Change-Id: Idbddf9c7fc8ebccdfde1b753fef36a8ce5d74e18
Signed-off-by: Ravikanth Tuniki <rtunik@codeaurora.org>
Along with client id, client domain info is also required
by mmrm driver to identify & register clients accurately.
Change-Id: I516749c363474604b4b24f967c1068f8d48d90a7
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
Overwrite EA provided in device tree with
Moselle's EA if Moselle is attached.
CRs-Fixed: 2778447
Change-Id: I73b01c5f4eb62bbe7d726695737c4e30b8e97cbf
Signed-off-by: Satish Kodishala <skodisha@codeaurora.org>
-Change EA for HSP before getting LA based
on the soc type queried from BT power driver.
-By default, HSP's Slimbus EA is added in DTSI file.
Update HST's Slimbus slave EA address based on HST chip ver.
CRs-Fixed: 2667021
Change-Id: I49e06e2e43025797e6110bf55304c7b3f0616c8e
Signed-off-by: Satish Kodishala <skodisha@codeaurora.org>
With CFI enabled compiler replacing the reference to vm_mmap
passed to copy_to_user with a pointer to the CFI jump table
in the module itself. So use the __va_function API for
finding the proper address of vm_mmap.
Bug: 166220312
Suggested-by: Sami Tolvanen <samitolvanen@google.com>
Change-Id: Id5bd96cc9bfa1aa99f34bd4785792e0a4eeae5b1
Git-commit: 33752ec915fb9dcccfe3afe4c4df4e032a0d823f
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
We use non-canonical CFI jump tables with CONFIG_CFI_CLANG, which
means the compiler replaces function address references with the
address of the function's CFI jump table entry. This results in
__pa_symbol(function), for example, returning the physical address
of the jump table entry, which can lead to address space confusion
since the jump table itself points to a virtual address.
This change adds generic definitions for __pa/va_function, which
architectures that support CFI can override.
Bug: 166220312
Change-Id: If4a162de7854547d8437bf59be03eb6d16220832
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Git-commit: d509371db88a829fa13fbb066423b20fc4698845
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
The msm_performance driver provides an interface for voting
CPU frequency from the user space.
Change-Id: I93e1d5de4b33fba90aae5e86dfad80b6ad9111ed
Signed-off-by: Ashish Jain <ashjai@codeaurora.org>
Enable QGKI config for fsa4480 driver for holi,
to support Analog Audio over Type-C USB.
Change-Id: I7c5b215629b7981cb481b40387e59637aa81e6e9
Signed-off-by: Vangala, Amarnath <avangala@codeaurora.org>
This change enables synaptic dsx config for holi target.
Change-Id: Ia1e107658acf226a0b1d3331c5a2f5a93d1475b8
Signed-off-by: Ravikanth Tuniki <rtunik@codeaurora.org>
Observes below crash while accessing (use-after-free) lock member
of bfq data.
context#1 context#2
process_one_work()
kthread() blk_mq_run_work_fn()
worker_thread() ->__blk_mq_run_hw_queue()
process_one_work() ->blk_mq_sched_dispatch_requests()
__blk_release_queue() ->blk_mq_do_dispatch_sched()
->__elevator_exit()
->blk_mq_exit_sched()
->exit_sched()
->kfree()
->bfq_dispatch_request()
->spin_unlock_irq(&bfqd->lock)
This is because of the kblockd delayed work that might got scheduled
around blk_release_queue() and accessed use-after-free member of
bfq_data.
240.212359: <2> Unable to handle kernel paging request at
virtual address ffffffee2e33ad70
...
240.212637: <2> Workqueue: kblockd blk_mq_run_work_fn
240.212649: <2> pstate: 00c00085 (nzcv daIf +PAN +UAO)
240.212666: <2> pc : queued_spin_lock_slowpath+0x10c/0x2e0
240.212677: <2> lr : queued_spin_lock_slowpath+0x84/0x2e0
...
Call trace:
240.212865: <2> queued_spin_lock_slowpath+0x10c/0x2e0
240.212876: <2> do_raw_spin_lock+0xf0/0xf4
240.212890: <2> _raw_spin_lock_irq+0x74/0x94
240.212906: <2> bfq_dispatch_request+0x4c/0xd60
240.212918: <2> blk_mq_do_dispatch_sched+0xe0/0x1f0
240.212927: <2> blk_mq_sched_dispatch_requests+0x130/0x194
240.212940: <2> __blk_mq_run_hw_queue+0x100/0x158
240.212950: <2> blk_mq_run_work_fn+0x1c/0x28
240.212963: <2> process_one_work+0x280/0x460
240.212973: <2> worker_thread+0x27c/0x4dc
240.212986: <2> kthread+0x160/0x170
Fix this by cancelling the delayed work if any before elevator exits.
Change-Id: If015576983e328aa726bac90a7a8de824d6532f0
Signed-off-by: Pradeep P V K <ppvk@codeaurora.org>
Added support for PMU counters for collection of
instructions and cycles events.
Change-Id: Id170177f3e3651fd2fa0eac3ebf1ee7bd08458df
Signed-off-by: richagar <richagar@codeaurora.org>