Commit Graph

520 Commits

Author SHA1 Message Date
Camera Software Integration
2b214147d4 Merge "msm: camera: sensor: Cleaning redundant code" into camera-kernel.lnx.7.0 2024-04-01 01:58:16 -07:00
Shivi Mangal
6245be68a9 msm: camera: sensor: Handling race condition in util api
I2C cmd is coming from user space which can be modified due to
access to shared memory. This change scopes the data locally so
as to avoid vulnerability of count being modified by external
means while executing due to being in shared memory.

CRs-Fixed: 3707472
Change-Id: I8a89e23e99b80b089ed4c4cf3098feead752356e
Signed-off-by: Shivi Mangal <quic_smangal@quicinc.com>
(cherry picked from commit 4e00cc5f9f81bf471d58ee5d6beb210a5326fcff)
2024-03-26 03:53:05 -07:00
Camera Software Integration
e8fb277c8d Merge "msm: camera: sensor: Optimize usleep_range call during power on/off" into camera-kernel.lnx.7.0 2024-03-25 23:45:20 -07:00
Abhilash Mahapatra
9d0e75ed46 msm: camera: sensor: Cleaning redundant code
Change includes proper handling of identical
code in if-else conditional blocks.

CIDs-Fixed: 116678, 115377
CRs-Fixed: 3764553
Change-Id: Ib83b6644a5df741d299af76f30ed5137c657415e
Signed-off-by: Abhilash Mahapatra <quic_abhmah@quicinc.com>
2024-03-20 02:53:24 -07:00
Mukund Deshmukh
3989f5c473 msm: camera: sensor: Added macro-check to enable WLED compilation
-include header for WLED flash

CRs-Fixed: 3759419.

Change-Id: Ib2fefd4deeeccf7a2bd5a6c8e7c8e4fd19f712ed
Signed-off-by: Mukund Deshmukh <quic_mdeshmuk@quicinc.com>
2024-03-18 15:19:13 +05:30
liji
5ea0047a7a msm: camera: sensor: Optimize usleep_range call during power on/off
Decrease max value of usleep_range during sensor power on/off

CRs-Fixed: 3698124
Change-Id: If152fce49331fa057cf6bcb63f99b17b184dd00e
Signed-off-by: liji <quic_liji@quicinc.com>
(cherry picked from commit a4c76acef4188da15247304a58d262b4d2bb9c8d)
2024-03-16 22:18:12 -07:00
Mukund Deshmukh
dc1b82712d msm: camera: csiphy: Update PHY secure CP register for volcano
Update secure CP register bitmask for volcano csiphy-v2.2.1

CRs-Fixed: 3753058.

Change-Id: Ie44d52ad3ad18b42163c2f848d90d203015ccebf
Signed-off-by: Mukund Deshmukh <quic_mdeshmuk@quicinc.com>
2024-03-12 21:47:17 -07:00
Wasim Khan
61056e4ed8 Merge "msm: camera: sensor: Proper handling of race condition in util api" into camera-kernel.lnx.7.0 2024-02-20 02:42:08 -08:00
Camera Software Integration
1eea09205f Merge "msm: camera: sensor: Duplicate TPG changes for Crow" into camera-kernel.lnx.7.0 2024-02-14 02:55:40 -08:00
Wasim Khan
7c2568adff Merge "msm: camera: common: Prevent NULL access in ISP & Sensor driver" into camera-kernel.lnx.7.0 2024-02-12 04:17:42 -08:00
Shivi Mangal
0ed9862f09 msm: camera: sensor: Proper handling of race condition in util api
Power count is coming from user space which can be modified due to
access to shared memory. This change scopes the data locally so
as to avoid vulnerability of count being modified by external
means while executing due to being in shared memory.

CRs-Fixed: 3691744.

Change-Id: I57d13435453195f8aab0c9aad4414d290274ff81
Signed-off-by: Shivi Mangal <quic_smangal@quicinc.com>
2024-02-11 08:58:57 -08:00
Camera Software Integration
f888f2c3b9 Merge "msm: camera: sensor: Proper handling of NULL Dereference" into camera-kernel.lnx.7.0 2024-02-11 07:20:53 -08:00
Camera Software Integration
82fcf87afd Merge "msm: camera: sensor: Use bubble packet for request reapply" into camera-kernel.lnx.7.0 2024-02-11 07:20:45 -08:00
Sourabh Soni
7ca6a56b11 msm: camera: common: Prevent NULL access in ISP & Sensor driver
Null arguments in ISP and Sensor drivers during init
and deinit calls can result in invalid dereferences
impacting the stability.
This commit adds checks to
handle such invalid arguments.

CRs-Fixed: 3711570
Change-Id: I08727201f787af0d5bc5dbe85acea03bb4db247c
Signed-off-by: Sourabh Soni <quic_soursoni@quicinc.com>
2024-02-06 03:14:00 -08:00
Wasim Khan
0f44ebacdf Merge "msm: camera: tpg: Handling Null Pointer Dereference" into camera-kernel.lnx.7.0 2024-02-05 03:24:19 -08:00
Wasim Khan
0fc142d2fa Merge "msm: camera: csiphy: Trigger ISP callback on phy clock change" into camera-kernel.lnx.7.0 2024-02-05 03:24:15 -08:00
Abhilash Mahapatra
23bc30fee2 msm: camera: sensor: Proper handling of NULL Dereference
- Change to dereference s_ctrl only after proper
  NULL Dereference Check.
- Proper Handling in case of invalid pinctrl
  index.
CIDs Fixed: 50869, 41493

CRs-Fixed: 3715664
Change-Id: If55f7d0854eb4709bd9e93f10bf67318a348a035
Signed-off-by: Abhilash Mahapatra <quic_abhmah@quicinc.com>
2024-02-01 01:02:54 -08:00
Karthik Anantha Ram
6d725cc619 msm: camera: sensor: Use bubble packet for request reapply
Use bubble packet for request reapply for all scenarios
irrespective of mode switch. Bubble packet carries exposure
updates as well.

CRs-Fixed: 3689201
Change-Id: If2170fd77ea7fe88155ed7101fc053d13bd592a8
Signed-off-by: Karthik Anantha Ram <quic_kartanan@quicinc.com>
(cherry picked from commit c0b8a1bad215c6ba71851897ad642611f085dfb3)
2024-01-31 23:12:59 -08:00
Abhilash Mahapatra
2d9d2bc7ec msm: camera: tpg: Handling Null Pointer Dereference
Proper handling of null pointer dereference in tpg
kernel code.
Fix for cust CID: 121781 119491

CRs-Fixed: 3714844
Change-Id: I653a6e3721223f705a4f1579ab54c2a145bf2d3c
Signed-off-by: Abhilash Mahapatra <quic_abhmah@quicinc.com>
2024-01-24 00:58:10 -08:00
Shadul Shaikh
57f19ae659 msm: camera: sensor: Duplicate TPG changes for Crow
Add support to skip TPG hardware operations with
"hw-no-ops" property.

CRs-Fixed: 3562223

Change-Id: I2ce3cc3d46d90567dba23e8952bb41e7b5936be4
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit a117f9910be023824aea1ad598bf59359730e1f4)
2024-01-23 16:00:15 +05:30
Shadul Shaikh
fe2796ca01 msm: camera: csiphy: Trigger ISP callback on phy clock change
Trigger callback to ISP each time when there is a change
in phy clock so that csid and tfe clock rate can be
updated accordingly. The argument passed in callback api is
the final phy clock rate that is applied.

CRs-Fixed: 2854066

Change-Id: Ia74465e4082e08b4c50338e0eb779f996afa2795
Signed-off-by: shiwgupt <quic_shiwgupt@quicinc.com>
Signed-off-by: shaduls <quic_shaduls@quicinc.com>
(cherry picked from commit 1fd5054f530a16a5bf90901ba4c8bf2025e136dc)
2024-01-17 04:08:22 -08:00
jinguiw
7390bf08c9 msm: camera: sensor: add missing call for put buf
adding missing call for put buf in flash to avoid leak.

CRs-Fixed: 3666659
Change-Id: I2e08331654e63b77950bb83ee6d95c4f5a716a86
Signed-off-by: jinguiw <quic_jinguiw@quicinc.com>
(cherry picked from commit 92e992dfae3cd269fbba0b51f0b456bebbb5f797)
2024-01-15 23:41:22 -08:00
Camera Software Integration
ef21140fd3 Merge "msm: camera: sensor: Duplicate sensor changes" into camera-kernel.lnx.7.0 2023-12-25 19:44:48 -08:00
Camera Software Integration
d073f8c8d6 Merge "msm: camera: cci: Check if cci_info structure pointer is NULL" into camera-kernel.lnx.7.0 2023-12-19 21:56:47 -08:00
Camera Software Integration
3e9d2a6729 Merge "msm: camera: sensor: Add threaded irq support for cci" into camera-kernel.lnx.7.0 2023-12-18 06:53:09 -08:00
Camera Software Integration
080692e6ef Merge "msm: camera: sensor: Reg settings missed while lookahead on qup" into camera-kernel.lnx.7.0 2023-12-18 06:53:04 -08:00
Shravan Nevatia
e309d6fc30 msm: camera: sensor: Duplicate sensor changes
Add support to skip HW operations (power/CCI) for
sensor nodes with "hw-no-ops" property. These nodes are
dummy entries since CSID reads data from a different sensor.

CRs-Fixed: 3150840
Change-Id: I6ceb3f9d2ea4f16abb9d5d2a6b89d5cb1d95c614
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit 3deec40a9a58296f6f43d3cfe15b092e5a16c28b)
2023-12-14 16:58:54 +05:30
Camera Software Integration
a90b42d899 Merge "msm: camera: sensor: Add Trace logs for CCI BURST WRITE" into camera-kernel.lnx.7.0 2023-12-13 02:01:14 -08:00
chengxue
5aa6302ba5 msm: camera: sensor: Reg settings missed while lookahead on qup
While we lookahead and merge the continuous reg settings to
burst, the packed setting len with uint8 data type may happen
overflow if the continuous reg setting count is larger than 255,
then some reg settings missed and lead to some sensor issues,
so modify the data type of len to avoid it.

CRs-Fixed: 3678429
Change-Id: I51a153d2340b84dd874ecd7bef6b3df1356611b0
Signed-off-by: chengxue <quic_chengxue@quicinc.com>
(cherry picked from commit aadcb5e66d37f556c570621e3b15e834601f074b)
2023-12-13 01:58:42 -08:00
Lokesh Kumar Aakulu
8dc1b0cd65 msm: camera: sensor: Add threaded irq support for cci
When CCI drains its payload cmds in QUEUE because
of CPU scheduling delays from SW Driver side then
next successive transaction will endup in NACK ERROR.
To Fix this issue, Updating payload cmds to CCI QUEUE
is moved to Threaded irq so that Scheduling delays can
be minimized and avoid NACK Error.

CRs-Fixed: 3562709
Change-Id: I577a6531d692a4f202651e2dd5d4cf0684259b75
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
(cherry picked from commit bcdafbc3c3afcbed75c2c469f26d8c483d0430d1)
2023-12-13 01:58:01 -08:00
Camera Software Integration
7cdb3df0f5 Merge "msm: camera: sensor: Add CCI BURST WRITE Support" into camera-kernel.lnx.7.0 2023-12-11 09:08:15 -08:00
Camera Software Integration
192fbd4d41 Merge "msm: camera: csiphy: Update PHY secure CP register for Crow" into camera-kernel.lnx.7.0 2023-12-11 09:07:44 -08:00
Camera Software Integration
85469b7344 Merge "msm: camera: csiphy: Update PHY secure CP register" into camera-kernel.lnx.7.0 2023-12-11 09:07:28 -08:00
Lokesh Kumar Aakulu
8bc2eafe25 msm: camera: sensor: Add Trace logs for CCI BURST WRITE
Add Trace logs for each threshold irq and corresponding
Error cases for BURST WRITE usecases.

CRs-Fixed: 3562709
Change-Id: I9e91fc0b9ae0eda20063c8150c8c4694b583355f
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
(cherry picked from commit 9326d397a2ec90696ce37a5d5966cdc671d657e3)
2023-12-10 06:19:49 -08:00
Lokesh Kumar Aakulu
3efecb742f msm: camera: sensor: Add CCI BURST WRITE Support
Introduce Threshold IRQ and compose dynamically
allocated buffer with CCI BURST WRITE Commands
and finally write to the CCI HW register and
manage Threshold Interrupts in optimized way. So,
that SW Driver latencies will not affect the I2C
BURST WRITE functionality.

CRs-Fixed: 3562709
Change-Id: I5749ba3b61e28d8f2c1075f46f470f5a9c5bd6b5
Signed-off-by: Lokesh Kumar Aakulu <quic_lkumar@quicinc.com>
(cherry picked from commit 1e4f481db9076c766b7300bb65364a13a61247c1)
2023-12-06 08:10:04 -08:00
Shadul Shaikh
24376453b3 msm: camera: csiphy: Update PHY secure CP register for Crow
Update secure CP register bitmask for Crow csiphy-v2.1.2.

CRs-Fixed: 3542076

Change-Id: I02cbb9528661767f0c275b6ad110002ce372591e
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit 42c8aa11f18a71c6acd272574e8149d58a5dfd52)
2023-11-28 10:40:37 +05:30
Shadul Shaikh
a6fbca726b msm: camera: sensor: Remove mutex sensitive call in interrupt context
Remove the function call, is getting clock rates with mutex locked
in interrupt context.

CRs-Fixed: 3615675

Change-Id: I838fbd0b211e454de812b7631a1bb8072072ec75
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit a42bed83fbfd0dff1940ce7b221ee3370f1e917e)
2023-11-23 14:20:26 +05:30
Shadul Shaikh
9bd3915e24 msm: camera: cci: Check if cci_info structure pointer is NULL
Though cci_ctrl is not NULL its content is handled by user,
who could set cci_info to NULL. A NULL pointer check is placed
before accessing it to avoid any null pointer derefernce.

CRs-Fixed: 3095084

Change-Id: I6f50d4ba38efd9b5c0eb0d14e3d958ff94c11554
Signed-off-by: Rajat Goel <quic_rajgoe@quicinc.com>
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit 81c7a070db15aea8a2d7835a68840ac31f4586fb)
2023-11-22 09:29:04 -08:00
Shadul Shaikh
0ab2c977a1 msm: camera: csiphy: Update PHY secure CP register
Update PHY secure CP register bitmask logic for CSIPHY
1.2.3.

CRs-Fixed: 3176306
Change-Id: Ie15767f3bd5d162ba544080e25de8c41c57d4ad4
Signed-off-by: shiwgupt <quic_shiwgupt@quicinc.com>
Signed-off-by: Shadul Shaikh <quic_shaduls@quicinc.com>
(cherry picked from commit e35411f0ea905b01cf45ee6b7ffe74e1a7781df0)
2023-11-22 09:26:42 -08:00
Shravan Nevatia
5e66e1bf36 msm: camera: csiphy: Add support for dummy PHY settings
Add the CSIPHY_DNP_PARAMS macro to specify dummy PHY
settings. These settings will not be applied to HW
and can be used to pad the settings arrays.

CRs-Fixed: 3642100
Change-Id: I42859598996d6190b23111e8ac655bb34e174238
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit b78027078dd6654f96f6d0472ebab09c6e1b088b)
2023-11-21 23:10:55 -08:00
Sourabh Soni
eeb2706049 msm: camera: common: Added missing NULL Checks
This change is returning error for the cases
when platform device misses some data for
device or sub device. Adding Null pointer
checks resolves this issue.

CRs-Fixed: 3608850
Change-Id: If8fc3fc7c93bb2b95087674165dca8c1c13d54f6
Signed-off-by: Sourabh Soni <quic_soursoni@quicinc.com>
2023-10-14 17:54:09 +05:30
mingpan
0c04a30b66 msm: camera: common: Fix possible OOB reads and writes operation
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)
2023-10-06 15:26:34 +05:30
Shravan Nevatia
6bbdc6d2ec msm: camera: sensor: Add subdev data ptr NULL checks
Add NULL checks for the private device data ptr
returned by v4l2_get_subdevdata for sensor/CCI/PHY/flash
subdevs.

CRs-Fixed: 3605325
Change-Id: I146857a944988655f75327046bebd9b87154939b
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit 8eaa13f96deb4d940c25cb6043a06f0b7235966a)
2023-10-06 15:25:29 +05:30
Camera Software Integration
19ca7a73f9 Merge "msm: camera: memmgr: Add missing calls of put buf to avoid leak" into camera-kernel.lnx.7.0 2023-10-04 03:06:41 -07:00
Camera Software Integration
083ac0c2f4 Merge "msm: camera: sensor: Add PHY support for cliffs" into camera-kernel.lnx.7.0 2023-10-04 00:50:06 -07:00
Depeng Shao
c0c785043e msm: camera: cci: Remove some dead code
This change removes some dead checking code for
lock function.

CRs-Fixed: 3612969
Change-Id: I8f43ab6021ed6122d37d14b06f4dac1f7e48e6c8
Signed-off-by: Depeng Shao <quic_depengs@quicinc.com>
(cherry picked from commit eea20d5fb340d847ec8ec50554b4334cd964ce47)
2023-09-26 23:54:57 +05:30
Shravan Nevatia
0101ba0568 msm: camera: sensor: Always stream-off at flush in standby mode
Issue:
- In standby mode, aux sensor is streamed-off at flush only if
stream-off command has already been received.
- If flush happens before stream-off command, the sensor is never
streamed off. This causes the next config command to fail.

Fix:
In standby mode, stream off sensor at flush regardless of the
stream-off status.

CRs-Fixed: 3537642
Change-Id: I15956d51dae4a30cdcabbe9d0ed59857c028218e
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit d5c922710cea5c19a9bcabda946842ba47d920a5)
2023-09-26 23:54:25 +05:30
Vikram Sharma
ec8012559c msm: camera: memmgr: Add missing calls of put buf to avoid leak
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>
2023-09-26 05:49:27 -07:00
Shravan Nevatia
855f371ebb msm: camera: sensor: Add PHY support for cliffs
Add PHY driver support for cliffs (PHY version 2.2.1).

CRs-Fixed: 3618770
Change-Id: I0cec1b62e827a6c0413ec9f79612507eaaa62724
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
2023-09-22 01:42:51 -07:00
Shravan Nevatia
ed308a3020 msm: camera: sensor: Fix mutex handling in TPG driver
Issue:
TPG driver doesn't release the device mutex when the stop/
configure commands fail.

Fix:
Release the mutex everytime it's acquired in TPG driver.

Change-Id: I8414c73b89e1e69b60682d860ec1d97d6a7a8dbc
CRs-Fixed: 3594995
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit 7b9602e996781f36a79c514780d1f776f5dfda8a)
2023-09-18 09:30:52 +05:30