How to provide interrupt generating GPIOs from a kernel module
In order to test GPIO library inside the kernel the gpio-sim
module has been created which emulates what regular GPIO chip can do, including interrupt generation.
The code responsible for that is located in the gpio_sim_apply_pull()
. Don't look at the function name, because it just applies the full state of the artificial line.
Note, that in the older kernels the gpio-mockup
driver is present for the similar purposes.
How to detecting interrupt on a GPIO line in Embedded Linux?
Make the GPIO pin explicitly to detect falling edge.
At the gpio module level it is necessary to enable FALLING_DETECT of gpio.
GPIO IRQ on ARM based Embedded Linux
I assume you are triggering your interrupts with an external system (maybe a microcontroller or something that can toggle the GPIOS). Since I do not see a real ack of the interrupt, I assume the external system does not wait for the interrupt to be handled to maybe trigger a new one.
printk is a very slow function and that's why you can miss some interrupts: a new one can be triggered while you are still handling the previous one.
So I would advise not to use printk in the handler. If you want to achieve something like this, it would be better to use a tasklet or a workqueue as the bottom half of the interrupt handler.
I can only recommend the reading of the Chapter 10 of Linux Device Drivers.
Oh and by the way, your IRQ handler should not return 0 but IRQ_HANDLED.
Related Topics
How to Avoid Grub Errors After Running Apt-Get Upgrade - Ubuntu
How Does Copy-On-Write in Fork() Handle Multiple Fork
Chmod a Freshly Mounted External Drive to Set Up Writing Access
Get X/Y Position of Caret (Input Text Cursor) Under Xorg
How to Manage Permissions When Developing in a Docker Container
Why Doesn't Time() from Time.H Have a Syscall to Sys_Time
How to Create a Core File for My Crashed Program
Simulate Effect of Select() and Poll() in Kernel Socket Programming
How to Delete All Files Starting with ._ from The Shell in Linux
Efficiently Read The Average Color of The Screen Content Rendered by Xbmc
How to Make Unix Binary Self-Contained
While Using Printf How to Escape Special Characters in Shell Script
Selecting a Part of a File and Copying That into New File in Linux
Is Anyone Using Netlink for Ipc