Commit 6489e326 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

sata_nv: make sure link is brough up online when skipping hardreset

prereset doesn't bring link online if hardreset is about to happen and
nv_hardreset() may skip if conditions are not right so softreset may
be entered with non-working link status if the system firmware didn't
bring it up before entering OS code which can happen during resume.
This patch makes nv_hardreset() to bring up the link if it's skipping
reset.

This bug was reported by frodone@gmail.com in the following bug entry.

  http://bugzilla.kernel.org/show_bug.cgi?id=14329Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Reported-by: frodone@gmail.com
Cc: stable@kernel.org
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 5deab536
...@@ -1594,9 +1594,21 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class, ...@@ -1594,9 +1594,21 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class,
!ata_dev_enabled(link->device)) !ata_dev_enabled(link->device))
sata_link_hardreset(link, sata_deb_timing_hotplug, deadline, sata_link_hardreset(link, sata_deb_timing_hotplug, deadline,
NULL, NULL); NULL, NULL);
else if (!(ehc->i.flags & ATA_EHI_QUIET)) else {
ata_link_printk(link, KERN_INFO, const unsigned long *timing = sata_ehc_deb_timing(ehc);
"nv: skipping hardreset on occupied port\n"); int rc;
if (!(ehc->i.flags & ATA_EHI_QUIET))
ata_link_printk(link, KERN_INFO, "nv: skipping "
"hardreset on occupied port\n");
/* make sure the link is online */
rc = sata_link_resume(link, timing, deadline);
/* whine about phy resume failure but proceed */
if (rc && rc != -EOPNOTSUPP)
ata_link_printk(link, KERN_WARNING, "failed to resume "
"link (errno=%d)\n", rc);
}
/* device signature acquisition is unreliable */ /* device signature acquisition is unreliable */
return -EAGAIN; return -EAGAIN;
......
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