Commit 8d4c277e authored by Jon Hunter's avatar Jon Hunter Committed by Grant Likely

gpio/omap: warn if bank is not enabled on setting irq type

For OMAP devices, if a gpio is being used as an interrupt source but has
not been requested by calling gpio_request(), a call to request_irq()
may cause the kernel hang because the gpio bank may be disabled and
hence the register access will fail. To prevent such hangs, test for
this case and warn if this is detected.
Signed-off-by: default avatarJon Hunter <>
Reviewed-by: default avatarFelipe Balbi <>
Acked-by: default avatarSantosh Shilimkar <>
Acked-by: default avatarKevin Hilman <>
Tested-by: default avatarJavier Martinez Canillas <>
Signed-off-by: default avatarGrant Likely <>
parent ede4d7a5
......@@ -427,6 +427,9 @@ static int gpio_irq_type(struct irq_data *d, unsigned type)
int retval;
unsigned long flags;
if (WARN_ON(!bank->mod_usage))
return -EINVAL;
if (d->irq > IH_MPUIO_BASE)
gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment