Commit a038e2536472b4dd932399b5277e65f188811de5
Committed by
Jens Axboe
1 parent
bae386f788
Exists in
master
and in
7 other branches
[PATCH] blk_start_queue() must be called with irq disabled - add warning
The queue lock can be taken from interrupts so it must always be taken with irq disabling primitives. Some primitives already verify this. blk_start_queue() is called under this lock, so interrupts must be disabled. Also document this requirement clearly in blk_init_queue(), where the queue spinlock is set. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jens Axboe <axboe@suse.de>
Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff
block/ll_rw_blk.c
... | ... | @@ -1663,6 +1663,8 @@ |
1663 | 1663 | **/ |
1664 | 1664 | void blk_start_queue(request_queue_t *q) |
1665 | 1665 | { |
1666 | + WARN_ON(!irqs_disabled()); | |
1667 | + | |
1666 | 1668 | clear_bit(QUEUE_FLAG_STOPPED, &q->queue_flags); |
1667 | 1669 | |
1668 | 1670 | /* |
... | ... | @@ -1878,7 +1880,8 @@ |
1878 | 1880 | * get dealt with eventually. |
1879 | 1881 | * |
1880 | 1882 | * The queue spin lock must be held while manipulating the requests on the |
1881 | - * request queue. | |
1883 | + * request queue; this lock will be taken also from interrupt context, so irq | |
1884 | + * disabling is needed for it. | |
1882 | 1885 | * |
1883 | 1886 | * Function returns a pointer to the initialized request queue, or NULL if |
1884 | 1887 | * it didn't succeed. |