Commit graph

11 Commits

Autor SHA1 Nachricht Datum
Sourabh Soni
70c2c7d653 msm: camera: sync: Prevent double lock/unlock on fence object
For Camera DMA and Synx object, multiple locking and
unlocking of fence object of fence object.Added check
to avoid double locking and unlocking.

CRs-Fixed: 3747628
Change-Id: I3ff9d448196c223d34f5e9ea049ff93154002422
Signed-off-by: Sourabh Soni <quic_soursoni@quicinc.com>
2024-03-11 21:47:16 -07:00
Haochen Yang
18b9847377 msm: camera: sync: Add support for putting dma fence
This change will put dma fence no matter what the value
of row->ext_dma_fence is when closing it.

CRs-Fixed: 3423230
Change-Id: Iaf3faad970ad226bebaed41305f70afa9e5858f7
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
2023-03-21 18:06:34 -07:00
Karthik Anantha Ram
84607f072a msm: camera: sync: Ensure dma fence is signaled prior to release
The change ensures the dma fence is always signaled prior
to release.

CRs-Fixed: 3423230
Change-Id: I6063b49c23451fc5053dde6436776b8a42d0fd02
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
2023-03-21 18:06:27 -07:00
Haochen Yang
28439b686e msm: camera: sync: Handle dangling pointers in monitor dump
This change appropriately handles dangling pointer generated
by sync/dma/synx when closing the drivers.

CRs-Fixed: 3350863
Change-Id: Id5353814f4908f17706cebc04b3f02ccc1488813
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
2023-03-20 13:46:18 -07:00
Haochen Yang
ae91bc4768 msm: camera: sync: Add extra support for monitor dump
Add monitor dump when dma/synx is already in signaled
state or has registered a cb, and when sync fails to
signal its corresponding dma/synx.

CRs-Fixed: 3350863
Change-Id: I4b52647f1d3f53eff119df1ab143be6848dd0d5d
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
2023-03-09 23:36:05 -08:00
Karthik Anantha Ram
d4731aa3fb msm: camera: sync: Enhance synx/dma fence drivers
The change addresses race conditions stemming from releasing
internal row lock prior to invoking synx APIs. The change
also deregisters dma/synx callbacks if the corresponding
fences are signaled when the associated sync object is signaled.
The change also cleans up & reorganizes functions.

CRs-Fixed: 3403341
Change-Id: I32995900e31ba73eac6b44d2238808f8e6c23f9a
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-02-16 18:36:11 -08:00
Pavan Kumar Chilamkurthi
07b3c215a1 msm: camera: sync: Add monitor information for sync objects
Monitor sync object operations such as create, register callback,
signal, unregister callback which is useful in debugging. Introduce
debugfs to dynamically set the monitor mask. Apply dump on error
when CAM_GENERIC_FENCE_TYPE_xx is set in cam_sync_monitor_mask and
apply dump on release when CAM_GENERIC_FENCE_TYPE_xx_DUMP is also set
at the same time. Apply dynamic memory allocation for monitor data
in synx and dma. Refactor APIs into generic ones and add memory
checkings.

CRs-Fixed: 3350863
Change-Id: I70cfdc1215be5f6bf564c672a874e6ba7997cdfa
Signed-off-by: Pavan Kumar Chilamkurthi <quic_pchilamk@quicinc.com>
Signed-off-by: Haochen Yang <quic_haocyang@quicinc.com>
2023-02-08 20:06:10 -08:00
Karthik Anantha Ram
8b2265fe1f msm: camera: sync: Release spinlock prior to calling synx
Mutex is the synchronization primitive used in synx, which
can sleep. Holding the spin lock and invoking synx APIs could
deadlock the system. Release spin lock and invoke synx driver.

CRs-Fixed: 3365172
Change-Id: I01291fdd96df772f4cb1d87a44d79dd4a62fdc26
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2023-01-05 17:36:09 -08:00
Karthik Anantha Ram
167437bdeb msm: camera: sync: Avoid use after free
There is a narrow window, in which the critical section is
not fully protected which possibly could lead to use after free.
To avoid this, hold the row lock and validate the state prior
to processing the dma fence.

CRs-Fixed: 3273450
Change-Id: Ib1f09e62a5060a38b5cd8f3d4594bce2e533b3d3
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2022-09-13 16:07:33 -07:00
Sokchetra Eung
d2a1f0c968 msm: camera: common: memset usage optimization
Remove unnecessary memsets of the structure variables
whose fields are assigned prior to their usage or they
are dynamically allocated with calls that set the memory
to 0. This memset usage optimization is to improve
performance.

CRs-Fixed: 3228092
Change-Id: Iec68c6d072863627959ce603cff28afd26a1c408
Signed-off-by: Sokchetra Eung <quic_eung@quicinc.com>
2022-07-26 11:03:32 -07:00
Karthik Anantha Ram
a130199cd3 msm: camera: sync: Add support for dma fences
Add support to create, release, signal and import
a dma fence. When a sync object is imported for a dma fence
signal the dma fence when signaling the sync object with
appropriate status. This is achieved by implementing
generic fence scheme. The change also adds support
for batched fences.

CRs-Fixed: 3207212
Change-Id: I23fbc0992281cfee0303e213a30bce138ae7bdff
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
2022-06-08 13:06:40 -07:00