libata: fix incorrect link online check during probe
commit7bbd09e13f297655290b892621a08ec4413dd07d
authorTejun Heo <tj@kernel.org>
Tue, 6 Oct 2009 08:08:40 +0000 (6 17:08 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 12 Oct 2009 19:40:14 +0000 (12 12:40 -0700)
treeb153b89401435870a64123d7ce44b88e4aafcac9
parent99db179ffe7e2533c7796085e011f16d0f57518b
libata: fix incorrect link online check during probe

commit 3b761d3d437cffcaf160a5d37eb6b3b186e491d5 upstream.

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>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ata/libata-eh.c