Subject: Re: Can't blank RW CD
To: Steven Sartorius <ssartor@bellatlantic.net>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-i386
Date: 07/22/2002 22:41:57
--7JfCtLOvnd9MIVvH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Thanks. Can you try the attached patch and see if it helps for you ?
Otherwise we'll have to look at the VIA code.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
--

--7JfCtLOvnd9MIVvH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: syssrc/sys/dev/scsipi/atapi_wdc.c
diff -u syssrc/sys/dev/scsipi/atapi_wdc.c:1.52 syssrc/sys/dev/scsipi/atapi_wdc.c:1.53
--- syssrc/sys/dev/scsipi/atapi_wdc.c:1.52	Sat May 18 17:49:55 2002
+++ syssrc/sys/dev/scsipi/atapi_wdc.c	Mon Jul 22 23:31:56 2002
@@ -368,8 +368,10 @@
 		 * 2 bytes. It's a bug to request such transfers for ATAPI
 		 * but as the request can come from userland, we have to
 		 * protect against it.
+		 * Also some devices seems to not handle DMA xfers of less than
+		 * 4 bytes.
 		 */
-		if (sc_xfer->datalen & 0x01)
+		if (sc_xfer->datalen < 4 || (sc_xfer->datalen & 0x01))
 			xfer->c_flags |= C_FORCEPIO;
 
 		xfer->cmd = sc_xfer;

--7JfCtLOvnd9MIVvH--