Commit-Graf

13 Incheckningar

Upphovsman SHA1 Meddelande Datum
Yash Upadhyay
d6d05fba0b msm: camera: cdm: Prevention from OOB on virtual cdm write
Adds proper sanity on virtual cdm right operation to avoid
OOB register space access. After getting the mapped buffers
through cam_mem_get_cpu_buf() in kernel, userspace is still
able to access those buffers. So, the validation of offsets
and sizes does not have any advantage if userspace can alter
those parameters after we have validated them. That's why we
copied the information in kernel before we validate that.

CRs-Fixed: 3778045
Change-Id: I3b53549419b40a92333263e29d93220577d691e9
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
2024-04-19 09:17:36 +05:30
Karthik Dillibabu
97c4721bae msm: camera: isp: validation of cmd_buf support
This change validates cmd_buf in IFE/TFE before submitting
BL to CDM when debugfs(enable_invalid_cmd_check) is enabled.

CRs-Fixed: 3616889
Change-Id: I5418661ff092fb15d04ab7dda6f3b59742a232a8
Signed-off-by: Karthik Dillibabu <quic_kard@quicinc.com>
(cherry picked from commit 7528980860a33e0d800915c64005965862b80982)
2023-10-03 01:17:11 -07:00
Atiya Kailany
97b61780f6 msm: camera: cdm: Removing dead code
This change removes unused variables in CDM driver.

CRs-Fixed: 3394193
Change-Id: I21b1b8c5ad3483b0883d5fb09e48f5156f0d8b12
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
2023-03-07 18:06:24 -08:00
Joshua Florez
380923cd39 msm: camera: cdm: Remove redundant if condition in cdm util
Removes if statement condition that would always evaluate
to false.

CRs-Fixed: 3300441
Change-Id: Ia5e68cdcf28dedd8e38c06feb475340fec7d4d9e
Signed-off-by: Joshua Florez <quic_jflorez@quicinc.com>
2022-10-13 16:06:42 -07:00
Jigar Agrawal
b9cc540346 msm: camera: cdm: Fix the CDM Reg dump
Fix the CDM register dump and the command buffer dump.

CRs-Fixed: 3115371
Change-Id: I8b047f365187362593038724b29b98f1f40e47df
Signed-off-by: Jigar Agrawal <quic_jigar@quicinc.com>
2022-01-26 23:06:23 -08:00
Jigar Agrawal
6c91eb5bf0 msm: camera: cdm: Fix cdm driver for bufffer excursion
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>
2021-10-06 12:27:35 -07:00
Jigar Agrawal
b5c4f91b83 msm: camera: common: Add a check for 0 reg-val pairs in cdm command
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>
2021-04-20 12:17:50 -07:00
Tejas Prajapati
4574450a12 msm: camera: common: Merge camera-kernel.3.1 changes in camera-kernel.4.0
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>
2020-10-13 12:08:01 +05:30
Vishalsingh Hajeri
7d3f7b71b6 msm: camera: cdm: Add CDM cmd_type WAIT in dump util
CDM comp_wait is the new cmd_type used by IFE Master
to wait for trigger from slave. Add this type to
the dump command buffer routine.

CRs-Fixed: 2679783
Change-Id: I142cbd849141725cc05f3276c20ea1c0d59f7c3c
Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
2020-06-11 18:16:17 -07:00
Rishabh Jain
704dc07b7b msm: camera: ope: Clear comp events before each request
If there is a stale entry of any event in the CDM,
it will end the wait of same event in next request.
So, clearing the comp events before each request.

CRs-Fixed: 2611231
Change-Id: I252ee5edaea1cda34dc48343dd6bc865b490e977
Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
2020-02-12 12:06:50 -08:00
Gaurav Jindal
e3f5738e43 msm: camera: isp: LDAR Dump ISP information
When user space detects an error or does not receive
response for a request, Lets do a reset(LDAR) is triggered.
Before LDAR, user space sends flush command to the
kernel space.
In order to debug the cause for this situation and to dump
the information, user space sends a dump command to
kernel space before sending flush.
As a part of this command, it passes the culprit request id
and the buffer into which the information can be dumped.
Kernel space traverses across the drivers and find the culprit hw
and dumps the relevant information in the buffer.
This data is written to a file for offline processing.
This commit dumps the IFE, CSID registers, LUT tables and context
information, cmd buffers, timestamps information for
submit, apply, RUP, epoch and buffdones of the last 20
requests.

CRs-Fixed: 2612116
Change-Id: If83db59458c1e5ad778f3fa90cbc730122491c54
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
2020-02-10 14:39:46 -08:00
Trishansh Bhardwaj
d907c2c7cb msm: camera: cdm: Add support for different CDM hardware
Different CDM hardware have different capability and registers.
With old register space, handling new features and operations
would have been a complex task. This change takes care of old
version of CDM and also changes the regspace to provide every
register's access to CDM.
This change further adds support for "arbitration" in case of
multi-context CDMs.
Exports reset functionality to clients, detection of CDM hang.
Flushing the CDM requests and dumping the FIFO content for all
contexts.
It also adds submitting "debug_gen_irq" as BL_done IRQ is only
an indication for availability of FIFO's. The AHB operations
are completed can only be known if the added "debug_gen_irqs"
gets executed and are received by the CDM.

CRs-Fixed: 2594541
Change-Id: I9846b1c5320ba652c5d3b7d83d616d2dabc843e1
Signed-off-by: Abhilash Kumar <krabhi@codeaurora.org>
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2020-01-16 17:45:41 +05:30
Jigarkumar Zala
05349feaa2 Camera: Bring over camera driver changes
Bring over camera driver changes as of msm-4.19
commit  5a5551a7 (Merge "msm: camera: reqmgr: Fix CRM
shift one req issue").

Change-Id: Ic0c2b2d74d1b3470c1c51d98228e312fb13c501a
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
2019-07-08 10:24:55 -07:00