diff options
-rw-r--r-- | sys/i386/isa/isa_dma.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/i386/isa/isa_dma.c b/sys/i386/isa/isa_dma.c index b203666..23dc07d 100644 --- a/sys/i386/isa/isa_dma.c +++ b/sys/i386/isa/isa_dma.c @@ -101,12 +101,20 @@ isa_dmainit(chan, bouncebufsize) { void *buf; + /* + * If a DMA channel is shared, both drivers have to call isa_dmainit + * since they don't know that the other driver will do it. + * Just return if we're already set up good. + * XXX: this only works if they agree on the bouncebuf size. This + * XXX: is typically the case since they are multiple instances of + * XXX: the same driver. + */ + if (dma_bouncebuf[chan] != NULL) + return; + #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) panic("isa_dmainit: channel out of range"); - - if (dma_bouncebuf[chan] != NULL) - panic("isa_dmainit: impossible request"); #endif dma_bouncebufsize[chan] = bouncebufsize; |