Skip to contentSkip to conversation

libata: allow xgene-ahci to opt-out of tag ordered submission

PATCH In review Dan Williams 1 participant 2 messages Jun 6, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata: allow xgene-ahci to opt-out of tag ordered submission

Ming Lei reports:
"Looks the commit 8a4aeec8d(libata/ahci: accommodate tag ordered
controllers) causes below sata failure on APM AHCI controller.

And the error does disappear after reverting the commit.

     ata4.00: exception Emask 0x40 SAct 0xff00 SErr 0x800 action 0x6 frozen
     ata4: SError: { HostInt }
     ata4.00: failed command: READ FPDMA QUEUED
     ata4.00: cmd 60/08:40:e0:a4:88/00:00:04:00:00/40 tag 8 ncq 4096 in
              res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x44 (timeout)"

http://marc.info/?l=linux-kernel&m=140195842716315&w=2

Maintain tag ordered submission as the default, but allow xgene-ahci to continue with the old behavior.

Cc Loc Ho <[email protected]>
Cc Tuan Phan <[email protected]>
Cc Dave Jiang <[email protected]>
Cc Suman Tripathi <[email protected]>
Cc Ed Ciechanowski <[email protected]>
Cc Matthew Wilcox <[email protected]>
---
 drivers/ata/ahci_xgene.c  |    2 ++
 drivers/ata/libata-core.c |   42 +++++++++++++++++++++++++++++++++++++++---
 drivers/ata/libata.h      |    2 ++
 include/linux/libata.h    |    1 +
 4 files changed, 44 insertions(+), 3 deletions(-)
drivers/ata/ahci_xgene.c +2 -0
index 77c89bf171f1..33de8d23de8a 100644
@@ -28,6 +28,7 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/phy/phy.h>
+#include "libata.h"
 #include "ahci.h"
 
 /* Max # of disk per a controller */
@@ -300,6 +301,7 @@ static struct ata_port_operations xgene_ahci_ops = {
 	.host_stop = xgene_ahci_host_stop,
 	.hardreset = xgene_ahci_hardreset,
 	.read_id = xgene_ahci_read_id,
+	.qc_new = ata_qc_new_fifo_order,
 };
 
 static const struct ata_port_info xgene_ahci_port_info = {
drivers/ata/libata-core.c +39 -3

72 lines not on this page · raw message

drivers/ata/libata.h +2 -0
index 45b5ab3a95d5..381ba41de464 100644
@@ -90,6 +90,8 @@ extern int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel);
 extern unsigned int ata_dev_set_feature(struct ata_device *dev,
 					u8 enable, u8 feature);
 extern void ata_sg_clean(struct ata_queued_cmd *qc);
+extern struct ata_queued_cmd *ata_qc_new_tag_order(struct ata_port *ap);
+extern struct ata_queued_cmd *ata_qc_new_fifo_order(struct ata_port *ap);
 extern void ata_qc_free(struct ata_queued_cmd *qc);
 extern void ata_qc_issue(struct ata_queued_cmd *qc);
 extern void __ata_qc_complete(struct ata_queued_cmd *qc);
include/linux/libata.h +1 -0
index 5ab4e3a76721..852686837d1c 100644
@@ -880,6 +880,7 @@ struct ata_port_operations {
 	void (*qc_prep)(struct ata_queued_cmd *qc);
 	unsigned int (*qc_issue)(struct ata_queued_cmd *qc);
 	bool (*qc_fill_rtf)(struct ata_queued_cmd *qc);
+	struct ata_queued_cmd *(*qc_new)(struct ata_port *ap);
 
 	/*
 	 * Configuration and exception handling
#1 lore raw
Quoted 27 lines · Dan Williams

Ming Lei reports:
"Looks the commit 8a4aeec8d(libata/ahci: accommodate tag ordered
controllers) causes below sata failure on APM AHCI controller.

   And the error does disappear after reverting the commit.

     ata4.00: exception Emask 0x40 SAct 0xff00 SErr 0x800 action 0x6 frozen
     ata4: SError: { HostInt }
     ata4.00: failed command: READ FPDMA QUEUED
     ata4.00: cmd 60/08:40:e0:a4:88/00:00:04:00:00/40 tag 8 ncq 4096 in
              res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x44 (timeout)"

http://marc.info/?l=linux-kernel&m=140195842716315&w=2

Maintain tag ordered submission as the default, but allow xgene-ahci to continue with the old behavior.

Cc Loc Ho <[email protected]>
Cc Tuan Phan <[email protected]>
Cc Dave Jiang <[email protected]>
Cc Suman Tripathi <[email protected]>
Cc Ed Ciechanowski <[email protected]>
Cc Matthew Wilcox <[email protected]>
Quoted 1 line

---

Hold off on this as it appears an ahci_xgene fix is on its way.