Module Name:    src
Committed By:   jmcneill
Date:           Mon Dec 28 16:49:58 UTC 2020

Modified Files:
        src/sys/dev/hdaudio: hdaudio.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/hdaudio/hdaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/hdaudio/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.11 src/sys/dev/hdaudio/hdaudio.c:1.12
--- src/sys/dev/hdaudio/hdaudio.c:1.11	Thu Jun 11 02:39:30 2020
+++ src/sys/dev/hdaudio/hdaudio.c	Mon Dec 28 16:49:58 2020
@@ -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 <[email protected]>
@@ -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 @@ hdaudio_dma_alloc(struct hdaudio_softc *
 	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;
 

Reply via email to