I am trying to design opensource kernel module analyzing how uio driver is designed (I primarily need interrupts). I have designed class module with common routines, and device driver module, which is expected to probe specific device from device tree.
The problem I am astonished with is that probe function is suspended at the end, and I can’t identify what is going on.
Here’s the piece of probe code (sorry for mess, I was putting diag print to see what is going on)
printk(KERN_ERR "mb_ctrl class registering device");
pm_runtime_enable(&pdev->dev);
status = devm_add_action_or_reset(&pdev->dev, mb_ctrl_master_cleanup, &pdev->dev);
if (status) return status;
status = mb_ctrl_register_device(&pdev->dev, &mb_ctrl_master);
printk(KERN_ERR "mb_ctrl class returned from registering device");
if(status)
{
printk(KERN_ERR "mb_ctrl printing erro message");
dev_err(&pdev->dev, "unable to register the device");
printk(KERN_ERR "mb_ctrl finished printing erro message");
}
else
{
printk(KERN_ERR "mb_ctrl setting init flag");
master_initialized = true;
printk(KERN_ERR "mb_ctrl finished setting init flag");
}
printk(KERN_ERR "mb_ctrl class finished registering device");
printk(KERN_ERR "mb_ctrl class finished registering device1");
printk(KERN_ERR "mb_ctrl class finished registering device2");
printk(KERN_ERR "mb_ctrl class finished registering device3");
return status;
And here what is displayed in the console
The modprobe suspends exactly before the last printk statement. If I remove statement with ‘3’, the last printed will be not ‘2’, but ‘1’. And it resumes when I try to probe once more (see pic).