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.
This commit is contained in:
nat 2023-02-18 13:28:05 +00:00
parent e4b9067855
commit f2f57c1e61
4 changed files with 20 additions and 16 deletions

View File

@ -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 @@ include "arch/mac68k/conf/GENERIC"
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

View File

@ -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 @@ include "arch/mac68k/conf/INSTALL"
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

View File

@ -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 @@ sbc_pdma_out(struct ncr5380_softc *ncr_sc, int phase, int datalen, u_char *data)
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);

View File

@ -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 @@ struct sbc_softc {
* 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;