Reputation: 1
I'm working on a project using the UltraZed EV SOM, and I've encountered an issue with interrupt handling in my custom kernel module.
Issue Description:
I have two video modes: "Normal" and "RAW", and I have 12 interrupt handlers. Four of these interrupt handlers are used in both modes.
1. CASE
When I start RAW recording, the dru_irq_vid11
interrupt handler works as expected and records successfully. However, if I start normal recording and then switch back to RAW recording, the dru_irq_vid11
interrupt handler does not trigger at all.
2. CASE
dru_irq_vid11
interrupt handler works as expected.stopall
command and then initiating a RAW recording, the dru_irq_vid11
interrupt handler does not trigger at all.Debugging Steps Taken:
dru_irq_vid11
handler is correctly registered and enabled.video_mode
and VID15_ENABLE
values, and they appear correct.stopall
command is functioning correctly./*init dru interrupt VID11*/
printk("Geldim, Gördüm, Gidiyorum. \n");
r_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 10);
if (!r_irq) {
dev_err(&pdev->dev, "No IRQ VID11 resource defined.\n");
return -ENXIO;
}
dru_dev->irq = r_irq->start;
printk("IRQ VID11 registered at %d\n", r_irq->start);
ret = request_irq(dru_dev->irq, dru_irq_vid11,IRQF_TRIGGER_RISING, "dru_irq_vid11", dev);
if (ret) {
dev_err(dev, "Failed to request interrupt VID11: %d\n", ret);
return ret;
}
printk("ret Value : %d\n",ret);
printk("dev Value : %d\n",dev);
ret=0;
static irqreturn_t dru_irq_vid11(int irq, void *dev_id)
{
struct device *dev = dev_id;
int num;
int vid_mode=readl(video_mode);
num = vid_mode & VID15_ENABLE;
printk("Reach -2- \n");
printk(KERN_INFO "vid_mode Value : %d\n", vid_mode);
printk(KERN_INFO "num Value : %d\n", num);
int vid11_buffercount=readl(base_part3buffercount);
int vid15_buffercount=readl(base_part4buffercount);
if(num != VID15_ENABLE){
vid11_buffercount = (vid11_buffercount & 0x0000fffff) >> 16;
dev_err(dev, "VID11 Frame Count: %d\n",vid11_buffercount);
write_mchar_vid11(dev,vid11_buffercount);
}
else{
vid15_buffercount = (vid15_buffercount & 0x0000fffff) >> 16;
dev_err(dev, "VID15 Frame Count: %d\n",vid15_buffercount);
write_mchar_vid15(dev,vid15_buffercount);
}
return IRQ_HANDLED;
}
Debugging Steps Taken:
dru_irq_vid11
handler is correctly registered and enabled.video_mode
and VID15_ENABLE
values, and they appear correct.stopall
command is functioning correctly.I started by verifying that the interrupt handler (dru_irq_vid11
) was correctly registered and enabled. I also checked that the video_mode
and VID15_ENABLE
values were correct. After sending the stopall
command, I expected the dru_irq_vid11
handler to trigger again when I initiated RAW recording. However, the handler did not trigger at all, even though the values appeared correct and the system behaved as if no data was being received. I added debug prints to confirm the handler wasn't being called, and ensured that all memory addresses and register values were correct.
Upvotes: 0
Views: 22