ata: Introduce the AHCI_HFLAG_EDGE_IRQ_BROKEN in libahci and enabling it for ahci_xgene driver.
cover ata: Introduce the AHCI_HFLAG_EDGE_IRQ_BROKEN in libahci and enabling it for ahci_xgene driver.
This patch set implements a workaround for an errate in the APM X-Gene SATA host controller with edge interrupt. The HOST_IRQ_STAT misses the edge interrupt from the PORT_IRQ_STAT when clearing the HOST_IRQ_STAT and reporting the PORT_IRQ_STAT happens in same clock cycle.
Suman Tripathi (2):
libahci: Implement the workaround to fix the missing of edge
interrupt for HOST_IRQ_STAT
ahci_xgene: Enable AHCI_HFLAG_EDGE_IRQ_BROKEN for APM X-Gen2 SATA
host controller
drivers/ata/ahci.h | 2 ++ drivers/ata/ahci_xgene.c | 3 ++- drivers/ata/libahci.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/2 libahci: Implement the workaround to fix the missing of edge interrupt for HOST_IRQ_STAT
In reply to a message not in the archiveDue to H/W errata, the HOST_IRQ_STAT register misses the edge interrupt when clearing the HOST_IRQ_STAT register and hardware reporting the PORT_IRQ_STAT register at the same clock cycle. As such, the algorithm below outlines the workaround.
1. Read HOST_IRQ_STAT register and save the state.
2. Clear the HOST_IRQ_STAT register.
3. Read back the HOST_IRQ_STAT register.
4. If HOST_IRQ_STAT register equals to zero, then traverse the rest of port's PORT_IRQ_STAT register to check if an interrupt is triggered at that point else go to step 6.
5. If PORT_IRQ_STAT register of rest ports is not equal to zero then update the state of HOST_IRQ_STAT saved in step 1.
6. Handle port interrupts.
7. Exit
--- drivers/ata/ahci.h | 2 ++ drivers/ata/libahci.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 0 deletions(-)
drivers/ata/ahci.h +2 -0
@@ -242,6 +242,8 @@ enum {AHCI_HFLAG_NO_FBS = (1 <<18 ),/* no FBS */ AHCI_HFLAG_EDGE_IRQ = (1 <<19 ),/* HOST_IRQ_STAT behaves as Edge Triggered */ + AHCI_HFLAG_EDGE_IRQ_BROKEN = (1 << 20), /* HOST_IRQ_STAT miss edge +from PORT_IRQ_STAT */ /* ap->flags bits */
drivers/ata/libahci.c +45 -0
55 lines not on this page · raw message
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/2 ahci_xgene: Enable AHCI_HFLAG_EDGE_IRQ_BROKEN for APM X-Gen2 SATA host controller
In reply to a message not in the archiveThis patch enables the AHCI_HFLAG_EDGE_IRQ_BROKEN for APM X-Gene2 AHCI SATA host controller. Due to H/W errata, the HOST_IRQ_STAT misses the edge interrupt from PORT_IRQ_STAT when clearing the HOST_IRQ_STAT and reporting the PORT_IRQ_STAT at the same clock cycle.
--- drivers/ata/ahci_xgene.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/ata/ahci_xgene.c +2 -1
@@ -779,7 +779,8 @@ skip_clk_phy: hpriv->flags =AHCI_HFLAG_NO_NCQ ;break ;case XGENE_AHCI_V2 : - hpriv->flags |=AHCI_HFLAG_YES_FBS |AHCI_HFLAG_EDGE_IRQ ; + hpriv->flags |=AHCI_HFLAG_YES_FBS |AHCI_HFLAG_EDGE_IRQ | +AHCI_HFLAG_EDGE_IRQ_BROKEN ;break ;default :break ;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
cover ata: Introduce the AHCI_HFLAG_EDGE_IRQ_BROKEN in libahci and enabling it for ahci_xgene driver.
In reply to Suman TripathiHappy new year !!
Any comments on this patchset ?
Quoted 19 lines · Suman Tripathi
This patch set implements a workaround for an errate in the APM X-Gene SATA host controller with edge interrupt. The
HOST_IRQ_STATmisses the edge interrupt from thePORT_IRQ_STATwhen clearing theHOST_IRQ_STATand reporting thePORT_IRQ_STAThappens in same clock cycle.Signed-off-by Suman Tripathi <[email protected]>Suman Tripathi (2):
libahci: Implement the workaround to fix the missing of edge
interrupt forHOST_IRQ_STAT
ahci_xgene: EnableAHCI_HFLAG_EDGE_IRQ_BROKENfor APM X-Gen2 SATA
host controllerdrivers/ata/ahci.h | 2 ++ drivers/ata/ahci_xgene.c | 3 ++- drivers/ata/libahci.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletions(-)
Signature · 3 lines
Thanks, with regards, Suman Tripathi