]> git.baikalelectronics.ru Git - kernel.git/commit
ide: correctly prevent IDE timer expiry function to run if request was already handled
authorSuleiman Souhlal <suleiman@google.com>
Tue, 10 Apr 2007 20:38:37 +0000 (22:38 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 10 Apr 2007 20:38:37 +0000 (22:38 +0200)
commit2fcbc971c75dc544c2941c9d6aa7742768ea6561
treec30fc173d8b97343f8ae7b1b1ed511366af256ab
parente16b3f857575340a627947227e1eb93e75274f8b
ide: correctly prevent IDE timer expiry function to run if request was already handled

It is possible for the timer expiry function to run even though the
request has already been handled: ide_timer_expiry() only checks that
the handler is not NULL, but it is possible that we have handled a
request (thus clearing the handler) and then started a new request
(thus starting the timer again, and setting a handler).

A simple way to exhibit this is to set the DMA timeout to 1 jiffy and
run dd: The kernel will panic after a few minutes because
ide_timer_expiry() tries to add a timer when it's already active.

To fix this, we simply add a request generation count that gets
incremented at every interrupt, and check in ide_timer_expiry() that
we have not already handled a new interrupt before running the expiry
function.

Signed-off-by: Suleiman Souhlal <suleiman@google.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
include/linux/ide.h