Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci disable (U)DMA for ATAPI on aceride(4), the chip...



details:   https://anonhg.NetBSD.org/src/rev/8d395b76f5b6
branches:  trunk
changeset: 948210:8d395b76f5b6
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Dec 20 19:30:03 2020 +0000

description:
disable (U)DMA for ATAPI on aceride(4), the chip doesn't support it
PR port-sparc64/55540

diffstat:

 sys/dev/pci/aceride.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r fed63025c999 -r 8d395b76f5b6 sys/dev/pci/aceride.c
--- a/sys/dev/pci/aceride.c     Sun Dec 20 19:29:06 2020 +0000
+++ b/sys/dev/pci/aceride.c     Sun Dec 20 19:30:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aceride.c,v 1.37 2017/07/21 21:01:13 nakayama Exp $    */
+/*     $NetBSD: aceride.c,v 1.38 2020/12/20 19:30:03 jdolecek Exp $    */
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aceride.c,v 1.37 2017/07/21 21:01:13 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aceride.c,v 1.38 2020/12/20 19:30:03 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -298,6 +298,13 @@
                    ACER_UDMA_EN(chp->ch_channel, drive) |
                    ACER_UDMA_TIM(chp->ch_channel, drive, 0x7));
 
+               /* (U)DMA doesn't work with ATAPI devices */
+               if (drvp->drive_type == ATA_DRIVET_ATAPI) {
+                       s = splbio();
+                       drvp->drive_flags &= ~(ATA_DRIVE_DMA|ATA_DRIVE_UDMA);
+                       splx(s);
+               }
+
                /* add timing values, setup DMA if needed */
                if ((drvp->drive_flags & ATA_DRIVE_DMA) == 0 &&
                    (drvp->drive_flags & ATA_DRIVE_UDMA) == 0) {



Home | Main Index | Thread Index | Old Index