Use spin_lock_irqsave utility to avoid preemtpion of process_cmd thread
in jpeg. This can come in rare conditions when IRQ is received on same
CPU which is handling the thread.
Such cases will result in deadlock conditions.
CRs-Fixed: 3712176
Change-Id: Ib0d9997495272ab49a75b0419eb1e0fd84b1962c
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
We need to check if the packet is valid before using it.
CRs-Fixed: 3605421
Change-Id: Ide4e005ba46690c1cac02cb77a2d9aaa497b15df
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
(cherry picked from commit 0156c0475a4c6c042eb84fcfbc14b3e837e0cb4c)
This change add missing calls to put cpu buf in few scenarios.
CRs-Fixed: 3578162
Change-Id: Iab6aa0324b5072390b38df296c7acee00f5102a1
Signed-off-by: Vikram Sharma <quic_vikramsa@quicinc.com>
This change removes some dead code and fixes memory leak
issues and mismatched labels.
CRs-Fixed: 3394193
Change-Id: Ieb6f0d56cddc58be4caea6f0aece63a793a08c07
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
Currently, lowest clk voting level supported is LowSVS, this
change will add support to a lower voting level, LowSVS_D1.
CRs-Fixed: 3480799
Change-Id: Ibdfe9d1d05aa45439a537cebe828cceea83f39d4
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
The function cam_mem_mgr_release can unmap the buffers when in use.
This change prevents unmapping the buffers when in use.
CRs-Fixed: 3489559
Change-Id: I2e72e795d39ac15abfa56c19043c419a03686966
Signed-off-by: Shivakumar Malke <quic_smalke@quicinc.com>
This change adds support to detect early
unmapping of buffers from UMD, and signal
when the error occurs by sending an error
code to UMD.
At present, buffers are allocated and/or mapped
by UMD, and the following sequence occurs.
KMD prepares packets sent during a config ioctl,
and these packets reside in the mapped buffers;
HW blocks then access these buffers, and may
write output to other mapped buffers(io buffers);
Once HW is done(upon a buf done), KMD signals
this event to UMD;
UMD may free/unmap these relevant buffers.
This change adds support to detect cases where a
free/unmap happens before/while HW is accessing
these buffers.
This feature is enabled by default, but a debugfs
variable disable_buf_tracking is added under smmu
which will enable the user to disable the feature.
Camera server needs to be restarted whenever this
variable is set/unset for changes to take place.
CRs-Fixed: 3382609
Change-Id: I39c3f0c373743c10bc2e6304ffbdc820e3c95970
Signed-off-by: Li Sha Lim <quic_lishlim@quicinc.com>
Currently the maximum length of tag is 64, but in some
cases, the tag length we need is lager than 64, in
this case some information will be lost, which leads
to the failure to properly parse out the required
information. We need to make sure that all the tags
are the same length so that the parsing script can
parse them correctly. We also need to make sure that
the last character in tag is ":" in order for the
parsing script to get the full tag string correctly.
CRs-Fixed: 3467258
Change-Id: Ie8107ffd902d70d88026632a2c9fadaca0c276d8
Signed-off-by: mingpan <quic_mingpan@quicinc.com>
When UMD requests to flush specific request that was submitted
to HW/FW, return error code back to userspace and log the particular
active request id if the device does not flush active request.
Currently devices that do not support flushing a specific active
request are ICP, OPE, and CRE.
Return error if there is no request to flush upon UMD call to
flush specific request.
Print all ICP requests' id from all active streams when encountering
WD or ICP fatal errors.
CRs-Fixed: 3438283
Change-Id: I7921463250c6e5e45ec263ccdce9d60d2b0f1ed3
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
Update SOC util to be able to parse multiple irq names from DT and,
request, enable, disable multiple irq lines per soc.
All IRQ lines per SOC will have the same handler but different data,
so ISR will have their own private data to differentiate source of irq
in the same handling function.
CRs-Fixed: 3395596
Change-Id: Id9ca1cd3ef105d732a82decd7c8078bd29668326
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
This change removes some flags and unused variables
in JPEG driver.
CRs-Fixed: 3394193
Change-Id: Iccdadebbd6943322e58da682986c4f6145ca9a64
Signed-off-by: Atiya Kailany <quic_akailany@quicinc.com>
Add switch case to handle query cap v2 ioctl, and add query cap
v2 hw mgr intf function pointer to handle query cap v2.
CRs-Fixed: 3364267
Change-Id: I1f992982f8d06755c977839ee61ee450306d65a5
Signed-off-by: Petar Ivanov <quic_pivanov@quicinc.com>
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
On chipsets having cesta hw block support, for cesta supported clks
clk frequency can be changed during veritcal blanking based on
CSID DRV events. For this to happen, camera clients need to setup
high and low clock votes through hw clients. Use corresponding clk,
crm APIs to setup high, low clk frquencies and do channel switch
to apply newly set rates. Clients can also set clk frequency through
sw client which will set the floor. This feature helps in saving
power for usecases where vertical blanking is high such as
Fast Shutter usecase.
CRs-Fixed: 3294948
Change-Id: I1bcf650b439991a23b2a0f0f9a5162bdcd60dc64
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
Signed-off-by: Pavan Kumar Chilamkurthi <quic_pchilamk@quicinc.com>
Each driver can pass private data in mini dump callback register, so
when mini dump is invoked, the mini dump handler will pass the private
data to the callback associated with the driver. With the private data,
ICP driver can determine which mini dump callback corresponds to which
ICP device/hw mgr.
CRs-Fixed: 3353541
Change-Id: I85171aa7ba31f92c5620ddbd8de8a9c168398856
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
Add precision to nanosecond part of monotonic timestamps.
Update delimiters between second and nanosecond values.
CRs-Fixed: 3307225
Change-Id: I4e7aab0ea9256c2ff769a87c3873002d715ed3c9
Signed-off-by: Mukund Madhusudan Atre <quic_matre@quicinc.com>
Update from error injection framework to event injection framework to
support PF event inducement and node event. Different set of user
input parameters are required dependent on which event to injection.
ICP and ISP support error event and page fault event injection. JPEG
supports node event and page fault event injection. However, buf done
error injection is only supported for JPEG and ICP.
Create a query API to check whether PF is fatal for a context bank.
Using the API, if PF is fatal, page fault event injection is not
supported for the device that owns the context bank.
Make change to JPEG context event callback handling to account for
various events including Event Injection event.
CRs-Fixed: 3210139
Change-Id: I582ee0bda8dbf631ece2522a5a8145f38ec71928
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
Instead of caching packet address pointer, store packet handle
in page fault req info structutre to obtain packet address through
mem manager to avoid potential access to dangling packet pointer which
resulted from UMD called to free the packet buffer before kernel finishes
handling page fault. If the packet was freed, then querying to get packet
address from memory manager will fail since the mem handle is invalid.
If it is invalid, the page fault handler will return before accessing
the dangling packet.
CRs-Fixed: 3287554
Change-Id: I02bc0c706b64f1dc0d098d8189f2f129a91efba7
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
Customer may have more than 3 physical cameras, and userland
may also create multi jpeg pipelines, so increase the max
context number to 24.
CRs-Fixed: 3228532
Change-Id: Ia90947f03a1543f19684aa7cad1b1972419e9c74
Signed-off-by: chengxue <quic_chengxue@quicinc.com>
Shared memory is initialized by CRM and used by
other drivers; with CRM not active other drivers
would fail to access the shared memory if
memory manager is deinit. Reader Writer locks can
prevent the open/close/ioctl calls from other drivers
if CRM open/close is already being processed.
Issue observed with the below sequence if drivers
are opened from UMD directly without this change.
CRM Open successful,ICP open successful,
CRM close in progress, ICP open successful,
mem mgr deinit and CRM close successful,
ICP tries to access HFI memory and result in crash.
This change helps to serialze the calls and prevents
issue.
CRs-Fixed: 3019488
Change-Id: I84d50918713686a067c0e3deb64c9c6ae9edfcb5
Signed-off-by: Tejas Prajapati <quic_tpraja@quicinc.com>
Upon Page Fault, smmu driver invokes faulted client's callback
which looks for faulted buffer and context. The client driver
can be ISP, ICP, JPEG, IFE CDM and CPAS CDM. The driver then
fills PF msg struct, logs related info, and notify PF msg to
userspace. Userspace is expected to abort and calls to shut
down kernel drivers. When Titan powers on next session, CAMSS
undergoes async reset.
This change also ensures the page fault related changes added
to TFE, OPE, CRE do not break the drivers compilation.
CRs-Fixed: 3156671
Change-Id: Icd6c8c9a38cac206fe8260d374d03964fb280879
Signed-off-by: sokchetra eung <quic_eung@quicinc.com>
Add and implement sysfs parameters to inject errors to
camera HW on demand through UMD for IFE,ICP and JPEG.
CRs-Fixed: 3115857
Change-Id: I4376fe31016cd81ad7e6f04cbc55e8ce010a6154
Signed-off-by: Pranav Sanwal <quic_psanwal@quicinc.com>
Force callers to say if they are using 36 bit address patching or not.
CRs-fixed: 3121782
Change-Id: I4dee25e3f73104a1be043fe18a295cd4f8447821
Signed-off-by: Karthik Jayakumar <quic_kjayakum@quicinc.com>
IRQ line verification can now be triggerred from JPEG HW manager by
writing to a debugfs file as follows:
echo 1 > /d/camera/jpeg/test_irq_line
IRQ line verification can also be done at probe if
CONFIG_CAM_TEST_IRQ_LINE_AT_PROBE is set to true during compilation.
Both debugfs and probe-time verifications are only active if
CONFIG_CAM_TEST_IRQ_LINE is set to true during compilation.
CRs-Fixed: 3071027
Change-Id: Ib24022a12e3aa3ac529c7bc925fd4df1f2a96310
Signed-off-by: Anand Ravi <quic_ananravi@quicinc.com>
Create common root folder under debugfs root named camera at probe. Add
utility functions to create subdirectories under the common camera root.
CRs-Fixed: 3093049
Change-Id: Ia4cefb5d2263ecabf1b9d70deefa1ee624b04f07
Signed-off-by: Anand Ravi <quic_ananravi@quicinc.com>
Add compatible string and header to support MISR
for JPEG DMA and encoder for v780.
CRs-Fixed: 3012752
Change-Id: I3f50506c20620dc46b6c5b3615887bbbc6027e36
Signed-off-by: Ridhi Shah <quic_ridhshah@quicinc.com>
Support for Camnoc MISR for JPEG DMA and Encoder.
Also added support for seprate target files.
CRs-Fixed: 3012752
Change-Id: I5e066d5d871f58073f669c01270d5b64ce16088e
Signed-off-by: Dharmender Sharma <quic_dharshar@quicinc.com>
Added checks to make sure in_map /out_map entries of
packet io configs are within expected maximum value.
CRs-Fixed: 3007258
Change-Id: I7e5a652cd8f9ae104a10a2af551fe49930849b2d
Signed-off-by: Shravya Samala <shravyas@codeaurora.org>
Check if ctx_data is null after assignment but before checking if it's in use.
CRs-Fixed: 3026736
Change-Id: I366383cbd30b7c22c16610d7b73e4e0ad8f74a55
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
Add support for copying buffers to and from presil in
jpeg.
CRs-Fixed: 2932495
Change-Id: I0ca7069feae3f063259d88f1d02177de9675388a
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
Based on targets, in case of device crash, in place
of complete memory dump, mini dump can be extracted.
This commit adds changes in context utils for NRT devices
and in ICP, JPEG drivers.
CRs-Fixed: 2993116
Change-Id: I7c4af2cdf44713f741d3d772316080124e8a9a7f
Signed-off-by: Gaurav Jindal <gjindal@codeaurora.org>
Fix the incorrect implementation which keeps the failed
thumbnail requests in the active request list and do not
free up.
CRs-Fixed: 2999106
Change-Id: I8f34d8b24aa1e0e3afb1452cffbf5a4113e0dc0e
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Add support for JPEG Thumbnail retry mechanism. Restructure
the command buffer arrangement, add JPEG generic blob functionality
and add support to notify user when the JPEG Thumbnail encoder
size increases than the threshold size received through blob.
CRs-Fixed: 2999106
Change-Id: Ica74f934939b562a3a88af551bfb5de79399e247
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Kernel apis provide information fault caused pid and mid data.
Handle the JPEG 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 jpeg node
dt entries.
CRs-Fixed: 2878371
Change-Id: I0d2d1e474d4662707d85efd022ccce87e67f0d93
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
In subdev close call if CRM is still active wait for shutdown
from CRM [media device]. Remove subdevice check for active
handles, shutdown to happen irrespective of any active context.
If CRM is not active, subdevice shutdown should ensure there is
no access to kernel allocated buffers since at this point
memmgr is de-initialized.
As part of ICP close, remove usage of HFI queues, trigger PIL
to transfer FW memory ownership back to HLOS and power off ICP.
CRs-Fixed: 2976107
Change-Id: Ib05b3fbdcc33f4072da7ef77cf0118a807860e8c
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
when provider crash occurred, there was a CSID lane overflow
observed due to shutdown sequence from CRM(sensor, csid, csiphy).
To fix the issue need to change the shutdown sequence
(csid, sensor, csiphy).
This change will update the devices sequence in order while registering
and close the sequence accordingly.
CRs-Fixed: 2852076
Change-Id: Ia6d8022e995823bf031400c33528eb8544dc2e29
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
With the allow list tightened, use the right header for spinlock
usage. Change replaces usage of linux/spinlock.h to
linux/spinlock_types.h.
CRs-Fixed: 2841729
Change-Id: I0247501b765436099f75c9725e9f614f0873c888
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>