libata: improve EH internal command timeout handling
authorTejun Heo <htejun@gmail.com>
Mon, 19 May 2008 17:17:54 +0000 (02:17 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 14 Jul 2008 19:59:32 +0000 (15:59 -0400)
commit87fbc5a060faf2394bee88a93519f9b9d434727c
tree6f90cacb1471e64051473c4e1e664b2dea8603e0
parentd8af0eb6046c56e7238171ca420622541db24926
libata: improve EH internal command timeout handling

ATA_TMOUT_INTERNAL which was 30secs were used for all internal
commands which is way too long when something goes wrong.  This patch
implements command type based stepped timeouts.  Different command
types can use different timeouts and each command type can use
different timeout values after timeouts.

ie. the initial timeout is set to a value which should cover most of
the cases but not too long so that run away cases don't delay things
too much.  After the first try times out, the second try can use
longer timeout and if that one times out too, it can go for full 30sec
timeout.

IDENTIFYs use 5s - 10s - 30s timeout and all other commands use 5s -
10s timeouts.

This patch significantly cuts down the needed time to handle failure
cases while still allowing libata to work with nut job devices through
retries.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/ata/libata.h
include/linux/libata.h