From: patrick Date: Thu, 1 Jun 2017 21:19:07 +0000 (+0000) Subject: Pass the correct dma tag to the load buffer function. Passing t only X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=35e955906efae14e6017afb833ca781a38ef0ad6;p=openbsd Pass the correct dma tag to the load buffer function. Passing t only passes the tag where the pointer to the simplebus_dmamap_load_buffer() wrapper is stored in. We want to call the load buffer function that was passed from our parent device, so we have to pass the parent's tag. Otherwise we end up in a recursive and neverending loop. This only occurs when a simplebus attaches to a simplebus, which we apparently didn't have so far. --- diff --git a/sys/arch/arm64/dev/simplebus.c b/sys/arch/arm64/dev/simplebus.c index fccf11b5fbf..af2e1ff1d42 100644 --- a/sys/arch/arm64/dev/simplebus.c +++ b/sys/arch/arm64/dev/simplebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simplebus.c,v 1.7 2017/04/27 10:23:19 kettenis Exp $ */ +/* $OpenBSD: simplebus.c,v 1.8 2017/06/01 21:19:07 patrick Exp $ */ /* * Copyright (c) 2016 Patrick Wildt * @@ -291,8 +291,8 @@ simplebus_dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map, void *buf, int firstseg = *segp; int error; - error = sc->sc_dmat->_dmamap_load_buffer(t, map, buf, buflen, p, - flags, lastaddrp, segp, first); + error = sc->sc_dmat->_dmamap_load_buffer(sc->sc_dmat, map, buf, buflen, + p, flags, lastaddrp, segp, first); if (error) return error;