Camera: Use separate lock for status tracker access sync
A race condition is possible during access to status tracker in 'disonnect' and inflight updates like 'registerInFlight' and 'removeInFlightMapEntryLocked'. To avoid this, access is serialized using 'mLock'. However 'mLock' is also used in other contexts which under the right conditions could result in a deadlock. One such instance could occur during consecutive reprocess requests. The request thread while holding the request lock will try to obtain a free input buffer. In case the input stream doesn't have any free buffers left, it will block on an internal condition and wait. In the meantime if another capture request gets submitted, then the request itself will block on the request lock within request thread while holding 'mLock' inside submit helper. This will not allow incoming input buffer results to get processed as they could call 'removeInFlightMapEntryLocked' and try to acquire the already locked 'mLock'. The deadlock will continue until the input stream timeout expires, which will fail the request. One way to resolve this is by adding a separate lock which will only be used for the status tracker access synchronization. Bug: 79972865 Test: Camera CTS Change-Id: Ic63f891202ba102f6408ed714c5eef29b41404e3
Loading
Please register or sign in to comment