aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-10-13 22:18:28 -0400
committerJeff Garzik <jgarzik@redhat.com>2009-10-16 06:21:32 -0400
commit6489e3262e6b188a1a009b65e8a94b7aa17645b7 (patch)
tree6d9e13bb5a57abd06b8373fc2dced674bed152a4 /drivers
parent5deab536654f95345ea11e8ec6ed5c778df348b5 (diff)
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=14329 Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: frodone@gmail.com Cc: stable@kernel.org Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/sata_nv.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 86a40582999c..1eb4e020eb5c 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -1594,9 +1594,21 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class,
1594 !ata_dev_enabled(link->device)) 1594 !ata_dev_enabled(link->device))
1595 sata_link_hardreset(link, sata_deb_timing_hotplug, deadline, 1595 sata_link_hardreset(link, sata_deb_timing_hotplug, deadline,
1596 NULL, NULL); 1596 NULL, NULL);
1597 else if (!(ehc->i.flags & ATA_EHI_QUIET)) 1597 else {
1598 ata_link_printk(link, KERN_INFO, 1598 const unsigned long *timing = sata_ehc_deb_timing(ehc);
1599 "nv: skipping hardreset on occupied port\n"); 1599 int rc;
1600
1601 if (!(ehc->i.flags & ATA_EHI_QUIET))
1602 ata_link_printk(link, KERN_INFO, "nv: skipping "
1603 "hardreset on occupied port\n");
1604
1605 /* make sure the link is online */
1606 rc = sata_link_resume(link, timing, deadline);
1607 /* whine about phy resume failure but proceed */
1608 if (rc && rc != -EOPNOTSUPP)
1609 ata_link_printk(link, KERN_WARNING, "failed to resume "
1610 "link (errno=%d)\n", rc);
1611 }
1600 1612
1601 /* device signature acquisition is unreliable */ 1613 /* device signature acquisition is unreliable */
1602 return -EAGAIN; 1614 return -EAGAIN;