Fix the incorrect condition in the cdm code and also
remove cdm debug register dump from ife_hw_mgr_config
function to avoid the duplication of the dump with the
one being printed from cdm workqueue.
CRs-fixed: 3064926
Change-Id: Idd5938030d4f9737e5ab3301d08dd221b25a54ea
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
This change handles a race condition in which cdm workqueue is
scheduled on one of the cores and cdm flush is executing on
another core. We come across a dead lock between fifo_lock and
hw_mutex lock.
CRs-Fixed: 3049531
Change-Id: Ie0b8982a7e55218fc5655f8e3d08a952fd852ed7
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
Fix the possibility of uninitialized variable
getting returned by the cdm_bl_submit function.
CRs-fixed: 3038735
Change-Id: Ib40d83ac2e8c7826197aa73de64f5dbf4996f0a5
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Presil IRQ handling requires running in a workqueue, with
wait for acknowledgement in io operations. This busy wait
should be done while holding a mutex lock as opposed to
spinlock in usual irq context. Add wrapper to switch from
spinlock to mutex for presil mode in irq controller and
cdm. Add the hw lock wrapper in hw interface header.
CRs-Fixed: 2932495
Change-Id: I7600eb1e6ae8746a39e76f6cb3a2652b255f2ddd
Signed-off-by: Suraj Dongre <sdongre@codeaurora.org>
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
Update the cdm submit bl function to use allocated
genirq memory for genirq command instead of appending
the command to the last BL entry to prevent possibly
using the memory not mapped. Also, add some more logs
to make the debugging easier.
CRs-fixed: 3029732
Change-Id: I2fc679bef4c0f72031798a03b26f840b6b4ef746
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Correct the CDM iommu handler by changing the
false pid and mid values written in the cdm
header file. Also, adding a support to read the
pid and mid from the dtsi file, since there is
already support for the PID values available in the
dtsi.
CRs-fixed: 2982542
Change-Id: I319a32fdcba44a6a96b79e4e67b0a2cc0e01bc4c
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
There is a chance of use after release of client data in
cdm internal operation calls. Hence acquire mutex lock whenever
accessing client data to avoid use after release scenario.
CRs-Fixed: 3010261
Change-Id: Iaf7f41d56301299a6f63a5dc1090334063019881
Signed-off-by: Shravya Samala <shravyas@codeaurora.org>
This changes is to detect workqueue and tasklet
scheduling and execution delay.
CRs-Fixed: 2977775
Change-Id: Ia4b4845a067c22bd1f24bd63a971d103fcfc049c
Signed-off-by: Ayush Kumar <ayushkr@codeaurora.org>
Append workq name in workq delay detect API to identify
which workq is scheduled late. Create workq name macros for
cci and cpas to pass to workq delay detect API.
CRs-Fixed: 2994927
Change-Id: Iebc14520b918272e92b59c900de5fe17f38a2406
Signed-off-by: Sokchetra Eung <eung@codeaurora.org>
Read version and family from device tree if presil enabled.
CRs-Fixed: 2932495
Change-Id: I6a2518c033ee42202ab7ad2beb839aad20679311
Signed-off-by: Suraj Dongre <sdongre@codeaurora.org>
Signed-off-by: ridhshah <ridhshah@codeaurora.org>
Add a check for reg-val count=0 in reg_random command. Count=0 in
reg_random cdm command will throw an invalid command HW error.
CRs-Fixed: 2916477
Change-Id: Idb8654c3752963cf5a52147d350e291208b917d0
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
This change adds missing cdm debug status register
offsets for cdm version 1.0 that are read during cdm hang.
CRs-Fixed: 2898496
Change-Id: I3a83d13f6b18231561973054845cb87b1ffc4b2d
Signed-off-by: Chandan Kumar Jha <cjha@codeaurora.org>
Currently cdm driver is updating work records
in case of all the interrupts received, but
decrementing only when it schedule workq for
inline irq interrupt. This causes the mismatch
in work records and return incorrect work records
count when cdm client check the cdm hang detect.
Updated hang detect logic in cdm driver.
CRs-Fixed: 2878695
Change-Id: I7039422bf573a7105c16ac2f752eb235c377bfee
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Add logic to dump stripe info and wait event status at the
time of cdm hang.
CRs-Fixed: 2878214
Change-Id: Ib9892b0273e4436988c5f1384d18d60d29529c94
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
global-out-of-bounds issue on:
msm_cam_hw_cdm_dt_match
Due to no null-terminating struct in the array.
CRs-Fixed: 2883523
Change-Id: I36e4811f239993e1e6de158df959157217c28bfe
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
If there are any reset errors for the CDM, CDM should
send error to UMD upon reset failure. Updated the
error status with relevant error code.
CRs-Fixed: 2882732
Change-Id: I12e746f71b1a294aa4e7ef540f39aec91fb44648
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
Avoid iterating for masked BL fifos for single BL
fifo usecase. Also, Fix an if condition in cdm
workque function to check for fifo index correctly
for single BL FIFO usecase.
CRs-Fixed: 2893426
Change-Id: Id3c740a9d311863c0f08c331f9e5de992a721e30
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
In current implementation, each driver call wait_for_completion_timeout
and readl_poll_timeout with own timeout values.
In case of slow environments like presil, lot of hacks are needed to
change the timeouts for each driver. It needs multiple code changes
and compilations, thus consuming time.
This commit implements a common interface to call
wait_for_completion_timeout and readl_poll_timeout.
Debug variable is also introduced to
change the timeout value. This will help to change the timeout
without compilations and changes at multiple places.
Change-Id: Iba51e0805a49ed325147a12688c2fe6619bb68e6
CRs-Fixed: 2830502
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
Kernel apis provide information fault caused pid and mid data.
Handle the OPE smmu fault using pid and mid data. Based on the
mid data, dump only corresponding port info which caused the
fault. Pid and mid values are target dependent, these values
will be updated on the ope node dt entries.
CRs-Fixed: 2857868
Change-Id: I909f1787e71e67e5ed1d3464dfeb506418d151e4
Signed-off-by: Vikram Sharma <vikramsa@codeaurora.org>
CDM driver check for available bl fifo slots before
submitting to HW. If no free slots available then
it wait for CDM HW to process all the BLs and return
available slots.
CDM driver was incorrectly calculating the available bl
slots and causing bl fifo overflow.
Corrected the sequence in wait for bl fifo logic.
CRs-Fixed: 2837583
Change-Id: I2861f8c66822e0739f0546eaf153d8e2af0caefe
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
There is chance that handle error info get scheduled
after cdm deinit. As clock and regulator gets disabled
as part of deinit so this can cause issue for cdm hw
interaction as part of handle error.
Added cdm power state check before dumping CDM HW
status at the time of error.
CRs-Fixed: 2833653
Change-Id: I4bf01ce3900196909cf66ffdb24607c50ab03295
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Improve the cdm debug register dump to dump more
registers and more information.
CRs-Fixed: 2874806
Change-Id: Ica9a5b63bbb30c59463c6b2c0115a452def0fcf8
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Reduce logging as part of error handling to avoid
flooding kernel log with excessive log. Apart from
that send feedback to client irrespective of cdm
reset status.
CRs-Fixed: 2826285
Change-Id: I9b0d8c6f64ced4972bb20e26774508573c815e4f
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Add more CDM registers in cdm dump function for better
debugging.
CRs-fixed: 2816605
Change-Id: I3925a094ee89e7f8f3d6ed6eead45c099ca4ac09
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
msm: camera: cdm: Fix dangling pointer issue
msm: camera: cdm: change work record to atomic variable
msm: camera: utils: Adding device type to track device handles
msm: camera: tfe: Reduce stack footprint during bw vote
msm: camera: req_mgr: Thread switch delay detection mechanisms
msm: camera: cdm: Avoid submitting BL if FIFO is full
msm: camera: tfe: check cdm hang in the tfe config timeout
msm: camera: req_mgr: Delay detection mechanism
msm: camera: cdm: Debug info in case of cdm page fault
msm: camera: isp: Max context reduction for TFE in isp driver
msm: camera: ope: Maintain current clock value during acquire
msm: camera: req_mgr: Limit CAM_ERR log in case of no empty task
msm: camera: cdm: Decrement write-count only after Bl commit
msm: camera: isp: Added CSID recovery mechanism.
CRs-Fixed: 2792394
Change-Id: I1c7a903ae15b572acf3f6318cda7394cb6549c8d
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
Add support to dump the cdm core debug registers and CDM hang detect
support for better debugging purpose in case of cdm timeout at config
ife. Add a debugfs for CDM command buffer dump for cdm hang events.
Fix the possible NULL derefernce while dumping the cdm registers.
Turn on debugfs using following command in adb shell:
echo 1 >> /sys/kernel/debug/camera_isp_ctx/enable_cdm_cmd_buffer_dump.
CRs-Fixed: 2748715, 2782720, 2770565
Change-Id: Ibb9aa1d232d742ca1b6e64c16e9718bfc0bc8624
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
cdm client check for loading number of clients is
not correct. It does not take error codes into account.
The variable that holds the value is of incorrect
data type.
CRs-fixed: 2768636
Change-Id: Ie5b752aa6bc7a70fe777c16a70a5bdb2e5a663a4
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Currently when page fault happen, iommu driver callers camera
handler with CB details and iova address which caused the page
fault. With iommu iova address cam smmu driver finds the
closest mapping address for that cb and call the
corresponding driver to find the which port caused page fault.
This has limitation has page fault address always not mapped.
New approach is get the page fault ids from iommu driver.
Based on the Pid and Mid values, get the HW id and port ids,
go through all context which has this hw id and port id and log
the data. Once context id is identified, log the acquire data and
last consumed client address details. Dump the hw register data
in the given buffer. Send the smmu page fault event through
v4l2 queue to user.
CRs-Fixed: 2750690
Change-Id: I87c809b3229992c7c95655a4f3c6c70ebc035ae8
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
The dt match table needs end up with null.
CRs-Fixed: 2730795
Change-Id: I75bdf20d74d9a83d9a0de28a2ad4d95412a51f0c
Signed-off-by: Depeng Shao <depengs@codeaurora.org>