Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Use AHCI_RFIS_SYNC in ahci_cmd_complete() AT_READ...



details:   https://anonhg.NetBSD.org/src/rev/0e9b186fd20d
branches:  trunk
changeset: 459881:0e9b186fd20d
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Sep 29 21:28:20 2019 +0000

description:
Use AHCI_RFIS_SYNC in ahci_cmd_complete() AT_READREG case.

Ensures CPU sees the current device to host FIS before parsing.

diffstat:

 sys/dev/ic/ahcisata_core.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r 340c90f7060e -r 0e9b186fd20d sys/dev/ic/ahcisata_core.c
--- a/sys/dev/ic/ahcisata_core.c        Sun Sep 29 21:25:08 2019 +0000
+++ b/sys/dev/ic/ahcisata_core.c        Sun Sep 29 21:28:20 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisata_core.c,v 1.77 2019/09/29 21:25:08 jakllsch Exp $      */
+/*     $NetBSD: ahcisata_core.c,v 1.78 2019/09/29 21:28:20 jakllsch Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.77 2019/09/29 21:25:08 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.78 2019/09/29 21:28:20 jakllsch Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -1265,6 +1265,7 @@
 {
        struct ata_command *ata_c = &xfer->c_ata_c;
        struct ahci_channel *achp = (struct ahci_channel *)chp;
+       struct ahci_softc *sc = AHCI_CH2SC(chp);
 
        AHCIDEBUG_PRINT(("ahci_cmd_complete port %d CMD 0x%x CI 0x%x\n",
            chp->ch_channel,
@@ -1286,8 +1287,10 @@
                ata_c->flags |= AT_ERROR;
        }
 
-       if (ata_c->flags & AT_READREG)
+       if (ata_c->flags & AT_READREG) {
+               AHCI_RFIS_SYNC(sc, achp, BUS_DMASYNC_POSTREAD);
                satafis_rdh_cmd_readreg(ata_c, achp->ahcic_rfis->rfis_rfis);
+       }
 
        ahci_cmd_done(chp, xfer);
 



Home | Main Index | Thread Index | Old Index