Page MenuHomeFreeBSD

D4240.id10399.diff
No OneTemporary

D4240.id10399.diff

Index: sys/dev/ahci/ahci.c
===================================================================
--- sys/dev/ahci/ahci.c
+++ sys/dev/ahci/ahci.c
@@ -483,6 +483,10 @@
/* AHCI declares level triggered IS. */
if (!(ctlr->quirks & AHCI_Q_EDGEIS))
ATA_OUTL(ctlr->r_mem, AHCI_IS, is);
+#if defined(__arm__) || defined(__aarch64__)
+ /* Readback ensures that AHCI_IS is already updated in HW */
+ ATA_INL(ctlr->r_mem, AHCI_IS);
+#endif
}
/*
@@ -501,6 +505,10 @@
ctlr->interrupt[unit].function(arg);
/* AHCI declares level triggered IS. */
ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit);
+#if defined(__arm__) || defined(__aarch64__)
+ /* Readback ensures that AHCI_IS is already updated in HW */
+ ATA_INL(ctlr->r_mem, AHCI_IS);
+#endif
}
static void
@@ -516,6 +524,10 @@
ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit);
if ((arg = ctlr->interrupt[unit].argument))
ctlr->interrupt[unit].function(arg);
+#if defined(__arm__) || defined(__aarch64__)
+ /* Readback ensures that AHCI_IS is already updated in HW */
+ ATA_INL(ctlr->r_mem, AHCI_IS);
+#endif
}
struct resource *
@@ -1606,10 +1618,15 @@
if ((ch->quirks & AHCI_Q_NOBSYRES) == 0 &&
(ch->quirks & AHCI_Q_ATI_PMP_BUG) == 0 &&
softreset == 2 && et == AHCI_ERR_NONE) {
- while ((val = fis[2]) & ATA_S_BUSY) {
- DELAY(10);
- if (count++ >= timeout)
+ for ( ; count < timeout; count++) {
+ bus_dmamap_sync(ch->dma.rfis_tag,
+ ch->dma.rfis_map, BUS_DMASYNC_POSTREAD);
+ val = fis[2];
+ bus_dmamap_sync(ch->dma.rfis_tag,
+ ch->dma.rfis_map, BUS_DMASYNC_PREREAD);
+ if ((val & ATA_S_BUSY) == 0)
break;
+ DELAY(10);
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 19, 7:24 AM (18 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25609256
Default Alt Text
D4240.id10399.diff (1 KB)

Event Timeline