Repository navigation
Conversation
imx415_s_stream() ignores the return value of __imx415_stop_stream(). If the I2C write fails, the callback reports success and clears the streaming flag. Another runtime PM reference can keep the sensor powered, so a subsequent start may program the mode registers while the sensor is still streaming. Return the standby error and remember that standby is unconfirmed. Drop the stream's runtime PM reference even on failure. Retry standby before programming the mode on the next start. Abort the start if the retry fails. Take a temporary PM reference if the caller retries stream-off instead. Also mark a partially completed start for recovery. On a ROCK 5B+ with two IMX415s, a one-shot injected -EIO after a successful standby write made the sensor callback return the error. The next start retried standby and delivered frames with sequences 0-7. Fixes: c7d0063 ("media: i2c: add imx415 sensor driver") Signed-off-by: xiongzt <xiongzt2003@163.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The rk2410 IMX415 driver drops the result of the standby register write
in
s_stream(0). A separate runtime PM reference can keep the sensorpowered after the stream reference is released. A later start can then
program the mode while the sensor may still be streaming.
Change
Return the standby error from the sensor callback and remember that the
standby state is unconfirmed. Before programming a new mode, retry the
standby write and abort the start if it fails again. An explicit stop
retry takes its own runtime PM reference. A partially completed start
also leaves standby pending.
Testing
camera streaming while the other opened, captured eight frames and
closed. All 100 cycles passed in each direction. The cycled sensor
returned to runtime usage 0 and the suspended state after every cycle.
-EIOon CAM1 after thephysical standby write succeeded. The sensor callback returned
-EIOand released its stream reference. The video-nodeVIDIOC_STREAMOFFreturned 0. On the next start, the standby retrysucceeded and CAM1 delivered frames with sequence numbers 0 through 7.
standby write that did not reach the simulated sensor, both with and
without another runtime PM reference. Repeated standby failure,
failed PM resume, reopen and repeated stop all passed.
byte.
git diff --checkpassed. The target branch'scheckpatch.plreported 0 errors and 0 warnings.