Skip to contentSkip to conversation

AHCI: disabled FBS before softreset handling. According to chapter 9.3.9 in AHCI spec, controller should disable FBS before softreset.

PATCH In review Xiangliang Yu 2 participants 3 messages Sep 25, 2013 – Sep 27, 2013 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 AHCI: disabled FBS before softreset handling. According to chapter 9.3.9 in AHCI spec, controller should disable FBS before softreset.

---
 drivers/ata/libahci.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
drivers/ata/libahci.c +10 -0
index acfd0f7..8d024a4 100644
@@ -1267,9 +1267,11 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
 {
 	struct ata_port *ap = link->ap;
 	struct ahci_host_priv *hpriv = ap->host->private_data;
+	struct ahci_port_priv *pp = ap->private_data;
 	const char *reason = NULL;
 	unsigned long now, msecs;
 	struct ata_taskfile tf;
+	bool flag = FALSE;
 	int rc;
 
 	DPRINTK("ENTER\n");
@@ -1279,6 +1281,11 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
 	if (rc && rc != -EOPNOTSUPP)
 		ata_link_warn(link, "failed to reset engine (errno=%d)\n", rc);
 
+	if (!ata_is_host_link(link) && pp->fbs_enabled) {
+		ahci_disable_fbs(ap);
+		flag = TRUE;
+	}
+
 	ata_tf_init(link->device, &tf);
 
 	/* issue the first D2H Register FIS */
@@ -1319,6 +1326,9 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
 	} else
 		*class = ahci_dev_classify(ap);
 
+	if (flag)
+		ahci_enable_fbs(ap);
+
 	DPRINTK("EXIT, class=%u\n", *class);
 	return 0;
 
Signature · 1 line
1.7.1
#1 lore raw

Please shorten the subject and explain in detail what this patch changes how and why along with how you tested it and what, if any, behavior changes occur from it.

Thanks.

Signature · 1 line
tejun
#2 lore raw

ok, i'll update and re-commit the patch

2013/9/26 Tejun Heo <[email protected]>:

Quoted 8 lines

Please shorten the subject and explain in detail what this patch changes how and why along with how you tested it and what, if any, behavior changes occur from it.

Thanks.

--
tejun