notro / fbtft_tools

27 stars 17 forks source link

Updated IRQ request to avoid IRQ loosing #3

Closed martinlbb closed 10 years ago

martinlbb commented 10 years ago

On some condition, when driver initialize, IRQ is forgotten/deleted by system. Power switch is no longer useable (no powerdown when clicking. Kernel detect clicking, but can send an IRQ as it does not longer exist). Main cause is IRQ request is not link with a cookie, allowing any to delete it. When setting a cookie, everything works fine.

martinlbb commented 10 years ago

Hi Notro!

Thanks again for your wonderful work with TFT devices and this RPI power switch.

I've found a bug on RPI Power Switch. Basically, button stop working. Module is loaded (lsmod okay), but nothing happen. When checking IRQ (cat /proc/interrupts), there is no "Power button" interrupt.

IRQ registration in rpi_power_switch code allow anything to delete this IRQ, as there is no cookie declared (last arguments). See http://www.makelinux.net/books/lkd2/ch06lev1sec3 for explanation.

I just added cookie declaration, and everything work perfectly since them.

notro commented 10 years ago

Thanks, you might want to alert Sean Cross (or Adafruit) as well, since he wrote the module.

martinlbb commented 10 years ago

I'll do it

martinlbb commented 10 years ago

Adafruit warned: http://forums.adafruit.com/viewtopic.php?f=50&t=62551&p=317142#p317142