Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/hdaudio Always access CORBCTL using hda_read1/hda_wr...



details:   https://anonhg.NetBSD.org/src/rev/6753ad55d518
branches:  trunk
changeset: 828037:6753ad55d518
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Nov 24 14:00:04 2017 +0000

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

diffstat:

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

diffs (44 lines):

diff -r a207dafb7142 -r 6753ad55d518 sys/dev/hdaudio/hdaudio.c
--- a/sys/dev/hdaudio/hdaudio.c Fri Nov 24 08:36:22 2017 +0000
+++ b/sys/dev/hdaudio/hdaudio.c Fri Nov 24 14:00:04 2017 +0000
@@ -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 <support%precedence.co.uk@localhost>
@@ -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 @@
        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 @@
        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");



Home | Main Index | Thread Index | Old Index