Re: i2c send inside ISR

From: Mark Brown
Date: Thu Jan 27 2011 - 07:25:50 EST


On Thu, Jan 27, 2011 at 09:22:27PM +0900, Murali K. Vemuri wrote:

> I am working on a driver, and I reached a problem.
> problem: My driver is supposed to send I2C message whenever it
> receives an interrupt. the interrupt is generated when a GPIO is
> detected to be FALLING EDGE of input voltage.
> Now, when I am sending the i2c message, I am getting the error and
> dump like the following:
> Any suggestions???

Use a threaded IRQ handler registered with request_threaded_irq() -
if you grep for that within the kernel you'll find quite a few examples
of handling interrupts from I2C connected devices. You can't use I2C or
other buses that need to sleep from within hard interrupt context.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/