Since the SOF timestamp is only updated at SOF,
so we can't do self-correction at EOF. When the
frames already in sync, but the req is a EOF
triggered req, then the req can't be applied at
SOF, but it will fail to pass self-correction
checking at EOF. Then we will loop this progress,
the req can't be applied anymore.
CRs-Fixed: 2930497
Change-Id: I079cbd3cb9ac9541f049c5369baeee831f7444a2
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
Propagate error code to user in order to let the
user know more about the failure.
CRs-Fixed: 2860306
Change-Id: Icf030aa9df32eac97371059c2d282cfb53257401
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Set the debugfs root entry pointer to null after
recursive remove at unbinding to prevent null pointer
dereference by kernel followed by kernel panic. Also,
add checks to avoid null pointer dereference.
CRs-Fixed: 2920490
Change-Id: I5a4f44f3d8f533f3a51e108472d5ccf93c261a98
Signed-off-by: Jigar Agrawal <jigar@codeaurora.org>
Remove all the debug flags in cache create call. The change
also adds the destroy call during unbind for consistency.
CRs-Fixed: 2841729
Change-Id: I2e0a0e4f2ec9191a3159d77892ff292a0a3cc131
Signed-off-by: Karthik Anantha Ram <kartanan@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>
If req#N in slot idx, and this req meets bubble issue,
then the req#(N+1) in slot (idx+1) may also be applied,
and its status is APPLIED. If req#(N+1) applies failed
after finishing bubble recovery due to some reasons,
but we still can move to next slot since the status of
slot (idx+1) is already APPLIED. This change resets
the status of slot (idx+1) to ADDED if it is APPLIED
during processing error.
CRs-Fixed: 2902809
Change-Id: I32f318569ad8f24fdf0f324603f4ea0036867e98
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
Apply the flash at EOF and apply the other devices
at the EPOCH of next frame, then the flash can
cover all the exposure zone of current request.
Add the inject delay for SOF and EOF separate,
then we can use inject delay for more flexible
frame skip control.
CRs-Fixed: 2820683
Change-Id: Ic6a58327a0ae44c54190884ba42ea7926ec7c90e
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
In sHDR case, the trigger cnt may be different when one of the IFE
meet bubble or irq delay issue, then reset the trigger cnt when
we find the trigger cnt is different.
CRs-Fixed: 2857614
Change-Id: Ie02fd7204bebd16d32d7a277ac1f2e45f8357dd9
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
SHDR case has two ISP instances, if one of them
apply req failed sometimes, but the other one is
good and the buf done has been handled successfully,
then we don't need to apply the req again for the
successful ISP.
CRs-Fixed: 2842495
Change-Id: I3dfbb455244daa0d155858dd59f4a661fd3b87cd
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
Currently, the camera initialization log only points to the
camera initcalls execution. The camera driver is initailized when
all components are bound succussfully in CRM master bind. Add
appropriate log to convey correct info.
CRs-Fixed: 2841729
Change-Id: I5a52ad9fdf84d79d66763d47c92d2a63bb8d0e21
Signed-off-by: Mukund Madhusudan Atre <matre@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>
In case of sHDR to have a continuous flow of frames,
program scratch buffer even if there are no pending
requests to apply.
CRs-Fixed: 2841729
Change-Id: I8015a3a184751b2a772db55c35b02de380f04491
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
last_applied_idx is updated on every successful applied
request and the buf_done. After buf_done last_applied_idx
is set to -1. While accessing last applied req the same
index is used, if the last_applied_idx is -1 accessing
last applied request will result in slab out of bound
error, so check last_applied_idx before accessing
last applied request.
CRs-Fixed: 2840329
Change-Id: I8f49b9df097859cde20e651149167db7316976bb
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
Sometimes, the cpu load is very high, then the devcies
stream on will be delayed, but the CRM watchdog is already
enabled before streaming on, then we will have a chance to
notify SOF freeze issue.
This change pauses the CRM watchdog timer before streaming
on sensor and after stopping ife, when we can detect the
stream on and stream off delay, but don't notify error,
also can detect the real SOF freeze issue.
CRs-Fixed: 2804587
Change-Id: Iccaee837930ea22290b109eff45b05300d844312
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
Use fw_uncached region instead of secondary heap region. Pass
this region information to FW through CSR registers.
Allocate Qtlb, cmd_q, msg_q, dbg_q from fw_uncached region
instead of shared mem region. Allocate Sec heap also from
fw uncached region instead of its own dedicated region.
CRs-Fixed: 2722486
Change-Id: Ib88b2202ca1b610946c712fcca936b72d4eecd15
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Due LX7 cache requirement, buffers need 4K padding at the
end. Allocate accordingly, this is hidden from user mode
driver and umd never uses this extra 4K memory.
CRs-Fixed: 2722486
Change-Id: I3b327ab3615eee30d17c95e23703024ff7446648
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
Signed-off-by: Karthik Anantha Ram <kartanan@codeaurora.org>
Kernel 5.5+ changed debugfs API's for creating simple dentry variables.
There is now no return value for those API's.
CRs-Fixed: 2835738
Change-Id: Ic5eea63f2e94451e5dfb211cb2b4aa80ce47073a
Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
Use dma-buf-heaps for allocating buffers. Keep ion usage
to support kernels without dma-buf-heaps support.
CRs-Fixed: 2852327
Change-Id: I3ebcb591827d9b8e5366f716efd08e4cd6f1070a
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
Consolidate ion usage functions and bring all ion related
usage into one single function. This helps to easily
write a different allocation wrapper in case a new allocator
need to be used in future.
CRs-Fixed: 2852327
Change-Id: I717ee5a976ae0f148dcdd5a050204514566c823d
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
If Nth request has additional exposure timeout, after
applying sensor settings for Nth request; CRM watchdog
timer should be updated with the Nth requests additional
timeout on next frame irrespective of skip frame to
avoid sof freeze.
CRs-Fixed: 2802634
Change-Id: Iae70df66f0a1c22c2410e4826aea964ffd6d887b
Signed-off-by: Tejas Prajapati <tpraja@codeaurora.org>
Add the null check for dev parameter before reporting the error on
link. Certain corner scenario for flash, send request return native
value in that case dev parameter could be null.
CRs-Fixed: 2814597
Change-Id: Ibe08f12c2f2c1864c46b17b0ae0f8df5c5648d35
Signed-off-by: Ravikishore Pampana <rpampana@codeaurora.org>
Rate limit errors logs in case of incoming invalid handles
from userspace.
CRs-Fixed: 2807712
Change-Id: I3f8765be2f07f869149b9315ab38b7d02ae71a58
Signed-off-by: Shravya Samala <shravyas@codeaurora.org>
While links out of sync, one link faster than another.
the early link reset its slot while receive trigger from
isp, and the slow link will check ready always fail
on sync link, and stuck happens.
CRs-Fixed: 2800759
Change-Id: If615828304947d79ecbb2c87f03af29824598be0
Signed-off-by: chengxue <chengxue@codeaurora.org>
Add implementation to allow forcing all camera buffer allocations
to be CACHED and mapped as CACHED while iommu_map. This
is enabled based on DT property. Force this only if
io-coherency is enabled. Validations are added to make sure
a correct combination of "force_cache" and "io-coherency"
properties are mentioned in DT.
CRs-Fixed: 2814719
Change-Id: I0d291ce199f523d67e8cd0105386cc63a671806e
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
During destroying the session, sof freeze timeout happens
after destroying workqueue. Then sof freeze timeout callback
will access workqueue causing use after free memory issue.
This change invokes destroying timer prior to workqueue.
CRs-Fixed: 2807936
Change-Id: I1f0dcb7a03fbf802f4ec872727e3b627a78f56f8
Signed-off-by: zhuo <zhuo@codeaurora.org>