Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Fix minor bugs.



details:   https://anonhg.NetBSD.org/src/rev/361b67ea4589
branches:  trunk
changeset: 450266:361b67ea4589
user:      isaki <isaki%NetBSD.org@localhost>
date:      Mon Apr 08 15:35:57 2019 +0000

description:
Fix minor bugs.
- sc_lock should use an adaptive lock.
- yds_round_blocksize: fix typo.
- yds_trigger_output: fix typo. SlotControlData is pbankoff.
   ptbloff points to ControlData.
- yds_halt_input: fix wrong and extra sc_rec.intr.

diffstat:

 sys/dev/pci/yds.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (58 lines):

diff -r d46bda80e55c -r 361b67ea4589 sys/dev/pci/yds.c
--- a/sys/dev/pci/yds.c Mon Apr 08 14:48:33 2019 +0000
+++ b/sys/dev/pci/yds.c Mon Apr 08 15:35:57 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: yds.c,v 1.60 2018/12/09 11:14:02 jdolecek Exp $        */
+/*     $NetBSD: yds.c,v 1.61 2019/04/08 15:35:57 isaki Exp $   */
 
 /*
  * Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.60 2018/12/09 11:14:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.61 2019/04/08 15:35:57 isaki Exp $");
 
 #include "mpu.h"
 
@@ -771,7 +771,7 @@
                return;
        }
 
-       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_AUDIO); /* XXX IPL_NONE? */
+       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
        mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_AUDIO);
 
        intrstr = pci_intr_string(pc, ih, intrbuf, sizeof(intrbuf));
@@ -1284,7 +1284,7 @@
        if (blk < 1024)
                blk = 1024;
 
-       return blk & ~4;
+       return blk & ~3;
 }
 
 static uint32_t
@@ -1455,7 +1455,7 @@
        /* Now the play slot for the next frame is set up!! */
        /* Sync play slot control data for both directions */
        bus_dmamap_sync(sc->sc_dmatag, sc->sc_ctrldata.map,
-                       sc->ptbloff,
+                       sc->pbankoff,
                        sizeof(struct play_slot_ctrl_bank) *
                            channels * N_PLAY_SLOT_CTRL_BANK,
                        BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
@@ -1613,11 +1613,10 @@
 
        DPRINTF(("yds: yds_halt_input\n"));
        sc = addr;
-       sc->sc_rec.intr = NULL;
        if (sc->sc_rec.intr) {
+               sc->sc_rec.intr = NULL;
                /* Stop the rec slot operation */
                YWRITE4(sc, YDS_MAPOF_REC, 0);
-               sc->sc_rec.intr = 0;
                /* Sync rec slot control data */
                bus_dmamap_sync(sc->sc_dmatag, sc->sc_ctrldata.map,
                                sc->rbankoff,



Home | Main Index | Thread Index | Old Index