Skip to content

Fix unsafe disable_irq usage

Ben Nizette linux-input linux-omap lkml 1 version Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 of 9 patches 9 repliesApplied

8 of 9 patches are in this archive. The cover letter announces 9.

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/9ipu_idmac: Use disable_irq_nosync() from within irq handlers.drivers/dma/ipu/ipu_idmac.c+2 -20 replies
2/9pxa25x_udc: Use disable_irq_nosync() from within irq handlers.drivers/usb/gadget/pxa25x_udc.c+2 -20 replies
3/9omap-keypad: Use disable_irq_nosync() from within irq handlers.drivers/input/keyboard/omap-keypad.c+10 -25 replies
4/9sa1111ps2: Use disable_irq_nosync() from within irq handlers.drivers/input/serio/sa1111ps2.c+1 -10 replies
5/9tsc2007: Use disable_irq_nosync() from within irq handlers.drivers/input/touchscreen/tsc2007.c+1 -10 replies
6/9ucb1400: Use disable_irq_nosync() from within irq handlers.drivers/input/touchscreen/ucb1400_ts.c+1 -10 replies
8/9pcf50633: Use disable_irq_nosync() from within irq handlers.drivers/mfd/pcf50633-core.c+1 -10 replies
9/9omap mmc host: Use disable_irq_nosync() from within irq handlers.drivers/mmc/host/omap.c+1 -13 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchTony Lindgren
1/9
2/9
3/9
4/9
5/9
6/9
8/9
9/9A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/9] Fix unsafe disable_irq usage

After being bitten by unsafe usage of disable_irq from within that irq's handler [1], I went through and used Coccinelle to audit the rest of drivers/ too. This turned up 9 more unsafe usages.

As Haavard pointed out in that thread, disable_irq waits for running handlers of an irq to complete before returning. When a handler disable_irq's its own irq then we see a deadlock.

Note that this wasn't actually observed in the wild until the recent merge of

commit 3aa551c9b4c40018f0e261a178e3d25478dc04a9

Author: Thomas Gleixner <[email protected]>
Date:   Mon Mar 23 18:28:15 2009 +0100

genirq: add threaded interrupt handler support

Add support for threaded interrupt handlers

Regards,

	--Ben.

[1] http://lkml.org/lkml/2009/4/15/498