Commit 0cbf0711 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

libata: fix sata_link_hardreset() @online out parameter handling

The @online out parameter is supposed to set to true iff link is
online and reset succeeded as advertised in the function description
and callers are coded expecting that.  However, sata_link_reset()
didn't behave this way on device readiness test failure.  Fix it.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 7715a6f9
...@@ -3653,9 +3653,13 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing, ...@@ -3653,9 +3653,13 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing,
if (check_ready) if (check_ready)
rc = ata_wait_ready(link, deadline, check_ready); rc = ata_wait_ready(link, deadline, check_ready);
out: out:
if (rc && rc != -EAGAIN) if (rc && rc != -EAGAIN) {
/* online is set iff link is online && reset succeeded */
if (online)
*online = false;
ata_link_printk(link, KERN_ERR, ata_link_printk(link, KERN_ERR,
"COMRESET failed (errno=%d)\n", rc); "COMRESET failed (errno=%d)\n", rc);
}
DPRINTK("EXIT, rc=%d\n", rc); DPRINTK("EXIT, rc=%d\n", rc);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment