when camera_v4l2_close is called for one of the stream
and say backend is taking more time to delete the stream
and in between mediaserver crashes which call close camera
which lead to race condition. To avoid this added a lock
for close camera.
Change-Id: Idc4a72fd1d639619fafd3e2856d5bb502785c0bf
Signed-off-by: Manish Poddar <mpoddar@codeaurora.org>
During ADSP subsystem restart, all slimbus read/write would fail
as the bus is not available. Avoid codec read/write, until the
slimbus master in ADSP is up.
Change-Id: Iec1933d2625c1cd3dd700b2b3e2ffc7eae64880b
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
If page fault handler is triggered from within the same context
as ARM IOMMU driver, it can lead to deadlock due to improper
grabbing of mutexes.
This can be avoided if the page fault handler context is
immediately returned to ARM IOMMU driver after scheduling
work queue for triggering client specific fault handler
registered with CAM SMMU driver.
So, schedule tasklet for triggering page fault handler of all
registered clients.
Change-Id: I7fbe520f7e27c9a4f4917cd259f138c64ee76e78
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
A recent change in the ARM SMMU driver expects either a 0 or an
-EBUSY from any of the registered page fault handlers. Otherwise
it will assume the page fault unhandled and trigger a fatal crash.
So unless the various context bank page fault handlers are updated
to return either a 0 or an -EBUSY, each page fault will trigger a
fatal crash. This will make debugging the underlying problem
causing the page fault in the first place, more difficult.
So fix the page fault handler to return proper error code so that
ARM SMMU driver does not consider the page fault unhandled and the
device does not crash.
Change-Id: I1f1cab324d6ee89400cd7006758a906244368472
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
SW should not be registered for GSI_BREAK_POINT interrupt as
this is for debug purpose only
Change-Id: I17d152955bb52bccc89ff731eabe05582b7fd14c
Acked-by: Ady Abraham <adya@qti.qualcomm.com>
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
For each successful wsa read and write, we are printing the
values. Moving the print to debug.
Change-Id: I1b5c6b345b1d967d43f26bd9b1d4731d02ad021c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
zcache store can fail on lowmemory conditions.
Do not throw unnecessary prints on such events, causing
a stall.
Change-Id: I8fba6938f75ef5b6054ee079951b7409279e1c02
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
The following race is possible:
CPU 1 CPU2
zcache_store_page
zbud_alloc
zcache_evict_zpage
zpool = zhandle->zpool;
CRASH
zcache_store_page
zhandle->zpool = zpool
Fix this by properly initializing the zhandle and validating
in zcache_evict_zpage
Change-Id: I02328220b30f415fa1f171236eab3a2e40072fd9
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
MSM Cobalt TSENS can support upto 22 temperature
sensors across two controllers. Use explicity
the msmcobalt to specify changes to the controller
usage such as enabling health monitor check.
Change-Id: I6e0d600e9fe88cc2d835ad051eede4efcbee9563
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
MSM Cobalt TSENS supports upto 22 temperature
sensors across two TSENS controllers. Thermal
clients have the ability to set temperature
threshold and receive notification on a threshold
crossing.
Change-Id: I05d6f7cfceece6c27ef5d03b9ea3b77d409108db
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Currently, while updating the real time vote
there is a possibility that index will go beyond
the array size which will lead to buffer overflow.
This patch rectifies the index checking to avoid
possible buffer overflow.
Change-Id: I71fa3698eacdcb2933dc388ca8571bb6f952becc
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Define the OOB interrupt interfaces in case that internal
interrupt is unsupported in some platforms.
In some specific platform, only polling mode is supported, with
these OOB interrupt interfaces implementation, it will support
interrupt mode.
To be generic, this OOB feature is default unsupported.
Change-Id: I3b38e59bd7fdb441c85eb82a79cf9c951ca32130
CRs-Fixed: 937303
Signed-off-by: Kai Liu <kaliu@codeaurora.org>
Add support to modify the completion timeout range for
the root complex. This value/range will inform when
the root complex should send out a completion if the
endpoint does not respond.
Change-Id: Iabca3f637d9abf6c93810c84d81ff6b5c77d4528
Signed-off-by: Tony Truong <truong@codeaurora.org>
In some targets, explicitly turning on/off the regulator for WLAN
antenna switch is needed to enable/dsiable antenna sharing capacity.
Hence add the change to achieve this based on device tree option.
Change-Id: Ic04019cbe9c42bc92a65f308f56f307c52346d92
Signed-off-by: Yue Ma <yuem@codeaurora.org>
DCI packet header validation fails when there are multiple masks
enabled in the packet type. Change the validation from comparing
each individual mask to the bitwise OR of all packet types.
Change-Id: Ie0131646f49a93ec85bd1ae5e02b89639f0cfc2c
Signed-off-by: Chris Lew <clew@codeaurora.org>
While processing the diag stm mask stm state is set
incorrectly even though the ctrl packet is sent to peripheral
successfully.
Change-Id: I594f97ab824bf161b98fd5ac722ea96b985dbf9c
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Currently, the flash_led device for PMI8994/8996 has a step up
and step down ramp rate of 6.7uS. For PMI8996, reduce it to 27uS
as per the systems team recommendation.
CRs-Fixed: 948392
Change-Id: I787916470a2ce6dda079259f60eda3ea50f0fa17
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This reverts commit e37ff31b0476 ("soc: qcom: rpm-smd: Account for NOACK
messages during system sleep")'.
Change-Id: If35cd5fe6bc94510125b828af2b260cebd5fbcd7
Signed-off-by: Srinivas Rao L <lsrao@codeaurora.org>
Digital microphone clock drive strength setting in the codec could
be platform dependent based on the type of microphone, etc. Add support
to make the DMIC clock drive strength configurable through device tree.
CRs-fixed: 938006
Change-Id: I8b17d985052098b56d012081a77b6dfc94553eca
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
When clients are trying to send message while the worker thread is
processing existing messages, there is possibility that the message
queue can get corrupted. This can result into kernel crash. Fix to make
sure the message queue does not get corrupted.
CRs-fixed: 951194
Change-Id: I1eb5232d9d079ecc9d28b95737333c1198a8b20c
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Support thermal clients to read die temperature from the
temperature sensors. MSM Cobalt TSENS supports upto 22
temperature sensors across two TSENS controllers. Thermal
client has the ability to set temperature threshold and
receive notification on a threshold crossing.
Change-Id: I30ed627567643e014fae588f43c4f8945cf6165b
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
When a filesystem driver calls into makes a RPM request, RPM driver
makes a kzalloc request with GFP_KERNEL flag. This results in a deadlock
if a driver waiting on IO completion sends a RPM message.
Change memory allocation in the RPM driver to use GFP_NOFS.
Change-Id: Ic10b4d45ee9097c419d39b48b3aef6d3b41045e6
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Global pagetable entries are exclusively for IOMMU and per-process
pagetables. Move all the code out of the generic driver and into
the IOMMU driver and clean up a bunch of stuff along the way.
Change-Id: Ic0dedbadbb368bb2a289ba4393f729d7e6066a17
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
The setstate memory is a IOMMU specific construct. Move it to the
IOMMU code where it belongs.
Change-Id: Ic0dedbada977f2861f7c1300a5365da5b09d70a9
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
This enables assertion of QDSP6 I/O, memory wordline and compiler memory
clamps during MSS restart for MSM8996.
CRs-Fixed: 949533
Change-Id: Icae60cc08ec23104817394bd20e03d87740a0da8
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
Remove the HPD pin assignment for ADV7533 as it is connected
to GPIO on the Agave peripheral board.
Change-Id: Iccdbb1c6dece5cf8a60d0bc79b86a161b188184b
Signed-off-by: Siddharth Zaveri <szaveri@codeaurora.org>
Existing solution to reserve the memory region for CNSS ramdump
collection has it's own limitations because of reserving the
memory region for each platforms even before CNSS driver is
probed. Add implementation to allocate the required memory for
CNSS ramdump using dma_alloc_coherent API and update the physical
address in dump table so that tools can find the starting address
of the CNSS ramdump in the crash dump.
Change-Id: I9fb3d77fdd35de54ca2a7a27d4a55bd12049311f
Signed-off-by: Komal Seelam <kseelam@codeaurora.org>
CRs-Fixed: 957203
Prevent gdsc code from modifying the MDSS memory retention
and PERIPH ON and OFF bits on msm8996.
Change-Id: I020ab27336227a2ad8577ff882defa517bde8464
Signed-off-by: Ping Li <pingli@codeaurora.org>
Add snapshot of the batterydata-interface files from msm-3.10, this
is required for qpnp-vmbms module.
(msm-3.10 commit - 7704c94d47f8ed7cc81e487ab9d576ef52e0f1e5)
Change-Id: I322774879dec5856443c90280f7eb8b1b7f07798
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
A freemem list entry maybe truncated/deleted even if it doesn't
overlap with a new buffer, for example, if the new buffer is entirely
to the left or right of the entry. Fix the conditional logic so
that an entry may be truncated/deleted only if it overlaps with
the new buffer.
Change-Id: Ib1519f20d3b56c1e0ed36e9e0afb33c1b31d6166
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
For the case when newly allocated gpuaddr falls between
a memfree entry's gpuaddr and size, the size of the mem
entry was being truncated to a negative value. Fix
the math to reflect the truncated size correctly.
Change-Id: Id39519acc2af106240db8f41539b9fd1dc0cb0eb
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
All the mem entries were being written to a single location hence
the snapshot consisted of only the last mem entry of the process.
Fix this by writing each mem entry to consecutive location in the
snapshot.
Change-Id: I1971fc4b3adce3146768862a56db2b11c6ac44c4
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Update MSM8996 HS UART interrupt mapping as needed based on
GICv3 ITS changes.
Change-Id: I3cba4522249dab94b4d94b89880b4edcd1803f06
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
current avtimer ioctl uses deprecated logic to query
avtimer. Use the updated API to query avtimer to avoid
wrong timestamp values when query using ioctl interface.
Change-Id: I16e4373226903b6121c911ed9f2ca31851de80e5
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
There are extra EOT packages sent by r69006 panel, so its
output does not match what DSI host expects. Ignore EOT
in the end of transmission.
Change-Id: I50ac96dbc92ab0062f403af0ebbe052a966f0671
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
We call msm_iommu_bus_register only when legacy
msm iommu driver is enabled. If for some reason
the driver is disabled, we never register our
dummy bus msm_iommu_non_sec_bus_type. So, we might
end up with NULL pointer exception if clients try
to call iommu_present with this dummy bus.
Put a NULL pointer check to ensure we don't end
up crashing system if legacy driver is disabled.
Change-Id: I7122e3355459e5115d639a8c1aab547bf0fc7f6e
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
_gpu_find_svm() makes a BUG_ON if the returned address is
greater than ULONG_MAX.
But in 32bit kernel, Error conditions would also make the
comparison to be true. Because it compares address or
error in unit64_t with ULONG_MAX which is in 32bit.
Check whether returned address is an error before making the BUG_ON.
Change-Id: I482b330db3e06a1bee31dd6931faf239a61f9ab8
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
Disable the regulator vote on CX only if there is failure,
also check if the regulator handle is valid.
Change-Id: I8cbb8aad3c99d0a619dfeb2f68873c39316f0158
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
BUG: KASAN: global-out-of-bounds in dyna_alpha_pll_enable+0x1a8/0x450 at
addr ffffffc003412ee0
Read of size 8 by task surfaceflinger/548
page:ffffffba45a3cc60 count:1 mapcount:0 mapping: (null) index:0x0
flags: 0x400(reserved)
page dumped because: kasan: bad access detected
Address belongs to variable p_vco_8937+0x20/0x40
Call trace:
Memory state around the buggy address:
ffffffc003412d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc003412e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffc003412e80: 00 00 00 00 fa fa fa fa 00 00 00 fa fa fa fa fa
^
ffffffc003412f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc003412f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
==================================================================
When slewing is enabled the expectation is the vco will operate in the same
vco mode. The calibrated frequency should use only index '0'.
Change-Id: I1fdcb7d8c09b4f7ff41a1c1a9b36351a6c808c47
Signed-off-by: Taniya Das <tdas@codeaurora.org>
The GPU core on MSM TITANIUM can be powered by an internal
MSM (on-die) LDO or BHS. Typically the lower voltage corners
are powered by the LDO and the higher corners by BHS. Add
support to configure the LDO and hand-off between LDO and BHS.
Change-Id: Id13b6b601c91aa6c2c2f0e6d820a244144b60437
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Currently, there is a possibility of double freeing the
buffer in memory device mode. This patch protects the
buffer properly and also does the required cleanup once
buffer will be freed.
Change-Id: Ia016884bff4d41f2f8c59a547bd00a862c477e01
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
If low-power mode is not entered due to timeout, it is possible that
HW has actually been turned off by ADSP but the response was not
received by driver on apps on time.
Change device state to sleep to make sure HW is woken up for
subsequent runtime-resume operation.
Change-Id: I4e454f7e90e1244985c86286b95202eecfc50a7e
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
For RPM messages that dont require to be waited on, when an ACK is
received, there are no drivers waiting on it. So the element never
gets freed resulting in a memory leak.
Change-Id: I5cce36750e0acfa66b3d23a770986bd1de20601c
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
When a system is entering RPM assisted sleep, the NOACK messages are not
accounted in preventing such sleep modes as no driver is waiting on it. In
such scenarios, some active messages could still be in the Apps RX buffer
which reduces the number of outstanding sleep messages.
Fix by accounting for NOACK messages while flushing sleep set requests and
ensuring that they are read before sending any Sleep set requests.
Change-Id: I804cd923b88809b9d638756d934403914b5feff5
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
As per hardware specifications register read
cannot be done upon setting GDRC register
with HW_CONTROL. This change will set
GDRC register with HW_CONTROL after
firmware load to ensure that HW version
returns correct value
CRs-Fixed: 950485
Change-Id: Ia08a14f9f05cd410140cf01c26b41d3afba94513
Signed-off-by: Shilpa Mamidi <shilpam@codeaurora.org>