]> rtime.felk.cvut.cz Git - linux-imx.git/commit
i2c-mpc: do not allow interruptions when waiting for I2C to complete
authorTimur Tabi <timur@freescale.com>
Fri, 6 Feb 2009 14:00:37 +0000 (08:00 -0600)
committerKumar Gala <galak@kernel.crashing.org>
Mon, 9 Mar 2009 14:25:34 +0000 (09:25 -0500)
commit1ab082d7cbd0f34e39a5396cc6340c00bc5d66ef
treeae55102ad5c2ef84ca0462f29e6adf3607daf9b7
parent652e8f8d579d61745094e36b4ff085026a332e73
i2c-mpc: do not allow interruptions when waiting for I2C to complete

The i2c_wait() function is using wait_event_interruptible_timeout() to wait for
the I2C controller to signal that it has completed an I2C bus operation.  If
the process that causes the I2C operation terminated abruptly, the wait will
be interrupted, returning an error.  It is better to let the I2C operation
finished before the process exits.

It is safe to use wait_event_timeout() instead, because the timeout will allow
the process to exit if the I2C bus hangs.  It's also better to allow the
I2C operation to finish, because unacknowledged I2C operations can cause the
I2C bus to hang.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
drivers/i2c/busses/i2c-mpc.c