summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-05-21 21:43:51 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-05-21 21:43:51 +0000
commit9d903cf258c7152aeb91ccb923233df9c9017c86 (patch)
tree9c526a538a00d810794ec017187bf06a3138f225
parentcb7e3cea8ed3d6ed3b9cf54a9f20b50923c8f7b4 (diff)
Make iommu_dvmamap_unload cleanup properly.
-rw-r--r--sys/arch/hppa/dev/astro.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/arch/hppa/dev/astro.c b/sys/arch/hppa/dev/astro.c
index b163f89edf1..3a15fb6ffad 100644
--- a/sys/arch/hppa/dev/astro.c
+++ b/sys/arch/hppa/dev/astro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: astro.c,v 1.1 2007/05/21 19:33:09 kettenis Exp $ */
+/* $OpenBSD: astro.c,v 1.2 2007/05/21 21:43:50 kettenis Exp $ */
/*
* Copyright (c) 2007 Mark Kettenis
@@ -310,7 +310,7 @@ iommu_dvmamap_destroy(void *v, bus_dmamap_t map)
* map to be unloaded before it is destroyed.
*/
if (map->dm_nsegs)
- bus_dmamap_unload(sc->sc_dmat, map);
+ iommu_dvmamap_unload(sc, map);
if (map->_dm_cookie)
iommu_iomap_destroy(map->_dm_cookie);
@@ -439,15 +439,15 @@ iommu_dvmamap_unload(void *v, bus_dmamap_t map)
struct iommu_page_entry *e;
int err, i, s;
- bus_dmamap_unload(sc->sc_dmat, map);
-
- /* XXX */
- if (ims->ims_dvmasize == 0)
- return;
-
+ /* Remove the IOMMU entries. */
for (i = 0, e = ipm->ipm_map; i < ipm->ipm_pagecnt; ++i, ++e)
iommu_remove(sc, e->ipe_dva);
+ /* Clear the iomap. */
+ iommu_iomap_clear_pages(ims);
+
+ bus_dmamap_unload(sc->sc_dmat, map);
+
s = splhigh();
err = extent_free(sc->sc_dvmamap, ims->ims_dvmastart,
ims->ims_dvmasize, EX_NOWAIT);