Kernel module not receiving interrupts properly
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a pulse generator that's supposed to trigger my linux device to take an action, and that pulse goes to an IRQ on my processor.
In the linux device tree the interrupt is represented under this entry
align_trigger
compatible = "align_trigger";
interrupt-parent = <0x1>;
interrupts = <0x0 0x37 0x4>;
;
So in my kernel module I use this
dtnode = of_find_compatible_node(NULL,NULL,"align_trigger");
if(!dtnode)
printk(KERN_ALERT "Unable to locate devicetree entryn");
else
irq_index = of_irq_get(dtnode,0);
if(irq_index>0)
i = request_irq(irq_index,align_trigger_irq,0,"gxq_03",NULL);
if(i)
printk(KERN_ALERT "Unable to register IRQn");
else
printk(KERN_ALERT "Registed IRQ %dn",irq_index);
And then the IRQ handler I use is this
irqreturn_t align_trigger_irq(int irq,void *ptr, struct pt_regs *regs)
if(max_segment>0)
if(current_segment>=max_segment)
current_segment = 0;
else
current_segment++;
printk(KERN_ALERT "CURRENT SEGMENT: %dn",current_segment);
return IRQ_HANDLED;
So at the moment its not doing much, just reporting when it gets triggered so I can confirm it. The pulse generator is sending interrupts in every 100 us, and I set the max segment to 100.
I checked my log every 10 seconds for 1 minute.
10 Seconds-> CURRENT FRAME: 1
20 Seconds-> CURRENT FRAME: 1
30 Seconds-> CURRENT FRAME: 2
40 Seconds-> CURRENT FRAME: 4
50 Seconds-> CURRENT FRAME: 5
60 Seconds-> CURRENT FRAME: 5
So I am certainly not getting the number of interrupts per second that I ought to be getting, and it doesn't really seem to be a consistent rate being seen by the processor.
The reported IRQ number was 165, so I looked at /proc/interrupts, since that's what's been mentioned on other posts about interrupts. The entry for 165 is this:
CPU0 CPU1
165: 8 0 GIC-0 87 Level gxq_03
The only thing I am able to verify is that my pulse generator is putting out pulses at the right rate, but there is alot that could potentially be going wrong in between that and my kernel module registering an interrupt. How can I proceed with debugging what is going wrong?
kernel-modules interrupt
add a comment |Â
up vote
0
down vote
favorite
I have a pulse generator that's supposed to trigger my linux device to take an action, and that pulse goes to an IRQ on my processor.
In the linux device tree the interrupt is represented under this entry
align_trigger
compatible = "align_trigger";
interrupt-parent = <0x1>;
interrupts = <0x0 0x37 0x4>;
;
So in my kernel module I use this
dtnode = of_find_compatible_node(NULL,NULL,"align_trigger");
if(!dtnode)
printk(KERN_ALERT "Unable to locate devicetree entryn");
else
irq_index = of_irq_get(dtnode,0);
if(irq_index>0)
i = request_irq(irq_index,align_trigger_irq,0,"gxq_03",NULL);
if(i)
printk(KERN_ALERT "Unable to register IRQn");
else
printk(KERN_ALERT "Registed IRQ %dn",irq_index);
And then the IRQ handler I use is this
irqreturn_t align_trigger_irq(int irq,void *ptr, struct pt_regs *regs)
if(max_segment>0)
if(current_segment>=max_segment)
current_segment = 0;
else
current_segment++;
printk(KERN_ALERT "CURRENT SEGMENT: %dn",current_segment);
return IRQ_HANDLED;
So at the moment its not doing much, just reporting when it gets triggered so I can confirm it. The pulse generator is sending interrupts in every 100 us, and I set the max segment to 100.
I checked my log every 10 seconds for 1 minute.
10 Seconds-> CURRENT FRAME: 1
20 Seconds-> CURRENT FRAME: 1
30 Seconds-> CURRENT FRAME: 2
40 Seconds-> CURRENT FRAME: 4
50 Seconds-> CURRENT FRAME: 5
60 Seconds-> CURRENT FRAME: 5
So I am certainly not getting the number of interrupts per second that I ought to be getting, and it doesn't really seem to be a consistent rate being seen by the processor.
The reported IRQ number was 165, so I looked at /proc/interrupts, since that's what's been mentioned on other posts about interrupts. The entry for 165 is this:
CPU0 CPU1
165: 8 0 GIC-0 87 Level gxq_03
The only thing I am able to verify is that my pulse generator is putting out pulses at the right rate, but there is alot that could potentially be going wrong in between that and my kernel module registering an interrupt. How can I proceed with debugging what is going wrong?
kernel-modules interrupt
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a pulse generator that's supposed to trigger my linux device to take an action, and that pulse goes to an IRQ on my processor.
In the linux device tree the interrupt is represented under this entry
align_trigger
compatible = "align_trigger";
interrupt-parent = <0x1>;
interrupts = <0x0 0x37 0x4>;
;
So in my kernel module I use this
dtnode = of_find_compatible_node(NULL,NULL,"align_trigger");
if(!dtnode)
printk(KERN_ALERT "Unable to locate devicetree entryn");
else
irq_index = of_irq_get(dtnode,0);
if(irq_index>0)
i = request_irq(irq_index,align_trigger_irq,0,"gxq_03",NULL);
if(i)
printk(KERN_ALERT "Unable to register IRQn");
else
printk(KERN_ALERT "Registed IRQ %dn",irq_index);
And then the IRQ handler I use is this
irqreturn_t align_trigger_irq(int irq,void *ptr, struct pt_regs *regs)
if(max_segment>0)
if(current_segment>=max_segment)
current_segment = 0;
else
current_segment++;
printk(KERN_ALERT "CURRENT SEGMENT: %dn",current_segment);
return IRQ_HANDLED;
So at the moment its not doing much, just reporting when it gets triggered so I can confirm it. The pulse generator is sending interrupts in every 100 us, and I set the max segment to 100.
I checked my log every 10 seconds for 1 minute.
10 Seconds-> CURRENT FRAME: 1
20 Seconds-> CURRENT FRAME: 1
30 Seconds-> CURRENT FRAME: 2
40 Seconds-> CURRENT FRAME: 4
50 Seconds-> CURRENT FRAME: 5
60 Seconds-> CURRENT FRAME: 5
So I am certainly not getting the number of interrupts per second that I ought to be getting, and it doesn't really seem to be a consistent rate being seen by the processor.
The reported IRQ number was 165, so I looked at /proc/interrupts, since that's what's been mentioned on other posts about interrupts. The entry for 165 is this:
CPU0 CPU1
165: 8 0 GIC-0 87 Level gxq_03
The only thing I am able to verify is that my pulse generator is putting out pulses at the right rate, but there is alot that could potentially be going wrong in between that and my kernel module registering an interrupt. How can I proceed with debugging what is going wrong?
kernel-modules interrupt
I have a pulse generator that's supposed to trigger my linux device to take an action, and that pulse goes to an IRQ on my processor.
In the linux device tree the interrupt is represented under this entry
align_trigger
compatible = "align_trigger";
interrupt-parent = <0x1>;
interrupts = <0x0 0x37 0x4>;
;
So in my kernel module I use this
dtnode = of_find_compatible_node(NULL,NULL,"align_trigger");
if(!dtnode)
printk(KERN_ALERT "Unable to locate devicetree entryn");
else
irq_index = of_irq_get(dtnode,0);
if(irq_index>0)
i = request_irq(irq_index,align_trigger_irq,0,"gxq_03",NULL);
if(i)
printk(KERN_ALERT "Unable to register IRQn");
else
printk(KERN_ALERT "Registed IRQ %dn",irq_index);
And then the IRQ handler I use is this
irqreturn_t align_trigger_irq(int irq,void *ptr, struct pt_regs *regs)
if(max_segment>0)
if(current_segment>=max_segment)
current_segment = 0;
else
current_segment++;
printk(KERN_ALERT "CURRENT SEGMENT: %dn",current_segment);
return IRQ_HANDLED;
So at the moment its not doing much, just reporting when it gets triggered so I can confirm it. The pulse generator is sending interrupts in every 100 us, and I set the max segment to 100.
I checked my log every 10 seconds for 1 minute.
10 Seconds-> CURRENT FRAME: 1
20 Seconds-> CURRENT FRAME: 1
30 Seconds-> CURRENT FRAME: 2
40 Seconds-> CURRENT FRAME: 4
50 Seconds-> CURRENT FRAME: 5
60 Seconds-> CURRENT FRAME: 5
So I am certainly not getting the number of interrupts per second that I ought to be getting, and it doesn't really seem to be a consistent rate being seen by the processor.
The reported IRQ number was 165, so I looked at /proc/interrupts, since that's what's been mentioned on other posts about interrupts. The entry for 165 is this:
CPU0 CPU1
165: 8 0 GIC-0 87 Level gxq_03
The only thing I am able to verify is that my pulse generator is putting out pulses at the right rate, but there is alot that could potentially be going wrong in between that and my kernel module registering an interrupt. How can I proceed with debugging what is going wrong?
kernel-modules interrupt
asked Feb 15 at 19:56
Zephyr
206211
206211
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424456%2fkernel-module-not-receiving-interrupts-properly%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password