libata: fix incorrect link online check during probe
authorTejun Heo <tj@kernel.org>
Tue, 6 Oct 2009 08:08:40 +0000 (17:08 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 7 Oct 2009 00:58:18 +0000 (20:58 -0400)
commit3b761d3d437cffcaf160a5d37eb6b3b186e491d5
treec1f501cb350776f60eb1d4deaf206b10ed852c4e
parentf80ae7e45a0e03da188494c6e947a5c8b0cdfb4a
libata: fix incorrect link online check during probe

While trying to work around spurious detection retries for
non-existent devices on slave links, commit
816ab89782ac139a8b65147cca990822bb7e8675 incorrectly added link
offline check logic before ata_eh_thaw() was called.  This means that
if an occupied link goes down briefly at the time that offline check
was performed, device class will be cleared to ATA_DEV_NONE and libata
wouldn't retry thus failing detection of the device.

The offline check should be done after the port is thawed together
with online check so that such link glitches can be detected by the
interrupt handler and handled properly.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Tim Blechmann <tim@klingt.org>
Cc: stable@kernel.org
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-eh.c