Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/hdaudio Initialize DMA memory when allocating it. Sh...



details:   https://anonhg.NetBSD.org/src/rev/836f61e087fc
branches:  trunk
changeset: 1017465:836f61e087fc
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Dec 28 16:49:58 2020 +0000

description:
Initialize DMA memory when allocating it. Should fix PR# 51734 (hdaudio
"RIRB timeout" on boot).

diffstat:

 sys/dev/hdaudio/hdaudio.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r a14a8de66425 -r 836f61e087fc sys/dev/hdaudio/hdaudio.c
--- a/sys/dev/hdaudio/hdaudio.c Mon Dec 28 15:42:53 2020 +0000
+++ b/sys/dev/hdaudio/hdaudio.c Mon Dec 28 16:49:58 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.11 2020/06/11 02:39:30 thorpej Exp $ */
+/* $NetBSD: hdaudio.c,v 1.12 2020/12/28 16:49:58 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.11 2020/06/11 02:39:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.12 2020/12/28 16:49:58 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -179,6 +179,10 @@
        if (err)
                goto destroy;
 
+       memset(dma->dma_addr, 0, dma->dma_size);
+       bus_dmamap_sync(sc->sc_dmat, dma->dma_map, 0, dma->dma_size,
+           BUS_DMASYNC_PREWRITE);
+
        dma->dma_valid = true;
        return 0;
 



Home | Main Index | Thread Index | Old Index