diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-03-14 13:08:33 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-03-14 13:08:33 +0000 |
commit | 5e30a99df6e0caa152847fc85f58f8dabcc13e4b (patch) | |
tree | 436e68b4fc1a9827535894fde0fb4aabead144b5 /sys/arch | |
parent | a7fe88f0298d4a918d8d3a66bdaedfd7d281618d (diff) |
Make sure the apldart(4) implementation of bus_dmamap_destroy(9) does the
equivalent of bus_dmamap_unload(9) if active mappings exist. This fixes
the kerenal panics seen with bringing bwfm(4) down and up again.
ok jsg@, patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm64/dev/apldart.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/arch/arm64/dev/apldart.c b/sys/arch/arm64/dev/apldart.c index 5b4f65e7459..3f3b3bd26c8 100644 --- a/sys/arch/arm64/dev/apldart.c +++ b/sys/arch/arm64/dev/apldart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apldart.c,v 1.12 2022/03/01 20:45:27 kettenis Exp $ */ +/* $OpenBSD: apldart.c,v 1.13 2022/03/14 13:08:32 kettenis Exp $ */ /* * Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org> * @@ -517,6 +517,9 @@ apldart_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) struct apldart_softc *sc = t->_cookie; struct apldart_map_state *ams = map->_dm_cookie; + if (map->dm_nsegs) + apldart_dmamap_unload(t, map); + free(ams, M_DEVBUF, map->_dm_segcnt * sizeof(*ams)); sc->sc_dmat->_dmamap_destroy(sc->sc_dmat, map); } |