summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorfvdl <fvdl@NetBSD.org>2007-06-21 11:32:54 +0000
committerfvdl <fvdl@NetBSD.org>2007-06-21 11:32:54 +0000
commitfc625d2effe55974080df68b65af4e5bedba1b58 (patch)
tree3aa935491642a70d0c432d14a2ae5a05b49cba4c /sys
parent3a15d3861a28875f4a49b5c288fb60e71eeb5b47 (diff)
* Add bus_dmamap_sync calls for cmd structure.
* During initialization, use the right port index when setting up the physical pointers for a port. Fixes issue with non-contigous ports. Reviewed by Manuel.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ahcisata_core.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/dev/ic/ahcisata_core.c b/sys/dev/ic/ahcisata_core.c
index 9b8b162e8a4..3132846bb9d 100644
--- a/sys/dev/ic/ahcisata_core.c
+++ b/sys/dev/ic/ahcisata_core.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ahcisata_core.c,v 1.1 2007/05/12 11:04:58 bouyer Exp $ */
+/* $NetBSD: ahcisata_core.c,v 1.2 2007/06/21 11:32:54 fvdl Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.1 2007/05/12 11:04:58 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.2 2007/06/21 11:32:54 fvdl Exp $");
#include <sys/types.h>
#include <sys/malloc.h>
@@ -276,10 +276,10 @@ ahci_attach(struct ahci_softc *sc)
goto end;
}
}
- AHCI_WRITE(sc, AHCI_P_CLB(port), achp->ahcic_bus_cmdh);
- AHCI_WRITE(sc, AHCI_P_CLBU(port), 0);
- AHCI_WRITE(sc, AHCI_P_FB(port), achp->ahcic_bus_rfis);
- AHCI_WRITE(sc, AHCI_P_FBU(port), 0);
+ AHCI_WRITE(sc, AHCI_P_CLB(i), achp->ahcic_bus_cmdh);
+ AHCI_WRITE(sc, AHCI_P_CLBU(i), 0);
+ AHCI_WRITE(sc, AHCI_P_FB(i), achp->ahcic_bus_rfis);
+ AHCI_WRITE(sc, AHCI_P_FBU(i), 0);
chp->ch_ndrive = 1;
if (bus_space_subregion(sc->sc_ahcit, sc->sc_ahcih,
AHCI_P_SSTS(i), 1, &achp->ahcic_sstatus) != 0) {
@@ -738,6 +738,9 @@ ahci_cmd_done(struct ata_channel *chp, struct ata_xfer *xfer, int slot)
bus_dmamap_unload(sc->sc_dmat, achp->ahcic_datad[slot]);
}
+ AHCI_CMDH_SYNC(sc, achp, slot,
+ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+
ata_c->flags |= AT_DONE;
if (achp->ahcic_cmdh[slot].cmdh_prdbc)
ata_c->flags |= AT_XFDONE;
@@ -850,7 +853,8 @@ ahci_bio_start(struct ata_channel *chp, struct ata_xfer *xfer)
((ata_bio->flags & ATA_READ) ? 0 : AHCI_CMDH_F_WR) |
20 /* fis lenght */ / 4);
cmd_h->cmdh_prdbc = 0;
- AHCI_CMDH_SYNC(sc, achp, slot, BUS_DMASYNC_PREWRITE);
+ AHCI_CMDH_SYNC(sc, achp, slot,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
if (xfer->c_flags & C_POLL) {
/* polled command, disable interrupts */