Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mac68k Introduce a flag to disable PDMA when writing.
details: https://anonhg.NetBSD.org/src/rev/cf5880119773
branches: trunk
changeset: 373572:cf5880119773
user: nat <nat%NetBSD.org@localhost>
date: Sat Feb 18 13:28:05 2023 +0000
description:
Introduce a flag to disable PDMA when writing.
The use of pdma when writing would always cause a panic on my Powerbook 160,
possibly others as well.
As posted to tech-kern.
diffstat:
sys/arch/mac68k/conf/GENERICSBC | 9 +++++----
sys/arch/mac68k/conf/INSTALLSBC | 9 +++++----
sys/arch/mac68k/dev/sbc.c | 5 +++--
sys/arch/mac68k/dev/sbcvar.h | 13 +++++++------
4 files changed, 20 insertions(+), 16 deletions(-)
diffs (95 lines):
diff -r 64cd3c016f7f -r cf5880119773 sys/arch/mac68k/conf/GENERICSBC
--- a/sys/arch/mac68k/conf/GENERICSBC Sat Feb 18 13:17:45 2023 +0000
+++ b/sys/arch/mac68k/conf/GENERICSBC Sat Feb 18 13:28:05 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERICSBC,v 1.56 2008/03/27 20:00:24 hauke Exp $
+# $NetBSD: GENERICSBC,v 1.57 2023/02/18 13:28:05 nat Exp $
#
# GENERICSBC machine description file
@@ -12,7 +12,8 @@
no ncrscsi0 # SCSI NCR 5380
-# SBC_PDMA 0x01 Use PDMA for polled transfers
-# SBC_INTR 0x02 Allow SCSI IRQ/DRQ interrupts
-# SBC_RESELECT 0x04 Allow disconnect/reselect
+# SBC_PDMA 0x01 Use PDMA for polled transfers
+# SBC_INTR 0x02 Allow SCSI IRQ/DRQ interrupts
+# SBC_RESELECT 0x04 Allow disconnect/reselect
+# SBC_PDMA_NO_WRITE 0x08 Disallow PDMA for writing
sbc0 at obio? addr 0 flags 0x1 # MI SCSI NCR 5380
diff -r 64cd3c016f7f -r cf5880119773 sys/arch/mac68k/conf/INSTALLSBC
--- a/sys/arch/mac68k/conf/INSTALLSBC Sat Feb 18 13:17:45 2023 +0000
+++ b/sys/arch/mac68k/conf/INSTALLSBC Sat Feb 18 13:28:05 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALLSBC,v 1.32 2008/03/27 20:00:24 hauke Exp $
+# $NetBSD: INSTALLSBC,v 1.33 2023/02/18 13:28:05 nat Exp $
#
# INSTALLSBC machine description file
@@ -12,7 +12,8 @@
no ncrscsi0 # SCSI NCR 5380
-# SBC_PDMA 0x01 Use PDMA for polled transfers
-# SBC_INTR 0x02 Allow SCSI IRQ/DRQ interrupts
-# SBC_RESELECT 0x04 Allow disconnect/reselect
+# SBC_PDMA 0x01 Use PDMA for polled transfers
+# SBC_INTR 0x02 Allow SCSI IRQ/DRQ interrupts
+# SBC_RESELECT 0x04 Allow disconnect/reselect
+# SBC_PDMA_NO_WRITE 0x08 Disallow PDMA for writing
sbc0 at obio? addr 0 flags 0x1 # MI SCSI NCR 5380
diff -r 64cd3c016f7f -r cf5880119773 sys/arch/mac68k/dev/sbc.c
--- a/sys/arch/mac68k/dev/sbc.c Sat Feb 18 13:17:45 2023 +0000
+++ b/sys/arch/mac68k/dev/sbc.c Sat Feb 18 13:28:05 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbc.c,v 1.58 2023/02/18 13:17:45 nat Exp $ */
+/* $NetBSD: sbc.c,v 1.59 2023/02/18 13:28:05 nat Exp $ */
/*
* Copyright (C) 1996 Scott Reynolds. All rights reserved.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbc.c,v 1.58 2023/02/18 13:17:45 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbc.c,v 1.59 2023/02/18 13:28:05 nat Exp $");
#include "opt_ddb.h"
@@ -318,6 +318,7 @@
if (datalen < ncr_sc->sc_min_dma_len ||
(sc->sc_options & SBC_PDMA) == 0 ||
+ (sc->sc_options & SBC_PDMA_NO_WRITE) ||
(ncr_sc->sc_current != NULL &&
(ncr_sc->sc_current->sr_xs->xs_control & XS_CTL_POLL)))
return ncr5380_pio_out(ncr_sc, phase, datalen, data);
diff -r 64cd3c016f7f -r cf5880119773 sys/arch/mac68k/dev/sbcvar.h
--- a/sys/arch/mac68k/dev/sbcvar.h Sat Feb 18 13:17:45 2023 +0000
+++ b/sys/arch/mac68k/dev/sbcvar.h Sat Feb 18 13:28:05 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbcvar.h,v 1.12 2005/12/11 12:18:02 christos Exp $ */
+/* $NetBSD: sbcvar.h,v 1.13 2023/02/18 13:28:05 nat Exp $ */
/*
* Copyright (C) 1996 Scott Reynolds. All rights reserved.
@@ -77,11 +77,12 @@
* The options code is based on the sparc 'si' driver's version of
* the same.
*/
-#define SBC_PDMA 0x01 /* Use PDMA for polled transfers */
-#define SBC_INTR 0x02 /* Allow SCSI IRQ/DRQ interrupts */
-#define SBC_RESELECT 0x04 /* Allow disconnect/reselect */
-#define SBC_OPTIONS_MASK (SBC_RESELECT|SBC_INTR|SBC_PDMA)
-#define SBC_OPTIONS_BITS "\10\3RESELECT\2INTR\1PDMA"
+#define SBC_PDMA 0x01 /* Use PDMA for polled transfers */
+#define SBC_INTR 0x02 /* Allow SCSI IRQ/DRQ interrupts */
+#define SBC_RESELECT 0x04 /* Allow disconnect/reselect */
+#define SBC_PDMA_NO_WRITE 0x08 /* No PDMA for writes */
+#define SBC_OPTIONS_MASK (SBC_PDMA_NO_WRITE|SBC_RESELECT|SBC_INTR|SBC_PDMA)
+#define SBC_OPTIONS_BITS "\10\4NOWRITE3RESELECT\2INTR\1PDMA"
extern int sbc_debug;
extern int sbc_link_flags;
Home |
Main Index |
Thread Index |
Old Index