Module Name:    src
Committed By:   jdolecek
Date:           Sun Dec 20 19:30:04 UTC 2020

Modified Files:
        src/sys/dev/pci: aceride.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/aceride.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/pci/aceride.c
diff -u src/sys/dev/pci/aceride.c:1.37 src/sys/dev/pci/aceride.c:1.38
--- src/sys/dev/pci/aceride.c:1.37	Fri Jul 21 21:01:13 2017
+++ src/sys/dev/pci/aceride.c	Sun Dec 20 19:30:03 2020
@@ -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_setup_channel(struct ata_channel *c
 		    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) {

Reply via email to