Module Name:    src
Committed By:   jmcneill
Date:           Fri Nov 24 14:00:04 UTC 2017

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

Log Message:
Always access CORBCTL using hda_read1/hda_write1 (it is an 8-bit wide reg).
Reported by Michal Necasek.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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.6 src/sys/dev/hdaudio/hdaudio.c:1.7
--- src/sys/dev/hdaudio/hdaudio.c:1.6	Fri Nov 24 00:30:29 2017
+++ src/sys/dev/hdaudio/hdaudio.c	Fri Nov 24 14:00:04 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.6 2017/11/24 00:30:29 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.7 2017/11/24 14:00:04 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.6 2017/11/24 00:30:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.7 2017/11/24 14:00:04 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -428,10 +428,10 @@ hdaudio_corb_stop(struct hdaudio_softc *
 	corbctl = hda_read1(sc, HDAUDIO_MMIO_CORBCTL);
 	if (corbctl & HDAUDIO_CORBCTL_RUN) {
 		corbctl &= ~HDAUDIO_CORBCTL_RUN;
-		hda_write4(sc, HDAUDIO_MMIO_CORBCTL, corbctl);
+		hda_write1(sc, HDAUDIO_MMIO_CORBCTL, corbctl);
 		do {
 			hda_delay(10);
-			corbctl = hda_read4(sc, HDAUDIO_MMIO_CORBCTL);
+			corbctl = hda_read1(sc, HDAUDIO_MMIO_CORBCTL);
 		} while (--retry > 0 && (corbctl & HDAUDIO_CORBCTL_RUN) != 0);
 		if (retry == 0) {
 			hda_error(sc, "timeout stopping CORB\n");
@@ -452,10 +452,10 @@ hdaudio_corb_start(struct hdaudio_softc 
 	corbctl = hda_read1(sc, HDAUDIO_MMIO_CORBCTL);
 	if ((corbctl & HDAUDIO_CORBCTL_RUN) == 0) {
 		corbctl |= HDAUDIO_CORBCTL_RUN;
-		hda_write4(sc, HDAUDIO_MMIO_CORBCTL, corbctl);
+		hda_write1(sc, HDAUDIO_MMIO_CORBCTL, corbctl);
 		do {
 			hda_delay(10);
-			corbctl = hda_read4(sc, HDAUDIO_MMIO_CORBCTL);
+			corbctl = hda_read1(sc, HDAUDIO_MMIO_CORBCTL);
 		} while (--retry > 0 && (corbctl & HDAUDIO_CORBCTL_RUN) == 0);
 		if (retry == 0) {
 			hda_error(sc, "timeout starting CORB\n");

Reply via email to