We have an IMX283 sensor. We use this sensor with TX2 modules over CSI ports with custom carrier board. Driver works without any problem, we can capture frames in all modes etc. but we are facing a problem on many reboots. There is a problem with driver initialization. After rebooting couple of times kernel module hangs at loading state.
This issue happens randomly. Most of the time we are able to use the camera, driver is ok. But after restarting TX2 couple times this happens and we can not reboot the TX2 and we can not capture frames.
I am attaching related dmesg output. What could be causing this? How can we debug it?
are you having scripts to insert the kernel module during boot-up sequence? why don’t you make it as kernel builti-in driver if you would like to have sensor driver be loaded at kernel initialization stage.
thanks
# R32 (release), REVISION: 4.4, GCID: 23942405, BOARD: t186ref, EABI: aarch64, DATE: Fri Oct 16 19:37:08 UTC 2020
Yes, I have an insmod line in my camera application which works as a service.
Actually I was using that way before. After realizing this problem I switched to build as module method instead of built-in module.
I guess I misunderstand but yes for example I can make another insmod call to load another kernel module. It loads up and gets into “Live” state. We can gather dmesg output. I attached samples above.
I dig into code and this is what I found out:
This error happens at
drivers/media/v4l2-core/v4l2-ctrls.c : (below HERE mark)
/* Call s_ctrl for all controls owned by the handler */
int v4l2_ctrl_handler_setup(struct v4l2_ctrl_handler *hdl)
{
struct v4l2_ctrl *ctrl;
int ret = 0;
if (hdl == NULL)
return 0;
mutex_lock(hdl->lock);
list_for_each_entry(ctrl, &hdl->ctrls, node)
ctrl->done = false;
list_for_each_entry(ctrl, &hdl->ctrls, node) {
struct v4l2_ctrl *master = ctrl->cluster[0];
int i;
/* Skip if this control was already handled by a cluster. */
/* Skip button controls and read-only controls. */
if (ctrl->done || ctrl->type == V4L2_CTRL_TYPE_BUTTON ||
(ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY))
continue;
//HERE------------------------
for (i = 0; i < master->ncontrols; i++) {
if (master->cluster[i]) {
cur_to_new(master->cluster[i]);
master->cluster[i]->is_new = 1;
master->cluster[i]->done = true;
}
}
ret = call_op(master, s_ctrl);
if (ret)
break;
}
mutex_unlock(hdl->lock);
return ret;
}
master->ncontrols value returns a very large negative number such as -673772992. Probably it doesnt get initialized. But it does return 1 generally. I cant understand the randomness of this issue.