From: Marc Zyngier Date: Tue, 27 Apr 2010 20:13:07 +0000 (-0700) Subject: gpio: fix pca953x set_type 'scheduling while atomic' bug X-Git-Tag: v2.6.34-rc6~20 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2cb9aeb3c9b2475955cec328487484034f414e4;p=pandora-kernel.git gpio: fix pca953x set_type 'scheduling while atomic' bug Bill Gatliff reported the following bug when using the irq_chip facility of the pca953x driver on a PPC platform: BUG: scheduling while atomic: insmod/1530/0x00000002 He traced it back to an i2c transaction in pca953x_irq_set_type(), which can be called with interrupt disabled (from __setup_irq()). As the i2c controller can sleep while sending a message, this qualifies as a bad idea. This patch moves the i2c transaction to pca953x_irq_bus_sync_unlock(), where it is actually safe to send an i2c message. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Marc Zyngier Reported-by: Bill Gatliff Cc: Eric Miao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed