Re: gpio_get_value in atomic context (was: make gpio-keys use IRQF_SHARED)
From: Arve Hjønnevåg <arve@android.com>
Date: 2009-10-14 11:41:44
From: Arve Hjønnevåg <arve@android.com>
Date: 2009-10-14 11:41:44
2009/10/14 Ferenc Wagner [off-list ref]:
Dmitry Torokhov [off-list ref] writes:quoted
On Mon, Oct 12, 2009 at 07:09:50PM +0200, Ferenc Wagner wrote:quoted
The gpio_get_value function may sleep, so it should not be called in a timer function. So is drivers/staging/dream/gpio_input.c in error, too?I guess so. Initially gpio method did not sleep but that has changed.Let's make Arve aware of this then (even though it may not affect Android in practice).
If gpio_get_value may sleep, then what is gpio_get_value_cansleep for? The gpio documentation claims gpio_get_value and gpio_set_value are safe to use from interrupt context, but a call to gpio_cansleep is probably needed in probe. The matrix driver also need to change the direction of the gpio from the timer, so it would be useful to have a standard way to check if this is allowed as well. -- Arve Hjønnevåg -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html