diff options
-rw-r--r-- | drivers/ata/libahci.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 7e2a1b38093e..6686dbec4440 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
@@ -1267,9 +1267,11 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, | |||
1267 | { | 1267 | { |
1268 | struct ata_port *ap = link->ap; | 1268 | struct ata_port *ap = link->ap; |
1269 | struct ahci_host_priv *hpriv = ap->host->private_data; | 1269 | struct ahci_host_priv *hpriv = ap->host->private_data; |
1270 | struct ahci_port_priv *pp = ap->private_data; | ||
1270 | const char *reason = NULL; | 1271 | const char *reason = NULL; |
1271 | unsigned long now, msecs; | 1272 | unsigned long now, msecs; |
1272 | struct ata_taskfile tf; | 1273 | struct ata_taskfile tf; |
1274 | bool fbs_disabled = false; | ||
1273 | int rc; | 1275 | int rc; |
1274 | 1276 | ||
1275 | DPRINTK("ENTER\n"); | 1277 | DPRINTK("ENTER\n"); |
@@ -1279,6 +1281,16 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, | |||
1279 | if (rc && rc != -EOPNOTSUPP) | 1281 | if (rc && rc != -EOPNOTSUPP) |
1280 | ata_link_warn(link, "failed to reset engine (errno=%d)\n", rc); | 1282 | ata_link_warn(link, "failed to reset engine (errno=%d)\n", rc); |
1281 | 1283 | ||
1284 | /* | ||
1285 | * According to AHCI-1.2 9.3.9: if FBS is enable, software shall | ||
1286 | * clear PxFBS.EN to '0' prior to issuing software reset to devices | ||
1287 | * that is attached to port multiplier. | ||
1288 | */ | ||
1289 | if (!ata_is_host_link(link) && pp->fbs_enabled) { | ||
1290 | ahci_disable_fbs(ap); | ||
1291 | fbs_disabled = true; | ||
1292 | } | ||
1293 | |||
1282 | ata_tf_init(link->device, &tf); | 1294 | ata_tf_init(link->device, &tf); |
1283 | 1295 | ||
1284 | /* issue the first D2H Register FIS */ | 1296 | /* issue the first D2H Register FIS */ |
@@ -1319,6 +1331,10 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, | |||
1319 | } else | 1331 | } else |
1320 | *class = ahci_dev_classify(ap); | 1332 | *class = ahci_dev_classify(ap); |
1321 | 1333 | ||
1334 | /* re-enable FBS if disabled before */ | ||
1335 | if (fbs_disabled) | ||
1336 | ahci_enable_fbs(ap); | ||
1337 | |||
1322 | DPRINTK("EXIT, class=%u\n", *class); | 1338 | DPRINTK("EXIT, class=%u\n", *class); |
1323 | return 0; | 1339 | return 0; |
1324 | 1340 | ||